Back to guides
5
9 min

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:

  • Corrosion tables (e.g., MTI corrosion data surveys) — lookup-based, cover standard conditions only
  • NACE/ASTM standards — prescriptive material selection for specific environments
  • Coupon testing — months to years of exposure for meaningful data
  • Electrochemical testing — accelerated but does not always correlate with long-term field performance
  • 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 TypeMAE (mm/yr)Key Predictors
    Sweet (CO₂)0.15CO₂ pp, temp, pH, flow velocity
    Sour (H₂S)0.22H₂S pp, pH, Cl⁻, temp
    Marine atmospheric0.008Cl⁻ deposition, time of wetness, temp
    Process acids0.35Acid 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 × %N

    This 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:

  • Crude blend optimization — predicting which crude combinations create the most aggressive corrosion, and scheduling blends to stay within corrosion budget
  • Inspection prioritization — focusing UT surveys on circuits where the model predicts highest corrosion rates, rather than inspecting everything on a fixed schedule
  • Material upgrade decisions — quantifying the cost-benefit of upgrading from CS to 5Cr-0.5Mo to 316L for specific circuits
  • 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 ModeMacroscopic FeaturesMicroscopic Features
    FatigueBeach marks, flat fracture, initiation site visibleStriations, ratchet marks at origin
    SCCBranching cracks, intergranular (IGSCC) or transgranular (TGSCC)Mud-cracking pattern, cleavage facets
    Hydrogen embrittlementBright, granular fracture, delayed failureIntergranular facets, quasi-cleavage, secondary cracks
    CreepThick-walled component, bulging, grain boundary voidsCavitation at grain boundaries, wedge cracks
    OverloadNecking (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:

  • Corrosion resistance in the specific environment
  • Mechanical properties at service temperature
  • Fabricability (welding, forming, machining)
  • Cost (material + fabrication + lifecycle maintenance)
  • Availability in India (import lead time, domestic alternatives)
  • 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:

  • Initial material and fabrication cost
  • Inspection costs (frequency driven by corrosion rate and consequence)
  • Probability of failure between inspections (from corrosion rate distribution, not point estimate)
  • Consequence of failure (environmental, safety, production loss)
  • Maintenance and repair costs
  • This transforms material selection from a technical corrosion question to a quantified business decision.

    Key Takeaways

  • Corrosion prediction must model the material-environment interaction — PREN and corrosion tables are starting points, not answers. ML models that include environmental parameters (Cl⁻, temperature, pH, flow) dramatically improve CPT and corrosion rate predictions.
  • Failure mode classification accelerates root cause analysis — CNN on fractographs and NLP on investigation reports provide consistency and pattern detection across large failure databases.
  • Material selection is a lifecycle optimization problem — initial cost comparisons are misleading. AI-based lifecycle cost models quantify the true cost of material choices including inspection, maintenance, and failure risk.
  • Indian industrial environments have specific corrosion challenges — naphthenic acid in refineries, coal ash in power plants, marine splash zone in ports. AI models must be trained on local environmental data.
  • 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