AI for Quality Control & NDT
SPC Pattern Recognition, NDT Indication Classification, and Process Capability Monitoring
Mechanical Testing SPC with AI Pattern Recognition
Statistical Process Control (SPC) is standard practice in any quality-managed metallurgical operation — X-bar/R charts on tensile strength, hardness, Charpy impact, elongation. The Nelson rules (or Western Electric rules) detect non-random patterns: trends, shifts, stratification, mixture. But manual chart monitoring misses subtle patterns, especially when multiple variables drift simultaneously.
Open data/mechanical-test-results.csv in the code panel. Each row is a mechanical test result: steel grade, heat number, sample location, test type (tensile, hardness, Charpy), measured value, specification limits, and test date.
Beyond Nelson Rules
Traditional SPC detects 8 patterns (Nelson rules). AI-based pattern recognition extends this to:
| Pattern | Nelson Rule | AI Detection | Corrective Action |
|---|---|---|---|
| Mean shift | Rule 1 (point beyond 3σ) | Detects shifts of 0.5σ with CUSUM | Raw material change, furnace drift |
| Trend | Rule 3 (6 points increasing) | Detects trends earlier (4 points + slope) | Electrode wear, furnace refractory erosion |
| Cyclic | Rule 8 (8 points alternating) | FFT-based cycle detection at any frequency | Shift-to-shift variation, day/night temperature |
| Stratification | Rule 5 (15 points within 1σ) | Detects mixture distributions (bimodal) | Two populations in data (two furnaces, two operators) |
| Multi-variable drift | Not covered | PCA on correlated properties | Systematic process change affecting multiple properties |
Multivariate SPC
Mechanical properties are correlated — YS and UTS move together, Charpy and elongation are inversely related to hardness. Monitoring each property independently misses situations where all properties shift together by a small amount (still within individual spec limits) but the shift indicates a process change.
Hotelling's T² chart on the principal components of [YS, UTS, elongation, Charpy, hardness] detects multivariate shifts that individual X-bar charts miss:
Input: [YS, UTS, elongation, reduction_of_area, Charpy, hardness] per heat
PCA: 6 variables → 3 principal components (capturing 95% variance)
T² = Σ (PC_i / λ_i)² — Mahalanobis distance from process centroid
Alarm: T² exceeds UCL (F-distribution threshold)At a US auto component manufacturer, multivariate SPC detected a slow drift in 42CrMo4 (SAE 4140) properties (YS dropping by 15 MPa, Charpy increasing by 8 J — each within spec) that traced to a systematic decrease in carbon content from the steel supplier. Individual charts showed nothing abnormal. The T² chart flagged it 3 weeks before any property would have breached spec limits.
Anomaly Detection on Test Data
Beyond SPC, anomaly detection flags individual test results that are physically inconsistent:
A simple rule engine catches the obvious cases. An isolation forest trained on the multivariate distribution catches subtle anomalies — results that are individually plausible but collectively improbable.
NDT Indication Classification
Non-Destructive Testing generates enormous amounts of data that is currently interpreted by human inspectors — ASNT Level II or III certified technicians (or ISO 9712 certified, in the EU) who visually assess indications and classify them per acceptance criteria. AI assists (not replaces) these inspectors.
Open data/ndt-inspection-results.json — each record contains: inspection method (UT, RT, MPI, DPT), component details, indication characteristics, inspector classification, and accept/reject decision.
Ultrasonic Testing (UT)
UT produces A-scan waveforms (amplitude vs time) or phased array S-scan images (sector view). Indication classification requires determining:
AI classification from UT data:
Input: A-scan waveform (or S-scan image for phased array)
probe_frequency, probe_angle, material_velocity, scan_position
Model: 1D-CNN on A-scan waveforms OR 2D-CNN on S-scan images
Classes: crack, lack_of_fusion, porosity, slag_inclusion, geometric_reflector
Accuracy: 91% (vs 84% inter-inspector agreement on indication classification)The highest-value application: distinguishing cracks from slag inclusions in weld inspection. Both produce reflections at similar depths, but cracks are planar (high amplitude, sharp echo, orientation-dependent) while slag is volumetric (lower amplitude, broader echo, orientation-independent). Misclassifying a crack as slag has severe safety implications.
Radiographic Testing (RT)
Digital radiography (DR) produces 16-bit greyscale images where indications appear as density variations. Manual interpretation involves comparing indication characteristics to reference radiographs (ASTM E446 for steel castings, E186 for thick-wall castings; weld acceptance per ASME BPVC Section V and AWS D1.1).
Input: DR image (2048 × 2048, 16-bit)
Preprocessing: flat-field correction, contrast enhancement (CLAHE)
Model: Faster R-CNN for indication detection + ResNet classifier for type/severity
Classes: shrinkage_cavity, gas_porosity, slag_inclusion, crack, hot_tear,
shrinkage_porosity (micro/macro), sand_inclusion
Severity: ASTM E446 Level 1-5
Output: annotated image with indication boxes, type labels, severity levelsAt a US diesel engine foundry, AI-assisted RT interpretation reduced radiographic review time from 12 minutes to 3 minutes per image while improving consistency — the system achieved 96% agreement with a Level III radiographer, vs 88% agreement between two Level II inspectors.
Magnetic Particle Inspection (MPI) and Dye Penetrant Testing (DPT)
MPI and DPT produce visual indications (fluorescent or visible particles/dye in surface-breaking discontinuities). AI-assisted classification uses camera images of the inspected surface:
Input: high-resolution photograph of MPI/DPT indication
Model: Object detection (YOLO v8) for indication localization +
classifier for type (crack, seam, lap, grinding crack, non-relevant)
Key challenge: distinguishing relevant indications from non-relevant
(magnetic writing, part geometry, grain flow lines in MPI)The practical challenge on the shop floor: lighting consistency. MPI under UV light requires controlled ambient darkness, and camera settings must be standardized. DPT requires consistent developer thickness. AI models trained on well-controlled images may fail on shop-floor images with variable lighting and developer application.
Process Capability with AI-Assisted Monitoring
Cp and Cpk Calculation
Process capability indices quantify how well a process meets specifications:
Cp = (USL - LSL) / (6σ) — process spread vs specification width
Cpk = min[(USL - μ) / (3σ), (μ - LSL) / (3σ)] — includes centeringOpen data/spc-charts-data.csv — it contains time-series data for key quality parameters with specification limits.
For metallurgical processes, Cpk targets are:
| Parameter | Typical Baseline Cpk | Customer Requirement | AI Target |
|---|---|---|---|
| Hardness (HRC) | 1.2-1.4 | ≥ 1.33 | ≥ 1.67 |
| Yield Strength (MPa) | 1.0-1.3 | ≥ 1.33 | ≥ 1.67 |
| Charpy Impact (J) | 0.8-1.1 | ≥ 1.0 (min spec only) | ≥ 1.33 |
| Grain Size (ASTM) | 1.1-1.5 | ≥ 1.33 | ≥ 1.67 |
| Nodularity (% for ductile iron) | 0.9-1.2 | ≥ 1.33 | ≥ 1.67 |
AI-Assisted Cpk Improvement
AI contributes to Cpk improvement by:
Standards Acceptance Criteria and Accreditation Compliance
Quality control in North America and Europe operates within the ASTM/ASME/EN framework. ASTM A370 (mechanical testing of steel), ASME BPVC, EN 10025 — each has specific acceptance criteria for mechanical properties, and these are not always aligned across regions.
AI-assisted compliance checking ensures:
Customer Audit Readiness
Automotive component suppliers face 3-5 customer audits per year (OEM quality engineers, tier-1 auditors, third-party certification bodies). Each audit examines SPC charts, Cpk reports, MSA (Measurement System Analysis) results, and PPAP documentation.
AI-generated audit packages:
This transforms audit preparation from a 2-week scramble into a button click.
Key Takeaways
This is chapter 6 of AI for Metallurgy & Materials (Global).
Get the full hands-on course — free during early access. Build the complete system. Your projects become your portfolio.
View course details