Project guide

Project Guide | Weld Defect Vision

Free industrial vision validation model-card worksheet for weld-defect review boundaries. This guide organizes the repository's original implementation notes for manufacturing AI validation teams.

Reviewed 2026-07-28. This page is derived from checked-in repository evidence and links back to its source.

Live Demo

Industrial weld defect detection research sandbox using YOLOv8 fine-tuning. It demonstrates 5 defect labels: Crack, Porosity, Spatter, Undercut, and Overlap. The repository is a synthetic-data validation discovery surface, not evidence of plant-floor performance.

Technical review pack: `docs/architecture-pack.md`

System Overview

An industrial inspection AI workflow that sells value through validation discovery, data-suitability review, and operator-readable evidence.

AreaDetails
UsersManufacturing quality teams, welding inspection groups, industrial AI teams, and edge deployment quality reviewers.
Technical pathValidate the demo, README, architecture notes, and quality gate before deeper workflow review.
System scopeYOLOv8 workflow, synthetic scenarios, Triton/Jetson notes, MES/SCADA integration framing, model governance, and technical review pack.
Operating boundaryPrototype outputs need human inspector review; production use, yield claims, and customer outcomes require site-specific validation and acceptance criteria.
Evaluation pathInspect the model card, validation notes, serving docs, and deterministic sample outputs.

Evaluation Path

Architecture Notes

Architecture

Input Image (640x640)
    │
    ▼
┌──────────────────────────┐
│  YOLOv8 Backbone (CSPNet) │  ← COCO pretrained weights
│  + FPN Neck               │
└──────────┬───────────────┘
           │ Multi-scale features
           ▼
┌──────────────────────────┐
│  Detection Head           │
│  3 scales: P3/P4/P5       │
│  Per anchor: bbox + cls   │
└──────────┬───────────────┘
           │
           ▼
    NMS → Detections
    [bbox, class, confidence]

Key Features

Project Structure

weld-defect-vision/
├── src/
│   ├── config.py        # Hyperparameters, class labels, colors
│   ├── dataset.py       # YOLO dataset prep, validation, synthetic data
│   ├── train.py         # YOLOv8 training pipeline
│   ├── evaluate.py      # mAP evaluation with per-class charts
│   ├── inference.py     # Detection wrapper (single/batch)
│   └── visualize.py     # Bounding box drawing, detection grid
├── api/
│   ├── main.py          # FastAPI detection server
│   └── schemas.py       # Request/response models
├── data/
│   └── weld_defect.yaml # YOLO dataset configuration
├── tests/
│   ├── test_dataset.py  # Dataset and label format tests
│   ├── test_train.py    # Config and training component tests
│   └── test_api.py      # API endpoint tests
├── Dockerfile
├── docker-compose.yml
├── pyproject.toml
└── requirements.txt

Setup

pip install -r requirements.txt

Prepare Dataset


## Option 2: Generate synthetic data for pipeline testing
python -m src.dataset --synthetic 200


## Validate dataset structure
python -m src.dataset data/weld_defect.yaml

Expected YOLO format:

data/
├── weld_defect.yaml
├── images/
│   ├── train/
│   ├── val/
│   └── test/
└── labels/          # class x_center y_center width height (normalized)
    ├── train/
    ├── val/
    └── test/

Train

python -m src.train

Outputs:

Evaluate

python -m src.evaluate checkpoints/best.pt

Outputs:

Inference API

uvicorn api.main:app --host 0.0.0.0 --port 8000


## Detect defects (JSON response)
curl -X POST http://localhost:8000/detect -F "file=@weld_image.jpg"


## Detect + visualize (annotated image response)
curl -X POST http://localhost:8000/detect/visualize -F "file=@weld_image.jpg" -o result.png

Docker


## Inference server
docker compose up api


## Training (GPU)
docker compose --profile training run train

Tests

pytest -v

Defect Classes

ClassDescriptionColor
CrackLinear discontinuity in weld metalRed
PorosityGas pockets trapped during solidificationGreen
SpatterMetal droplets expelled during weldingBlue
UndercutGroove melted into base metal at weld toeOrange
OverlapWeld metal flowing over base metal without fusionPurple

Tech Stack

ComponentTechnology
Object DetectionYOLOv8 (Ultralytics)
Deep LearningPyTorch
Image ProcessingOpenCV
Evaluationmatplotlib, seaborn
APIFastAPI, Uvicorn
ContainerDocker, Docker Compose (GPU support)
Testingpytest
Production ServingTriton Inference Server (via serving/)
Edge RuntimeJetson Orin + TensorRT (via edge/)
Industrial IntegrationOPC-UA, MQTT, Kafka, REST webhook

Case Studies

See docs/case-studies/ for composite narratives. They are illustrative discovery material, not proof from a live site:

Both are composite narratives with fabricated but plausible numbers, written in the SE-delivery format.

Production Deployment

docs/production/ covers deployment considerations that would need site-specific validation before use:

RunbookTopic
edge-deployment.mdONNX/TensorRT export, Jetson deployment, INT8 quantization trade-offs
model-serving.mdTriton vs FastAPI vs ONNX Runtime Server; picking Triton
mes-scada-integration.mdOPC-UA, MQTT, PLC signal flow into the detection service
monitoring-drift.mdMonitoring deployed models: confidence drift, re-evaluation cadence
labeling-pipeline.mdActive learning with human-in-the-loop label capture

Edge & Integration

Model Governance

governance/ follows industry-standard artifacts:

Benchmarks

benchmarks/ contains reference benchmarks across devices and configurations. Sample results (see benchmarks/results/):

DeviceBatch sizep50 latency (ms)p95 latency (ms)FPS
CPU (Xeon Gold 6138)14204802.4
GPU (T4, PyTorch)1385226.3
GPU (T4, TensorRT FP16)1111890.9
Jetson Orin Nano (TensorRT INT8)1223145.4

Regenerate with python benchmarks/latency_benchmark.py --devices cpu,gpu,jetson.

Related Projects

ProjectRelationship
retina-scan-aiSibling vision project — medical imaging classification with Grad-CAM
AegisOpsOperator handoff and incident analysis — directly applicable to plant floor escalation
Nexus-HiveAnalytics layer consuming defect telemetry for trend analysis
enterprise-llm-adoption-kitShared governance patterns (audit, RBAC) applicable to MES integration

Cloud + AI Architecture

Enterprise Productization

System Architecture

Service Architecture

Search And Service Surface