Skip to content

selected case study

Visual QC Project

A steel-defect classification case study using 1,800 NEU-CLS images, handcrafted visual features, model benchmarking, error analysis, and an entropy-ranked review queue, extended with a measured embedding-RAG assistant and a live 3D digital twin of the inspection line.

Role fit

Applied Data ScientistComputer VisionAI EngineerIndustrial Analytics

Quick technical review

The case study in four points.

Full methodology

Problem

Aggregate accuracy alone does not tell a quality team which defect classes fail most often or which uncertain cases should be reviewed first.

Architecture

A deterministic 80/20 holdout evaluates HOG, Gabor, and grid features across baseline, Logistic Regression, and Random Forest models.

Results

1,800 NEU-CLS images across 6 classes

Verification path

Start with the case study and model-comparison artifacts before reviewing implementation details.

Summaries reuse the project’s documented evidence. Review the complete case study for evaluation boundaries.

Evidence-led visual review

Explore the actual work.

Actual project screenshots and repository figures are shown with source provenance.

Visual QC Project public demo captured 2026-10-14

Dated demo screenshot

Public demonstration screenshot dated 2026-10-14; does not establish that the demo is currently online.

Open published source

1,800 NEU-CLS images across 6 classes

0.9389 accuracy / 0.9392 macro F1

Top 20% review queue captures 81.8% of errors

Project proof

Verified external evidence

Last verified 2026-10-05

Loading the interactive view...

Problem and approach

Problem

Aggregate accuracy alone does not tell a quality team which defect classes fail most often or which uncertain cases should be reviewed first.

Architecture

A deterministic 80/20 holdout evaluates HOG, Gabor, and grid features across baseline, Logistic Regression, and Random Forest models.

Review logic

Prediction entropy ranks low-confidence cases so a limited human-review budget captures a disproportionate share of model errors.

AI engineering layer

BGE-base embeddings served from Chroma were chosen from a four-way retriever benchmark; a local Qwen2.5 generator and prompt were selected by NLI-measured faithfulness against a no-retrieval control.

Why it matters

It connects computer-vision evaluation, class-level error analysis, and a practical human-in-the-loop quality-review strategy.

Architecture and analysis

  • Evaluates 1,800 balanced NEU-CLS images across six steel-surface defect classes.
  • Uses Pareto and class-level analysis to identify where observed errors concentrate.
  • Turns model uncertainty into a review queue instead of presenting predictions without an operating strategy.
  • Shows RAG retrieval on a 3D embedding map whose highlights come from the real search, with the projection distortion reported on the page.
  • Renders the simulated line as a live 3D digital twin: scan gantry, reject pusher with NEU defect classes, OK stacking.
  • Lets an operator confirm or correct the predicted defect of each rejected unit, with decisions persisted per visitor and exported as a quality-engineer CSV.
  • Adds an SPC p-chart of the reject rate per batch with 3-sigma control limits, and a CNN pipeline (ResNet18 / EfficientNet-B0) built to be compared with the Random Forest on the exact same holdout.

Testing and validation

  • Operator review queue with Postgres (SQLite fallback) persistence, versioned migrations, row quotas and per-client rate limits on the public write endpoints
  • CNN comparison pipeline with temperature scaling, ECE, bootstrap intervals, Grad-CAM and ONNX export, verified on synthetic data; a separate fine-tuned ResNet-18 baseline (cnn/train_cnn.py) scores 1.000 accuracy on the random and on a blocked 80/20 split of NEU-CLS, which the repository reads as a saturated benchmark rather than production readiness
  • Dockerfile and docker-compose (app + Postgres); CI with ruff, mypy, an 80% coverage floor, a Postgres service and Playwright end-to-end tests on Python 3.12
  • HOG, Gabor filter-bank, and grid-statistics feature pipeline
  • Model benchmark, confusion matrix, class metrics, and Pareto error artifacts
  • Entropy-ranked review-queue analysis with versioned JSON evidence
  • RAG pipeline: pinned Wikipedia corpus, retriever benchmark, Chroma index, NLI faithfulness, UMAP projection
  • Three.js line twin synced to the simulation API, with a 2D fallback

Operational value

  • Achieves 0.9389 accuracy and 0.9392 macro F1 with the selected Random Forest model.
  • Shows that two defect classes account for approximately 64% of observed errors.
  • The top 20% entropy-ranked review queue captures 81.8% of model errors.
  • RAG retrieval puts the exact source passage in the top 4 for 94.8% of 77 questions (TF-IDF baseline: 89.6%).
  • 75.7% of generated answer sentences are entailed by the retrieved passages, versus 20.7% for the same model without retrieval.
  • A fine-tuned ImageNet ResNet-18 reaches 1.000 accuracy (360/360) on both the random and the blocked holdout, so NEU-CLS no longer separates models; under test-time degradation its accuracy falls to roughly 0.34-0.39 with strong sensor noise and 0.36-0.38 with strong blur.

How to inspect

  • Start with the case study and model-comparison artifacts before reviewing implementation details.
  • Inspect the confusion matrix and Pareto analysis to understand class-level failure modes.
  • Use the entropy review-queue curve as the main operational decision surface.
  • Rotate the embedding map on this page and pick a sample question: the highlighted passages are the real 768-d top 4, not the nearest dots on screen.

Related case studies

All projects