Building an Industrial Image Annotation QA Pipeline with Python
How do you know whether bounding-box annotations in an industrial equipment dataset are actually correct?
A JSON file can be syntactically valid while containing incorrect labels, missing image files, bounding boxes outside image boundaries or significant disagreements between annotators.
These issues can introduce noise into computer vision datasets before they reach model training.
I built an open-source Python project to demonstrate a structured approach to this problem:
Industrial Equipment Image Annotation QA Benchmark
GitHub: https://github.com/Enterprise-AI-Solutions/Industrial-Equipment-Image-Annotation-QA-Benchmark
The project validates industrial equipment image annotations against actual image files, compares two annotators, detects duplicate bounding boxes and generates a human-review queue.
1. What does the project do?
The benchmark demonstrates an image annotation QA workflow covering:
- Pydantic-based annotation schema validation.
- Equipment-class validation.
- Actual image-file resolution.
- Real image-dimension loading using Pillow.
- Bounding-box boundary checks.
- IoU-based duplicate detection.
- Inter-annotator label and spatial agreement.
- Configurable annotation quality scoring.
- Human-review queue generation.
- Consolidated Markdown and CSV reporting.
The sample dataset covers nine industrial equipment categories:
pump, valve, motor, bearing, pipeline, gearbox, air_compressor, heat_exchanger, and electrical_panel.
2. Pipeline architecture
The pipeline follows these steps:
- Validate annotations.
- Detect duplicate bounding boxes.
- Calculate reviewer agreement.
- Generate a manual-review queue.
- Generate QA reports.
- Run unit tests.
The code is separated into Python modules, making the workflow easier to inspect and extend.
3. Validate annotations against real image dimensions
One important feature is that the pipeline does not rely only on image metadata.
It resolves annotation filenames to actual uploaded files and uses Pillow to load the real image dimensions.
For example, an annotation may reference pump.jpg, while the uploaded file is pump_001.png.
The image resolver uses fuzzy matching to handle filename suffix and extension differences.
Once the image has been resolved, the pipeline validates bounding-box boundaries:
[
x + w \leq image_width
]
[
y + h \leq image_height
]
This helps identify annotations that extend outside the actual image.
4. Compare annotators using IoU
Intersection over Union (IoU) measures the spatial overlap between two bounding boxes.
[
IoU = \frac{Area(A \cap B)}{Area(A \cup B)}
]
The value ranges from 0 to 1:
- 0 means no overlap.
- 1 means exact overlap.
The project calculates:
- Label agreement.
- Mean IoU.
- Per-label agreement.
- Per-label mean IoU.
[INSERT IMAGE 03 — Agreement summary screenshot]
Sample results
The committed sample report contains:
| Metric | Result |
|---|---|
| Annotations compared | 9 |
| Matching labels | 9 |
| Label agreement | 100.0% |
| Mean IoU | 0.973 |
| Duplicate boxes detected | 0 |
| Annotations flagged for review | 0 |
These are results from the small illustrative dataset, not production annotation-team performance figures.
5. Duplicate detection
The project includes an IoU-based duplicate-detection module.
It identifies near-duplicate bounding-box pairs within each image using a configured threshold.
Output:
reports/duplicate_boxes.csv
[INSERT IMAGE 04 — Duplicate detection screenshot or output]
The sample report detected zero pairs meeting the configured duplicate condition.
6. Generate a human-review queue
Automation should identify potential annotation problems, not replace human judgement.
The benchmark flags annotations when it detects:
- Label disagreement.
- Low IoU.
- Low confidence from either annotator.
The resulting CSV includes image and annotation IDs, both annotators' labels, IoU, confidence values and review reasons.
Output:
reports/review_queue.csv
This allows a reviewer to prioritize records that need further inspection.
7. Annotation quality scoring
The repository also compares predictions against ground-truth annotations.
Its scoring formula uses:
| Component | Weight |
|---|---|
| IoU | 60% |
| Label match | 30% |
| Confidence | 10% |
[
QualityScore = (IoU \times 0.60) + (LabelMatch \times 0.30) + (Confidence \times 0.10)
]
The current rubric defines:
- IoU pass threshold: 0.80
- Quality pass score: 0.80
- Confidence threshold: 0.70
These thresholds are configurable and should be calibrated for the specific annotation task.
8. Generated reports
The pipeline produces:
| File | Description |
|---|---|
validation_report.json | Schema, image and bounding-box validation |
agreement_summary.json | Label and spatial agreement |
review_queue.csv | Records flagged for manual review |
duplicate_boxes.csv | Near-duplicate bounding-box pairs |
annotation_summary.csv | Resolved images, dimensions and box status |
annotation_report.md | Consolidated QA report |
9. Technology stack
| Technology | Purpose |
|---|---|
| Python 3.12 | Core implementation |
| Pydantic | Annotation validation |
| Pillow | Image dimensions |
| OpenCV | Image-processing utilities |
| Pandas | Reporting |
| NumPy | Numerical calculations |
| Pytest | Automated tests |
The core pipeline runs locally. It does not require a paid API, GPU, Docker or cloud infrastructure.
10. Run the project
Clone the repository:
git clone https://github.com/Enterprise-AI-Solutions/Industrial-Equipment-Image-Annotation-QA-Benchmark.git cd Industrial-Equipment-Image-Annotation-QA-Benchmark Upload nine industrial equipment images (JPG/JPEG/PNG) into:
data/images/ Create an environment and install dependencies.
Windows PowerShell:
py -3.12 -m venv .venv .\.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip python -m pip install -r requirements.txt macOS/Linux:
python -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install -r requirements.txt Run the pipeline:
Windows:
powershell -ExecutionPolicy Bypass -File ".\run.ps1" macOS/Linux:
chmod +x scripts/run_pipeline.sh ./scripts/run_pipeline.sh Run the tests:
python -m pytest -v The repository documents 11 tests covering IoU, scoring, validation and duplicate detection.
11. Possible future extensions
The current implementation focuses on bounding-box annotations and two-annotator comparison.
Potential extensions include:
- Polygon and segmentation-mask QA.
- Multi-annotator agreement.
- CVAT and Label Studio integrations.
- Annotation-distribution monitoring.
- Dataset versioning and audit trails.
- Object-detection dataset exports.
- Visual annotation review dashboards.
These are roadmap ideas, not features already implemented in this version.
12. Explore the project
The complete source code, sample annotation structures, configuration, reports and tests are available here:
GitHub repository:
https://github.com/Enterprise-AI-Solutions/Industrial-Equipment-Image-Annotation-QA-Benchmark
I'm particularly interested in feedback from computer vision developers, AI data-quality specialists, annotation teams and industrial AI practitioners.
What additional validation checks would you include in an industrial image annotation QA pipeline?
About the author
IT professional with 15+ years of experience across Manufacturing, Maintenance, CRM and ERP (SAP), now focused on AI Engineering, Data Quality, LLM Evaluation, RAG, MLOps and Enterprise Automation.
This article was prepared with AI assistance and reviewed and edited by the author.



