AI for Corrosion & Failure Analysis
Predicting Degradation, Classifying Failure Modes, and Optimizing Material Selection
Corrosion Rate Prediction
Corrosion is a materials-environment interaction problem. The same 316L stainless steel that lasts 30 years in a pharmaceutical plant will pit through in 3 years in a chloride-rich coastal refinery. Predicting corrosion rate requires modelling both the material (composition, microstructure, surface condition) and the environment (temperature, pH, chloride concentration, dissolved oxygen, flow velocity, microbial activity).
Traditional corrosion engineering relies on:
AI bridges the gap between quick electrochemical tests and long-term field performance.
Open data/corrosion-test-data.csv in the code panel. Each row represents a corrosion test or field measurement: material grade, composition, environment chemistry (pH, Cl⁻, SO₄²⁻, H₂S, CO₂, dissolved O₂, temperature), exposure time, and measured corrosion rate (mm/year), pitting depth, and crevice corrosion severity.
Regression Model for General Corrosion
Features:
material: Cr%, Ni%, Mo%, N%, Cu%, W%, PREN
environment: temp_C, pH, Cl_ppm, SO4_ppm, dissolved_O2_ppm,
flow_velocity_m_s, CO2_partial_pressure_bar
exposure: time_hours
Target: corrosion_rate_mm_yr
Model: Gradient boosted trees (XGBoost)| Environment Type | MAE (mm/yr) | Key Predictors |
|---|---|---|
| Sweet (CO₂) | 0.15 | CO₂ pp, temp, pH, flow velocity |
| Sour (H₂S) | 0.22 | H₂S pp, pH, Cl⁻, temp |
| Marine atmospheric | 0.008 | Cl⁻ deposition, time of wetness, temp |
| Process acids | 0.35 | Acid concentration, temp, impurities |
Pitting Prediction
Pitting is more dangerous than general corrosion — it is localized, hard to detect, and causes unexpected failures. The critical pitting temperature (CPT) is the minimum temperature at which pitting initiates in a given chloride concentration.
Traditional prediction uses PREN (Pitting Resistance Equivalent Number):
PREN = %Cr + 3.3 × %Mo + 16 × %NThis works as a ranking metric but does not predict actual CPT accurately — it ignores the effects of W, Cu, surface finish, and sensitization. An ML model trained on potentiodynamic polarization data and field pitting records:
Features: Cr%, Ni%, Mo%, N%, W%, Cu%, Mn%, surface_finish_Ra,
sensitization_grade, Cl_ppm, pH, temperature
Target: CPT (°C) or pitting_probability at service temperature
Model: Random Forest regression
MAE: 4.2°C on CPT prediction (vs ±10°C for PREN-based estimates)Indian Context: Jamnagar Refinery Corrosion
Reliance Jamnagar — the world's largest refinery complex — processes high-sulfur crudes (from the Middle East and Venezuela) that create aggressive naphthenic acid + sulfur corrosion environments. Traditional approaches use TAN (Total Acid Number) as the sole corrosion indicator, but corrosion severity depends on the interaction of TAN, sulfur content, temperature, and flow regime.
An AI model trained on Jamnagar's inspection data correlates wall thickness measurements (from UT surveys) with crude blend composition, operating temperature, and flow velocity. This enables:
Failure Mode Classification
Open data/failure-investigation-cases.json — each record is a failure investigation: failed component details, service conditions, fracture surface description (macroscopic and microscopic features), metallographic findings, and root cause classification.
AI-Assisted Fractography
Fracture surface features are diagnostic:
| Failure Mode | Macroscopic Features | Microscopic Features |
|---|---|---|
| Fatigue | Beach marks, flat fracture, initiation site visible | Striations, ratchet marks at origin |
| SCC | Branching cracks, intergranular (IGSCC) or transgranular (TGSCC) | Mud-cracking pattern, cleavage facets |
| Hydrogen embrittlement | Bright, granular fracture, delayed failure | Intergranular facets, quasi-cleavage, secondary cracks |
| Creep | Thick-walled component, bulging, grain boundary voids | Cavitation at grain boundaries, wedge cracks |
| Overload | Necking (ductile) or flat (brittle) | Dimples (ductile) or cleavage (brittle) |
A CNN trained on SEM fractograph images classifies failure modes:
Architecture: EfficientNet-B4 fine-tuned on 8,000 SEM fractographs
Classes: fatigue, SCC, H_embrittlement, creep, ductile_overload, brittle_fracture
Input: 512 × 512 px SEM image (multiple magnifications: 50x, 500x, 2000x)
Accuracy: 89% top-1 (vs 85% for individual failure analysts)The model is most valuable for differentiating hydrogen embrittlement from SCC — a distinction that even experienced analysts find difficult on fractographs alone, but which has completely different corrective actions (hydrogen source elimination vs environment modification).
Text-Based Case Classification
Not every failure investigation includes SEM fractography. For the majority of Indian industrial failures — particularly in SME settings — the investigation report is a text document describing visual observations, hardness measurements, and metallographic findings.
An NLP classifier trained on 5,000+ failure investigation reports:
Input: failure_report_text (findings, observations, metallography results)
Features: TF-IDF on technical vocabulary + extracted numerical features
(hardness, grain_size, inclusion_rating, carbon_content)
Target: root_cause_category
Model: Logistic Regression with feature engineering
(simpler model, more interpretable for engineering review)This assists quality engineers in categorizing failures consistently and identifies patterns — for example, if 60% of crankshaft failures from a specific forging supplier are hydrogen embrittlement, that points to a systematic problem in their heat treatment atmosphere.
Material Selection Optimization
Open data/material-selection-matrix.json — it contains material-environment compatibility ratings, cost data, and availability for common Indian industrial applications.
Multi-Criteria Decision Framework
Material selection balances:
Traditional approaches (Ashby charts, weighted scoring) work for initial screening but struggle with the combinatorial complexity of real industrial environments. A material has to resist corrosion AND maintain strength AND be weldable AND be available from Indian stockholders.
Optimization formulation:
minimize: lifecycle_cost = material_cost + fabrication_cost +
inspection_cost × n_inspections + repair_probability × repair_cost
subject to:
corrosion_rate <= allowable (from design life / corrosion allowance)
yield_strength_at_temp >= design_stress × safety_factor
weldability_index >= threshold (for welded construction)
indian_availability = true (or accept 8-12 week import lead time)Indian Industrial Environments
Marine structures (Mumbai/Vizag ports): Splash zone corrosion is the most aggressive — cyclic wetting, high chloride, biological fouling. The model recommends super duplex (UNS S32750) for critical structural members, with coating systems quantitatively compared on lifecycle cost. For Mumbai's offshore platforms, the model identified that 22Cr duplex with HDPE lining outperformed 316L on 20-year lifecycle cost despite higher initial material cost.
Power plant boiler tubes: High-temperature fireside corrosion in coal-fired plants depends on coal ash composition — specifically Na₂O + K₂O + Cl content. Indian coals (especially from Jharia, Raniganj) have variable ash chemistry that creates localized aggressive conditions. The AI model predicts tube wastage rate from coal analysis, boiler operating parameters, and tube material, enabling proactive tube replacement scheduling.
Refinery process piping: Beyond the Jamnagar example above, every Indian refinery (IOCL, BPCL, HPCL, MRPL) faces the challenge of material selection for high-temperature hydrogen service (hydrocrackers, hydrotreaters). Nelson curves provide the baseline — AI refines them by incorporating actual operating data, weld joint factors, and PWHT effectiveness.
Lifecycle Cost Analysis with AI
The most impactful application of AI in corrosion engineering is not predicting corrosion rate — it is optimizing lifecycle cost. A component that corrodes at 0.1 mm/year in CS (cost: ₹80/kg) may be cheaper over 25 years than the same component in 316L (corrosion: 0.01 mm/year, cost: ₹400/kg) — or it may not, depending on inspection frequency, shutdown costs, and failure consequences.
The AI lifecycle model incorporates:
This transforms material selection from a technical corrosion question to a quantified business decision.
Key Takeaways
This is chapter 5 of AI for Metallurgy & Materials.
Get the full hands-on course — free during early access. Build the complete system. Your projects become your portfolio.
View course details