
Geometric Anomaly Segmentation.
An end-to-end GPU-optimized deep learning pipeline using PyTorch and U-Net to detect geometric anomalies in industrial images with 97.65% IoU.
The Problem
Industrial inspection pipelines produce high-resolution RGB images containing unwanted geometric anomalies such as random noise, inverted colors, solid color blocks, and varying geometric shapes. Because these defects vary completely randomly in size, location, transparency, and color, classical computer vision algorithms fail to isolate them. The challenge is to identify these defects at the pixel level and segment them into a precise Binary Mask.
Our Solution
Developed a modular pipeline in PyTorch utilizing a U-Net architecture with a pretrained EfficientNet-B4 encoder. To handle class imbalance and small objects, a hybrid of Dice Loss and Focal Loss was implemented. The system uses a 3-Fold Ensemble strategy and morphological post-processing to maximize precision, achieving an IoU of 97.65%.
This project delivers a robust Deep Learning solution for autonomously segmenting and pixel-mapping geometric anomalies in high-resolution (512x512) industrial RGB images. The system effectively detects random noise, color inversions, solid color blocks, and structural defects. By combining a U-Net architecture with a pretrained EfficientNet-B4 encoder, advanced data augmentation via Albumentations, and a 3-Fold Cross-Validation strategy, the model achieves a highly accurate 97.65% IoU.
Step-by-step Pipeline.
Data Preparation & Augmentation
Designed a custom PyTorch Dataset loader. To prevent model overfitting, the Albumentations library was used to drastically increase data variance through rotation, mirroring, brightness/contrast adjustments, and complex geometric distortions (Shift/Scale/Rotate).
Key Metrics
Stack

Anomaly Detection Example 1
Original image overlay showing segmented geometric anomalies and noise.

Anomaly Detection Example 2
Precise segmentation of inverted colors and solid blocks.

Anomaly Detection Example 3
Pixel-perfect mask generation for random structural defects.

Anomaly Detection Example 4
Model prediction mapped onto a highly complex background.
Let's discuss
clean energy together.
I'm always open to discussing research collaborations, internship opportunities, or just talking about machine learning and renewable energy optimization. If you're passionate about building a sustainable future, reach out!