Overview
Automated visual quality control — texture as the discriminating signal
20 images, varying lighting conditions, one key challenge: texture patterns are exactly what over/under-exposure makes hardest to see.
In manufacturing, manual visual inspection is slow and fatigue-prone. This project builds an automated pipeline for a specific quality control problem: components photographed on a circular platter where the discriminating feature is surface texture — good components show clear cross/strip patterns, bad ones appear blank. The dataset is photographed under varying lighting that causes significant over and under-exposure, making texture patterns (the very thing we need to detect) difficult to see reliably.
The counterintuitive preprocessing finding: Component detection performed better on original images than on preprocessed versions. Histogram equalisation removed the intensity contrast that Sobel edge detection relied on to locate component boundaries. This result — that more preprocessing is not always better — is directly transferable to every deep learning preprocessing pipeline in this portfolio: augmentation and normalisation choices can hurt as easily as they help, and should be validated empirically, not assumed beneficial.
Pipeline
Five-stage automated classification pipeline
Gabor and Wavelet feature extraction run in parallel from the same isolated component patches. Role annotations show which team member owned each stage.
Stage 1 — Image Preprocessing
RGB → Grayscale → Gaussian smoothing (noise reduction) → Histogram equalisation (lighting normalisation). Evaluated against direct detection on originals — originals outperformed preprocessed for Sobel edge detection.
Stage 2 — Component Detection
Sobel edge detection on original images → Adaptive thresholding (handles varying illumination across the 20 images) → Morphological operations (dilation, erosion, closing) to fill gaps in edge maps → Connected component labelling → Bounding box generation. All detected components saved to detected_components/.
Stage 3 — Isolation + Ground Truth Annotation
Individual component patches cropped from original images using detected bounding boxes. All 20 images manually annotated using MATLAB Image Labeler — good components marked with green boxes, bad with red — producing 20 .mat ground truth files for mIoU evaluation. The annotation quality directly determines the validity of every metric computed downstream.
Stage 4a — Gabor Feature Extraction
Gabor filters at multiple orientations and spatial frequencies applied to isolated patches. Two filter configurations evaluated (Gabor 1 and Gabor 2 with different frequency/orientation parameters). Statistical features — mean and standard deviation of filter responses — computed per component per configuration.
Stage 4b — Wavelet Feature Extraction
Multi-level wavelet decomposition using Haar, Daubechies (db2), Symlet (sym4), and Coiflet (coif1) families. Multi-scale texture features captured at different frequency bands simultaneously — complementary to the orientation-selective Gabor approach.
Stage 5 — Classification + Evaluation
Threshold-based classifier: if frequency response exceeds threshold → Textured → Good. Mixed classifiers combining Gabor and Wavelet responses for robustness. Evaluated with mIoU (localisation) and Accuracy/Precision/Recall/F1 (classification).
Feature Methods
Gabor and Wavelet — two complementary views of texture
Gabor filters — orientation-selective texture
Gabor filters are band-pass filters that respond to oriented spatial frequency patterns — they detect texture at a specific angle and scale. For this quality control task, good components have directional cross/strip patterns, making Gabor filters a natural fit. Two configurations were evaluated to find the optimal orientation and frequency set for this specific texture type.
Per-component features: mean and standard deviation of filter responses across all orientations and frequencies tested.
Clinical relevance: Gabor features are used in medical texture analysis — mammographic density classification, skin lesion characterisation, and retinal image analysis. The spatial frequency selectivity directly maps to biological texture at different scales.
Wavelet transforms — multi-scale decomposition
Wavelet transforms decompose the component image into sub-bands at different frequency scales simultaneously. Unlike Gabor (which probes one orientation at a time), wavelets capture the full multi-scale energy distribution — how much energy exists at each frequency band and spatial location.
| Wavelet | Characteristics |
|---|---|
| Haar | Step function, fast, detects sharp edges |
| Daubechies (db2) | Compact support, good for natural textures |
| Symlet (sym4) | Near-symmetric, reduced phase distortion |
| Coiflet (coif1) | Vanishing moments, smooth signal representation |
Contributions
4-person team — my role as project lead
- ▸Project lead — coordinated 4-person team across a 6-phase project timeline
- ▸Full image preprocessing pipeline — grayscale conversion, Gaussian smoothing, histogram equalisation, and empirical validation that originals outperform preprocessed for detection
- ▸Component detection — Sobel edge detection + adaptive thresholding + morphological operations (dilation, erosion, closing) + connected component labelling + bounding box generation
- ▸Component isolation — cropping individual patches using detected bounding boxes for downstream feature extraction
- ▸Ground truth annotation — manually labelled all 20 images using MATLAB Image Labeler (green = good, red = bad) — 20 .mat annotation files used for mIoU evaluation
Team: Tarun Sadarla (lead, preprocessing, detection, annotation) · Jeevan Umesha (Gabor + Wavelet extraction) · Rena Bipinkumar Patel (Gabor + Wavelet extraction) · Ramyasri Murugesan (classification, threshold tuning)
What this project built that transfers to clinical AI
Classical interpretable feature engineering as an alternative to deep learning: Every other project in this portfolio uses neural networks. This project uses handcrafted Gabor and Wavelet features with a threshold classifier — the discriminating features are completely visible. Understanding when classical feature engineering is sufficient (and interpretable) is practically important: in clinical settings with scarce labelled data, a transparent handcrafted pipeline can be more defensible than a black-box network.
MATLAB as a scientific computing environment for image analysis: The only project built in MATLAB Live Scripts — Image Processing Toolbox, Wavelet Toolbox, and MATLAB Image Labeler for annotation. The toolbox-based mental model (morphological operations, connected component labelling, and wavelet decomposition as built-in primitives) is distinct from Python/PyTorch and directly relevant to clinical imaging teams that standardise on MATLAB.
Preprocessing is not always helpful — empirical validation is mandatory: Histogram equalisation degraded detection performance by removing the contrast that Sobel edge detection relied on. This specific finding generalises: augmentation and normalisation choices in deep learning pipelines can hurt performance on subsets of the data even when average metrics improve. Every preprocessing decision should be validated, not assumed to help.
Annotation quality determines metric validity: Creating 20 .mat ground truth files manually — marking good components with green bounding boxes and bad ones with red — made the relationship between annotation quality and the mIoU score immediately tangible. The metric is only as good as the annotations, and annotation consistency across an annotator (or between annotators) is the primary source of uncertainty in clinical AI ground truth datasets.