
Pcb 472
simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.
Pcb 079 is an open-source printed circuit board by simone-ingvild, from the simone-ingvild/AnomalyDetection repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 120 × 100 mm with 6 parts on 4 nets, routed with 32 tracks and 0 vias.
Its parts include 3 capacitors and 3 ICs.
Authors: Rikke Aa. Boysen, Simone I. Lebech, Andreas S. From
Supervisor: Jakob Wilm
Course: Semester Project (Advanced Robotics)
Programme: M.Sc. in Advanced Robot Technology
Institution: University of Southern Denmark (SDU)
Semester: 2nd Semester, M.Sc. in Advanced Robot Technology, Spring 2026
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks. The framework supports synthetic photometric datasets with 24 fixed illumination directions by default and provides tools for dataset generation, model training, experimentation, and evaluation.
This README reflects the current implementation. Model training is performed through src/train.py or src/run_experiment.py, dataset generation through src/experiment.py, and evaluation through src/evaluate.py.
pip install -r requirements.txtNote: The project was developed using recent Python and PyTorch versions. Ensure that the installed PyTorch build is compatible with your CUDA version or CPU environment.
The dataset should be organized as follows:
dataset/
├── normal/
│ ├── pcb001/
│ │ ├── image01.png
│ │ ├── ...
│ │ └── image24.png
│ └── ...
└── anomaly/
├── pcb101/
│ ├── image01.png
│ ├── ...
│ └── image24.png
└── ...Each PCB sample is stored in a separate folder containing 24 grayscale images, one for each illumination direction. By default, image files are expected to follow the naming convention image01.png through image24.png (see src/dataset.py and src/experiment.py).
The synthetic data generator creates photometric image stacks using the illumination directions specified in src/blenderproc/lights_export.csv.
python src/experiment.py --num_normal 50 --num_anomaly 50This command generates the dataset/normal/ and dataset/anomaly/ directories along with the corresponding PCB samples.
To train a model using the default configuration:
python src/train.pyThe script invokes src.anomaly_model.train() using a predefined configuration suitable for quick experimentation.
For systematic parameter studies, use:
python src/run_experiment.pyThis script executes multiple PaDiM configurations by varying parameters such as feature_dim, topk_ratio, and use_patches. Results are written to the experiment_logs/ directory.
Trained models can be evaluated using:
python src/evaluate.py --model_path "src/Training output/padim_model.pth" --save_heatmapsEvaluation outputs, including CSV files, performance plots, and anomaly heatmaps, are saved to the training output directory specified by TRAINING_OUTPUT_DIR (src/Training output by default).
src/dataset.pyImplements the PCBAnomalyDataset class responsible for loading photometric image stacks. Optional preprocessing steps include CLAHE enhancement and patch extraction.
src/experiment.pyContains the synthetic PCB generation pipeline, including surface generation and photometric rendering through render_photometric_images().
src/anomaly_model.pyImplements the modified ResNet-18 feature extractor, Spatial PaDiM training (manual_padim_train), and inference (manual_padim_predict). Trained models are stored as padim_model.pth within the experiment output directory.
src/run_experiment.pyProvides automated execution of multiple experimental configurations and records results in the experiment_logs/ directory.
src/evaluate.pyLoads trained checkpoints and computes evaluation metrics such as ROC and Precision–Recall curves while generating qualitative visualizations.
src/anomaly_model.py and src/evaluate.py.The required packages are listed in requirements.txt.
Core dependencies include:
torch)torchvision)numpy)pandas)matplotlib)scikit-learn)| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | C_0603_1608Metric | C_0603_1608Metric | C0_0, C1_1, C2_1 |
| 2 | SOIC-8_3.9x4.9mm_P1.27mm | SOIC-8_3.9x4.9mm_P1.27mm | U0_1, U1_0 |
| 1 | TQFP-32_7x7mm_P0.8mm | TQFP-32_7x7mm_P0.8mm | U2_0 |
It measures 120 × 100 mm and has 2 copper layers, 1.6 mm thick.
6 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the simone-ingvild/AnomalyDetection repository on GitHub, at the commit this page was made from: the board is KiCad/PCB/pcb_079.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

simone-ingvild/AnomalyDetection
This repository implements Spatial PaDiM (Patch Distribution Modeling) for anomaly detection on printed circuit boards (PCBs) using photometric (multi-illumination) image stacks.

byrantech/laptop
anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.


Jcparkyn/dpoint
Open-source digital stylus using camera tracking and inertial measurements

VoronDesign/Voron-Hardware
Cool Hardware designed by the Voron Design group

hoglet67/RGBtoHDMI
Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

Luos-io/luos_engine
Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.
