Skip to content

pnnl/struct2im

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a Pytorch implementation for unpaired microstructures-to-SEM translation along with downstream tasks (particles segmentation and calcination temperature estimation) to validate generated micrographs.

Datasets

The desired dataset need to be structured as following

${TRAINING_DATASET_ROOT_FOLDER}
└───images_a
    |___train
        └───001.jpg
        └───002.jpg
        └───003.jpg
        ...
    |___val
        └───001.jpg
        └───002.jpg
        └───003.jpg
        ...
└───images_b
    |___train
        └───001.jpg
        └───002.jpg
        └───003.jpg
        ...
    |___val
        └───001.jpg
        └───002.jpg
        └───003.jpg
        ...

Microstructures-to-SEM Task

  • Execute the script script/train_i2i.sh
  • The following parameters can be modified for desired behaviors:
  • gpu_id -- Manually assign a specific gpu for current job
  • exp_name -- Name of current experiment
  • type_exp -- This parameter should be set to i2i1 for this task
  • config_file -- Location of config file
  • stage -- Specify the process [train/val/gen]
  • checkpoint -- Specify the checkpoint to restore
  • checkpoint_dir -- Specify directory of saved checkpoints
  • gen_dir -- 'Directory for storing generated images

Particles Segmentation or Calcination Estimation Task

  • Execute the script script/train_seg.sh or script/train_clf.sh
  • The following parameters can be modified for desired behaviors:
  • gpu_id -- Manually assign a specific gpu for current job
  • exp_name -- Name of current experiment
  • type_exp -- Specify desired downstream task [seg/clf]
  • stage -- Specify the process [train/test]
  • config_file -- Location of config file
  • train_dir -- Specify directory of real training dataset
  • val_dir -- Specify directory of validation dataset
  • test_dir -- Specify directory of test dataset
  • gen_dir -- Specify directory of generated images used for training
  • saved_model_dir -- Specify directory of trained model

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.

Citation

If you find this code useful for your research, please cite our paper:

@inproceedings{ly2025struct2im,
  title={Improving microstructures segmentation via pretraining with synthetic data},
  author={Ly, Cuong and Frazier, William and Olsen, Adam and Schwerdt, Ian and McDonald, Luther and Hagen, Alex},
  journal={Computational Materials Science},
  year={2025}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published