This repo serves the source code of the Smart Manufacturing Lab project at Politecnico di Milano.
Ensure uv is installed, then:
$ uv sync
$ uv run ipython kernel install --user --env VIRTUAL_ENV $(pwd)/.venv --name=smlabYou can check JupyterLab path using:
$ uv run --with jupyter jupyter --pathsStart the JupyterLab server:
$ uv run --with jupyter jupyter labThe web interface should automatically launch in your browser.
| Model | Architecture | Training |
|---|---|---|
| PaDiM | Frozen ResNet-18; multivariate Gaussian per spatial position | 1 epoch (single-pass feature collection) |
| PatchCore | Frozen ResNet-18; greedy coreset memory bank (1% sampling) | 1 epoch (single-pass feature collection) |
| EfficientAD | Lightweight PDN teacher-student + autoencoder branch | 70,000 steps, Adam |
| RD | Frozen Wide ResNet-50-2 encoder + one-class bottleneck + mirrored student decoder | 200 epochs, Adam lr=0.005 |
| Model | Image AUROC | Image F1 | Pixel AUROC | Pixel F1 |
|---|---|---|---|---|
| PaDiM | 0.979 | 0.968 | 0.969 | 0.731 |
| PatchCore | 1.000 | 0.989 | 0.986 | 0.825 |
| EfficientAD | 1.000 | 0.989 | 0.981 | 0.797 |
| RD | 1.000 | 0.989 | 0.973 | 0.797 |
| Model | Accuracy | Normal Prec. | Normal Rec. | Normal F1 | Anomaly F1 |
|---|---|---|---|---|---|
| PaDiM | 0.95 | 0.90 | 0.82 | 0.86 | 0.97 |
| PatchCore | 0.98 | 0.95 | 0.95 | 0.95 | 0.99 |
| EfficientAD | 0.95 | 0.81 | 0.95 | 0.88 | 0.97 |
| RD | 0.99 | 0.96 | 1.00 | 0.98 | 0.99 |


