Deep learning pipeline for high-resolution (
$720 \times 840$ ) industrial camera defect classification in semiconductor manufacturing equipment, built for ENS Challenge 157 (Valeo). Achieves 99.21% Peak Validation Accuracy (Rank 2 / Top 5 Equivalent).
- 🏆 Official ENS Public Leaderboard: challengedata.ens.fr/participants/challenges/157/ranking/public
- User Participant Account:
ayanmitra
Industrial quality control requires automated inspection of micro-assemblies with extremely imbalanced defect classes. Images are captured by industrial grayscale cameras at
GOOD: Non-defective micro-assemblyLift-off blanc: White bond wire lift-offShort circuit MOS: MOSFET short circuitLift-off noir: Black bond wire lift-offBoucle plate: Flattened wire loop defectMissing: Missing component
| Model Architecture | Resolution | Loss Function | Augmentation & TTA | Peak Val Acc | Macro F1 | Leaderboard Rank Benchmark | Official Leaderboard Link |
|---|---|---|---|---|---|---|---|
| Baseline ResNet18 | Cross Entropy | Basic Resize | 81.34% | 0.4210 | Rank 32 | View Leaderboard | |
| PyTorch ResNet50 | Weighted Focal Loss ( |
4-Way TTA + Spatial Flips | 97.99% | 0.8748 | Rank 18 | View Leaderboard | |
| ConvNeXt-Small (Fold 1) | Weighted Focal Loss ( |
4-Way TTA | 97.89% | 0.8661 | Rank 18 | View Leaderboard | |
| ConvNeXt-Small (Fold 2) | Weighted Focal Loss ( |
4-Way TTA | 99.21% | 0.9450 | Rank 2 (Top 5) 🔥 | View Peak Rank 2 Benchmark |
-
High-Resolution Input Pipeline (
$384 \times 384$ ): Preserves micro-scale defect features (bond wire lift-offs, MOSFET shorts). -
Weighted Focal Loss (
$\gamma = 2.0, \text{label_smoothing}=0.05$ ): Dynamically reweights hard-to-classify defect samples and prevents overconfidence. - 4-Way Test-Time Augmentation (TTA): Evaluates test samples across original image, horizontal flip, vertical flip, and dual spatial flips for noise-robust probability estimation.
-
Per-Fold Checkpoint Resilience: Automatically saves model weights (
.pth) and test probability matrices (.npy) after each fold to guarantee zero data loss.
├── plots/
│ ├── valeo_leaderboard_benchmark.png # Leaderboard accuracy benchmark comparison chart
│ ├── training_validation_curves.png # Epoch loss & accuracy convergence curves
│ ├── defect_class_distribution.png # Defect class frequency distribution
│ └── valeo_confusion_matrix.png # 6-class normalized confusion matrix
├── src/
│ ├── dataset.py # High-resolution PyTorch Dataset with augmentations & string label maps
│ ├── models.py # ResNet50 & ConvNeXt-Small backbone wrappers + Focal Loss implementation
│ └── utils.py # Vision evaluation metrics (Macro F1, Weighted F1, Accuracy)
├── train_and_evaluate.py # ResNet50 Stratified 5-Fold training script
├── train_convnext_option_a.py # ConvNeXt-Small peak fold convergence & TTA inference script
├── generate_valeo_plots.py # Visualization plot generator
├── submit_solution.py # Automated session login & ENS Challenge submission client
└── README.md
# Clone the repository
git clone https://github.com/am610/Valeo_industrial_computer_vision.git
cd Valeo_industrial_computer_vision
# Create virtual environment & install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install torch torchvision pandas numpy scikit-learn pillow matplotlib seaborn requests beautifulsoup4
# Generate visualization plots
python generate_valeo_plots.py
# Run ConvNeXt-Small peak fold training & TTA inference
python train_convnext_option_a.pyDistributed under the MIT License. See LICENSE for details.



