Artificial Intelligence (AI) for Automated Defect Detection in Metal Castings

ai casting inspeksi

Casting inspection demands great precision but is exhausting work. Inspectors must examine thousands of casting surfaces or radiographs every day and decide which pass and which fail. Artificial intelligence (AI), especially deep-learning computer vision, can now help recognize defects automatically, quickly, and consistently. This article explains the limits of manual inspection, how AI detects defects, the types of models used, the advantages, AI’s role as a partner to inspectors, implementation challenges, and how to start an AI project in a foundry.

The Limits of Manual Defect Detection

  • Fatigue. Inspector concentration drops after a few hours, so small defects are missed.
  • Subjectivity. Two inspectors can judge the same defect differently, especially borderline cases.
  • Speed. An automotive die casting line can produce a casting every 1–2 minutes, while manual radiographic review takes longer.
  • Lost data. Results are often recorded only as “pass” or “reject”, without defect type and location, so they cannot be used to improve the process.
  • Shortage of certified inspectors, especially for radiography and ultrasonics.

How AI Detects Defects in Inspection Images

Image sources

SourceDefects detected
Visual cameras with special lightingSurface cracks, fins, sand inclusions, cold shuts, surface porosity
Digital radiography (X-ray)Gas porosity, shrinkage, internal inclusions
CT scanning3D defects, porosity, and dimensions
3D scannersShape and dimensional deviations
ThermographySubsurface defects and cracks
Ultrasonic signalsInternal voids and cracks, especially in steel

Inspection methods are explained in NDT methods for metal castings.

Types of AI tasks

  1. Classification: deciding whether an image contains a defect, or which type.
  2. Object detection: marking each defect’s location with a box, for example with YOLO-family models.
  3. Segmentation: marking defect regions pixel by pixel, for example with U-Net, so defect size can be measured against standard limits.
  4. Anomaly detection: the model is trained only on good castings and flags anything different. Useful when defect examples are scarce.

Workflow

  1. Collect images from the production line under consistent conditions.
  2. Label images with experienced inspectors: defect type, location, and pass or reject decision.
  3. Train the model on most of the images, then test on images it has never seen.
  4. Set decision thresholds, often stricter so dangerous defects do not slip through.
  5. Run in parallel with inspectors for a period to compare results.
  6. Monitor and retrain when products, molds, or camera conditions change.

Advantages of AI Over Purely Manual Inspection

AspectManual inspectionAI-assisted inspection
ConsistencyDepends on person and timeSame every time
SpeedLimitedVery fast, suits automated lines
DataOften just pass or rejectDefect type, location, and size stored
FatigueYesNo
Never-seen-before defectsExperienced inspectors can spot themOften missed if absent from training data
Upfront costLowHigh

The stored defect data are very valuable: linked with process data from Industry 4.0, a foundry can see, for example, that porosity rises every time pouring temperature drops below a certain limit.

AI as a Partner, Not a Replacement for Inspectors

In best practice, AI screens out the clearly good and clearly defective castings and passes doubtful cases to a human inspector. This approach:

  • Reduces inspector workload so they can focus on hard decisions.
  • Keeps final responsibility with certified people, which standards and customers often require.
  • Generates new labeled data that keep improving the model.

Challenges of Implementing AI Defect Detection in Industry

  1. Few, imbalanced defect examples. Good castings vastly outnumber defective ones, and some defect types are very rare.
  2. Inconsistent labels. If inspectors disagree, the model learns from confusing data.
  3. Varying image conditions. Lighting, part position, and dirty lenses affect results.
  4. Product changes. New parts or mold changes can require retraining.
  5. Explainability. Customers and auditors want to know why a casting was rejected or passed.
  6. Integration with X-ray equipment, conveyors, and plant data systems.
  7. Combined expertise in metallurgy, inspection, and data science.

How to Start an AI Project in a Foundry

  1. Pick one part and one inspection type with high volume, such as radiography of an aluminum housing or visual surface inspection.
  2. Standardize image capture: position, lighting, and resolution.
  3. Collect and label images with senior inspectors, using clearly written defect definitions.
  4. Start with a simple model and measure both missed defects and false rejects.
  5. Run in parallel with manual inspection before using it for decisions.
  6. Link results to process data to fix root causes, for example with casting simulation.

The Future of AI-Based Defect Detection in Metal Casting

  • 100% in-line inspection, not sampling, for critical parts.
  • Predicting defects before they happen by combining process data with inspection results.
  • Foundation models for industrial images that need less training data.
  • Robots with AI vision that inspect and finish castings in one step. See robotics and automation.
  • Standards and guidelines for accepting AI systems in quality inspection.

The defects targeted by inspection are described in types of casting defects and the porosity and hot tearing case study.

Frequently Asked Questions

How does AI detect casting defects?

An AI model, usually deep learning, is trained on many casting images labeled as defective or good. Once trained, it recognizes defect patterns in new images from cameras, radiography, or CT scans.

Which defects can AI detect?

Porosity, shrinkage, inclusions, cracks, cold shuts, fins, and dimensional deviations, depending on the image source used.

How many images are needed?

It depends on the defect types and model. Early projects often start with a few hundred to a few thousand labeled images. Anomaly detection can start with images of good castings only.

Does AI replace inspectors?

Not entirely. AI works best as a screen and partner, while difficult decisions and final responsibility stay with certified inspectors.

What is the biggest challenge for AI defect detection?

Scarce defect data and inconsistent labels. Without good data, the model will not be reliable.

Related Articles