Skip to content

pnnl/ood_det

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OOD Detection

Description

This is an official implementation of weighted kNN density estimation for out-of-distribution (OOD) detection for SEM images. The associated journal paper "Out-of-distribution detection with non-parametric density estimation for models predicting processing history of uranium ore concentrates" can be found via this link.

Installation

  • Clone the repository
git clone https://devops.pnnl.gov/proteus/ood_detection.git
cd ood_detection
  • Install required libraries
pip install -e .

Usage

Follow the specification of parameters below to train, performance inference, or evaluate OOD detection. Specific examples can be found in the scripts folder.

python main.py *args*
  • gpu_id - Specify the GPU# to run the model on
  • exp_name - Name of current experiment
  • config_file - Location of config file that stores necessary parameters
  • stage - Execution stage [train|test|run_ood]
  • seed - Random seed
  • saved_mode_file - Location of model weights
  • crop_type - type of crop used on an input

Evaluate OOD Detection Performance

./scripts/ood_script.sh

Authors and Acknowledgment

Authors: Cuong Ly, Cody Nizinski, Alex Hagen If you find this repository useful, please consider citing our work:

@article{LY2025114148,
title = {Out-of-distribution detection with non-parametric density estimation for models predicting processing history of uranium ore concentrates},
journal = {Computational Materials Science},
volume = {259},
pages = {114148},
year = {2025},
issn = {0927-0256},
doi = {https://doi.org/10.1016/j.commatsci.2025.114148},
url = {https://www.sciencedirect.com/science/article/pii/S0927025625004914},
author = {Cuong Ly and Cody Nizinski and Luther W. McDonald and Aaron Chalifoux and Alex Hagen},
}

This implementation is benefited greatly from the publicly available codes from Barteli and MISO.

Support

Please contact nhatcuong.ly@pnnl.gov for questions and supports.

DISCLAIMER

This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights.

Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or Battelle Memorial Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.

             PACIFIC NORTHWEST NATIONAL LABORATORY
                          operated by
                            BATTELLE
                            for the
               UNITED STATES DEPARTMENT OF ENERGY
                under Contract DE-AC05-76RL01830

License

For open source projects, say how it is licensed. Copyright Battelle Memorial Institute 2025

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors