AI for predicting casting defects uses production records, inspection results and sometimes simulation outputs to estimate where quality problems are more likely.
The starting point is reliable data linked to individual castings or clearly defined batches. A useful model must also be tested on production it has not seen before and connected to an action the team can take.
Defect prediction and defect detection: what is the difference?
Prediction estimates risk from information available at a defined stage. Detection examines evidence of a defect that already exists. AI can support both, but they answer different questions.
| Application | Typical input | Practical output |
|---|---|---|
| Process-based prediction | Recorded temperatures, pressures and cooling conditions | A risk flag for a casting or batch |
| Image-based detection | Surface photographs or X-ray images | Suspected defect locations for review |
| Simulation-assisted prediction | Flow and solidification results combined with defect history | Risk estimates for proposed casting conditions |
Fraunhofer’s CastControl project combines production and X-ray inspection data to support prediction and process recommendations. Hitachi describes a separate simulation-assisted approach that learns relationships between analysis outputs and defect information.
Timing matters: a model using the complete cooling cycle cannot prevent a defect in a casting that has already solidified. It may still guide inspection or adjustments for subsequent production.
What data does a foundry need?
Begin with the records relevant to one process and one quality problem. The following is a starter checklist, not a universal sensor specification.
| Data group | Examples to consider |
|---|---|
| Traceability | Part number, alloy, heat, machine, mould or die, and timestamps |
| Process measurements | Pouring temperature, filling conditions, pressure and cooling history |
| Mould and core condition | Sand test results, binder addition and preparation records, where relevant |
| Inspection outcomes | Defect type, location, severity and acceptance decision |
| Production changes | Tool repairs, material changes and revised process settings |
A study of low-pressure die-cast aluminium wheels demonstrates the importance of matching process measurements to each part and its inspection result. Collecting sensor readings without that connection makes quality prediction much harder.
Use consistent defect names and inspection criteria. If one shift records every cavity as “porosity” while another separates gas and shrinkage, review those labels before training a model.
What published research shows
Research provides useful examples, but a result from one production line is not a performance promise for another.
- Foundry process data: A casting-surface-defect study compared machine-learning methods for predicting batch scrap associated with metal penetration. It also examined which mould-quality variables influenced the model.
- Combined production and inspection data: Fraunhofer reports analysing more than 16,000 sensor data records in CastControl, linking them with X-ray defect information.
- Simulation-assisted modelling: Hitachi’s technical explanation describes learning defect indicators from simulation and defect data. Its worked example uses fabricated defect information, so it should not be treated as a measured production improvement.
These examples support a practical approach: choose a defined problem, connect the right evidence and validate the result locally.
Five steps for a useful AI pilot
1. Choose one problem and one decision
Start with a recurring defect in a manageable product family. Define what the prediction should trigger: additional inspection, a process review or an approved adjustment for later cycles. Record the current rejection and rework rates as your baseline.
2. Set the prediction time
Decide exactly when the warning is needed. Only use inputs available at that moment. An inspection result recorded after production can be the outcome the model learns to predict; it cannot also be an input for an earlier warning.
Using future or otherwise unavailable information is called data leakage. It can make test results look far better than real operation. See scikit-learn’s guidance on data leakage.
3. Compare against a simple baseline
Check whether the model adds value beyond existing process limits and straightforward rules. A more complicated model is useful only if it improves the chosen decision.
Reserve later production for testing. Where records share a heat, batch or other strong dependency, account for those groups when splitting the data. Related records appearing on both sides can make evaluation too easy. Guidance on grouped and time-based validation.
4. Run warnings alongside normal production
Initially, let engineers review predictions while existing inspection and control procedures continue. Record each warning, the actual inspection outcome and whether a useful intervention was possible.
Treat explanations as investigation clues. A variable influencing the prediction does not, by itself, prove that changing it will remove the defect.
5. Monitor after deployment
Recheck performance after changes to alloys, tooling, sensors or operating conditions. Hitachi specifically notes that predictions can become less reliable when applied outside the conditions represented in the training data. Hitachi Review.
Measure missed defects and false alarms
Overall accuracy can be misleading when defective parts are uncommon. As a simple illustration, if 98 out of 100 castings are acceptable, a system that always predicts “acceptable” scores 98% accuracy while missing every defective part.
For a pilot, track:
- Missed defects: defective parts the model did not flag.
- False alarms: acceptable parts unnecessarily flagged.
- Useful warning time: whether staff could act before the relevant decision.
- Production impact: rejection, rework and inspection effort under comparable conditions.
Choose an alert threshold with the quality team. A warning that catches more defects may also increase unnecessary checks; evaluate both costs.
Frequently asked questions
Can AI replace casting inspection?
A risk prediction does not certify a casting. Keep the inspection methods and acceptance requirements specified for the component. The aluminium-wheel study explicitly states that its prediction approach does not replace X-ray inspection.
Our ultrasonic testing guide introduces another method used to investigate internal discontinuities.
How much data is enough?
There is no universal minimum. The dataset needs relevant operating variation and enough confirmed defect examples to assess performance credibly. Repeated readings from a few batches do not necessarily provide independent evidence.
Where should a smaller foundry start?
Start with consistent defect records and traceability for one product family. Use a limited pilot to establish whether predictions improve a real decision before expanding the project.
For casting buyers, ask suppliers how they validate quality predictions and retain inspection evidence. Explore casting manufacturers on Foundry Channel and discuss capabilities relevant to your component.
Frequently asked questions
How do gas porosity and shrinkage porosity differ?
Gas porosity involves gas-related cavity formation; shrinkage porosity involves inadequate feeding during solidification. Use process records and suitable examination to distinguish them reliably.
Can every casting defect be repaired?
Repair depends on the material specification, customer requirements and approved procedures. The correct disposition may be acceptance, authorised repair or rejection.
What should buyers ask a foundry?
Ask how defects are traced, which areas will be inspected, what acceptance criteria apply and how corrective actions are verified. Include these requirements in your enquiry.




