Automobile part crack detection method, device and equipment and readable storage medium
By using image fusion and an improved crack recognition model, cracks in automotive parts can be automatically detected, solving the problems of low efficiency and low accuracy in traditional detection methods and achieving efficient and accurate crack recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHERY AUTOMOBILE CO LTD
- Filing Date
- 2026-01-16
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for detecting cracks in automotive parts suffer from low efficiency and low accuracy. Traditional manual inspection is slow and results are inconsistent, while semi-automatic inspection systems have insufficient algorithm adaptability and a high rate of missed detections.
Automatic detection is achieved by using image fusion processing and crack recognition models to acquire multi-angle component images. Crack segmentation is performed by combining an improved U-Net model with dilated convolution and convolutional block attention modules. Crack parameters are analyzed and valid cracks are selected.
It improves detection speed and result consistency, reduces the false negative rate, and enhances the efficiency and accuracy of crack detection in automotive parts.
Smart Images

Figure CN121962075A_ABST
Abstract
Description
Methods, apparatus, equipment and readable storage media for detecting cracks in automotive components Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, device and readable storage medium for detecting cracks in automotive parts. Background Technology
[0002] With the rapid development of automotive testing and verification technologies, the requirements for durability testing of various automotive components are becoming increasingly stringent. After durability testing, surface crack detection is a crucial step in assessing the reliability of automotive components.
[0003] Traditional crack detection methods mainly rely on manual visual inspection or semi-automatic image detection. Traditional manual inspection methods suffer from slow speed and poor result consistency, while existing semi-automatic inspection systems have drawbacks such as insufficient algorithm adaptability and high false negative rates. Therefore, current crack detection methods for automotive components suffer from low efficiency and low accuracy. Summary of the Invention
[0004] In view of this, the purpose of this application is to overcome the shortcomings of the prior art and provide a method for detecting cracks in automotive parts. The method includes: acquiring images of the automotive parts taken at various preset shooting angles, and performing image fusion processing on the component images to obtain a target image of the automotive parts; inputting the target image into a preset crack recognition model to determine a crack segmentation mask image; analyzing each crack in the crack segmentation mask image to determine the crack parameters of each crack, and identifying cracks whose crack parameters meet preset conditions as valid cracks.
[0005] In one embodiment, the step of performing image fusion processing on the component image to obtain a target image of the automobile component includes: performing geometric correction, radiometric correction, and image fusion processing on the component image to obtain a fused image of the automobile component; and performing illumination compensation and noise suppression on the fused image to obtain the target image of the automobile component.
[0006] In one embodiment, the step of inputting the target image into a preset crack recognition model to determine a crack segmentation mask image includes: inputting the target image into a preset crack recognition model, the crack recognition model including an encoder path, a decoder path, and a skip connection structure, wherein a dilated convolutional layer is introduced in the encoder path, and a convolutional block attention module is introduced after each skip connection in the decoder path; and performing pixel-level crack segmentation processing on the target image based on the encoder path, the decoder path, and the skip connection structure using the crack recognition model to determine the crack segmentation mask image.
[0007] In one embodiment, the step of performing pixel-level crack segmentation processing on the target image using the crack recognition model based on the encoder path, the decoder path, and the skip connection structure to determine a crack segmentation mask image includes: performing multi-level downsampling processing on the target image using the crack recognition model based on the downsampling layer in the encoder path to obtain a low-level visual feature map, a mid-level structural feature map, a long-range crack feature map, and a macro-level structural feature map; processing the macro-level structural feature map using the crack recognition model based on the bottleneck layer in the encoder path to obtain a global feature map; performing multi-level upsampling processing on the global feature map using the crack recognition model based on the upsampling layer in the decoder path, and introducing the low-level visual feature map, the mid-level structural feature map, or the long-range crack feature map through the skip connection structure in each upsampling layer for convolutional block attention processing to obtain a crack segmentation result; and outputting a crack segmentation mask image based on the crack segmentation result using the output layer in the decoder path of the crack recognition model.
[0008] In one embodiment, after the step of outputting a crack segmentation mask image based on the crack segmentation result through the output layer in the decoder path using the crack recognition model, the method further includes: segmenting the target image into a preset number of target sub-images, and inputting each target sub-image into the crack recognition model to obtain a crack segmentation mask sub-image corresponding to each target sub-image; verifying the crack segmentation mask image based on the crack segmentation mask sub-image; if the verification fails, executing a preset exception response mechanism to re-determine the crack segmentation mask image; if the verification passes, performing the step of analyzing each crack in the crack segmentation mask image, determining the crack parameters of each crack, and determining cracks whose crack parameters meet preset conditions as valid cracks.
[0009] In one embodiment, the step of analyzing each crack in the crack segmentation mask image, determining the crack parameters of each crack, and identifying cracks whose crack parameters meet preset conditions as valid cracks includes: performing morphological processing on the crack segmentation mask image to obtain a target crack segmentation mask image; extracting the crack connected component corresponding to each crack in the target crack segmentation mask image, and calculating the crack parameters of each crack and the basic attribute parameters of the corresponding crack connected component; and identifying cracks whose crack parameters and basic attribute parameters meet preset conditions as valid cracks.
[0010] In one embodiment, the crack parameters include crack length, crack width, and crack complexity. The basic attribute parameters include: the step of determining cracks whose crack parameters and basic attribute parameters meet preset conditions as valid cracks includes: for each crack, if the crack length, crack width, crack complexity, and basic attribute parameters all meet the preset conditions, then the crack is determined as a valid crack; if any one of the crack length, crack width, crack complexity, and basic attribute parameters does not meet the preset conditions, then the crack is determined as interference information and discarded.
[0011] This application also provides an automotive component crack detection device, comprising: a processing module for acquiring component images of the automotive component taken at various preset shooting angles, and performing image fusion processing on the component images to obtain a target image of the automotive component; a first determining module for inputting the target image into a preset crack recognition model to determine a crack segmentation mask image; and a second determining module for analyzing each crack in the crack segmentation mask image, determining the crack parameters of each crack, and determining cracks whose crack parameters meet preset conditions as valid cracks. This application also provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described automotive component crack detection method.
[0012] This application also provides a computer-readable storage medium storing a computer program that, when run on a processor, executes the above-described method for detecting cracks in automotive components.
[0013] The embodiments of this application have the following beneficial effects: These embodiments acquire images of the automotive component taken from various preset shooting angles, and perform image fusion processing on the component images to obtain a target image of the automotive component; the target image is input into a preset crack recognition model to determine a crack segmentation mask image; each crack in the crack segmentation mask image is analyzed to determine the crack parameters of each crack, and cracks that meet preset conditions are identified as valid cracks based on the crack parameters. By combining automatic image detection with a crack recognition model for crack identification and filtering valid cracks in the automotive component based on crack parameters, the detection speed and result consistency are improved, and the high false negative rate is reduced, thereby improving the efficiency and accuracy of crack detection in automotive components. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and therefore should not be considered as a limitation on the scope of protection of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 is a flowchart illustrating the first embodiment of the automotive component crack detection method provided in this application; Figure 2 is a flowchart illustrating the second embodiment of the automotive component crack detection method provided in this application; Figure 3 is a flowchart illustrating the third embodiment of the automotive component crack detection method provided in this application; Figure 4 is a flowchart illustrating the fourth embodiment of the automotive component crack detection method provided in this application; Figure 5 is a flowchart illustrating the fifth embodiment of the automotive component crack detection method provided in this application; Figure 6 is a structural schematic diagram of the automotive component crack detection device provided in this application. Detailed Implementation
[0016] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0017] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0018] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.
[0019] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0020] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0021] It is understood that the method of this application is applied to an automotive component crack detection device, which can be a terminal device, a PC device, a smart terminal, etc., and is not limited thereto. For ease of explanation, the following embodiments are described using an automotive component crack detection device as the execution subject.
[0022] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0023] Please refer to Figure 1. Figure 1 is a flowchart of the first embodiment of the method for detecting cracks in automotive parts provided in this application. The method includes: step S101, acquiring images of the automotive parts taken at various preset shooting angles, and performing image fusion processing on the images of the parts to obtain a target image of the automotive parts.
[0024] In this embodiment, when it is necessary to perform crack detection on automotive parts that have undergone durability testing, the tester uses compressed air to clean the surface of the automotive parts, removing dust, oil, and other interfering substances. The cleaned automotive parts are then placed in the fixed position of the automotive parts crack detection device. The automotive parts crack detection device acquires images of the automotive parts taken from various preset shooting angles and performs image fusion processing on the images to obtain the target image of the automotive parts.
[0025] In one embodiment, the automotive component crack detection equipment includes three high-resolution industrial cameras (≥20 megapixels) arranged at a 120° angle around a fixed position on the component to ensure full surface coverage. The key parameters for each high-resolution industrial camera are set as follows: exposure time 1-5ms (dynamically adjusted according to material reflectivity), ISO sensitivity 100-400 (to avoid noise interference), and light source intensity 5000-10000 Lux (uniform diffused light to reduce glare). The automotive component crack detection equipment uses the three high-resolution industrial cameras to capture images of the automotive component at corresponding shooting angles, obtaining component images for each angle. These images are then fused to obtain a target image of the automotive component. This target image covers the entire surface of the automotive component, preventing any missed areas from causing subsequent crack detection errors.
[0026] Step S102: Input the target image into a preset crack recognition model to determine the crack segmentation mask image.
[0027] In this embodiment, after obtaining the target image of the automotive component, the automotive component crack detection equipment inputs the target image into a preset crack recognition model to determine the crack segmentation mask image. It should be noted that the crack recognition model is pre-trained, and the training data for the crack recognition model consists of collected and labeled crack images of metal / non-metal samples, mainly from fatigue and environmental durability test scenarios, with optimizers, loss functions, and data augmentation performed.
[0028] In one embodiment, the crack recognition model is an improved U-Net model. It is a deep improvement on the traditional U-Net, retaining its classic encoder-decoder structure and skip connection structure, and introducing dilated convolutional layers and a CBAM attention module. The dilated convolutional layers enhance the receptive field, capturing the long-range dependencies of microcracks. The convolutional block attention module strengthens the feature representation of high-incidence crack regions through dual visual focusing of channels and space. This achieves high-precision, low-miss-detection segmentation of microcracks down to 0.05mm.
[0029] Step S103: Analyze each crack in the crack segmentation mask image, determine the crack parameters of each crack, and identify cracks whose crack parameters meet preset conditions as valid cracks.
[0030] In this embodiment, the automotive component crack detection device analyzes each crack in the crack segmentation mask image output by the crack recognition model, determines the crack parameters of each crack, and identifies the valid cracks in the automotive component based on the crack parameters. It is understood that the crack segmentation mask image is a binary image, where pixels marked as 1 represent cracks and pixels marked as 0 represent the background. The automotive component crack detection device can identify each crack based on the crack segmentation mask image, and thus determine the crack parameters of each crack. Since, in the standards for cracks involved in automotive components, only cracks whose parameters conform to specific rules are considered valid cracks, and others are considered interference, the automotive component crack detection device analyzes the crack parameters of each crack to identify the valid cracks in the automotive component from all cracks.
[0031] It should be noted that if the crack parameters of each crack do not conform to the specific rules, it means that there are no valid cracks in the automotive parts.
[0032] The automotive component crack detection device of this embodiment acquires images of the automotive component taken from various preset shooting angles, and performs image fusion processing on the component images to obtain a target image of the automotive component. The target image is then input into a preset crack recognition model to determine a crack segmentation mask image. Each crack in the crack segmentation mask image is analyzed to determine the crack parameters of each crack, and cracks that meet preset conditions are identified as valid cracks based on the crack parameters. By combining automatic image detection with a crack recognition model for crack identification and using crack parameters to filter out valid cracks in automotive components, the detection speed and result consistency are improved, and the false negative rate is reduced, thereby improving the efficiency and accuracy of crack detection in automotive components.
[0033] Please refer to Figure 2. Figure 2 is a flowchart of the second embodiment of the automotive component crack detection method provided in this application. The difference between the second embodiment and the first embodiment is that the step of performing image fusion processing on the component image to obtain the target image of the automotive component includes: step S201, performing geometric correction, radiometric correction and image fusion processing on the component image to obtain the fused image of the automotive component.
[0034] In this embodiment, the automotive component crack detection device acquires images of the automotive component taken from various preset shooting angles, performs geometric correction and radiometric correction on the component images respectively, and then performs image fusion processing on the geometrically and radiometrically corrected component images to obtain a fused image of the automotive component. This solves the problem of local overexposure or shadows.
[0035] In one embodiment, the automotive component crack detection equipment performs precise spatial registration on component images captured from different shooting angles to eliminate geometric distortion and misalignment caused by differences in viewing angles, thereby achieving geometric correction. The specific implementation steps are as follows: 1. Using prior information from the automotive component's CAD model, construct its standard geometric contour in three-dimensional space. Perform extrinsic parameter calibration (i.e., rotation matrix R and translation vector t) between the imaging plane of each camera and the CAD model, establishing a mapping relationship between image pixels and the three-dimensional point cloud. During the calibration process, a checkerboard calibration board is used to jointly solve for intrinsic parameters (focal length, principal point, distortion coefficient) and extrinsic parameters. 2. Run an improved SURF (Speeded-Up Robust Features) algorithm on each component image to enhance feature point density and stability: Use Hessian determinant to detect interest points, with a threshold set to 400 to ensure a feature point density ≥ 50 points / cm²; introduce orientation adaptive filtering to suppress false features caused by strong reflections from metal surfaces; employ octree spatial distribution for balanced sampling to avoid feature points clustering in textured areas; use a simplified 64-dimensional feature descriptor to reduce computational load while maintaining matching accuracy. 3. Use FLANN nearest neighbor search for initial matching; apply the RANSAC algorithm to fit the homography matrix H, eliminating incorrect matching point pairs (setting reprojection error < 2 pixels); the matching success rate must be ≥ 90%, otherwise trigger a reshoot mechanism or adjust the light source.
[0036] In one embodiment, the automotive component crack detection equipment performs radiometric correction and image fusion processing on component images to eliminate brightness inconsistencies caused by differences in illumination angle and material reflection, and to provide a scientific weighting basis for subsequent fusion. The specific implementation steps are as follows: 1. Camera Response Function (CRF) estimation: Based on a multi-exposure image sequence (although this system uses single-exposure acquisition, it utilizes three-camera parallax to simulate multi-exposure characteristics), the Debevec method is used to reconstruct the nonlinear response curve of the camera, constructing an energy minimization problem. 2. HDR radiometric inversion: The three geometrically corrected component images are converted into a linear radiometric space, and a preliminary fused image is synthesized. 3. Fusion weight allocation mechanism: A weighted fusion strategy based on physical quality indicators is designed. 4. Multi-scale Laplacian pyramid fusion: The three images and their weight maps are constructed into a Laplacian Pyramid (5 layers); at each layer and at each spatial location, they are weighted and merged, and finally, the fused image is obtained through pyramid reconstruction.
[0037] In one embodiment, after obtaining the fused image, the automotive component crack detection equipment performs accuracy detection and quality assessment on the fused image to ensure that the fused image meets the requirements of registration accuracy and visual fidelity. The specific implementation steps are as follows: 1. Registration error detection: The phase correlation method is used to select the overlapping area between two component images; the frequency domain phase correlation is calculated to locate the peak position and obtain the sub-pixel level offset; the average registration error is required to be ≤0.05 pixels, and the maximum error is <0.1 pixels. If it is lower than this threshold, the re-fusion process is initiated or manual review is prompted. 2. Fusion quality assessment: The structural similarity index (SSIM) is used to calculate the SSIM index in the overlapping area between two component images. The overall SSIM is required to be ≥0.92. If it is lower than this threshold, the re-fusion process is initiated or manual review is prompted. 3. Auxiliary visual verification: According to preset rules, the fused image is processed to generate a difference map and an edge overlay map for debugging; abnormal areas (such as afterimages, misalignments, and blurring) are automatically marked and logged.
[0038] Step S202: Perform illumination compensation and noise suppression on the fused image to obtain the target image of the car component.
[0039] In this embodiment, after obtaining a fused image of the automotive component, the automotive component crack detection equipment performs illumination compensation and noise suppression on the fused image to obtain a target image of the automotive component. Illumination compensation employs the Retinex algorithm to eliminate uneven illumination, and uses multi-scale decomposition and color fidelity constraints to enhance the contrast of the crack area through adaptive enhancement. Noise suppression combines nonlocal mean (NLM) filtering and wavelet transform to remove particle noise while preserving crack edges; the hybrid noise reduction scheme uses time-domain filtering and frequency-domain processing. This embodiment's automotive component crack detection equipment performs geometric correction, radiometric correction, and image fusion processing on the component image to obtain a fused image of the automotive component. Illumination compensation and noise suppression are then applied to the fused image to obtain the target image of the automotive component. By performing steps including geometric correction, radiometric correction, image fusion, illumination compensation, and noise suppression on the component image data, problems such as surface reflection and texture interference are effectively overcome, improving the quality of the final target image of the automotive component, thereby contributing to improved accuracy in subsequent crack detection based on the target image.
[0040] Please refer to Figure 3. Figure 3 is a flowchart of the third embodiment of the automotive component crack detection method provided in this application. The difference between the third embodiment and the first to second embodiments is that the step of inputting the target image into a preset crack recognition model to determine the crack segmentation mask image includes: step S301, inputting the target image into a preset crack recognition model, wherein the crack recognition model includes an encoder path, a decoder path and a skip connection structure, wherein a dilated convolutional layer is introduced in the encoder path, and a convolutional block attention module is introduced after each skip connection in the decoder path.
[0041] In this embodiment, the crack recognition model pre-set in the automotive component crack detection equipment includes an encoder path, a decoder path, and a skip connection structure. A dilated convolutional layer is introduced in the encoder path, and a convolutional block attention module is introduced after each skip connection in the decoder path.
[0042] In one embodiment, the encoder path includes a first downsampling stage to a fourth downsampling stage and a bottleneck layer; a dilated convolutional layer is inserted into the third downsampling stage, the fourth downsampling stage, and the bottleneck layer to expand the receptive field and capture the long-range dependencies of microcracks. The decoder path includes a first upsampling stage to a third upsampling stage and an output layer; skip connections are respectively set between the first upsampling stage and the third downsampling stage, between the second upsampling stage and the second downsampling stage, and between the third upsampling stage and the first downsampling stage; a convolutional block attention module is inserted at the feature concatenation point after the skip connections between the first upsampling stage and the third upsampling stage (i.e., at the beginning of each decoding stage) to enhance crack-related features and suppress background interference.
[0043] Step S302: The crack recognition model performs pixel-level crack segmentation processing on the target image based on the encoder path, the decoder path, and the skip connection structure to determine the crack segmentation mask image.
[0044] In this embodiment, the automotive component crack detection device performs pixel-level crack segmentation processing on the target image based on the encoder path, decoder path, and skip connection structure using a crack recognition model to determine the crack segmentation mask image. The most crucial element is the collaborative mechanism between the dilated convolutional layer and the convolutional block attention module. During the feature extraction stage of the encoder path, dilated convolution expands the receptive field, extracts long-range crack context information, and outputs features that are fed into the skip connection to access the convolutional block attention module. Based on the wide-area features provided by the dilated convolution, the convolutional block attention module more accurately identifies "potential crack paths," achieving local focusing under global guidance. In the feature fusion stage of the skip connection structure, deep encoder features (including dilated convolution output) are concatenated with shallow detail features and output to the convolutional block attention module for weighted processing. The convolutional block attention module suppresses responses in non-crack areas, retaining and enhancing weak crack signals discovered by the dilated convolution, preventing them from being submerged by the background. In the feature reconstruction stage of the decoder path, after each layer is upsampled, the attention module of the convolutional block is used to guide the crack recognition model to prioritize the reconstruction of the long-range structure marked by the dilated convolution, so as to achieve crack reconstruction from coarse to fine and ensure that fine cracks are not smoothly discarded.
[0045] In one embodiment, the step of performing pixel-level crack segmentation processing on the target image based on the encoder path, the decoder path, and the skip connection structure using the crack recognition model to determine the crack segmentation mask image includes: step S3021, performing multi-layer downsampling processing on the target image based on the downsampling layer in the encoder path using the crack recognition model to obtain a low-level visual feature map, a mid-level structural feature map, a long-range crack feature map, and a macro-structural feature map.
[0046] Step S3022: The macroscopic structural feature map is processed by the crack recognition model based on the bottleneck layer in the encoder path to obtain a global feature map.
[0047] Step S3023: The crack recognition model performs multi-layer upsampling processing on the global feature map based on the upsampling layer in the decoder path. In each layer of upsampling processing, the low-level visual feature map, the intermediate-level structural feature map, or the long-range crack feature map are introduced through the skip connection structure for convolutional block attention processing to obtain the crack segmentation result.
[0048] Step S3024: The crack recognition model outputs a crack segmentation mask image based on the crack segmentation result through the output layer in the decoder path.
[0049] In this embodiment, the crack recognition model has the following structure: the encoder path includes a first downsampling stage to a fourth downsampling stage and a bottleneck layer. The decoder path includes a first upsampling stage to a third upsampling stage and an output layer. Skip connection structures are respectively set between the first upsampling stage and the third downsampling stage, between the second upsampling stage and the second downsampling stage, and between the third upsampling stage and the first downsampling stage.
[0050] In one embodiment, the specific process of the crack recognition model from input target image to output crack segmentation mask image is as follows: Input target image (size is H×W×3, i.e., height×width×3-channel RGB image). First downsampling stage: Input target image → standard convolution (3×3 convolution kernel, 64 channels) → ReLU activation function → standard convolution (3×3 convolution kernel, 64 channels) → ReLU activation function → max pooling downsampling → obtaining low-level visual feature map. Second downsampling stage: Input low-level visual feature map → standard convolution (3×3 convolution kernel, 128 channels) → ReLU activation function → standard convolution (3×3 convolution kernel, 128 channels) → ReLU activation function → max pooling downsampling → obtaining mid-level structural feature map. Third downsampling stage: Input intermediate structure feature map → dilated convolution (dilation rate r=2, 256 channels) → ReLU activation function → dilated convolution (dilation rate r=2, 256 channels) → ReLU activation function → max pooling downsampling → obtain long-range crack feature map. Fourth downsampling stage: Input long-range crack feature map → dilated convolution (dilation rate r=4, 512 channels) → ReLU activation function → dilated convolution (dilation rate r=4, 512 channels) → ReLU activation function → max pooling downsampling → obtain macroscopic structure feature map. Bottleneck layer: Input macroscopic structure feature map → dilated convolution (dilation rate r=6, 1024 channels) → ReLU activation function → dilated convolution (dilation rate r=6, 1024 channels) → ReLU activation function → obtain global feature map. First upsampling stage: Input global feature map → Transposed convolution (upsampling) → Concatenated with the long-range crack feature map output from the third downsampling stage (Concat) → Convolutional block attention module → Standard convolution (3×3 convolution kernel) → ReLU activation function → Standard convolution (3×3 convolution kernel) → ReLU activation function. Second upsampling stage: Transposed convolution (upsampling) → Concatenated with the intermediate-level structural feature map output from the second downsampling stage (Concat) → Convolutional block attention module → Standard convolution (3×3 convolution kernel) → ReLU activation function → Standard convolution (3×3 convolution kernel) → ReLU activation function. Third upsampling stage: Transposed convolution (upsampling) → Concatenated with the low-level visual feature map output from the first downsampling stage (Concat) → Convolutional block attention module → Standard convolution (3×3 convolution kernel) → ReLU activation function → Standard convolution (3×3 convolution kernel) → ReLU activation function. Output layer: 1×1 convolution (channel number adjusted to 1) → Sigmoid activation function → output binarized crack segmentation mask image with size H×W×1.
[0051] It should be noted that the dilation rate r=2 of the dilated convolution in the third downsampling stage can moderately expand the receptive field when the feature map size is still large, thus beginning to capture the continuous structure of cracks. The dilation rate r=4 of the dilated convolution in the fourth downsampling stage can further expand the field of view to cope with the decrease in spatial resolution caused by downsampling. The dilation rate r=6 of the dilated convolution in the bottleneck layer can achieve maximum receptive field coverage and capture the long-range dependencies of microcracks across regions (such as the direction of slender cracks). Dilated convolution significantly expands the receptive field without increasing the number of parameters by inserting "holes" (zero gaps) between the weights of the convolution kernel. For example, a 3×3 convolution kernel with r=2 actually covers a 7×7 region, effectively sensing the extension trend of microcracks and avoiding the information loss caused by traditional pooling.
[0052] The automotive component crack detection device in this embodiment inputs the target image into a preset crack recognition model to determine the crack segmentation mask image. The crack recognition model is trained on data from a large number of durability tests and can accurately identify crack textures under different test conditions, ensuring the model's accuracy and generalization ability. Simultaneously, the crack recognition model incorporates dilated convolutional layers and convolutional block attention modules. Dilated convolution increases the receptive field, and the attention mechanism suppresses background interference, further improving the accuracy of crack detection in the target image.
[0053] Please refer to Figure 4. Figure 4 is a flowchart of the fourth embodiment of the automotive component crack detection method provided in this application. The difference between the fourth embodiment and the first to third embodiments is that after the step of outputting a crack segmentation mask image based on the crack segmentation result by the output layer in the decoder path through the crack recognition model, the method includes: step S401, dividing the target image into a preset number of target sub-images, and inputting each target sub-image into the crack recognition model to obtain a crack segmentation mask sub-image corresponding to each target sub-image.
[0054] In this embodiment, the automotive component crack detection device segments the target image into a preset number of target sub-images and inputs each target sub-image into the crack recognition model to obtain the crack segmentation mask sub-image corresponding to each target sub-image.
[0055] In one embodiment, the target image is divided into a 256×256 pixel grid, and the unique boundary of each target sub-image is processed by mirror filling to prevent edge distortion before being input into the crack recognition model.
[0056] Step S402: Verify the crack segmentation mask image based on the crack segmentation mask sub-image.
[0057] In this embodiment, the automotive component crack detection equipment verifies the crack segmentation mask image based on the crack segmentation mask sub-image. Specifically, each crack segmentation mask sub-image is spatially aligned with the crack segmentation mask image, and it is determined whether the crack region marked in the crack segmentation mask image is also identified in the corresponding crack segmentation mask sub-image. If multiple adjacent crack segmentation mask sub-images report the presence of cracks, then the crack identification of the corresponding region in the crack segmentation mask image is determined to be accurate; if only one crack segmentation mask sub-image reports the presence of cracks, and the remaining crack segmentation mask sub-images are silent or negation, then the crack in the corresponding region of the crack segmentation mask image is regarded as isolated noise.
[0058] In step S403, if the verification fails, a preset exception response mechanism is executed to redetermine the crack segmentation mask image.
[0059] Step S404: If the verification is successful, the following steps are performed: analyze each crack in the crack segmentation mask image, determine the crack parameters of each crack, and determine the cracks whose crack parameters meet the preset conditions as valid cracks.
[0060] In this embodiment, if the verification fails, a preset anomaly response mechanism is executed to re-determine the crack segmentation mask image, or isolated noise identified during the verification process is directly removed from the crack segmentation mask image. If the verification passes, the steps of analyzing each crack in the crack segmentation mask image, determining the crack parameters of each crack, and identifying cracks that meet preset conditions as valid cracks based on the crack parameters are executed.
[0061] The automotive component crack detection device in this embodiment, after obtaining the crack segmentation mask image, further segments the target image into a preset number of target sub-images, inputs each sub-image into the crack recognition model, and obtains a crack segmentation mask sub-image corresponding to each target sub-image. Then, the crack segmentation mask image is verified based on the crack segmentation mask sub-images. This involves dividing the target image into multiple small regions, performing independent crack detection on each, and verifying the results. This improves the robustness and detection rate for micro-cracks, edge cracks, and locally poor-quality images, thus contributing to the accuracy of the obtained crack segmentation mask image.
[0062] Please refer to Figure 5. Figure 5 is a flowchart of the fifth embodiment of the automotive component crack detection method provided in this application. The difference between the fifth embodiment and the first to fourth embodiments is that the step of analyzing each crack in the crack segmentation mask image, determining the crack parameters of each crack, and determining the cracks whose crack parameters meet the preset conditions as valid cracks includes: step S501, performing morphological processing on the crack segmentation mask image to obtain the target crack segmentation mask image.
[0063] In this embodiment, the automotive component crack detection equipment performs morphological processing on the crack segmentation mask image to obtain the target crack segmentation mask image. The morphological processing includes opening and skeletonization. The opening operation first erodes and then dilates the crack segmentation mask image to remove small-area noise and fracture points. Skeletonization extracts the crack centerline from the crack segmentation mask image, facilitating subsequent length measurement and direction analysis.
[0064] In one embodiment, the morphological processing includes a closing operation that first dilates and then erodes the crack segmentation mask image to fill small holes or fractures inside the crack.
[0065] Step S502: Extract the crack connected region corresponding to each crack in the target crack segmentation mask image, and calculate the crack parameters of each crack and the basic attribute parameters of the corresponding crack connected region.
[0066] In this embodiment, the automotive component crack detection equipment extracts the crack connected region corresponding to each crack in the target crack segmentation mask image, and calculates the crack parameters of each crack and the basic attribute parameters of the corresponding crack connected region.
[0067] In one embodiment, the automotive component crack detection device employs 8-connectivity (Connected Component Labeling). Using OpenCV's `cv2.connectedComponents()` function, white regions (crack pixels) in a binary mask are numbered based on an 8-neighborhood rule. Each independent connected region is assigned a unique label ID. Regions with excessively small areas (e.g., <5 pixels) are filtered out and considered noise. The remaining regions constitute the crack connected region corresponding to each crack. Basic attribute parameters are calculated for each connected region: area, perimeter, minimum bounding rectangle, and aspect ratio.
[0068] In one embodiment, the automotive component crack detection equipment calculates crack parameters for each cracked object, including crack length, crack width, and crack complexity. Specifically, Freeman chain code is used to describe the crack skeleton's path, and the crack length is obtained by accumulating the path length. The specific implementation steps are as follows: 1. Extract skeleton endpoints: Find pixels with a degree of 1 (i.e., the start and end points) in the skeleton graph; if there are more than two endpoints, the longest path is selected as the main crack. 2. Track the skeleton path: Starting from one endpoint, track the path pixel by pixel along the 8-neighborhood direction until the other endpoint, recording the direction code (0~7) for each step, forming a Freeman chain code sequence. 3. The distance corresponding to each direction is different: horizontal distance = 1 diagonal movement (±45°), vertical distance = 1.414. 4. Output: Crack length accurate to sub-pixel level (unit: pixels), which can be converted into physical dimensions. The method utilizes Euclidean distance transformation to calculate the shortest distance from each pixel within the crack region to the boundary. The maximum value of this distance is the local half-width, which is then used to deduce the crack width. The specific implementation steps are: 1. Perform distance transformation on the original binary crack region, outputting the Euclidean distance from each pixel in the image to the nearest background pixel. 2. Use skeleton pixels as centerline sampling points; take the distance value corresponding to each skeleton point, representing the half-width at that location; calculate the average width. The minimum width, maximum width, and standard deviation can be output simultaneously. 3. Output: crack width, location of the narrowest / widest point, and width distribution histogram. The fractal dimension is used to reflect the irregularity of the crack boundary. The more tortuous and branched the crack, the higher the fractal dimension, indicating more severe damage. The specific implementation steps are: 1. Prepare the crack boundary: Perform edge detection (e.g., Canny) or contour extraction (cv2.findContours) on the crack mask to obtain the closed boundary curve. 2. Apply the Box Counting Method: Divide the image into a square grid; count the number of boxes containing at least one boundary pixel; change the number of pixels (e.g., 2, 4, 8, 16, 32), and repeat the above process; plot the curve; the slope of the fitted line is the fractal dimension. Typical values for reference: Straight crack: D ≈ 1.0, Slight bending: D ≈ 1.1–1.3, Multi-branch complex crack: D ≈ 1.4–1.7, Extreme fragmentation: D → 2.0. 3. Output: The fractal dimension D of the crack, used to evaluate crack propagation modes and material failure mechanisms.
[0069] Step S503: Cracks whose crack parameters and basic attribute parameters meet preset conditions are identified as valid cracks.
[0070] In this embodiment, after determining the crack parameters of each crack and the basic attribute parameters of the corresponding crack connected region, the automotive component crack detection device determines the effective cracks of the automotive component in the target crack segmentation mask image based on the crack parameters and basic attribute parameters.
[0071] In one embodiment, after identifying the valid cracks in the target crack segmentation mask image, the automotive component crack detection device automatically generates a report containing the following: crack location, mapped to the sample CAD model via 3D coordinates; material type, identified via a pre-trained ResNet classification model; and crack parameters, predicted via maximum depth and propagation trend.
[0072] In one embodiment, the crack parameters include crack length, crack width, and crack complexity, and the basic attribute parameters include: the step of determining a crack that meets the preset conditions for the crack parameters and the basic attribute parameters as a valid crack includes: step S5031, for each crack, if the crack length, crack width, crack complexity, and the basic attribute parameters all meet the preset conditions, then the crack is determined as a valid crack.
[0073] Step S5032: If any one of the crack length, crack width, crack complexity, and basic attribute parameters does not meet the preset conditions, then the crack is identified as interference information and removed.
[0074] In this embodiment, for each crack, the automotive component crack detection equipment compares the crack length, crack width, crack complexity, and basic attribute parameters with preset conditions. If the crack length, crack width, crack complexity, and basic attribute parameters all meet the preset conditions, the crack is identified as a valid crack. If any one of the crack length, crack width, crack complexity, and basic attribute parameters does not meet the preset conditions, the crack is identified as interference information and discarded.
[0075] In one embodiment, the preset conditions include: area ≥ 5 pixels and aspect ratio > 3 in the basic attribute parameters; crack length ≥ 0.1 mm (converted to the number of pixels, such as 5 pixels or 50μm / pixel); crack width ∈ [0.02mm, 2mm], exceeding the range is considered a false detection or stain; fractal dimension < 1.8 (too high may be texture interference) and the chain code path is continuous without jumps.
[0076] The automotive component crack detection equipment of this embodiment calculates basic attribute parameters and crack parameters based on each connected region of each crack. Combined with standardized preset rules, it screens out effective cracks, ensuring the comparability of different test batches, completely eliminating subjective differences, improving the consistency of test results, and thus ensuring the accuracy of crack detection to a certain extent.
[0077] Referring to Figure 6, which is a schematic diagram of the structure of the automotive component crack detection device provided in this application, the automotive component crack detection device includes a processing module 10, used to acquire component images of the automotive component taken at various preset shooting angles, and to perform image fusion processing on the component images to obtain a target image of the automotive component.
[0078] The first determining module 20 is used to input the target image into a preset crack recognition model to determine the crack segmentation mask image.
[0079] The second determining module 30 is used to analyze each crack in the crack segmentation mask image, determine the crack parameters of each crack, and determine the cracks whose crack parameters meet the preset conditions as valid cracks.
[0080] It is understood that the automotive component crack detection device of this embodiment corresponds to the automotive component crack detection method of the above embodiment. The options in the above embodiment are also applicable to this embodiment, so they will not be described again here.
[0081] This application also provides a computer device, exemplary of which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer device to perform the above-described method for detecting cracks in automotive parts by running the computer program.
[0082] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0083] The memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory is used to store computer programs, and the processor can execute the computer programs accordingly after receiving execution instructions.
[0084] This application also provides a computer storage medium for storing the computer program used in the aforementioned computer device. The computer storage medium can be a readable storage medium, a non-volatile storage medium, or a volatile storage medium. For example, the computer storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0085] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0086] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0087] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device to execute all or part of the steps of the methods described in the various embodiments of this application.
[0088] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for detecting cracks in automotive parts, characterized in that, The method includes: acquiring component images of the vehicle component taken at various preset shooting angles, and performing image fusion processing on the component images to obtain a target image of the vehicle component; inputting the target image into a preset crack recognition model to determine a crack segmentation mask image; analyzing each crack in the crack segmentation mask image to determine the crack parameters of each crack, and identifying cracks whose crack parameters meet preset conditions as valid cracks.
2. The method for detecting cracks in automotive parts according to claim 1, characterized in that, The step of performing image fusion processing on the component image to obtain the target image of the automobile component includes: performing geometric correction, radiometric correction, and image fusion processing on the component image to obtain a fused image of the automobile component; and performing illumination compensation and noise suppression on the fused image to obtain the target image of the automobile component.
3. The method for detecting cracks in automotive parts according to claim 1, characterized in that, The step of inputting the target image into a preset crack recognition model to determine a crack segmentation mask image includes: inputting the target image into a preset crack recognition model, the crack recognition model including an encoder path, a decoder path, and a skip connection structure, wherein a dilated convolutional layer is introduced in the encoder path, and a convolutional block attention module is introduced after each skip connection in the decoder path; and performing pixel-level crack segmentation processing on the target image based on the encoder path, the decoder path, and the skip connection structure using the crack recognition model to determine the crack segmentation mask image.
4. The method for detecting cracks in automotive parts according to claim 3, characterized in that, The step of performing pixel-level crack segmentation processing on the target image using the crack recognition model based on the encoder path, the decoder path, and the skip connection structure to determine the crack segmentation mask image includes: performing multi-level downsampling processing on the target image using the crack recognition model based on the downsampling layer in the encoder path to obtain a low-level visual feature map, a mid-level structural feature map, a long-range crack feature map, and a macro-level structural feature map; processing the macro-level structural feature map using the crack recognition model based on the bottleneck layer in the encoder path to obtain a global feature map; performing multi-level upsampling processing on the global feature map using the crack recognition model based on the upsampling layer in the decoder path, and introducing the low-level visual feature map, the mid-level structural feature map, or the long-range crack feature map through the skip connection structure in each upsampling layer for convolutional block attention processing to obtain a crack segmentation result; and outputting a crack segmentation mask image based on the crack segmentation result using the output layer in the decoder path of the crack recognition model.
5. The method for detecting cracks in automotive parts according to claim 4, characterized in that, After the step of outputting a crack segmentation mask image based on the crack segmentation result through the output layer in the decoder path of the crack recognition model, the method further includes: segmenting the target image into a preset number of target sub-images, and inputting each target sub-image into the crack recognition model to obtain a crack segmentation mask sub-image corresponding to each target sub-image; verifying the crack segmentation mask image based on the crack segmentation mask sub-image; if the verification fails, executing a preset abnormal response mechanism to re-determine the crack segmentation mask image; if the verification passes, performing the step of analyzing each crack in the crack segmentation mask image, determining the crack parameters of each crack, and determining the cracks whose crack parameters meet preset conditions as valid cracks.
6. The method for detecting cracks in automotive parts according to claim 1, characterized in that, The step of analyzing each crack in the crack segmentation mask image, determining the crack parameters of each crack, and identifying cracks whose crack parameters meet preset conditions as valid cracks includes: performing morphological processing on the crack segmentation mask image to obtain a target crack segmentation mask image; extracting the crack connected component corresponding to each crack in the target crack segmentation mask image, and calculating the crack parameters of each crack and the basic attribute parameters of the corresponding crack connected component; and identifying cracks whose crack parameters and basic attribute parameters meet preset conditions as valid cracks.
7. The method for detecting cracks in automotive parts according to claim 6, characterized in that, The crack parameters include crack length, crack width, and crack complexity. The basic attribute parameters include: the step of determining cracks whose crack parameters and basic attribute parameters meet preset conditions as valid cracks includes: for each crack, if the crack length, crack width, crack complexity, and basic attribute parameters all meet the preset conditions, then the crack is determined as a valid crack; if any one of the crack length, crack width, crack complexity, and basic attribute parameters does not meet the preset conditions, then the crack is determined as interference information and discarded.
8. A crack detection device for automotive parts, characterized in that, The automotive component crack detection device includes: a processing module for acquiring component images of the automotive component taken at various preset shooting angles, and performing image fusion processing on the component images to obtain a target image of the automotive component; a first determining module for inputting the target image into a preset crack recognition model to determine a crack segmentation mask image; and a second determining module for analyzing each crack in the crack segmentation mask image, determining the crack parameters of each crack, and determining cracks whose crack parameters meet preset conditions as valid cracks.
9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method for detecting cracks in automotive parts according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a processor, executes the method for detecting cracks in automotive components according to any one of claims 1-7.
Citation Information
Cited By
Complex background crack image candidate optimization, continuous repair and quantification method and system
CN122244057A