Research methodology
Scientific framework for defect detection and classification in tubular NDT inspection, operating under the constraint that only JPEG visual outputs are available from vendor hardware.
1. Problem statement
Nucliex operates integrated NDT inspection systems (MFL, UT, ECT) for tubular inventory across multiple yards. The vendor hardware+software produces only JPEG visual outputs — no raw signal data, no structured export (CSV/XML), no API or SDK access. The manufacturer has confirmed no intermediate data is available.
This is a recognized limitation in industrial inspection digitalization. Available input parameters per scan are limited to: pipe outer diameter (OD), wall thickness, trolley speed, excitation frequency (Hz), and inspection method.
Key constraint
All analytical methods must operate on JPEG images as the sole data source. This eliminates direct signal-level analysis (waveform decomposition, FFT on raw A-scans) and requires image-domain approaches for both detection and quantification.
2. Mathematical framework
2.1 Defect detection as object localization
Given an input image I ∈ ℝ^(H×W×3) (JPEG, RGB), the detection task is to find a set of bounding boxes B = { b₁, b₂, …, bₙ } where each bᵢ = (x, y, w, h, c, p) represents center coordinates, dimensions, class label c ∈ C, and confidence p ∈ [0, 1].
Where L_box is the CIoU (Complete Intersection over Union) loss for bounding box regression, L_obj is objectness loss (binary cross-entropy), and L_cls is classification loss over the defect taxonomy.
2.2 Defect class taxonomy C
| Class | NDT signature | Physical mechanism | Severity range |
|---|---|---|---|
| External corrosion | MFL amplitude drop, broad signal | Electrochemical oxidation of outer wall | 5–80% WT |
| Internal corrosion | MFL/UT wall loss indication from ID | Flow-induced erosion-corrosion | 5–60% WT |
| Wall loss | UT thickness below nominal | General or localized material loss | 10–70% WT |
| Lamination | UT mid-wall reflection, split signal | Rolling defect — gas pocket or inclusion | Minor–Moderate |
| Transverse crack | ECT impedance spike, narrow | Stress corrosion cracking (SCC), fatigue | Moderate–Critical |
| Longitudinal crack | MFL axial channel anomaly | Seam weld defect, hydrogen cracking | Moderate–Critical |
| Pitting | Sharp localized MFL/UT indication | Microbiologically influenced corrosion (MIC) | 10–50% WT |
| Inclusion | UT scatter, non-metallic reflection | Slag/oxide entrapped during steel making | Minor |
| Dent | Caliper channel geometry change | Mechanical damage (impact, pressure) | Minor–Moderate |
| Ovality | Caliper diameter variation >1% | External force, ground movement | Minor–Moderate |
2.3 Segmentation for wall loss quantification
For precise defect sizing, pixel-level segmentation via U-Net produces a mask M ∈ { 0, 1 }^(H×W). Wall loss depth d is estimated by correlating the mask area with calibrated signal intensity:
Where A_mask is defect area in pixels, I̅_region is mean intensity in the defect region, and α, β, γ are regression coefficients fitted to calibration standards (typically API 5L reference blocks).
2.4 Signal reconstruction from JPEG plots
When JPEG outputs contain graphical signal traces (B-scan strips, amplitude vs. position), approximate numerical reconstruction is possible via image digitization:
- Axis calibration — identify pixel coordinates for known physical values on x/y axes
- Curve tracing — edge detection (Canny) + contour following to extract (pixel_x, pixel_y) series
- Coordinate transform — map pixels → physical units using affine calibration matrix
- Signal conditioning — low-pass filter to suppress JPEG compression artifacts
Expected accuracy: ±3–5% of full scale, limited by JPEG compression (typical Q=75–85) and pixel resolution. Sufficient for trend analysis and anomaly flagging, not for regulatory-grade measurements.
3. Machine learning pipeline
3.1 Architecture overview
Ingest
JPEG capture
Upload from vendor NDT software. Extract EXIF metadata, file hash for dedup.
Pre-proc
Normalization
Resize to 640×640. CLAHE contrast enhancement. Denoise (bilateral filter σ=75).
Detect
Object detection
YOLOv8 inference. Output: bounding boxes + class + confidence for each defect.
Segment
Pixel masking
U-Net on cropped ROIs. Binary mask per defect. Area + centroid computation.
Classify
Defect typing
10 classes × 3 severity. EfficientNet classifier on masked regions. Ensemble voting.
Quantify
Sizing
Wall loss depth estimation from intensity-area regression. Circumferential extent.
Report
Output
Annotated JPEG + structured JSON + DB record. API returns defect annotations.
3.2 Model comparison — expected performance
| Model | Architecture | mAP@50 | Inference | Training data | Use case |
|---|---|---|---|---|---|
| YOLOv8-m | Single-stage anchor-free | 0.87–0.92 | ~8 ms | 500+ images | Real-time defect detection |
| Faster R-CNN | Two-stage with FPN | 0.89–0.94 | ~45 ms | 500+ images | High accuracy detection |
| U-Net | Encoder-decoder FCN | IoU 0.82–0.90 | ~15 ms | 300+ masks | Pixel-level segmentation |
| ResNet-50 AE | Autoencoder anomaly | AUC 0.88–0.95 | ~5 ms | Clean only | Unsupervised anomaly detection |
| EfficientNet-B4 | Compound scaling CNN | 0.90–0.93 | ~12 ms | 500+ images | Classification baseline |
| Vision LLM | Gemini / LLaVA / GPT-4o | Qualitative | ~2 s | Zero-shot | Exploratory analysis, reporting |
Performance estimates based on comparable industrial inspection literature (pipe weld defects, steel surface defects). Actual performance will depend on dataset quality and the specificity of Nucliex NDT JPEG outputs.
3.3 Training strategy
Phase A — Transfer learning
- • Pre-trained backbone (ImageNet / COCO)
- • Freeze early layers, fine-tune detection head
- • 300–500 labeled images sufficient for baseline
- • Expected mAP@50: 0.75–0.85
Phase B — Full fine-tuning + augmentation
- • Unfreeze all layers, reduced learning rate (1e-5)
- • Geometric augmentation: rotation, flip, crop
- • Photometric: brightness, contrast, JPEG re-compression
- • Synthetic mixing: CycleGAN defect injection
- • Target: 1000+ effective training samples
- • Expected mAP@50: 0.85–0.95
4. Synthetic data generation
Given the absence of historical structured datasets, synthetic data generation is critical for reaching training set sizes required by deep learning models.
Physics simulation
Finite-element modeling (COMSOL, ANSYS) of MFL/UT wave propagation through pipe walls with parametric defect geometries (depth, width, orientation). Output: synthetic inspection images matching vendor output format.
COMSOL Multiphysics / MATLAB
GAN augmentation
Train CycleGAN on paired clean/defective images to learn the defect→image mapping. Generate novel defect variations with controlled parameters. Diffusion models (Stable Diffusion + ControlNet) for finer control.
PyTorch / Diffusers
Domain randomization
Render synthetic NDT screens with randomized backgrounds, noise levels, axis scales, and overlay defect signatures at known locations. Cheap to produce at scale, useful for pre-training before real-data fine-tuning.
OpenCV / Pillow / Albumentations
Data pipeline
Real JPEG (N=300–500) → Label with CVAT → Augment (×3–5) → Mix with synthetic (×2–3) → Effective dataset: 2000–5000 training images. This is sufficient for robust detection across the 10-class defect taxonomy.
5. Signal reconstruction from JPEG
When JPEG outputs contain graphical representations of inspection signals (common for MFL longitudinal profiles, UT B-scans), it is possible to recover approximate numerical data through image digitization.
Reconstruction workflow
- ROI extraction — crop the plot region from the full JPEG screenshot
- Axis detection — Hough line transform to find axis lines, OCR for tick labels
- Calibration — build affine transform matrix from known axis points
- Curve tracing — color segmentation + morphological ops to isolate signal trace
- Sampling — extract (x_phys, y_phys) at regular intervals along the trace
- De-noising — Savitzky-Golay filter (window=11, order=3) to smooth JPEG artifacts
- Feature extraction — peak detection, baseline deviation, energy spectral density
Extracted features for ML
6. Implementation roadmap
Data intake & cataloging
Weeks 1–4
- • Build JPEG ingestion pipeline (watched folder + manual upload)
- • Extract metadata from filenames, EXIF, and operator input
- • Store in PostgreSQL with full-text search on tags and notes
- • Establish file naming convention: {pipe_id}_{date}_{method}_{seq}.jpg
Customer portal (Stage 1a)
Weeks 3–8
- • Inventory dashboard with filters (grade, size, yard, cert, status)
- • Inspection history per pipe with image gallery
- • Certificate storage and retrieval
- • Role-based access: operator, engineer, external customer
Defect detection (Stage 1b)
Weeks 6–16
- • Label 300–500 images using CVAT (bounding box + class + severity)
- • Train YOLOv8 baseline with transfer learning from COCO
- • Implement inference API: POST /api/v1/ai/detect → defect annotations
- • Integrate results into portal: overlay boxes on snapshots
- • A/B test: human inspector agreement vs model predictions
Signal reconstruction & synthetic data
Weeks 12–20
- • Implement plot digitizer pipeline for B-scan JPEG → time-series CSV
- • Build synthetic NDT image generator (parametric defect rendering)
- • Train CycleGAN for defect augmentation on real image pairs
- • Validate reconstructed signals against calibration blocks
Predictive analytics (Stage 2)
Weeks 20–30+
- • Combine inspection history + environmental data for corrosion rate modeling
- • Time-series analysis of repeated inspections → degradation curves
- • Risk-based ranking: probability of failure × consequence
- • Recommended re-inspection interval calculation
- • Asset life prediction dashboard
7. Key references
Deep Learning Based Steel Pipe Weld Defect Detection
Zhang et al. — NDT & E International, 2024
Demonstrates YOLOv5 achieving 91.3% mAP on pipe weld X-ray images — directly comparable to our JPEG-based detection task.
Critical Analysis and Best Practices for Visual Industrial Anomaly Detection
Baiocchi et al. — arXiv:2503.23451, 2025
Comprehensive survey of anomaly detection methods that work with visual data only. Validates the feasibility of unsupervised approaches when labeled defect data is scarce.
Introducing a Tool for Synthetic Defect Image Data Generation
Schmedemann et al. — SPIE, 2025
Framework for generating synthetic defect images to augment small real datasets — directly applicable to our data scarcity problem.
Automated Defect Detection in Industrial Pipes Using Image Processing
Kumar & Singh — Journal of NDE, 2024
Proposes a complete pipeline from image preprocessing to defect localization in pipe inspection images without requiring raw signal access.
A Survey of Deep Learning for Industrial Visual Anomaly Detection
Liu et al. — Springer CVIU, 2025
Reviews 50+ methods for visual defect detection. Key finding: transfer learning + moderate augmentation achieves 85–95% accuracy with <1000 training images.
Gas Pipeline Defect Detection Based on Improved Deep Learning
Wang et al. — Sensors (MDPI), 2024
Improved YOLOv8 architecture for pipeline defect detection with small object handling — relevant for detecting small corrosion pits in our NDT images.
Image Reconstruction from Compressed Measurements for NDT
Hauffen et al. — NDT.net, 2023
Addresses signal reconstruction from limited/compressed data — analogous to our JPEG-to-signal reconstruction challenge.
Synthetic X-ray Image Generation for Non-Destructive Testing using GANs
Chen et al. — IEEE Access, 2024
GAN-based synthetic generation for NDT specifically. Shows FID scores indicating generated images are realistic enough for model training.