Project Charter & Methodology
WeldVision AI
Computer-vision NDT diagnostics that automate digital radiography interpretation for critical welds.
Technology
- Python
- FastAPI
- RT-DETR / YOLO
- OpenCV (CLAHE)
- MongoDB Atlas
- SQLite
- fpdf2
- Cloud Run
Launch WeldVision AI
aiweld.centauri-research.com
- Request sent to aiweld.centauri-research.com
- Starting serverless container
- Endpoint ready
Launches the Autonomous NDT Inspector on serverless Cloud Run. The container may cold start on first request.
Introduction & Core Charter
This application is a Computer Vision-driven diagnostic tool designed specifically for Non-Destructive Testing (NDT) quality control in the oil & gas, piping, power, and manufacturing industries.
The primary charter of this project is to automate the interpretation of digital radiography (RT) images, rapidly identifying and quantifying critical welding defects (such as porosity, inclusions, and cracks). By combining deep learning with codified engineering standards, this tool aims to reduce human error in X-ray interpretation and accelerate the "Review-to-Repair" quality assurance cycle for critical assets.
Methodology & core pipeline
A modular, multi-phase approach
- Phase 1
Pre-processing & Enhancement (CLAHE)
We apply Contrast Limited Adaptive Histogram Equalization (CLAHE) on the backend to enhance low-contrast radiographic films, ensuring that micro-defects are visible to the AI engine.
- Phase 2
AI Detection & Inference
The core engine utilises state-of-the-art instance detection/segmentation models. The AI acts as a purely objective "measuring tool" to output bounding boxes, defect classes, and pixel dimensions.
- Phase 3
Engineering Rule Validation
Instead of relying solely on AI confidence, the system passes the detected dimensions through a deterministic Rule Engine. This engine cross-references the measurements against strict international engineering codes and standards (such as ASME B31.3 and ASME Section VIII). The application also includes a built-in provision to tune the rule engine against bespoke client specifications alongside the baseline international codes.
- Phase 4
Autonomous Agent Reasoning
The Generative AI Agent synthesises vision findings and rule-engine verdicts into a structured reasoning log — explaining why a weld passes or fails in plain language traceable to the exact standard clause.
- Phase 5
Automated Report Generation & Review Workflow
The system generates a gated PDF radiographic examination report. The report evolves through a structured review lifecycle — Performer → Supervisor — with digital signature stamps applied at each stage.
Agent workflow & orchestration
Step-by-step agent execution flow
The AI Agent is the reasoning core of the inspection pipeline. It operates as an autonomous orchestrator that dynamically selects and invokes a set of specialised tools, then synthesises their outputs into a final, standards-traceable verdict.
| Step | Agent action | Tool / system invoked |
|---|---|---|
| 1. Receive Task | Agent receives the inspection job: image path, wall thickness, regulatory code, material, and client spec | FastAPI /inspect endpoint |
| 2. Enhance Image | Calls the pre-processing tool to apply CLAHE contrast enhancement to the raw radiograph | WeldProcessor.enhance_image() |
| 3. Run Vision Inference | Invokes the computer vision model to detect, classify, and measure weld discontinuities | VisionPort → UltralyticsAdapter (RT-DETR / YOLO) |
| 4. Query Compliance Rules | Retrieves the applicable acceptance criteria for the detected defect types against the selected standard | CompliancePort → LocalComplianceAdapter (ASME B31.3 / ASME VIII / AWS / API) |
| 5. Apply Client Overrides | If a client specification is active, overlays stricter thresholds on top of the base code | Rule Engine — client spec merge layer |
| 6. Compute Verdict | Cross-references measured defect dimensions against the retrieved acceptance criteria to determine PASS / FAIL | InspectionOrchestrator.run() |
| 7. Generate Reasoning Log | Composes a human-readable reasoning statement that cites the exact standard and clause supporting the verdict | Agent LLM synthesis (Gemini / Claude) |
| 8. Persist Record | Writes the full InspectionRecord (verdict, defects, reasoning, image paths, metadata) to the database | DatabasePort → MongoAdapter (MongoDB Atlas primary, SQLite fallback) |
| 9. Log Audit Event | Appends an immutable audit entry with user identity, action, image hash, and timestamp | MongoAdapter.log_audit_event() |
| 10. Generate PDF Report | Compiles a gated, stage-aware PDF report embedding all findings and branding | reporter.py → fpdf2 |
| 11. Reviewer Feedback Loop | Performer submits remarks → Agent updates the record in DB → Supervisor approves → Final report sealed with dual digital signatures | POST /records/{id}/feedback → MongoAdapter.update_record() |
Key architectural decisions
Hexagonal architecture (Ports & Adapters)
The application follows the Hexagonal Architecture (Ports and Adapters) pattern, split into two phases — the AI Weld Analysis Pipeline and the Human-in-the-Loop Review & Approval workflow.
Tool Isolation
Each agent tool (vision, compliance, database) is accessed through a Port interface, making the agent's reasoning loop independent of the underlying model or database technology.
Deterministic Rules + Generative Reasoning
The pass/fail verdict is always computed by the deterministic rule engine — the LLM is used only for explanation, not for the binary decision. This ensures repeatability and auditability.
Stage-Gated PDF
The PDF report is compiled on-demand at each download event, reflecting only the content that exists at that workflow stage (no future signature stamps are shown).
Dual-Write Persistence
Every record is first attempted to MongoDB Atlas; on any connection failure, the SQLite local adapter transparently takes over with schema auto-migration.
Run the Autonomous NDT Inspector
Fetch the live Cloud Run application to upload a radiograph and walk through the full detect → validate → reason → report pipeline, or talk to an engineer about deploying it on your inspection data.
Launch WeldVision AI
aiweld.centauri-research.com
- Request sent to aiweld.centauri-research.com
- Starting serverless container
- Endpoint ready