Industrial visual detection method and system for cracks machined on surface of automobile casting mold

Through the unsupervised anomaly detection method of deep learning, combined with the residual attention autoencoder network and support vector machine, the problem of insufficient robustness of crack detection under complex background and illumination changes in the existing technology is solved, and efficient, accurate detection and fine-grained classification of cracks on the surface of automobile casting molds are achieved.

CN120765577APending Publication Date: 2025-10-10HUNAN CHENRUN MOLD MANUFACTURING CO LTD

Patent Information

Application Number
CN202510867997.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

Existing surface crack detection methods for automotive casting molds have difficulty accurately identifying tiny cracks when faced with complex background textures and lighting changes. In addition, the existing algorithms are not robust enough, resulting in high false positive and false negative rates, making it difficult to meet the quality control needs of modern production.

Method used

An unsupervised anomaly detection method based on deep learning is adopted. Through the residual attention autoencoder network and support vector machine, image preprocessing, feature extraction and classification positioning are performed. Combined with image rotation correction and multi-dimensional feature quantization, accurate detection of cracks is achieved.

Benefits of technology

It improves the robustness to complex backgrounds and lighting changes, enhances the sensitivity to tiny cracks, ensures the stability and accuracy of detection, and can achieve fine-grained classification and distinguish different types of cracks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120765577A_ABST
    Figure CN120765577A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial visual detection method and system for cracks machined on the surface of an automobile casting mold, and the method comprises the steps: S1, photographing an image of the surface of the automobile casting mold, and carrying out the noise reduction and correction of the image of the surface of the automobile casting mold; s2, performing abnormal region saliency calibration on the corrected image based on a residual attention self-encoding network, and generating a residual image; s3, separating a candidate crack region based on the residual image, and performing feature extraction and vectorization on the candidate crack region to obtain a multi-dimensional feature vector; and S4, performing crack classification and positioning on the multi-dimensional feature vector by using a support vector machine. According to the method, a complete algorithm process from image standardization preprocessing, unsupervised abnormal calibration based on deep learning, multi-dimensional feature quantitative extraction to final intelligent classification and positioning can be established, so that reliable, efficient and refined detection of the surface cracks of the automobile casting mold is realized, and the product quality control level is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of crack detection, and in particular to an industrial visual detection method and system for surface machining cracks in automobile casting molds. Background Art

[0002] In the modern automotive manufacturing industry, automotive casting molds play a crucial role, with their quality directly determining the precision, performance, and lifespan of the final automotive parts. During manufacturing and the intense, high-frequency use of molds, their surfaces are prone to developing tiny machining cracks due to factors such as thermal fatigue and mechanical stress. If these cracks are not detected promptly, they can continue to expand during subsequent production. At best, these cracks can lead to dimensional deviations and reduced surface quality in parts, or even cause mold collapse, resulting in significant production accidents and economic losses. Therefore, timely and accurate crack detection on the surfaces of automotive casting molds is crucial for ensuring product quality, extending mold life, and ensuring production safety.

[0003] Currently, the industry is gradually transitioning from traditional manual visual inspection to automated visual inspection technology for mold surface crack detection. Manual inspection is not only labor-intensive and inefficient, but also highly susceptible to subjective factors such as the inspector's experience and fatigue. This leads to inconsistent inspection standards, high rates of missed and false positives, and a failure to meet the quality control requirements of modern, large-scale production. Consequently, developing automated inspection methods based on machine vision has become a consensus within the industry and a research hotspot. However, existing automated visual inspection methods still face numerous challenges in practical application. The surfaces of automotive casting molds often contain complex background textures left behind by machining processes such as cutting and grinding. These textures can also appear in images as crack-like edge features, significantly interfering with accurate crack identification. Furthermore, real crack morphologies vary, some extremely subtle, with low contrast against the background. Furthermore, variable lighting conditions in the field place extremely high demands on the robustness and accuracy of detection algorithms.

[0004] To address these issues, several technical solutions have been proposed within the industry. For example, patent application publication number CN202510205855.6 discloses a detection method that relies on traditional digital image processing techniques. The method's core process involves first extracting edge information from the image through high-pass filtering and gradient calculation, then designing a cascaded data aggregation rule to optimize edge features. Recognition parameters are adjusted based on the statistical distribution of the features, and finally, crack identification is achieved through adaptability testing by simulating different environmental factors. However, such methods have inherent technical limitations. First, they rely heavily on artificially designed underlying features based on edges and gradients. When faced with complex background textures, faint crack features, or irregular morphology, it is difficult to effectively distinguish true crack edges from background noise edges. This results in insufficient generalization and a high incidence of false positives and negatives. Second, the so-called feature optimization and parameter adjustment in this method are essentially still a rule-based and statistical heuristic strategy. Its robustness depends largely on the parameter settings, making it difficult to cope with the complex and changing working conditions found in real industrial scenarios. Its environmental adaptability test is also an offline, passive simulation, rather than an inherent adaptability of the algorithm itself. Therefore, developing a new detection method that can automatically learn the essential characteristics of normal surfaces, is highly robust to complex backgrounds and lighting changes, and can accurately quantify and intelligently classify defects has become a technical challenge that needs to be solved in this field. Summary of the Invention

[0005] In view of this, the present invention provides an industrial visual inspection method and system for surface machining cracks in automobile casting molds. The purpose is to establish a complete algorithm flow from image standardization preprocessing, unsupervised anomaly calibration based on deep learning, multi-dimensional feature quantification extraction to final intelligent classification and positioning, thereby realizing reliable, efficient and refined detection of surface cracks in automobile casting molds, thereby improving the level of product quality control.

[0006] In order to achieve the above object, the present invention provides an industrial visual detection method for surface machining cracks of automobile casting molds, comprising the following steps: S1: photographing an image of the surface of an automobile casting mold, and performing noise reduction and correction on the image of the surface of the automobile casting mold to obtain a corrected image; S2: Based on the residual attention autoencoder network, the abnormal area of ​​the corrected image is saliently calibrated and a residual image is generated; S3: Separate candidate crack regions based on the residual image, perform feature extraction and vectorization on the candidate crack regions, and obtain multi-dimensional feature vectors; S4: Use support vector machine to classify and locate cracks on multi-dimensional feature vectors.

[0007] As a further improvement method of the present invention: Optionally, in step S1, capturing an image of the surface of the automobile casting mold, and performing noise reduction and correction on the image of the surface of the automobile casting mold to obtain a corrected image includes: S11: collect images and perform smoothing and denoising; Use a high-resolution line array industrial camera to shoot automobile casting molds and obtain surface images of automobile casting molds , the median filter algorithm is used to smooth the surface image of the automobile casting mold, and the denoised image is obtained as follows ; S12: performing edge detection and main direction detection on the denoised image and performing rotation correction; The tilt angle of the denoised image is accurately calculated through edge detection and Hough transform, specifically: First, use the Sobel operator to denoise the image Perform edge detection and generate edge intensity map ; Then, the edge strength map Apply Hough transform to map it from image space to Hough parameter space. In Hough parameter space, each peak point Corresponding to a straight line in the image space; by finding the peak with the highest cumulative count value in the Hough parameter space, the main direction angle of the mold structure is determined , set the standard angle to 90 degrees; the angle that the denoised image needs to be rotated is Calculated by the following formula: According to the calculated rotation angle , for the denoised image Apply affine transformation to rotate and get the rectified image .

[0008] Optionally, in step S2, the abnormal region saliency calibration of the corrected image is performed based on the residual attention autoencoder network, and a residual image is generated, including: S21: Build and train a residual attention autoencoder network; The residual attention autoencoder network consists of an encoder and a decoder; the encoder Receive the input rectified image And through the convolution layer integrating residual connection and spatial attention mechanism, the high-dimensional image information is compressed into a low-dimensional latent vector ; Decoder Receive the latent vector generated by the encoder , and through the transposed convolution layer, the low-dimensional latent vector Restore to an image with the same size as the original input image, recorded as the reconstructed image ; The training process of the residual attention autoencoder network is carried out on a dataset containing only crack-free automobile casting mold samples; the training goal is to minimize the input rectified image and reconstructed image The reconstruction loss between , so that the residual attention autoencoder network can acquire the ability to reconstruct a defect-free automobile casting mold surface image from the compressed features through training; S22: Perform saliency calibration on the abnormal region of the corrected image and generate a residual image.

[0009] Optionally, step S22 includes: The corrected image to be detected Input into the trained residual attention autoencoder network to obtain the reconstructed image .

[0010] when When cracks are contained in These abnormal regions cannot be accurately reconstructed, resulting in the reconstructed image of the corrected image to be detected The corrected image to be detected at the corresponding position There are significant differences; The residual image is generated by calculating the pixel-level absolute difference between the input rectified image to be detected and its reconstructed image .

[0011] Optionally, in step S3, candidate crack regions are separated based on the residual image, and feature extraction and vectorization are performed on the candidate crack regions to obtain multi-dimensional feature vectors, including: S31: segmenting and locating candidate crack regions; First, the residual image Convert it into a binary mask image and separate the candidate crack areas, specifically: Adopt Otsu's adaptive threshold segmentation algorithm to automatically determine the optimal segmentation threshold , and generate a binary mask image based on the optimal segmentation threshold , binary mask image In the middle, 1 represents the candidate crack area, and 0 represents the background; Binary mask image Apply the connected component analysis algorithm to identify and separate each independent candidate crack region to obtain a set of candidate crack regions ,in is the total number of candidate crack regions identified, Representative independent candidate crack regions; S32: extract multi-dimensional features; For each candidate crack region , extract multi-dimensional features, specifically: First, the geometric features of the candidate crack area are extracted and the candidate crack area is calculated. The total number of pixels contained to get its area , and calculate the compactness of the candidate cracks ; Secondly, from the rectified image to be detected Candidate crack regions The texture features are extracted from the corresponding positions; the texture features include the contrast calculated based on the gray level co-occurrence matrix and energy ; The contrast is the weighted square sum of the distances between all elements in the gray-level co-occurrence matrix and its main diagonal; the energy is the sum of the squares of the matrix element values ​​in the gray-level co-occurrence matrix; Finally, significant features are extracted, including: calculating candidate crack regions In the residual image The average residual of all pixel values ​​in , and obtain candidate crack regions In the residual image The maximum value of all pixel values ​​in the ; S33: Construct multi-dimensional feature vectors; Each candidate crack region All the extracted features are combined to form a multi-dimensional feature vector .

[0012] Optionally, in step S4, using a support vector machine to perform crack classification and location on the multi-dimensional feature vector includes: Use multi-class support vector machine as the classifier .

[0013] The classifier It needs to be constructed through an offline training process, specifically: Classifier The training process uses a training dataset with precise annotations, which contains feature vectors extracted from known crack samples and crack-free samples. By training on this dataset, a trained classifier is obtained. After training and deployment, the online detection process is entered; the online detection process will detect each candidate crack area. The constructed feature vector , and input them into the pre-trained classifier in turn for crack classification and location, and obtain the category label ; Category Label The corresponding crack location information is the candidate crack area segmented and located in step S31 The coordinate information of the crack itself in the image, which is the candidate crack area The external rectangular frame of ; All candidate crack regions classified as abnormal are summarized and the final automobile casting mold surface crack detection results are output. The automobile casting mold surface crack detection results contain a list of all identified cracks, each of which specifies the category label of the crack. and its position on the surface of automobile casting molds .

[0014] The present invention also discloses an industrial visual detection system for surface machining cracks of automobile casting molds, comprising: Correction module: captures the surface image of the automobile casting mold, performs noise reduction and correction on the surface image of the automobile casting mold, and obtains the corrected image; Saliency calibration module: Based on the residual attention autoencoder network, the saliency calibration of abnormal areas in the corrected image is performed and a residual image is generated; Feature extraction module: Separate candidate crack areas based on the residual image, perform feature extraction and vectorization on the candidate crack areas, and obtain multi-dimensional feature vectors; Classification module: Use support vector machine to classify and locate cracks on multi-dimensional feature vectors.

[0015] Compared with the prior art, the present invention has at least the following beneficial effects: The present invention uses a residual attention autoencoder network trained on crack-free samples to achieve unsupervised anomaly detection. This fundamentally solves the difficulty of collecting all crack morphology samples for supervised learning in industrial sites, enabling the method to also have excellent detection capabilities for new cracks of various shapes that have never been seen before. At the same time, by combining the preprocessing step of image rotation correction, the image input to the deep learning network is guaranteed to have consistent directionality, greatly enhancing the stability and accuracy of the model's learning of normal surface textures, thereby in turn improving its sensitivity to minor anomalies and ensuring that the algorithm's detection performance remains consistent and stable under different shooting angles and mold placement.

[0016] The present invention quantitatively describes each candidate region along three distinct dimensions: geometry, original texture, and residual saliency. This multi-dimensional feature combination enables the algorithm to comprehensively consider whether a candidate crack region's shape conforms to the elongated characteristics of a crack, whether its texture in the original image is unusual, and its prominence in the residual image. This comprehensive judgment mechanism effectively filters out interference items whose residual values ​​are high but whose morphology or texture does not conform to crack characteristics, thereby greatly improving the accuracy of subsequent classification.

[0017] This method uses a support vector machine (SVM), known for its superior performance in high-dimensional data classification, as the final decision-making core. This classifier learns and constructs an optimal classification hyperplane based on the rich feature vectors extracted in the previous steps. This not only ensures extremely high accuracy in classifying real cracks, but more importantly, it enables fine-grained crack classification, such as distinguishing between different types of cracks, such as transverse, longitudinal, and reticular. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a schematic flow chart of an industrial visual inspection method for surface machining cracks in automobile casting molds according to one embodiment of the present invention; Figure 2 Schematic diagram of the input and output of the residual attention autoencoder network according to one embodiment of the present invention, where 2(a) is the input image and 2(b) is the output image; Figure 3 FIG. 4 is a schematic diagram of a residual image result according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention fall within the scope of protection of the present invention.

[0020] Example 1: An industrial visual inspection method for surface machining cracks in automobile casting molds, such as Figure 1As shown, comprising the following steps: S1: photographing the surface image of the automobile casting mold, and denoising and correcting the surface image of the automobile casting mold to obtain a corrected image: S11: collecting the surface image of the automobile casting mold and performing smooth denoising: The surface image of the automobile casting mold is photographed using a high-resolution linear array industrial camera , and the surface image of the automobile casting mold may contain random noise generated by the camera photosensitive element or circuit. In order to suppress the influence of these noises on subsequent processing, the application preferably uses a median filtering algorithm to perform smooth processing on the surface image of the automobile casting mold. The process traverses the entire surface image of the automobile casting mold through a sliding two-dimensional window, and replaces the value of the center pixel of the window with the median value of all pixel values in the window, thereby obtaining a denoised image denoted as , the generation formula of which is as follows: , wherein represents the pixel value at coordinates after median filtering processing; represents the pixel value of the surface image of the automobile casting mold at coordinates ; is a neighborhood window with a size of centered on the pixel point , and is a positive odd number, which is 5 in this embodiment; represents the median value operation of taking all elements in the set.

[0021] Further, in order to make the crack detection algorithm not affected by the change of the surface processing texture angle of the casting mold, it is necessary to correct the surface processing marks in the image to the same direction. The application accurately calculates the tilt angle of the image through edge detection and Hough transform.

[0022] S12: performing edge detection and main direction detection on the denoised image and performing rotation correction: The tilt angle of the denoised image is accurately calculated through edge detection and Hough transform, specifically: First, the Sobel operator is used to perform edge detection on the denoised image to generate an edge intensity map ; Subsequently, the Hough transform is applied to , which is mapped from the image space to the parameter space. In the Hough parameter space, each peak point corresponds to a straight line in the image space. By finding the peak with the highest cumulative count value in the Hough parameter space, the main direction angle of the mold structure is determined and recorded as , set the standard angle to 90 degrees, so the denoised image needs to be rotated by Calculated by the following formula: in, Indicates the compensation rotation angle required for the image; According to the calculated rotation angle , for the denoised image Apply affine transformation to rotate and get the rectified image .

[0023] It should be noted that this step first effectively suppresses the inevitable random noise interference during the imaging process through smoothing and denoising, thereby significantly improving image clarity and signal-to-noise ratio. This step also unifies each image to be tested onto a standardized directional reference by accurately calculating and correcting the tilt angle of surface machining marks. This greatly enhances the stability of the entire detection method and its adaptability to different samples, ensuring that subsequent crack identification can be performed under consistent and controllable conditions.

[0024] S2: Based on the residual attention autoencoder network, the abnormal area of ​​the corrected image is saliently calibrated and a residual image is generated: S21: Build the residual attention autoencoder network and train it: The residual attention autoencoder network consists of an encoder and a decoder. Its role is to receive the input rectified image , and through a series of convolutional layers that integrate residual connections and spatial attention mechanisms, the high-dimensional image information is compressed into a low-dimensional latent vector . In this embodiment, the encoder function starts with an initial 3x3 convolution layer to extract preliminary features of the image, and then processes the feature map through three serial downsampling modules. Each downsampling module consists of a 3x3 convolution layer with a stride of 2, which halves the spatial size of the feature map and doubles the number of channels, followed by a residual attention module. The residual attention module optimizes gradient propagation and deepens feature learning through an internal residual connection structure, and uses an integrated spatial attention mechanism to generate a weight map to adaptively enhance the response to key feature areas.

[0025] Decoder The role of is the opposite, it receives the latent vector generated by the encoder , and through a series of transposed convolutional layers, try to transform this low-dimensional latent vector Restore to an image with the same size as the original input image, recorded as the reconstructed image In this embodiment, the decoder structure is mirror-symmetric to the encoder. Each upsampling module uses a 3x3 transposed convolutional layer with a stride of 2 to double the spatial size of the feature map while halving the number of channels, ultimately generating a reconstructed image with exactly the same size as the original input.

[0026] The training process of the residual attention autoencoder network is carried out on a dataset containing only crack-free automobile casting mold samples. The training goal is to minimize the input rectified image and reconstructed image The reconstruction loss between , so that the residual attention autoencoder network can acquire the ability to reconstruct a defect-free automobile casting mold surface image from the compressed features through training. In this embodiment, the reconstruction loss is the mean square error.

[0027] S22: Calibrate the crack significance of the abnormal area and generate a residual image: After training, a rectified image to be detected is Input into the network, such as Figure 2 (a). The processing flow is expressed by the following formula: Coding process: Decoding process: in, Indicated by the encoder From the rectified image to be detected The low-dimensional latent vector extracted from Representation decoder According to the latent vector The reconstructed image, such as Figure 2 (b) shown.

[0028] Furthermore, since the network has only been trained on samples of crack-free automobile casting molds, When cracks are contained in These areas will not be accurately reconstructed, resulting in the reconstructed image of the rectified image to be detected The corrected image to be detected at the corresponding position There are significant differences.

[0029] In order to quantify this difference, the present invention generates a residual image by calculating the pixel-level absolute difference between the input image and the reconstructed image. ,like Figure 3 As shown, specifically: in, Represents the residual image at coordinates The pixel value at Indicates the coordinates of the corrected image to be detected The pixel value at Represents the reconstructed image of the rectified image to be detected at coordinates The pixel value at Indicates the absolute value operation.

[0030] It's important to note that this step constructs a deep neural network trained only on crack-free mold samples, creating an expert model that excels at reconstructing perfect mold surface textures. Therefore, when an image containing a crack is input, the model inevitably deviates significantly when attempting to reconstruct this unusual pattern, which it has never learned. This reconstruction failure is converted into a significant signal, and a residual image is generated by calculating the difference between the original image and the reconstructed image.

[0031] S3: Separate candidate crack regions based on the residual image, perform feature extraction and vectorization on the candidate crack regions, and obtain multi-dimensional feature vectors: S31: Segment and locate candidate crack areas: First, the residual image needs to be The present invention preferably adopts the adaptive threshold segmentation algorithm Otsu's method to automatically determine an optimal segmentation threshold. This threshold can maximize the inter-class variance of distinguishing foreground candidate cracks from background normal areas. After applying this threshold, a binary mask image is generated. : in, Represents a binary mask image In coordinates The pixel value at , 1 represents the candidate crack area, and 0 represents the background.

[0032] Next, the binary mask image A connected component analysis algorithm is applied to identify and separate the independent candidate crack regions. The set of these regions is denoted as ,in is the total number of candidate crack regions identified, Representative independent candidate crack regions.

[0033] S32: Extract multi-dimensional features: For each candidate crack region identified by connected component analysis , the present invention will extract a set of multi-dimensional features that can describe its characteristics.

[0034] Specifically, firstly, the geometric features used to describe the shape and size of the candidate crack region are extracted, including calculating the candidate crack region The total number of pixels contained to get its area , and further calculate the compactness used to describe how close its shape is to a circle , the compactness The calculation formula is ,in is the candidate crack region circumference.

[0035] Secondly, in order to describe the texture pattern inside the candidate crack region, it is necessary to obtain the corrected image to be detected. Center and candidate regions The texture features are extracted from the corresponding positions; preferably, the texture features include the contrast calculated based on the gray level co-occurrence matrix , the contrast is the weighted square sum of the distances between all elements in the gray-level co-occurrence matrix and its main diagonal, and the energy also calculated based on the gray-level co-occurrence matrix , the energy The calculation parameters of the gray level co-occurrence matrix in this embodiment can be preferably set to the average value of the calculation results of the four directions of 0°, 45°, 90° and 135°, with a distance of 1.

[0036] Finally, in order to quantify the prominence of the candidate crack region in the residual image, the present invention also extracts significant features, including calculating the candidate crack region In the residual image The average residual of all pixel values ​​in , the average residual Reflects the overall abnormality of the area, as well as the acquisition area In the residual image The maximum value of all pixel values ​​in the , the maximum residual It reflects the most significant outlier in the area.

[0037] S33: Construct multi-dimensional feature vectors: Each candidate crack region All the extracted features are combined to form a multi-dimensional feature vector : It's important to note that this step first accurately transforms the fuzzy residual image generated in the previous step into independent, analyzable candidate crack entities through automated threshold segmentation and connected component analysis. This step comprehensively and profoundly characterizes each candidate region from a multi-dimensional perspective, examining not only geometric features like size and shape but also inherent texture information from the original image. This information, combined with its saliency in the residual image, ultimately condenses these previously abstract visual features into a standardized digital feature vector rich in discernible information.

[0038] S4: Use support vector machine to classify and locate cracks on multi-dimensional feature vectors: Each feature vector A candidate region In order to finally determine whether these candidate regions are real cracks and what kind of cracks they are, the present invention preferably uses a multi-classification support vector machine as a classifier, denoted as ,In this embodiment, the support vector machine adopts radial basis function as the kernel function.

[0039] The classifier It needs to be constructed through an offline training process. Specifically, the training process uses a training data set with precise annotations, which contains feature vectors extracted from known crack samples and crack-free samples. By training on this data set, the classifier An optimal hyperplane is learned that can effectively distinguish feature vectors of different categories in the multidimensional feature space.

[0040] After training and deployment, the online detection process is entered. The online detection process will detect each candidate crack area. The constructed feature vector , and are input into the pre-trained support vector machine classifier The classification process is expressed by the following formula: in, Indicates the classifier for The feature vector of the candidate crack region The output category label after classification belongs to a predefined category set. In this embodiment, the category set includes transverse cracks, longitudinal cracks, network cracks, and normal.

[0041] Getting the category label At the same time, the position information of the crack is also determined. The position information is the candidate region located in S31 step The coordinate information in the image itself, the coordinate information is the circumscribed rectangle of the region , denoted as .

[0042] Finally, the method summarizes all candidate regions classified as abnormal categories and outputs the final automobile casting mold surface crack detection result. The result is a list containing all identified cracks, each indicating the category of the crack and its position on the surface of the automobile casting mold .

[0043] It should be noted that this step uses a machine learning classifier to analyze and distinguish the digital feature description generated in the previous step. Since the classifier is learned based on a large number of known real crack samples, it has high classification accuracy and robustness, and can effectively identify the unique patterns of real cracks from complex feature data and clearly distinguish them from various interference artifacts. Further, this step not only determines the presence or absence of cracks, but also classifies cracks in detail and determines their specific morphology, thereby providing more valuable diagnostic information for subsequent process improvement or mold maintenance. Finally, this step combines the accurate classification results with the previously determined position information to output a complete detection result containing crack types and specific coordinates.

[0044] Embodiment 2: The application also discloses an automobile casting mold surface processing crack industrial visual detection system, which comprises the following five modules: The correction module photographs the automobile casting mold surface image, denoises and corrects the automobile casting mold surface image, and obtains a corrected image; The saliency calibration module calibrates the saliency of the abnormal area of the corrected image based on a residual attention self-encoding network, and generates a residual image; The feature extraction module separates the candidate crack region from the residual image, extracts and vectorizes the features of the candidate crack region, and obtains a multi-dimensional feature vector; The classification module uses a support vector machine to classify and locate cracks based on the multi-dimensional feature vector.

[0045] It should be noted that the serial numbers of the above-mentioned embodiments of the present invention are for descriptive purposes only and do not represent the advantages or disadvantages of the embodiments. In addition, the terms "including", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method comprising the element.

[0046] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0047] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An industrial visual inspection method for surface machining cracks in automobile casting molds, characterized in that: The following steps are involved: S1: photographing an image of the surface of an automobile casting mold, and performing noise reduction and correction on the image of the surface of the automobile casting mold to obtain a corrected image; S2: Based on the residual attention autoencoder network, the abnormal area of ​​the corrected image is saliently calibrated and a residual image is generated; S3: Separate candidate crack regions based on the residual image, perform feature extraction and vectorization on the candidate crack regions, and obtain multi-dimensional feature vectors; S4: Use support vector machine to classify and locate cracks on multi-dimensional feature vectors.

2. The industrial visual inspection method for surface machining cracks of automobile casting molds according to claim 1, characterized in that: The step S1 comprises: S11: collect images and perform smoothing and denoising; Use a high-resolution line array industrial camera to shoot automobile casting molds and obtain surface images of automobile casting molds , the median filter algorithm is used to smooth the surface image of the automobile casting mold to obtain the denoised image ; S12: performing edge detection and main direction detection on the denoised image and performing rotation correction; The tilt angle of the denoised image is accurately calculated through edge detection and Hough transform, specifically: First, use the Sobel operator to denoise the image Perform edge detection and generate edge intensity map ; Then, the edge strength map Apply Hough transform to map it from image space to Hough parameter space; in Hough parameter space, each peak point Corresponding to a straight line in the image space; by finding the peak with the highest cumulative count value in the Hough parameter space, the main direction angle of the mold structure is determined , set the standard angle to 90 degrees; the angle that the denoised image needs to be rotated is Calculated by the following formula: According to the calculated rotation angle , for the denoised image Apply affine transformation to rotate and get the rectified image .

3. The industrial visual detection method for surface machining cracks of automobile casting molds according to claim 2, characterized in that: The step S2 comprises: S21: Build and train a residual attention autoencoder network; The residual attention autoencoder network consists of an encoder and a decoder; the encoder Receive the input rectified image And through the convolution layer integrating residual connection and spatial attention mechanism, the high-dimensional image information is compressed into a low-dimensional latent vector ; Decoder Receive the latent vector generated by the encoder , and through the transposed convolution layer, the low-dimensional latent vector Restore to an image with the same size as the original input image, recorded as the reconstructed image ; The training process of the residual attention autoencoder network is carried out on a dataset containing only crack-free automobile casting mold samples; the training goal is to minimize the input rectified image and reconstructed image The reconstruction loss between , so that the residual attention autoencoder network can acquire the ability to reconstruct a defect-free automobile casting mold surface image from the compressed features through training; S22: Perform saliency calibration on the abnormal region of the corrected image and generate a residual image.

4. The industrial visual inspection method for surface machining cracks of automobile casting molds according to claim 3, characterized in that: The step S22 includes: The corrected image to be detected is input into the trained residual attention autoencoder network to obtain the reconstructed image ; when When cracks are contained in These abnormal regions cannot be accurately reconstructed, resulting in the reconstructed image of the corrected image to be detected The corrected image to be detected at the corresponding position There are significant differences; The residual image is generated by calculating the pixel-level absolute difference between the input rectified image to be detected and its reconstructed image .

5. The industrial visual inspection method for surface machining cracks of automobile casting molds according to claim 3, characterized in that: The step S3 comprises: S31: segmenting and locating candidate crack regions; First, the residual image Convert it into a binary mask image and separate the candidate crack areas, specifically: Adopt Otsu's adaptive threshold segmentation algorithm to automatically determine an optimal segmentation threshold , and generate a binary mask image based on the optimal segmentation threshold , binary mask image In the middle, 1 represents the candidate crack area, and 0 represents the background; For binary mask image Apply the connected component analysis algorithm to identify and separate each independent candidate crack region to obtain a set of candidate crack regions ,in is the total number of candidate crack regions identified, Representative independent candidate crack regions; S32: extract multi-dimensional features; For each candidate crack region , extract multi-dimensional features, specifically: First, the geometric features of the candidate crack area are extracted and the candidate crack area is calculated. The total number of pixels contained to get its area , and calculate the compactness of the candidate crack region ; Secondly, from the rectified image to be detected Candidate crack regions The texture features are extracted from the corresponding positions; the texture features include the contrast calculated based on the gray level co-occurrence matrix and energy The contrast is the weighted square sum of the distances between all elements in the gray-level co-occurrence matrix and its main diagonal; the energy is the sum of the squares of the matrix element values ​​in the gray-level co-occurrence matrix; Finally, extract significant features, including: calculating candidate crack regions In the residual image The average residual of all pixel values ​​in , and obtain candidate crack regions In the residual image The maximum value of all pixel values ​​in to obtain the maximum residual; S33: Construct multi-dimensional feature vectors; Each candidate crack region All the extracted features are combined to form a multi-dimensional feature vector .

6. The industrial visual inspection method for surface machining cracks of automobile casting molds according to claim 5, characterized in that: The step S4 comprises: Use multi-class support vector machine as the classifier ; The classifier It needs to be constructed through an offline training process, specifically: Classifier The training process uses a training dataset with precise annotations, which contains feature vectors extracted from known crack samples and crack-free samples. By training on this dataset, a trained classifier is obtained. After training and deployment, the online detection process is entered; the online detection process will detect each candidate crack area. The constructed feature vector , and input them into the pre-trained classifier in turn for crack classification and location, and obtain the category label ; Category Label The corresponding crack location information is the candidate crack area segmented and located in step S31 The coordinate information of the crack itself in the image, which is the candidate crack area The external rectangular frame of ; Summarize all candidate crack areas classified as abnormal categories and output the final automobile casting mold surface crack detection results, which contain a list of all identified cracks, each of which specifies the category label of the crack and its position on the surface of automobile casting molds .

7. An industrial visual inspection system for surface machining cracks in automobile casting molds, characterized by: include: Correction module: captures the surface image of the automobile casting mold, performs noise reduction and correction on the surface image of the automobile casting mold, and obtains the corrected image; Saliency calibration module: Based on the residual attention autoencoder network, the saliency calibration of abnormal areas in the corrected image is performed and a residual image is generated; Feature extraction module: Separate candidate crack areas based on the residual image, perform feature extraction and vectorization on the candidate crack areas, and obtain multi-dimensional feature vectors; Classification module: Use support vector machine to classify and locate cracks on multi-dimensional feature vectors; To realize the industrial visual detection method for surface machining cracks of automobile casting molds as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A Visual Inspection Method and System for Surface Processing Cracks of Automobile Molds

    CN119693366B

  • Copper sheet and strip surface defect detection method based on-line sequential extreme learning machine

    CN103593670A

  • High-definition image scene classification method based on unsupervised feature learning

    CN106250856A

  • Textile defect detection method based on peak value threshold, rotation calibration and mixed characteristic

    CN107945164A

  • In-service steel wire rope surface defect detection method and system based on deep learning

    CN110930357A

Cited By

  • License plate recognition method based on image processing

    CN121170775A

  • A license plate recognition method based on image processing

    CN121170775B