{"id":19863626,"url":"https://github.com/sandialabs/baldr-study-07.04","last_synced_at":"2026-07-11T11:32:27.304Z","repository":{"id":249715581,"uuid":"832322087","full_name":"sandialabs/BALDR-Study-07.04","owner":"sandialabs","description":"Code, data, and models for the paper \"Multilabel Proportion Prediction and Out-of-Distribution Detection on Gamma Spectra of Short-Lived Fission Products\"","archived":false,"fork":false,"pushed_at":"2024-07-22T19:45:42.000Z","size":22184,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-28T04:24:58.883Z","etag":null,"topics":["scr-3042","scr-3043","snl-data-analysis"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sandialabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-22T19:32:05.000Z","updated_at":"2024-11-21T02:26:10.000Z","dependencies_parsed_at":"2024-07-22T23:42:23.604Z","dependency_job_id":null,"html_url":"https://github.com/sandialabs/BALDR-Study-07.04","commit_stats":null,"previous_names":["sandialabs/baldr-study-07.04"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sandialabs/BALDR-Study-07.04","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2FBALDR-Study-07.04","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2FBALDR-Study-07.04/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2FBALDR-Study-07.04/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2FBALDR-Study-07.04/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandialabs","download_url":"https://codeload.github.com/sandialabs/BALDR-Study-07.04/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2FBALDR-Study-07.04/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35361644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["scr-3042","scr-3043","snl-data-analysis"],"created_at":"2024-11-12T15:15:32.457Z","updated_at":"2026-07-11T11:32:27.288Z","avatar_url":"https://github.com/sandialabs.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: README\nauthor:\n- Alan Van Omen (ajvanom@sandia.gov)\n- Tyler Morrow (tmorro@sandia.gov)\ngeometry: margin=1in\n---\nThis repository contains the code and synthetic data used to produce the results for the paper\n*Multilabel Proportion Prediction and Out-of-Distribution Detection on Gamma Spectra of Short-Lived Fission Products*.\n\n\n# Acknowledgements\n\nThis work was performed by employees of Sandia National Laboratories and funded by the U.S. Department of Energy, National Nuclear Security Administration, Office of Defense Nuclear Nonproliferation Research and Development (DNN R\u0026D).\n\nSandia National Laboratories is a multimission laboratory managed and operated by National Technology \\\u0026 Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy's National Nuclear Security Administration under contract DE-NA0003525.\n\nContributions from C. Scott were supported in part by the National Science Foundation under award 2008074, and by the Department of Defense, Defense Threat Reduction Agency under award HDTRA1-20-2-0002.\n\n\n# Manifest\n\n## `code/`\n\nThis directory contains the code used to generate data, models, and results.\nIt also contains the initial data files necessary to generate the synthetic training/testing data, as well as the best models found the in the paper.\nThere is a `requirements.txt` file which contains a list of the necessary packages you will need to install in your Python environment (tested with Python 3.9.6 on macOS Ventura and Red Hat Linux 7.9).\n\n```sh\npip install -r requirements.txt\n```\n\nThe code files we intend for you to run begin with \"step#\" where \"#\" indicates the execution order.\nDoc-strings in each code file describe their purpose.\nThe final results are generated in Jupyter notebooks which use the data and models to produce results.\nThe `config.py` file is referenced by all steps and centralizes nearly all critical parameters.\n\nAlso note that the following steps require access to a Weights \u0026 Biases developer platform [\\[1\\]][1]:\n\n- `code/step3_run_hp_sweep.py`\n- `code/step5_find_best_model.ipynb`\n\n**Skip these steps if you do not have access to such an instance.**\nBy default, the code assumes you do not have a W\u0026B instance, which enables you to run step 4 locally and at least train a model.\nHowever, a W\u0026B instance is one requirement for fully recreating the study results.\nIf you do have a W\u0026B instance, make sure to configure the `MODEL_USE_WANDB`, `MODEL_WANDB_HOST`, `MODEL_WANDB_PROJECT` parameters in `config.py`.\n\nAlso, you can choose to either evaluate local models (which you either trained locally or downloaded from Weights \u0026 Biases) or automatically download models from Weights \u0026 Biases to evaluate.\nThis is controlled via the `EVAL_USE_LOCAL` parameter in `code/config.py`.\nThe initial values you find in `config.py` are for the best models found in our study and described in the paper.\nHowever, if you choose to automatically download models from a Weights \u0026 Biases run, be sure to fill in the path to each run in the `EVAL_WANDB_BEST_MODELS` parameter.\n\n\n### `code/data/`\n\nThis directory contains the synthetic seed files obtained via GADRAS injects which are used to generate all the synthetic data for the paper.\n\n- `code/data/U-235_th_FALCON_11MIN_bg_seeds.h5` contains signatures for K, U, Th, and cosmic radiation which were used to generate representative background mixtures.\n- `code/data/U-235_th_FALCON_11MIN_fg_seeds.h5` contains signatures for all the fission products identified in the SME analysis of our target spectrum.\n- `code/data/U-235_th_FALCON_11MIN_ood_seeds.h5` contains signatures for Ce134, Cs137, and Mo99 which were used to simulate out-of-distribution (OOD) sources.\n\nAll seed files were obtained via inject with GADRAS 19.2.3 using a detector response function (DRF) based on a Falcon 5000 detector.\n\n\n#### PNNL Data\n\nIn order to obtain access to the measured data from PNNL, readers will have to reach out to the authors of [\\[3\\]][3].\nOnce obtained, place the data in `data/pnnl/` preserving the original file structure.\nNext, you will need to convert all `.n42` files to `.pcf`.\nYou can process an entire directory structure in this way on the command line using Cambio [\\[3\\]][3].\nNote: do not have the `.pcf` files output to a separate directory, leave them next to the existing `.n42` files (read `cambio --help` for more).\n\n\n### `code/models`\n\nThis directory is the destination for any trained model. If you do not want to perform synthesis and train a model, we have included the pre-trained \"best\" models from the paper (one for each unsupervised loss function) which were used to generate the final results.\nThe model file is in the Open Neural Network Exchange (ONNX) format and is accompanied by a JSON file providing additional, describing metadata [\\[4\\]][4].\nIf you are re-running the experiment, note that this folder is where models are output, so you will see many more appear.\n\nThe ONNX file will require the ONNX runtime to load and execute; it is primarily a binary file of sorts and not meant to be viewed. Its accompanying JSON file can be viewed by your text editor of choice.\n\n\n### `code/runs`\n\nIf you do not use Weights and Biases, then the directory `code/runs` will be created and will locally store all the trained ONNX models along with associated run files.\nIf you use Weights and Biases, models will be stored on the cloud by default.\n\n\n# Methodology\n\nAt a high level, the code represents the following process to conduct the study outlined in our paper.\n\n- The provided foreground and background seeds are randomly mixed in PyRIID using the `SeedMixer`.\n- The mixed seeds where used to generate noisy gamma spectrum which vary in terms of signal-to-noise ratio using the PyRIID `StaticSynthesizer`.\n- Training data from the previous step was then used to fit many models. Note that training consisted of hyperparameter tuning which looked for optimal parameters, and then a final step which trained an \"optimal\" model.\n- With a model found, the test data was then used in several notebooks to generate the final results, mainly plots.\n\n\n# References\n\n1. [Weights \u0026 Biases][1]\n2. [Cambio][2]\n3. [Methods to Collect, Compile, and Analyze Observed Short-lived Fission Product Gamma Data][3]\n4. [ONNX][4]\n\n[1]: https://wandb.ai/site\n[2]: https://doi.org/10.11578/dc.20210416.65\n[3]: https://www.osti.gov/biblio/1028568\n[4]: https://github.com/onnx/onnx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandialabs%2Fbaldr-study-07.04","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandialabs%2Fbaldr-study-07.04","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandialabs%2Fbaldr-study-07.04/lists"}