Laser Powder Bed Fusion Layer Instance Segmentation for Anomaly / Defect Identification
The following is a break-down of my system configuration:
- CPU: AMD Ryzen 7 5800X 8-Core Processor
- GPU: NVIDIA GeForce RTX 3090 w/ 24GB VRAM
- RAM: 128GB DDR4
- Open a command prompt in the root directory, and run
uv sync. This will configure the necessary Python packages to run the code.
- Download the three Peregrine datasets:
- Move the data into a parent
Peregrinefolder:
Peregrine/ <--- DATABASE_BASE_DIR
├── Peregrine Dataset v2021-03/
├── Peregrine Dataset v2022-10.1/
└── Peregrine Dataset v2025-09/
- Download the model weights from here, and place in
models/UNet/checkpoints/.
Configure the parameters of the repository, found within the configs/config.py file, such as:
- NUM_WORKERS: Should be set to the number of cores available on your CPU.
- DATASET_BASE_DIR: The full path to the root
Peregrinefolder, set in the previous section.
With the above configured, run the following command to standardize and combine the three datasets into a Unified_Unet_Dataset folder:
uv run python setup.py
With the above configured, you can perform the following functionalities.
To train your own model on the data, run the following:
uv run python train.py
To test on the held-out testing data using the trained model:
-
Set the TEST_DATA_DIR parameter in config.py to point to
test/AddUp_FormUp_350_Maraging_Steel,test/EOS_M290_Inconel_718_2, ortest/Concept_Laser_M2_Builds -
Run the following command:
uv run python test_suite_analysis.py
To conduct inference on your own data using the trained model, run the following:
uv run python inference.py <PATH_TO_IMAGE>
For more metadata information, review the following write-ups:
In future iterations, I plan to develop the following capabilities and features:
- Automatically export trained weights to the following to speed-up inference:
- ONNX
- TensorRT
- Compare performance metrics against larger pre-trained EfficientNet Encoders
- Quantify epistemic uncertainty (model confidence) by integrating Mote Carlo (MC) dropout as a toggle for testing and inference
- Conduct multi-class classification, and compare performance against binary classification
