Machine Vision for Sand Foundry Defects Detection

In modern manufacturing, cast components such as brake discs are produced in large quantities, and their surface quality directly affects both the functional performance and the service life of the final products. Among the many challenges encountered in casting production, the occurrence of sand foundry defects remains one of the most critical issues. These sand foundry defects, including pores, shrinkage cavities, cracks, and rust-like pseudo-defects, not only degrade the mechanical strength of the cast part but also create significant risks in applications such as automotive braking systems. In this research, I focused on the development of an automated visual inspection system for detecting and classifying sand foundry defects on the surface of cast brake discs. The work covers system design, image acquisition, preprocessing, segmentation, feature extraction, dimensionality reduction, and defect classification using support vector machines. The entire study is presented from the perspective of implementing a robust engineering solution that meets online inspection requirements. All experiments were conducted using a laboratory setup with industrial components, and the obtained results confirm the feasibility and effectiveness of the proposed methods. This article also emphasizes the importance of combining classical image processing techniques with machine learning to achieve a practical solution for sand foundry defects detection.

Introduction and Problem Statement

The detection of sand foundry defects has traditionally been performed by human inspectors. However, manual visual inspection is subjective, slow, and prone to errors, especially when the defects are small or when the surface texture is complex. In the case of cast brake discs, the working surface must be free of any surface anomalies that could affect the friction behavior between the brake pad and the disc. The presence of even a small shrinkage cavity or a micro-crack may lead to stress concentration and premature failure. Therefore, a reliable, non-contact, and fast inspection method is required. Machine vision provides an ideal solution because it can operate continuously in industrial environments, and it can extract quantitative characteristics of surface anomalies. The present study addresses the following technical objectives: (1) design a hardware platform capable of acquiring high-quality images of the rotating brake disc under controlled illumination; (2) develop image processing algorithms to suppress noise and to segment the region of interest; (3) separate suspected defect areas from the normal cast surface; (4) extract discriminative features from each suspected defect segment; and (5) classify those segments into predefined categories of sand foundry defects, namely blowholes, shrinkage cavities, cracks, and rust stains. The overall detection accuracy must reach at least 98% for distinguishing defective parts from non-defective parts, and the misclassification rate for defect types must be below 15%. Additionally, the entire processing time should be less than 5 seconds per part.

Analysis of Sand Foundry Defects on Brake Discs

Before designing the inspection system, I performed a detailed study of the typical surface anomalies found on cast brake discs. These sand foundry defects originate from various stages of the casting process. For example, blowholes are caused by gas entrapment during filling or solidification, while shrinkage cavities result from improper feeding or non-uniform cooling. Cracks may appear due to thermal stresses during cooling or mechanical stress during demoulding. Additionally, rust stains are not actual casting defects, but they are often misclassified as defects because in the image these stains appear as low-contrast regions with irregular boundaries. A summary of the main characteristics of these sand foundry defects is presented in Table 1.

Table 1: Primary characteristics of sand foundry defects observed on brake disc surfaces
Defect type Shape Boundary Gray level relative to normal surface Typical cause
Blowhole Approximately circular Smooth inner wall Lower, deep dark Gas entrapment
Shrinkage cavity Irregular Rough inner wall Lower, not uniform Solidification shrinkage
Crack Elongated, linear Sharp, well-defined Very low, dark Thermal or mechanical stress
Rust stain Irregular, large area Fuzzy transition Slightly lower with color variation Oxidation

Since the inspection system must operate in real time, the imaging system had to be carefully selected. I chose a black-and-white CCD camera because the color information was not essential for the detection of the sand foundry defects considered. The camera resolution is 2456×2058 pixels, which gave sufficient detail for detecting small cavities and cracks. A 12 mm fixed focal length lens was mounted on the camera. For illumination, I selected LED bar lights placed at a high angle to emphasize the local contrast of surface irregularities. The lighting arrangement was designed in a dark-field configuration so that ambient light from the workshop would not interfere. The hardware platform included a roller conveyor, a stopper mechanism, and two photoelectric sensors. The first sensor triggered the stopper to lift and the second sensor stopped the conveyor at the exact position under the camera. This arrangement ensured that the brake disc was always located in the same field of view with minimal positional variation.

Image Acquisition and Preprocessing

Images acquired directly from the camera contained significant noise due to vibrations from the conveyor, floating dust, and electrical disturbances. Noise is a major obstacle for accurate segmentation of sand foundry defects because it introduces false edges and small blobs that can be confused with true micro-defects. Therefore, a preprocessing step was mandatory. I compared four commonly used spatial domain filters: mean filter, Gaussian filter, median filter, and bilateral filter. All filters were implemented with a 5×5 kernel. The effectiveness of each filter was quantified by the peak signal-to-noise ratio (PSNR). The PSNR values are reported in Table 2.

Table 2: PSNR of different denoising filters applied to the brake disc image
Filter PSNR (dB)
Mean filter 39.789
Gaussian filter 40.990
Median filter 39.659
Bilateral filter 46.279

The bilateral filter clearly outperformed the others because it simultaneously considers spatial proximity and intensity similarity. It smooths the background while preserving the edges of surface defects. As a result, I selected the bilateral filter for all subsequent processing. The filtered image was then subjected to a geometric calibration step using a standard calibration target, although no lens distortion correction was necessary because the camera setup was fixed.

Template Matching for Region of Interest Localization

After denoising, the next task was to locate the brake disc surface within the complex industrial background. Since the conveyor, stoppers, and support structures were visible in the image, a blind threshold segmentation would fail. I used a template matching algorithm based on normalized cross-correlation. The template image was created offline using a background subtraction method: a background image without the workpiece was subtracted from a foreground image containing the brake disc. The difference image was binarized by the Otsu threshold, then morphological opening was applied to remove noise. The resulting mask was multiplied by the foreground image and cropped to obtain the final template. The normalized cross-correlation coefficient between the template T and a sub-image S is defined as:

$$ R(i,j) = \frac{\sum_{s=1}^{M} \sum_{t=1}^{N} \left( S_{i,j}(s,t) – \bar{S}_{i,j} \right)\left( T(s,t) – \bar{T} \right)}{\sqrt{\sum_{s=1}^{M} \sum_{t=1}^{N} \left( S_{i,j}(s,t) – \bar{S}_{i,j} \right)^2} \cdot \sqrt{\sum_{s=1}^{M} \sum_{t=1}^{N} \left( T(s,t) – \bar{T} \right)^2}} $$

Here, \(M\) and \(N\) are the width and height of the template, \(\bar{S}_{i,j}\) is the mean intensity of the sub-image at position \((i,j)\), and \(\bar{T}\) is the mean intensity of the template. The value of \(R\) ranges from -1 to 1, with 1 indicating perfect matching. The original algorithm produced correct localization but required an average of 879 ms per image. To meet the real-time requirement, I introduced two acceleration strategies. First, a termination criterion for the similarity computation was used. While calculating the correlation for a sub-image, if the partial correlation after processing \(k\) pixels is less than \(R_{min} – 1 + k/n\), the computation for that candidate aborts. Second, an image pyramid was constructed by successively down-sampling the image with a 2×2 mean filter. A pyramid of five levels was used, and search was performed from the coarsest level to the finest level. This reduced the average localization time to 289 ms while preserving high accuracy. The resulting region of interest was then cropped from the image, and a circular mask was applied to restrict further processing to the brake disc surface area.

Threshold Segmentation of Suspected Sand Foundry Defects

Once the surface region was extracted, the actual sand foundry defects needed to be separated from the normal cast surface. The defects appear as dark areas because the depressed regions scatter light differently and reflect less light back to the camera. Therefore, thresholding is a natural choice. I compared two threshold selection algorithms: Otsu’s method (maximum inter-class variance) and the maximum entropy method. Otsu’s method seeks the threshold that maximizes the between-class variance:

$$ \sigma^2(k) = P_0(k) \left( \mu_0(k) – \mu_T \right)^2 + P_1(k) \left( \mu_1(k) – \mu_T \right)^2 $$

where \(P_0\) and \(P_1\) are the probabilities of the two classes, \(\mu_0\) and \(\mu_1\) are their mean gray values, and \(\mu_T\) is the total mean. In our experiments, Otsu’s method failed because the defect area was extremely small compared with the background, causing the threshold to be biased toward the background statistics. On the other hand, the maximum entropy method selects the threshold that maximizes the total entropy of the foreground and background distributions:

$$ H(k) = -P_0(k) \ln P_0(k) – P_1(k) \ln P_1(k) $$

The maximum entropy method produced much better segmentation results for the sand foundry defects, since it uses a global information measure that is less sensitive to the area imbalance. However, after thresholding, the binary image still contained small noise blobs arising from the uneven surface texture of the cast iron. To remove these spurious regions, I applied morphological opening. The opening operation was defined as:

$$ A \circ B = (A \ominus B) \oplus B $$

where \(A\) is the binary image and \(B\) is a structural element. To avoid missing any true defects, a slightly larger dilation template was used after the erosion step. This ensured that genuine but fragmented defect regions remained connected. The total number of foreground pixels in the binary image was then used to determine whether the brake disc surface contains a suspected defect. For a defective part, the foreground area from the maximum entropy segmentation consists of the dark defect regions, whose total pixel count is typically below 100,000. For a non-defective part, the foreground is dominated by the darker portions of the normal cast texture, which usually contain more than 100,000 pixels. Table 3 lists some examples of the foreground pixel counts for defect-free and defective surfaces.

Table 3: Number of foreground pixels after maximum entropy segmentation
Image type Pixel count
Defective surface (with crack) 963
Defective surface (with shrinkage) 1362
Defective surface (with blowhole) 5793
Defective surface (with multiple defects) 13117
Non-defective surface sample 1 232829
Non-defective surface sample 2 273668
Non-defective surface sample 3 385106
Non-defective surface sample 4 327517

Based on the clear gap between the two groups, a threshold of 100,000 pixels was chosen. If the binary foreground count is smaller than this threshold, the part is considered to contain at least one suspected sand foundry defect. Then, each connected component of the binary image was extracted, and its minimum bounding rectangle was used to crop an individual defect region. These cropped images were stored for further classification.

Feature Extraction for Sand Foundry Defects

The classification of sand foundry defects required extracting meaningful descriptors from each segmented segment. I analyzed the distinct appearance of each defect category. Blowholes are nearly circular and have smooth boundaries. Shrinkage cavities are irregular and often show internal intensity variations due to rough surfaces. Cracks are long and narrow with very low gray values and sharp edges. Rust stains are typically much larger, have indistinct borders, and do not correspond to physical depressions. Therefore, I extracted both geometric features and texture features to discriminate these categories.

Geometric Shape Features

For each connected component, I computed the area \(A\), perimeter \(L\), circularity \(C\), rectangularity \(R\), aspect ratio \(W\), and the seven Hu moments. The area is simply the number of pixels in the region. The perimeter was calculated using the 8-connected chain code:

$$ L = \sqrt{2} N + M $$

where \(N\) is the count of chain code elements with odd values and \(M\) is the count of even values. Circularity is defined as the ratio of the region area to the area of its minimum circumscribed circle:

$$ C = \frac{A}{A_c} $$

Rectangularity is the ratio of the area to the area of the minimum bounding rectangle:

$$ R = \frac{A}{A_R} $$

The aspect ratio is the quotient of the maximum dimension and the minimum dimension of the minimum bounding rectangle:

$$ W = \frac{l}{w} $$

The Hu moments are derived from normalized central moments and are invariant to translation, scale, and rotation. They are defined as:

$$ \phi_1 = \eta_{20} + \eta_{02} $$

$$ \phi_2 = (\eta_{20} – \eta_{02})^2 + 4\eta_{11}^2 $$

$$ \phi_3 = (\eta_{30} – 3\eta_{12})^2 + (3\eta_{21} – \eta_{03})^2 $$

$$ \phi_4 = (\eta_{30} + \eta_{12})^2 + (\eta_{21} + \eta_{03})^2 $$

$$ \phi_5 = (\eta_{30} – 3\eta_{12})(\eta_{30} + \eta_{12})\left[(\eta_{30} + \eta_{12})^2 – 3(\eta_{21} + \eta_{03})^2\right] + (3\eta_{21} – \eta_{03})(\eta_{21} + \eta_{03})\left[3(\eta_{30} + \eta_{12})^2 – (\eta_{21} + \eta_{03})^2\right] $$

$$ \phi_6 = (\eta_{20} – \eta_{02})\left[(\eta_{30} + \eta_{12})^2 – (\eta_{21} + \eta_{03})^2\right] + 4\eta_{11}(\eta_{30} + \eta_{12})(\eta_{21} + \eta_{03}) $$

$$ \phi_7 = (3\eta_{21} – \eta_{03})(\eta_{30} + \eta_{12})\left[(\eta_{30} + \eta_{12})^2 – 3(\eta_{21} + \eta_{03})^2\right] + (3\eta_{12} – \eta_{30})(\eta_{21} + \eta_{03})\left[3(\eta_{30} + \eta_{12})^2 – (\eta_{21} + \eta_{03})^2\right] $$

In these equations, \(\eta_{pq}\) is the normalized central moment:

$$ \eta_{pq} = \frac{\mu_{pq}}{\mu_{00}^{\gamma}}, \quad \gamma = \frac{p+q}{2} $$

Table 4 provides example geometric features for representative samples of each defect category.

Table 4: Geometric features of representative sand foundry defect samples
Sample Area Perimeter Circularity Rectangularity Aspect ratio
Blowhole 1 431 79.70 0.628 0.757 1.548
Blowhole 2 219 55.70 0.702 0.805 1.382
Shrinkage 1 1244 147.98 0.479 0.758 1.535
Shrinkage 2 807 153.26 0.330 0.681 2.878
Crack 1 7744 971.21 0.058 0.430 10.768
Crack 2 4674 583.19 0.125 0.703 6.836
Rust 1 7564 444.25 0.348 0.774 2.395
Rust 2 2053 206.65 0.371 0.745 1.917

Texture Features Using Uniform LBP

Geometric features alone are insufficient to separate shrinkage cavities from rust stains because both can be irregular and have similar area ratios. Therefore, I incorporated a texture descriptor based on Local Binary Patterns (LBP). The basic LBP operator compares the center pixel intensity with those of its neighbors and generates a binary code:

$$ LBP(x_c, y_c) = \sum_{p=0}^{P-1} s(i_p – i_c) 2^p, \quad s(x) = \begin{cases} 1, & x > 0 \\ 0, & x \leq 0 \end{cases} $$

To achieve rotation invariance and multi-scale analysis, I used the circular neighborhood extension \(LBP_{P,R}^{ri}\). The rotation invariant version takes the minimum value among all circular shifts of the binary code:

$$ LBP_{P,R}^{ri} = \min\{ ROR(LBP_{P,R}, i) \mid i=0,1,\dots,P-1 \} $$

However, the number of possible patterns grows exponentially with \(P\). To reduce the dimension and also improve robustness, I applied the uniform pattern scheme. A pattern is considered uniform if the number of bitwise transitions (0→1 or 1→0) is at most two. All uniform patterns are indexed separately, and all non-uniform patterns are grouped into a single bin. For \(P\) neighboring points, the total number of uniform patterns is \(P(P-1)+2\), plus one bin for non-uniform patterns. In this study I used \(P=8\) and \(R=1\), which yields 59 features: 58 uniform pattern bins and one mixed bin. Figure 1 shows the histogram of uniform LBP features for a shrinkage cavity sample. The dimension of the texture feature vector is therefore 59. Combining with 12 geometric features (area, perimeter, circularity, rectangularity, aspect ratio, and the 7 Hu moments) gives a 71-dimensional feature vector for each suspected defect segment.

Dimensionality Reduction with Principal Component Analysis

The raw feature vector contained redundancy because many of the geometric and texture features are correlated. Feeding all 71 dimensions directly into a classifier could lead to overfitting, especially because the number of defect samples in industry is often limited. I therefore applied Principal Component Analysis (PCA) to reduce the feature dimension while preserving most of the variance. PCA operates on the sample matrix \(\mathbf{X}\) where each row is one sample and each column is one feature. The covariance matrix is computed as:

$$ \mathbf{C} = \mathbf{E}\{ (\mathbf{X} – \bar{\mathbf{X}})^\top (\mathbf{X} – \bar{\mathbf{X}}) \} $$

The eigenvectors of \(\mathbf{C}\) are the principal components. The eigenvalue \(\lambda_i\) associated with each component represents the variance captured by that component. The contribution rate of the first \(k\) principal components is given by:

$$ \gamma_k = \frac{\sum_{i=1}^{k} \lambda_i}{\sum_{i=1}^{n} \lambda_i} $$

I examined the contribution rates of all components. The first 6 principal components already accounted for 99.88% of the total variance. Therefore, I projected the original 71-dimensional feature vectors onto the 6 principal component axes. This dramatic reduction simplified the classifier design and improved generalization. The transformed feature matrix is:

$$ \mathbf{Y} = (\mathbf{X} – \bar{\mathbf{X}}) \mathbf{W} $$

where \(\mathbf{W}\) is the 71×6 projection matrix composed of the top six eigenvectors.

Support Vector Machine Classification

I selected Support Vector Machine (SVM) as the classifier because it is particularly well suited for small sample problems and nonlinear classification. SVM seeks an optimal separating hyperplane that maximizes the margin between different classes. In a binary classification setting, the decision function is:

$$ f(\mathbf{x}) = \operatorname{sign}\left( \sum_{i=1}^{N} \alpha_i y_i K(\mathbf{x}_i, \mathbf{x}) + b \right) $$

Here, \(K(\mathbf{x}_i, \mathbf{x})\) is a kernel function. Since sand foundry defects are often not linearly separable in the original feature space, a proper kernel must be chosen. I compared linear, polynomial, radial basis function (RBF), and sigmoid kernels. The classification accuracy on a validation set for each kernel is listed in Table 5.

Table 5: Classification accuracy for different SVM kernels
Kernel Accuracy (%)
Linear 68.57
Polynomial 65.71
Radial basis function 78.57
Sigmoid 72.86

The RBF kernel performed best. Its mathematical expression is:

$$ K(\mathbf{x}_i, \mathbf{x}_j) = \exp\left( -\gamma \|\mathbf{x}_i – \mathbf{x}_j\|^2 \right) $$

For RBF-SVM, the two most important parameters are the penalty coefficient \(C\) and the kernel parameter \(\gamma\). The penalty coefficient balances the trade-off between maximizing the margin and minimizing the classification error. When \(C\) is too large, the model may overfit; when \(C\) is too small, the model may underfit. The parameter \(\gamma\) controls the influence of a single training sample. To determine the optimal values, I performed a grid search with cross-validation. The range for \(C\) was from \(2^{-3}\) to \(2^{10}\), and the range for \(\gamma\) was from \(2^{-5}\) to \(2^{5}\). The grid search used 80 samples, with 20 samples for each of the four classes: blowhole, shrinkage cavity, crack, and rust stain. Cross-validation selected \(C = 512\) and \(\gamma = 0.125\). The achieved overall cross-validation accuracy was 86.48%. Although this value seems moderate, it satisfies the industrial specification because the class distribution in practice is not balanced, and correct detection of all true defects is more important than perfect classification.

Software System Design and Implementation

To make the inspection system operable for production, I developed a software package with a graphical user interface. The software consists of five main modules: (1) detection control, (2) image acquisition and display, (3) counting and display, (4) timing and display, and (5) production log. The user interface is designed to show the real-time camera view, the captured image after triggering, the localization result, and the final defect detection result. It also provides two trigger modes: software trigger and external hardware trigger from the photoelectric sensors. When an external trigger is selected, the software listens to the serial port connected to the sensor system. After the image is captured, the processing pipeline automatically performs denoising, template matching, threshold segmentation, and SVM classification. The interface displays the number of inspected parts, the number of non-defective parts, and the counts of each defect class. A production log records the start time, end time, inspection duration per part, and stores all original images and detection results. This log is crucial for tracing the causes of sand foundry defects and for improving the casting process.

The software also includes a real-time alert function. If a part is classified as containing any sand foundry defect, the interface highlights the defect region with a bounding box and triggers an alarm signal for the subsequent sorting mechanism. In addition, if the camera or serial port is not connected, the system displays a warning message to prevent the operator from starting an invalid session. A screenshot of the user interface after processing a defective brake disc is shown in the software test section, where the detected defect is marked on the reconstructed surface image.

Experimental Verification and Results

A comprehensive experiment was designed to validate the entire inspection system. I selected 100 brake disc samples: 40 discs were defect-free (without rust), and the remaining 60 discs contained various sand foundry defects or rust stains, with 15 samples for each category. The detection system was operated with the external trigger mode, and the conveyor was moved continuously to simulate an online production environment. The experiment was repeated under the same conditions twice to ensure repeatability. The confusion matrix for the detection and classification results is presented in Table 6.

Table 6: Confusion matrix of the defect detection experiment
Actual class Detected as non-defective Blowhole Shrinkage Crack Rust
Non-defective (no rust) 40 0 0 0 0
Blowhole 0 12 3 0 0
Shrinkage 0 1 14 0 0
Crack 0 0 0 15 0
Rust 1 0 1 0 13

From this table, the leakage rate was computed as:

$$ \text{Leakage rate} = \frac{\text{number of defective samples not detected}}{\text{total number of samples}} = 0\% $$

This means every part containing a real sand foundry defect was correctly identified as defective. The rust stains are not considered true defects, but they are included for classification to reduce false alarms. However, one rust sample was classified as non-defective, and another rust sample was classified as a shrinkage cavity. The rust sample that passed was likely too light in color and had a very low contrast, causing the threshold segmentation to miss it. The rust sample that was misclassified as shrinkage had a small area with a surrounding dark halo, which resembled the appearance of a shrinkage cavity. For the purpose of final product quality, the misclassification between rust and shrinkage is not critical because rust is a non-defective condition, but it does affect the defect type statistics. The classification accuracy for the 54 correctly detected samples out of the 60 actual defective/rust samples is:

$$ \text{Classification accuracy} = \frac{54}{60} \times 100\% = 90\% $$

The misclassification rate for the defective classes (blowhole, shrinkage, crack) was:

$$ \text{Misclassification rate} = \frac{4}{45} \times 100\% = 8.89\% $$

This satisfies the requirement of below 15%. The overall accuracy for distinguishing non-defective parts from defective parts was 99%, which meets the 98% specification. The average inspection times are listed in Table 7.

Table 7: Average inspection time for each class
Class Inspection time (s)
Non-defective 0.594
Blowhole 1.479
Shrinkage 1.487
Crack 1.495
Rust 1.492

Most of the time variation arises because defective parts require additional feature extraction and SVM classification, while non-defective parts are rejected early based on the large foreground area. The maximum time of about 1.5 seconds per part is well below the 5-second limit, leaving ample time for sorting and subsequent operations. The experimental results confirm that the proposed machine vision system can be deployed for online inspection of sand foundry defects on brake discs.

Discussion of Challenges and Limitations

Although the system achieved the desired specifications, I identified several limitations that should be addressed in future work. First, the classification accuracy for small blowholes and shallow shrinkage cavities is limited because their two-dimensional gray-level appearances are very similar. The inner roughness of a shrinkage cavity might not be captured by a simple uniform LBP operator if the defect region is too small. Second, the template matching approach assumes a fixed orientation and in-plane translation of the brake disc. In a real production line, the disc could be rotated by the conveyor drive, or a different type of brake disc with a different diameter could be presented. The template would then need to be changed or the algorithm extended to rotation-invariant matching. Third, the current lighting setup uses high-angle LED bars that may produce specular reflections on the machined surfaces of the brake disc. This reflection can cause bright areas that break the connectivity of the defect regions. A multi-angle lighting scheme or a polarizing filter could mitigate this issue. Fourth, the system relies on a binary decision based on the total foreground pixel count to reject non-defective parts. This threshold may need to be recalibrated when a new batch of castings exhibits a different surface texture. An adaptive threshold based on the local surface statistics would make the system more robust.

Another important consideration is the handling of pseudo-defects such as rust stains. In a full-scale production environment, rust stains may be present on many parts due to inadequate storage. The classifier was trained with a balanced dataset of 20 samples per class, but in practice the prior probabilities of each defect type are imbalanced. A cost-sensitive SVM or a separate rust detector could reduce the number of false alarms. Moreover, the current algorithms operate on 8-bit grayscale images. If the illumination or the camera response fluctuates over time, the threshold values may drift. A proper illumination control feedback system or a real-time background subtraction method could be used to adapt to these changes.

Improvements and Future Directions

To further increase the reliability of the detection of sand foundry defects, I plan to incorporate depth information using structured light or laser profile scanning. Many sand foundry defects, especially blowholes and shrinkage cavities, have distinct depth profiles that are much easier to identify in a three-dimensional representation. A 3D point cloud could be obtained using a laser line projector and a calibrated camera. Then the depth map can be segmented by applying a simple depth threshold, which would be robust to surface color and texture. The combination of 2D texture features and 3D shape features is expected to significantly reduce the misclassification between shrinkage cavities and rust stains, because rust stains are flat and do not exhibit a significant depth anomaly.

Another promising direction is the use of deep learning techniques, such as convolutional neural networks (CNNs), for both segmentation and classification of sand foundry defects. The main barrier to deep learning is the limited number of labeled defective images. However, with the production log system storing all inspection results, a large dataset can be collected over time. Semi-supervised learning or transfer learning from pre-trained models could overcome the scarcity of training data. In addition, data augmentation techniques such as random rotation, translation, scaling, and the injection of noise can artificially expand the training set. I also intend to explore the fusion of multiple classifiers. For instance, a geometric-feature-based SVM might be effective for distinguishing cracks, while a texture-based CNN could be better for the other categories. A decision-level fusion strategy would combine the strengths of both approaches.

From a system engineering viewpoint, the computing time could be reduced by using a GPU for parallel processing. The current implementation runs on a CPU, and the template matching part benefits from the pyramid but could be further optimized using FFT-based correlation. However, the measured average time of 1.5 seconds is already acceptable for a production line with a cycle time of 5 seconds. The more significant advantage of the proposed system is its modular architecture. Each processing stage can be independently replaced or upgraded without affecting the other modules.

Conclusion

In this article, I presented a comprehensive study on the detection and classification of sand foundry defects on the surface of cast brake discs using machine vision. The work included the development of a dedicated hardware platform with controlled lighting, a CCD camera, and a conveyor simulation. The image processing pipeline utilized bilateral filtering for denoising, template matching with pyramid acceleration for localization, maximum entropy thresholding with morphological refinement for segmentation, and a combination of geometric and uniform LBP features followed by PCA for representation. A support vector machine classifier with an RBF kernel was optimized through cross-validation. The experiments demonstrated that the system can correctly identify all defective parts that contain true sand foundry defects, with an overall product acceptance accuracy of 99%. The classification error rate for defect types was below 9%, and the processing time was less than 1.5 seconds per part, satisfying the requirement of 5 seconds. These results prove that machine vision is a feasible and effective technology for automated inspection of sand foundry defects in industrial production environments.

The contributions of this research can be summarized as follows: (1) a practical hardware setup for acquiring consistent images of moving cast brake discs; (2) a fast and robust localization algorithm that separates the brake disc surface from a complex background; (3) a reliable segmentation method for extracting small defect regions from a noisier surface; (4) a compact feature representation that combines shape and texture information while avoiding overfitting; and (5) a validated SVM-based classifier capable of distinguishing blowholes, shrinkage cavities, cracks, and rust stains. The proposed methods can be extended to other cast parts with minor modifications, and the software framework allows for easy integration into an automated production line. Future research directions include 3D defect detection and deep learning-based classification, which will further improve the accuracy and robustness of the system.

Scroll to Top