Zing Forum

Reading

Neural Network-Based Casting Defect Detection System: Application of MLP and CNN in Industrial Quality Inspection

This article introduces an open-source casting defect detection project that combines Multi-Layer Perceptron (MLP) and Convolutional Neural Network (CNN) technologies to provide an automated image defect recognition solution for the industrial manufacturing sector.

神经网络铸造缺陷检测卷积神经网络多层感知器工业质检计算机视觉深度学习TensorFlowKeras图像分类
Published 2026-06-12 15:16Recent activity 2026-06-12 15:21Estimated read 8 min
Neural Network-Based Casting Defect Detection System: Application of MLP and CNN in Industrial Quality Inspection
1

Section 01

【Introduction】Overview of the Open-Source Casting Defect Detection System Based on MLP and CNN

This post introduces an open-source casting defect detection project that combines Multi-Layer Perceptron (MLP) and Convolutional Neural Network (CNN) technologies to provide an automated image defect recognition solution for the industrial manufacturing sector. Maintained by Mhadevphad, the source code is hosted on GitHub (link: https://github.com/Mhadevphad/Neural-Network-Classification-Casting-Defect-Detection). It aims to address the issues of low efficiency and strong subjectivity in traditional manual quality inspection, and promote the automation of industrial quality inspection.

2

Section 02

Project Background and Significance

In modern manufacturing, product quality control is key to a company's competitiveness. Traditional manual quality inspection is inefficient and prone to subjective influences, leading to missed detections or misjudgments. With the development of deep learning, automated defect detection based on computer vision has become an important direction. Casting processes are widely used in automotive, aerospace, and other fields, but they are prone to defects such as pores and cracks. If not detected in time, these defects will affect product performance and safety, so developing an efficient and accurate automatic detection system is of great significance.

3

Section 03

Technical Architecture and Core Functions

The project adopts a dual-model architecture:

  • Multi-Layer Perceptron (MLP):Learns global image features and provides effective classification capabilities in some scenarios;
  • Convolutional Neural Network (CNN):Extracts local features (shape, texture, position), has the advantages of translation invariance and parameter sharing, and is suitable for defect detection.

The core functions of the system include: image-level defect detection, support for hyperparameter tuning, cross-platform compatibility (Windows/macOS/Linux), and open-source extensibility (facilitating secondary development).

4

Section 04

Technical Implementation Details

Development Environment Requirements

  • Operating system: Windows 10+, macOS 10.12+, or mainstream Linux distributions;
  • Memory: At least 4GB RAM;
  • Storage space: ≥200MB;
  • Python version: 3.7+;
  • Frameworks: TensorFlow, Keras.

Core Technology Stack

  • Deep learning frameworks: TensorFlow, Keras;
  • Computer vision: OpenCV (image preprocessing and feature extraction);
  • Supervised learning: Training with labeled data to achieve defect classification;
  • Hyperparameter optimization: Adjusting learning rate, batch size, etc., to improve performance.
5

Section 05

Application Scenarios and Value

Industrial Quality Inspection Automation Applications

  • Real-time detection: Analyze castings online on the production line to quickly identify defects;
  • Cost reduction: Reduce reliance on manual labor and lower labor costs;
  • Improved consistency: Avoid subjective judgments and unify detection standards;
  • Data traceability: Automatically record results to support quality traceability and process improvement.

Technical Learning Value

  • End-to-end practice: Covers the entire process from data preparation and model training to deployment;
  • Dual-model comparison: Understand the architectural characteristics and differences between MLP and CNN;
  • Industrial case study: Learn about the practical applications and challenges of deep learning in manufacturing.
6

Section 06

Technical Challenges and Future Directions

Current Challenges

  • High data annotation cost: Obtaining and annotating high-quality defect samples requires a lot of manual work;
  • Defect diversity: Various types, shapes, and positions increase detection difficulty;
  • Environmental impact: Changes in lighting and shooting angles may reduce accuracy;
  • Real-time balance: Production lines have high speed requirements, so it is necessary to balance precision and speed.

Future Directions

  • Transfer learning: Use pre-trained models to reduce dependence on new datasets;
  • Few-shot learning: Maintain high performance with a small number of labeled samples;
  • Multi-modal fusion: Combine visible light, X-ray, etc., to improve detection capabilities;
  • Edge computing: Deploy to edge devices to achieve low-latency real-time detection.
7

Section 07

Summary and Insights

This open-source project demonstrates the application potential of deep learning in the field of industrial quality inspection, providing a feasible solution for casting defect detection through the combination of MLP and CNN. For manufacturing enterprises, such tools can improve quality inspection efficiency and promote the digital transformation of production processes; for ML practitioners, it provides an industrial application case to help transform theory into practical solutions. With the advancement of Industry 4.0 and intelligent manufacturing, intelligent detection systems will be applied in more manufacturing scenarios.