New energy automobile part defect detection method and system based on deep learning

By employing deep learning-based image acquisition, filtering and denoising, edge detection, and neural network deep learning, the problem of rapid and accurate identification of defects in new energy vehicle parts under complex environments has been solved, achieving efficient and accurate defect detection and improving production quality and automation levels.

CN121504919BActive Publication Date: 2026-04-14CHANGSHA ZHONGSHENG AUTO PARTS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-12
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Traditional testing methods struggle to quickly and accurately extract defect features from new energy vehicle components in complex environments. In particular, the diverse types of defects and dynamic changes lead to unstable test results, making it difficult to meet the demands of high-speed production lines.

Method used

A deep learning-based approach is adopted to acquire image data through a camera, perform filtering and noise reduction processing, extract edge features, use neural networks for deep feature learning, and combine multi-layer image information fusion to achieve accurate classification and quantitative description of defect types. Real-time comparison is then performed in a high-frequency production environment to dynamically update the detection process.

Benefits of technology

It has achieved high-precision and high-efficiency detection of defects in new energy vehicle parts in complex environments, improving production quality and automation level, and reducing the rate of missed and false detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504919B_ABST
    Figure CN121504919B_ABST
Patent Text Reader

Abstract

The application discloses a new energy automobile part defect detection method and system based on deep learning, image collection of the surface of a new energy automobile part is performed through a camera to form an initial image set; a filtering method is used for denoising processing according to the initial image set, the influence of noise is effectively inhibited for the complex shape of the part and the interference of various materials, and a denoised image is determined; edge features are extracted from the denoised image, an edge detection algorithm is used to identify contour changes, potential abnormal boundaries are identified for defect diversity, and an edge feature map is obtained; if the intensity of the abnormal boundary in the edge feature map exceeds a preset threshold value, then deep feature learning is performed on the abnormal boundary area through a neural network model, multi-layer image extraction information is fused, and the defect type is judged; the defect area and position coordinates are calculated by using the defect type result, multi-scale feature information is integrated for the requirement of accurate classification, quantitative description of the defect is obtained, and the production quality and automation level are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of new energy vehicle technology, and in particular discloses a method and system for detecting defects in new energy vehicle components based on deep learning. Background Technology

[0002] With the rapid growth of the new energy vehicle market, the requirements for component quality are becoming increasingly stringent, especially the detection of surface defects, which has become a key link in ensuring production quality. Defect detection not only affects the function of components but may also lead to safety hazards in vehicle assembly. Therefore, there is an urgent need for efficient and accurate testing technologies to improve production efficiency and product reliability.

[0003] However, traditional inspection methods struggle to meet the demands of complex production scenarios, revealing significant limitations and necessitating technological breakthroughs. Existing inspection methods largely rely on manual visual inspection or simple machine vision technology. These methods often fall short when faced with the diverse defect types in new energy vehicle components. Manual inspection is limited by operator experience and fatigue, easily leading to missed or false detections, especially when dealing with components with minute scratches or complex geometries, where accuracy is difficult to guarantee. While traditional machine vision technology can automate some scenarios, its ability to extract defect features is limited, particularly its poor adaptability to different lighting conditions or complex backgrounds. These methods struggle to cope with the diversity and dynamic changes in component surface defects, resulting in unstable inspection results.

[0004] At the technical level, the core challenge of defect detection lies in achieving rapid and accurate defect localization and classification in complex environments. New energy vehicle components have complex shapes and diverse materials; for example, the metallic luster of battery casings or the texture of composite materials can interfere with image acquisition, making it difficult to clearly extract defect features. The image processing requirements in such complex environments directly impact the stability and accuracy of the detection system. Furthermore, the diversity of defects requires the system not only to identify common defects such as scratches and cracks, but also to distinguish subtle differences in defects, such as variations in crack width or depth. This need to classify subtle differences increases the computational burden on the system during real-time processing, especially on high-paced production lines, where balancing rapid inference with accurate classification becomes a technical bottleneck.

[0005] Therefore, how to quickly extract clear defect features in complex environments and accurately classify various defects has become a key problem that detection systems urgently need to solve. Summary of the Invention

[0006] This invention provides a method and system for detecting defects in new energy vehicle components based on deep learning, aiming to solve at least one defect existing in the prior art.

[0007] One aspect of this invention relates to a method for detecting defects in new energy vehicle components based on deep learning, comprising the following steps:

[0008] S100: The camera acquires images of the surface of new energy vehicle parts, obtaining raw image data containing potential defect areas and background interference to form an initial image set;

[0009] S200. Based on the initial image set, a filtering method is used to perform denoising processing, effectively suppressing the noise effect on the complex shape of the parts and the interference of multiple materials, and determining the denoised image;

[0010] S300: Extract edge features from the denoised image, use an edge detection algorithm to identify contour changes, identify potential abnormal boundaries for defect diversity, and obtain an edge feature map;

[0011] S400. If the intensity of the abnormal boundary in the edge feature map exceeds the preset threshold, the abnormal boundary region is subjected to deep feature learning through a neural network model, and information is extracted from multiple layers of images to determine the defect type.

[0012] S500: Calculate the defect area and location coordinates using the defect type results, and integrate multi-scale feature information to obtain a quantitative description of the defect for accurate classification.

[0013] S600: Based on the quantitative description of defects, a real-time comparison is performed in a high-cycle production environment. If the quantitative description meets the preset classification standard, it is marked as a qualified part; otherwise, an alarm is triggered to determine the final inspection output.

[0014] S700 updates the production database through the final detection output, and adjusts the next image acquisition parameters to balance detection speed and accuracy, thereby obtaining an optimized detection process.

[0015] Furthermore, in step S100, the composition model of the raw image data acquired by the camera is described by the following formula:

[0016] ;

[0017] in, Indicates position The original image pixel values ​​at that location, Indicates the number of image channels. Indicates the first The weighting coefficients of each channel, Indicates the first Each channel is located in Pixel intensity at that location Represents the noise weighting coefficient. Indicates position Background noise components at the location;

[0018] The degree of difference between potentially defective areas and normal surfaces is quantified using the following formula:

[0019] ;

[0020] in, Indicated by position The area defect detection value is centered on the center. and These represent the width and height of the detection window, respectively. Indicates the position within the window Image pixel values, This represents the average standard pixel value on the surface of a normal component.

[0021] Further, in step S200, the pixel values ​​of the denoised image are obtained using the following formula:

[0022] ;

[0023] in, This represents the pixel values ​​of the denoised image. Represents the pixel values ​​of the original image. Represents the normalized weighting coefficients. Indicates the radius of the filtering window. Represents the spatial Gaussian weighting function. This represents the gray-level similarity weighting function. Represents the spatial standard deviation parameter. This represents the standard deviation parameter for grayscale.

[0024] Set a noise suppression intensity function to effectively suppress the impact of noise on components with complex shapes and multiple materials:

[0025] ;

[0026] in, This represents the noise suppression intensity function. Indicates the material characteristic response value, This represents a measure of shape complexity. This represents the estimated local noise level. This represents the material interference weighting coefficient. This represents the shape complexity weighting coefficient. Indicates the noise level weighting coefficient;

[0027] Set an adaptive frequency domain filter response function to denoise the initial image set:

[0028] ;

[0029] in, This represents the response function of the adaptive frequency domain filter. Represents the frequency domain transfer function. and Represents frequency domain coordinate variables, This represents the adaptive frequency domain standard deviation parameter. This represents the mask function for the component region. This represents an exponential function.

[0030] Further, step S300 includes:

[0031] S310. Extract edge features from the denoised image using the Canny edge detection algorithm. For complex shapes of parts and interference from multiple materials, obtain an initial edge feature map containing contour information.

[0032] S320. Based on the initial edge feature map, the Sobel operator is used to detect contour changes. Considering the diversity of defects, the gradient changes in the edge region are judged to obtain the contour change distribution map.

[0033] S330. If gradient anomalies exist in the contour change distribution map, the region segmentation method is used to divide the abnormal region and determine the abnormal boundary region for the potential defect boundary.

[0034] S340. Morphological processing is performed on the abnormal boundary region, and dilation and erosion operations are used to optimize the boundary contour. Based on the integrity of the contour, the final edge feature map is generated.

[0035] Further, step S400 includes:

[0036] S410. If the intensity of the abnormal boundary in the edge feature map exceeds the preset threshold, a convolutional neural network is used to extract the deep features of the abnormal boundary region. For multi-layer image structures, a deep feature map containing texture and shape information is obtained.

[0037] Set the criteria for determining the intensity of abnormal boundaries in the edge feature map:

[0038] ;

[0039] in, Indicates position Boundary strength value at that location, Indicates the image in gradient of direction, Indicates the image in Gradient of direction, This represents the preset anomaly boundary detection threshold, when the location... Boundary strength value at Exceeding the preset anomaly boundary detection threshold Time-triggered deep feature extraction;

[0040] The depth feature map, which contains texture and shape information, is derived using the following formula:

[0041] ;

[0042] in, This represents the fused, integrated depth feature map. This represents the extracted texture feature map. This represents the extracted shape feature map. Represents multi-layer image structure feature maps. , , These represent the fusion weight coefficients for texture, shape, and structural features, respectively.

[0043] S420. Based on the depth feature map, a feature fusion method is used to integrate the multi-layer image information, and the fused comprehensive feature representation is obtained by considering feature consistency.

[0044] S430. If there is a significant feature distribution in the comprehensive feature representation, then a classification algorithm is used to analyze the significant feature distribution and determine the potential defect type based on the diversity of defects.

[0045] S440. Based on the potential defect types, clustering methods are used to group the defect regions, and the final defect classification map is determined based on the defect distribution characteristics.

[0046] Furthermore, in step S420, the fused integrated feature representation is obtained through the following formula:

[0047] ;

[0048] in, This represents the integrated feature representation after fusion. This indicates the number of layers in the depth feature map. Indicates the first The fusion weights of layer features Indicates the first Depth feature map of the layer The weight parameters represent the feature consistency constraints. The L2 distance between features of adjacent layers is used to ensure feature consistency.

[0049] Further, step S500 includes:

[0050] S510. Obtain multi-scale image data from the original image, use the image pyramid method to decompose the original image into multiple resolutions, extract edge features for different scales, and obtain multi-scale edge feature maps.

[0051] S520. If a significant edge region is detected in the multi-scale edge feature map, a convolution operation is used to extract features from the significant edge region, and a depth feature representation is obtained based on the texture and shape characteristics.

[0052] S530. Based on the deep feature representation, a weighted fusion method is used to integrate multi-scale features, and a comprehensive feature distribution is obtained by considering feature consistency.

[0053] S540. If there are significant feature clusters in the comprehensive feature distribution, the K-means clustering method is used to group the significant feature clusters, and a quantitative description of the defect area and location coordinates is determined based on the characteristics of the defect area.

[0054] Further, step S600 includes:

[0055] S610. Obtain the quantitative description data of component defects transmitted from the production line, and send the quantitative description data of component defects to the real-time comparison module using the data flow method. For high-cycle production environments, obtain a structured defect data stream.

[0056] S620. If the structured defect data stream is consistent with the preset classification standard, the feature comparison method is used to match the area and location coordinates in the defect data stream. Based on the matching consistency, the classification result of the new energy vehicle parts is determined.

[0057] S630. If the classification result of new energy vehicle parts is qualified, the qualified identification mark shall be added to the new energy vehicle parts by the marking allocation method, and the test data with qualified identification mark shall be obtained according to the data recording requirements of the production environment.

[0058] S640. If the classification result of new energy vehicle parts is unqualified, an alarm is triggered by a signal generation method. In accordance with the result recording requirements, the alarm information is associated with the test data to obtain the final test output.

[0059] Further, step S700 includes:

[0060] S710. Obtain a structured inspection data stream from the inspection output, use data parsing methods to extract the identifiers of qualified parts and the alarm information of unqualified parts, and obtain formatted inspection data according to the format requirements of the production database.

[0061] S720. If the formatted test data meets the update standard of the production database, the test data stream is transmitted to the production database using the database writing method, and the updated database record is obtained in accordance with the data integrity requirements.

[0062] S730. Based on the updated database records, use statistical analysis methods to calculate the deviation between detection speed and accuracy, and determine the adjusted acquisition frequency and image quality parameters according to the parameter optimization requirements for image acquisition.

[0063] S740: By adjusting the acquisition frequency and image quality parameters, the settings of the image acquisition device are updated using a parameter configuration method to obtain a reconfigured acquisition process in accordance with the requirements of optimizing the detection process.

[0064] Another aspect of the present invention relates to a deep learning-based defect detection system for new energy vehicle components, used to perform the aforementioned deep learning-based defect detection method for new energy vehicle components, comprising:

[0065] The initial image set formation module is used to acquire images of the surface of new energy vehicle parts through a camera, obtain raw image data containing potential defect areas and background interference, and form an initial image set;

[0066] The denoised image determination module is used to perform denoising processing on the initial image set using filtering methods. It effectively suppresses the noise effect on the complex shape of the parts and the interference of multiple materials, and determines the denoised image.

[0067] The edge feature map acquisition module is used to extract edge features from the denoised image, use the edge detection algorithm to identify contour changes, identify potential abnormal boundaries for defect diversity, and obtain the edge feature map.

[0068] The defect type determination module is used to determine the defect type by performing deep feature learning on the abnormal boundary region through a neural network model and fusing information extracted from multiple layers of images if the intensity of the abnormal boundary in the edge feature map exceeds a preset threshold.

[0069] The defect quantification description acquisition module is used to calculate the defect area and location coordinates based on the defect type results, and integrates multi-scale feature information to obtain the defect quantification description for the need for accurate classification.

[0070] The final inspection output determination module is used to perform real-time comparison based on the quantitative description of defects in a high-cycle production environment. If the quantitative description meets the preset classification criteria, it is marked as a qualified part; otherwise, an alarm is triggered to determine the final inspection output.

[0071] The detection process acquisition module is used to update the production database based on the final detection output, adjust the next image acquisition parameters to balance detection speed and accuracy, and obtain an optimized detection process.

[0072] The beneficial effects achieved by this invention are as follows:

[0073] This invention provides a deep learning-based method and system for defect detection of new energy vehicle components, solving the business challenge of accurate defect identification and real-time processing under complex shapes and multi-material interference in high-paced production environments. The invention addresses noise interference in the original image by effectively suppressing background noise through filtering and denoising techniques, generating a clear, denoised image. Subsequently, an edge detection algorithm is used to extract contour features and accurately identify potential abnormal boundaries. For areas where the intensity of abnormal boundaries exceeds a threshold, multi-scale features are fused using neural network deep learning to accurately determine the defect type and quantify its area and location. Finally, by comparing with preset standards in real time, qualified components are marked or alarms are triggered, and the database is dynamically updated to optimize detection parameters. This invention achieves high-precision and high-efficiency defect detection through the high integration of denoising, edge detection, deep learning, and real-time comparison, significantly improving production quality and automation levels. Attached Figure Description

[0074] Figure 1 This is a flowchart illustrating an embodiment of the deep learning-based defect detection method for new energy vehicle components according to the present invention.

[0075] Figure 2 This is a functional block diagram of an embodiment of the deep learning-based new energy vehicle component defect detection system of the present invention.

[0076] Explanation of icon numbers:

[0077] 10. Initial image set formation module; 20. Denoising image determination module; 30. Edge feature map acquisition module; 40. Defect type judgment module; 50. Defect quantification description acquisition module; 60. Final detection output determination module; 70. Detection process acquisition module. Detailed Implementation

[0078] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0079] like Figure 1 As shown, the first embodiment of the present invention proposes a method for defect detection of new energy vehicle components based on deep learning, including the following steps:

[0080] Step S100: Use a camera to capture images of the surface of new energy vehicle parts, obtain raw image data containing potential defect areas and background interference, and form an initial image set.

[0081] The initial image set refers to the collection of raw image data obtained after acquiring omnidirectional images of the surface of new energy vehicle components (such as battery casings, motor stators, and high-voltage wiring harness insulation layers) using industrial cameras (such as high-resolution CCD (Charge Coupled Device) / CMOS (Complementary Metal-Oxide-Semiconductor) cameras). This data includes potential defect areas (such as scratches, dents, cracks, stains, and coating peeling) and background interference (such as uneven lighting, texture noise, and shadows caused by shooting angle deviations). The initial image set serves as the fundamental data source for component surface defect detection, completely recording the raw visual information of the component surface and providing unprocessed image samples for subsequent defect identification and analysis.

[0082] Step S200: Denoising is performed using a filtering method based on the initial image set. This effectively suppresses noise interference from complex shapes and multiple materials of the parts, and determines the denoised image.

[0083] Denoising images refer to optimized images that have been processed using targeted filtering methods (such as adaptive filtering, morphological filtering, and wavelet filtering) on ​​an initial image set (containing potential defects and background interference). This effectively suppresses noise interference (such as uneven lighting, texture noise, and sensor noise) caused by the complex shapes of parts (e.g., curved surface reflections, corner shadows) and various materials (e.g., metallic highlights, plastic textures, and ceramic rough surfaces), while preserving key features of defect areas (e.g., scratch edges, crack details). Denoising images improve image quality through noise suppression, providing clearer and easier-to-analyze visual data for subsequent defect detection and identification.

[0084] Step S300: Extract edge features from the denoised image, use an edge detection algorithm to identify contour changes, identify potential abnormal boundaries for defect diversity, and obtain an edge feature map.

[0085] Edge feature maps are feature images extracted from denoised images using edge detection algorithms (such as the Canny operator, Sobel operator, and Laplacian operator) to identify regions of abrupt changes in grayscale values ​​on the surface of components (e.g., the boundary between defects and background, and the contour lines of normal structures). They focus on identifying abnormal contour changes caused by defects (such as scratches, cracks, and dents) and present this edge information as a binarized or gradient map. Edge feature maps strip away redundant image information, retaining only contour features reflecting surface morphological changes, highlighting the boundary information of potential defects, and providing structured edge feature data for subsequent defect localization and classification.

[0086] Step S400: If the intensity of the abnormal boundary in the edge feature map exceeds a preset threshold, then the abnormal boundary region is subjected to deep feature learning through a neural network model, and information extracted from multiple layers of images is fused to determine the defect type.

[0087] Defect type identification refers to the intelligent recognition process where, when the intensity (such as gradient magnitude and continuous length) of an abnormal boundary in the edge feature map exceeds a preset threshold, a deep learning neural network model (such as CNN (Convolutional Neural Network), FPN (Feature Pyramid Network), or a dedicated defect detection network) is used to accurately locate and learn deep features of the region containing the abnormal boundary. This process integrates low-level edge details (such as boundary curvature and length) with high-level semantic features (such as defect morphology and distribution patterns), ultimately outputting a specific defect category (such as scratches, cracks, dents, coating peeling, etc.) and a confidence score. By leveraging multi-layer feature extraction and fusion in neural networks, defect type identification overcomes the limitations of traditional feature engineering, enabling accurate classification of diverse surface defects in new energy vehicle components.

[0088] Step S500: Calculate the defect area and location coordinates using the defect type results, and integrate multi-scale feature information to obtain a quantitative description of the defect for accurate classification.

[0089] Defect quantification refers to the process of calculating the geometric parameters (area, size) and spatial coordinates of defects based on defect type judgment results (such as scratches, cracks, dents, etc.) using image measurement algorithms, while integrating multi-scale feature information (low-level edge details, high-level morphological features), forming a structured set of quantitative indicators for the physical properties, spatial distribution, and type characteristics of defects. Defect quantification transforms qualitative defect types into measurable numerical features, accurately depicting the "size, location, shape, and severity" of defects, providing standardized data support for the objective assessment, grading, and traceability of surface quality of new energy vehicle components.

[0090] Step S600: Perform real-time comparison in a high-cycle production environment based on the quantitative description of defects. If the quantitative description meets the preset classification standard, it is marked as a qualified part; otherwise, an alarm is triggered to determine the final inspection output.

[0091] The final inspection output refers to a structured inspection result generated in a high-paced production environment. Based on a quantitative description of defects (including defect type, area, location coordinates, morphological characteristics, etc.), it is compared in real-time with preset component quality classification standards (such as acceptance thresholds and defect tolerance ranges). This result includes the component quality judgment (qualified / unqualified), defect details, and abnormal alarm signals. Through automated comparison and decision-making, the final inspection output enables rapid verification and anomaly response for the surface quality of new energy vehicle components, providing immediate and clear output basis for quality control on the production line.

[0092] Step S700: Update the production database through the final detection output, adjust the next image acquisition parameters to balance detection speed and accuracy, and obtain the optimized detection process.

[0093] The optimized inspection process refers to a closed-loop quality inspection process of "inspection-feedback-optimization-re-inspection," which takes the final inspection output as the core feedback, accumulates historical inspection data (including defect distribution, judgment results, image acquisition parameters, etc.) by updating the production database, and performs dynamic balance analysis on inspection speed and accuracy in combination with the needs of high-speed production. It then adjusts the next image acquisition parameters (such as light intensity, resolution, frame rate) and algorithm thresholds accordingly. This optimized inspection process, driven by data, continuously improves the efficiency (adapting to high-speed production) and accuracy (reducing false positives / false negatives) of surface defect inspection for new energy vehicle components, achieving adaptive upgrades to production line quality inspection.

[0094] Furthermore, in the deep learning-based defect detection method for new energy vehicle components provided in this embodiment, step S100 describes the composition model of the original image data acquired by the camera using the following formula:

[0095] (1)

[0096] In formula (1), Indicates position The original image pixel values ​​at that location, Indicates the number of image channels. Indicates the first The weighting coefficients of each channel, Indicates the first Each channel is located in Pixel intensity at that location Represents the noise weighting coefficient. Indicates position The background noise component at the location. The control logic of formula (1) is the original image pixel composition of multi-channel pixel intensity weighting + background noise superposition. The core is to combine the effective pixel information of each channel of the image with the background noise to synthesize the original image pixel value at the corresponding position.

[0097] The degree of difference between potentially defective areas and normal surfaces is quantified using the following formula:

[0098] (2)

[0099] In formula (2), Indicated by position The area defect detection value is centered on the center. and These represent the width and height of the detection window, respectively. Indicates the position within the window Image pixel values, The standard pixel mean of a normal component surface is represented. The control logic of formula (2) is to quantify the defect difference by averaging the difference between the pixels in the detection window and the normal mean. The core is to define the detection window around the target position and measure the degree of difference between the area and the normal surface by calculating the average difference between the pixels in the window and the normal surface mean.

[0100] Surface defect inspection of new energy vehicle components is a crucial step in ensuring product quality. Images are acquired using cameras to form an initial image set, providing the foundational data for subsequent defect identification. Image acquisition typically employs high-resolution industrial cameras to capture subtle features of the component surfaces. For the surface inspection of new energy vehicle battery casings, a 20-megapixel CCD camera is used, paired with a high-brightness ring-shaped LED (Light Emitting Diode) light source to ensure uniform illumination and avoid glare interference. The camera is positioned at a fixed location 30 centimeters away from the workpiece, acquiring images at a frequency of 10 frames per second to generate an image set containing complete surface information. This high-resolution acquisition can capture defects such as minute scratches and dents, ensuring the accuracy of subsequent analysis.

[0101] Identifying potential defect areas requires attention to scratches, cracks, or foreign matter attachments that may appear on the surface of components. For example, aluminum alloy battery trays may have tiny scratches caused by mechanical impacts during the manufacturing process, typically ranging in size from 0.1 mm to 1 mm.

[0102] The images captured by the camera undergo preprocessing algorithms to enhance contrast, making defective areas appear as high-contrast regions in the grayscale image. For example, scratches typically appear as linear bright areas, while cracks appear as irregular dark textures. This method highlights defect features, facilitating subsequent algorithmic analysis and improving detection efficiency.

[0103] Surfaces of new energy vehicle components may be contaminated with oil, dust, or ambient light. For example, trace amounts of oil may adhere to the surface of the motor housing due to the production environment, causing irregular light spots in the image. Preferably, by using multispectral light source switching technology, combining infrared and visible light image acquisition, oil contaminants exhibit low reflectivity under infrared light, thus distinguishing them from metal surfaces. Furthermore, using polarizing filters effectively reduces ambient light reflection interference, ensuring the clarity of defective areas in the image.

[0104] The initial image set must ensure data integrity and diversity. For the same component, images are acquired from different angles, such as top-down, 45-degree angle, and side view, forming a multi-view image set. For example, for a power battery cover, top-down images can capture surface scratches, while side-view images are more likely to detect edge cracks. After acquisition, the image set is categorized and stored using timestamps and location information, facilitating subsequent defect tracing and analysis. This multi-view acquisition method significantly improves the comprehensiveness of defect detection.

[0105] Preferably, in the deep learning-based defect detection method for new energy vehicle components provided in this embodiment, the pixel values ​​of the denoised image in step S200 are obtained by the following formula: (3)

[0106] In formula (3), This represents the pixel values ​​of the denoised image. Represents the pixel values ​​of the original image. Represents the normalized weighting coefficients. Indicates the radius of the filtering window. Represents the spatial Gaussian weighting function. This represents the gray-level similarity weighting function. Represents the spatial standard deviation parameter. The grayscale standard deviation parameter is represented. The control logic of formula (3) is to combine spatial and grayscale dual weights for filter window weighted denoising. The core is to use the dual weights of spatial distance and grayscale similarity to perform weighted averaging on the pixels in the filter window to achieve image denoising.

[0107] Set a noise suppression intensity function to effectively suppress the impact of noise on components with complex shapes and multiple materials:

[0108] (4)

[0109] In formula (4), This represents the noise suppression intensity function. Indicates the material characteristic response value, This represents a measure of shape complexity. This represents the estimated local noise level. This represents the material interference weighting coefficient. This represents the shape complexity weighting coefficient. The noise level weighting coefficient is represented. The control logic of formula (4) is to calculate the noise suppression intensity by weighted fusion of multiple factors such as material, shape and noise. The core is to combine the material characteristics, shape complexity and local noise level of the parts and generate the noise suppression intensity at the corresponding position through weighted fusion.

[0110] Set an adaptive frequency domain filter response function to denoise the initial image set:

[0111] (5)

[0112] In formula (5), This represents the response function of the adaptive frequency domain filter. Represents the frequency domain transfer function. and Represents frequency domain coordinate variables, This represents the adaptive frequency domain standard deviation parameter. This represents the mask function for the component region. The exponential function is represented. The control logic of formula (5) is the construction of frequency domain filtering response by frequency domain transfer + adaptive Gaussian attenuation + region mask. The core is to combine frequency domain transfer characteristics, adaptive frequency domain attenuation rules and region mask to generate frequency domain filter response that is adapted to the component region.

[0113] For the initial image set used in the surface defect detection of new energy vehicle components, a bilateral filtering method is employed for noise reduction. This method effectively preserves the edge features of defect areas in the image while eliminating interference noise caused by complex shapes and various materials. The core principle of bilateral filtering is to perform a weighted average by combining spatial distance and pixel value differences. This considers both the geometric proximity between pixels and the similarity of gray values, thereby smoothing noise while preserving critical details.

[0114] For new energy vehicle components such as battery casings or motor rotors, these parts often have curved surfaces or areas where different materials are spliced ​​together. Dust or light noise may be introduced into the surface due to the production environment, resulting in random interference points in the image. Bilateral filtering can effectively suppress this noise, generating clear, denoised images and providing a high-quality data foundation for subsequent defect identification.

[0115] For image denoising of aluminum alloy battery trays, an initial image set was selected from a 20-megapixel industrial camera with a resolution of 5472×3648 pixels. The images may contain small noise points caused by environmental dust, with diameters ranging from approximately 0.05 mm to 0.2 mm. In the bilateral filtering parameter settings, the spatial domain standard deviation was set to 5 pixels, and the gray-level domain standard deviation was set to 50 to balance noise smoothing and edge preservation. After processing, dust noise was effectively suppressed, while the edges of defect areas such as scratches or cracks remained sharp. This method is particularly suitable for aluminum alloy surfaces, as their high reflectivity easily generates light spot interference. Bilateral filtering can reduce the impact of such interference through gray-level weighting, thereby improving the visibility of defect areas.

[0116] For the complex curved shape of the motor housing, trace amounts of oil residue from the coating process may remain on the surface, causing irregular noise areas in the image. Bilateral filtering, by analyzing pixel grayscale differences, can smooth the low-frequency noise in the oily areas while preserving high-frequency defect features such as cracks. The camera captures images of the motor housing at a 45-degree angle, and bilateral filtering is applied with a spatial domain standard deviation of 3 pixels and a grayscale domain standard deviation of 30. After processing, the background noise caused by oil stains is significantly reduced, and crack features are displayed with high contrast in the image. This method is particularly suitable for the noise reduction needs of complex curved surface parts because the reflected light from curved surfaces varies greatly; bilateral filtering can adaptively adjust the weights to ensure that defect details are not blurred.

[0117] Furthermore, in the deep learning-based defect detection method for new energy vehicle components provided in this embodiment, step S300 includes:

[0118] Step S310: Extract edge features from the denoised image using the Canny edge detection algorithm. For complex shapes of parts and interference from multiple materials, obtain an initial edge feature map containing contour information.

[0119] The following formula is used to achieve edge classification processing for complex-shaped parts of new energy vehicles:

[0120] (6)

[0121] In formula (6), This represents the pixel values ​​of the edge feature map after double thresholding. This indicates that a high threshold is used to identify strong edges. This indicates that a low threshold is used to identify weak edges. This represents the gradient magnitude.

[0122] The optimized contour feature values, after handling interference from multiple materials, are obtained using the following formula:

[0123] (7)

[0124] In formula (7), This represents the optimized contour feature value after handling interference from various materials. This represents the material adaptive weight kernel function. Represents the edge feature values ​​within the neighborhood. Indicates the material type mask. This indicates the size of the convolution kernel radius.

[0125] For edge feature extraction and processing in the surface defect detection of new energy vehicle parts, techniques such as the Canny edge detection algorithm, Sobel operator, region segmentation, and morphological processing have important applications in complex shapes and multi-material interference scenarios.

[0126] The Canny edge detection algorithm effectively extracts edge features from denoised images by calculating image gradients and applying dual thresholding. For a 5472×3648 pixel image of an aluminum alloy battery tray, which may contain defects such as scratches or pits, the Canny edge detection algorithm first performs Gaussian smoothing on the denoised image to reduce the influence of residual noise, and then calculates the gradient intensity and direction. Preferably, a low threshold of 50 and a high threshold of 150 are set to retain significant defect edges, such as scratches with a width of 0.1 mm, while filtering out false edges caused by material reflection. This method can clearly delineate the defect contours, providing a high-quality initial edge feature map for subsequent analysis.

[0127] Step S320: Based on the initial edge feature map, the Sobel operator is used to detect contour changes. Considering the diversity of defects, the gradient changes in the edge region are judged to obtain the contour change distribution map.

[0128] The final contour variation distribution map is generated using the following formula:

[0129] (8)

[0130] In formula (8), Indicates the location in the contour variation distribution map The binarization result, Indicates the location in the contour variation distribution map gradient magnitude, This represents the preset threshold parameter, which is used when the position in the contour change distribution map changes. gradient magnitude Exceeding the preset threshold parameter The time marker is used to indicate the region of contour change.

[0131] Based on an initial edge feature map, the Sobel operator is used to detect contour changes and analyze gradient distribution to identify defect diversity. The Sobel operator calculates gradients using convolution kernels in both horizontal and vertical directions, detecting intensity changes at the edges of potential cracks or pits on the aluminum alloy tray surface. For example, for a 0.2 mm wide crack, the Sobel operator can generate a gradient distribution map, highlighting high gradient values ​​in the crack area. The high reflectivity of the aluminum alloy surface can lead to uneven gradient distribution; the Sobel operator, through local gradient analysis, can effectively distinguish between gradient anomalies caused by defects and normal changes caused by material reflection, thus generating an accurate contour change distribution map.

[0132] Step S330: If there is a gradient anomaly in the contour change distribution map, the region segmentation method is used to divide the abnormal region and determine the abnormal boundary region for the potential defect boundary.

[0133] The following formula is used to accurately divide the abnormal region:

[0134] (9)

[0135] In formula (9), Indicates the first The segmented abnormal regions Indicates position eigenvalues ​​at that location and These represent the minimum and maximum thresholds for region segmentation, respectively. Indicates the first The spatial range of each candidate region.

[0136] The range of the abnormal boundary region of potential defects is determined by the following formula:

[0137] (10)

[0138] In formula (10), Indicates a defined anomaly boundary region. Point To the potential defect boundary distance, This represents the width threshold of the boundary region. Indicates a potential defect area.

[0139] If gradient anomalies are detected in the contour variation distribution map, such as a significantly higher gradient value in the crack area compared to the surrounding area, region segmentation methods can be used to delineate anomalous regions. For example, for a crack in a battery tray image, a threshold-based region growing algorithm can be used to classify pixels with gradient values ​​higher than 100 as anomalous regions. This method can accurately locate potential defect boundaries, and is particularly suitable for complex curved surface parts, avoiding interference from material transition areas. The segmented anomalous regions can clearly show the geometry of the crack, providing a clear target for subsequent processing.

[0140] If gradient anomalies are detected in the contour variation distribution map, such as a significantly higher gradient value in the crack area compared to the surrounding area, region segmentation methods can be used to delineate anomalous regions. For example, for a crack in a battery tray image, a threshold-based region growing algorithm can be used to classify pixels with gradient values ​​higher than 100 as anomalous regions. This method can accurately locate potential defect boundaries, and is particularly suitable for complex curved surface parts, avoiding interference from material transition areas. The segmented anomalous regions can clearly show the geometry of the crack, providing a clear target for subsequent processing.

[0141] Step S340: Morphological processing is performed on the abnormal boundary region, and dilation and erosion operations are used to optimize the boundary contour. Based on the integrity of the contour, the final edge feature map is generated.

[0142] The mathematical process of expanding the boundary region through the dilation operation is described by the following formula:

[0143] (11)

[0144] In formula (11), This indicates the abnormal boundary region after the dilation operation. Indicates the original anomaly boundary region. Represents a structural element. Indicates the position of the structural element Translation at the location; Indicates the position of the structural element Translation at point and the original anomaly boundary region The intersection of these points is not empty.

[0145] The mathematical expression for shrinking the boundary profile through erosion is defined by the following formula:

[0146] (12)

[0147] In formula (12), This indicates the boundary region after the etching operation. Indicates the position of the structural element Translation at point Completely contained within the original anomaly boundary region middle.

[0148] The final edge feature map with fused contour integrity is generated using the following formula:

[0149] (13)

[0150] In formula (13), This indicates the final edge feature map in coordinates. The value at that location, This represents the optimized contour integrity coefficient. This represents the image intensity value after morphological processing. and This represents the weighting coefficient.

[0151] For morphological processing of abnormal boundary regions, dilation and erosion operations are used to optimize contour integrity. For example, for pit defects on the surface of an aluminum alloy tray, the initial segmentation may result in discontinuous boundaries due to residual noise. A dilation operation is performed using a 3×3 pixel structuring element to connect discontinuous edge segments, followed by an erosion operation to remove isolated noise points. Preferably, the number of iterations for dilation and erosion is controlled to 1-2 times to avoid excessive smoothing that could lead to loss of defect details. After processing, the boundary contour of the pit is smoother and more complete, facilitating subsequent defect classification and identification. For example, in a real-time inspection scenario on a production line, for edge feature extraction of a battery tray, the Canny algorithm, combined with the Sobel operator and morphological processing, quickly completes single-frame processing. The camera acquires images at a rate of 10 frames per second. The Canny algorithm generates the initial edge map in approximately 50 milliseconds, the Sobel operator analyzes gradient changes in approximately 20 milliseconds, and the region segmentation and morphological processing together take 30 milliseconds, completing the entire process within 100 milliseconds. This efficient processing ensures accurate extraction of defect contours and significantly improves the reliability of automated inspection.

[0152] Furthermore, in the deep learning-based defect detection method for new energy vehicle components provided in this embodiment, step S400 includes:

[0153] Step S410: If the intensity of the abnormal boundary in the edge feature map exceeds a preset threshold, a convolutional neural network is used to extract deep features from the abnormal boundary region. For multi-layer image structures, a deep feature map containing texture and shape information is obtained.

[0154] Set the criteria for determining the intensity of abnormal boundaries in the edge feature map:

[0155] (14)

[0156] In formula (14), Indicates position Boundary strength value at that location, Indicates the image in Gradient of direction, Indicates the image in Gradient of direction, This represents the preset anomaly boundary detection threshold, when the location... Boundary strength value at Exceeding the preset anomaly boundary detection threshold The deep feature extraction is triggered at a certain time. The control logic of formula (14) is to calculate the boundary strength of the image gradient and compare it with the threshold to determine the abnormal boundary. The core is to calculate the boundary strength by the gradient of the image in the x and y directions and then compare it with the preset threshold to determine whether to trigger the deep feature extraction.

[0157] The depth feature map, which contains texture and shape information, is derived using the following formula:

[0158] (15)

[0159] In formula (15), This represents the fused, integrated depth feature map. This represents the extracted texture feature map. This represents the extracted shape feature map. Represents multi-layer image structure feature maps. , , These represent the fusion weight coefficients of texture, shape, and structure features, respectively. The control logic of formula (15) is to generate a comprehensive deep feature map by weighted fusion of multiple feature maps of texture, shape, and structure. The core is to assign corresponding weights to feature maps of different dimensions and then accumulate them to integrate a comprehensive deep feature map containing multi-dimensional information.

[0160] For surface defect detection of aluminum alloy battery trays in new energy vehicles, deep feature extraction and classification based on edge feature maps has important applications. For cases where the intensity of abnormal boundaries in the edge feature map exceeds a preset threshold, convolutional neural networks (CNNs) are used for deep feature extraction. CNNs capture texture and shape information of images through multiple layers of convolution and pooling operations.

[0161] For a 5472×3648 pixel image of an aluminum alloy battery tray, assuming an abnormal boundary intensity threshold of 120, a convolutional neural network processes high-intensity scratches or dents. The network structure employs multi-layer convolutional kernels, such as 3×3 pixel kernels, extracting low-level edge features to high-level texture features layer by layer, forming a depth feature map containing defect details. This method effectively captures the linear texture of scratches or the circular contours of dents, providing rich information for subsequent analysis.

[0162] Step S420: Based on the depth feature map, the feature fusion method is used to integrate the multi-layer image information, and the fused comprehensive feature representation is obtained by considering feature consistency.

[0163] The fused integrated feature representation is obtained through the following formula:

[0164] (16)

[0165] In formula (16), This represents the integrated feature representation after fusion. This indicates the number of layers in the depth feature map. Indicates the first The fusion weights of layer features Indicates the first Depth feature map of the layer The weight parameters represent the feature consistency constraints. The L2 distance between adjacent layer features is used to ensure feature consistency. The control logic of formula (16) is a comprehensive feature fusion of multi-layer deep feature weighting integration and adjacent layer consistency constraint. The core is to generate a comprehensive feature representation that contains multi-layer information and has consistency by constraining the differences between adjacent layer features on the basis of integrating the deep features of each layer.

[0166] Feature fusion methods based on deep feature maps integrate multi-layer image information. These methods employ weighted averaging or attention mechanisms to highlight key defect features. For example, for crack defects in aluminum alloy trays, the fusion process combines low-level edge features with high-level texture features. Assuming low-level features capture the 0.2 mm width of the crack, while high-level features reflect the surface roughness, the fused feature representation generates a comprehensive feature representation, enhancing feature consistency. This approach effectively integrates multi-scale information, improving the representational capability of defect regions.

[0167] Step S430: If there is a significant feature distribution in the comprehensive feature representation, then a classification algorithm is used to analyze the significant feature distribution and determine the potential defect type based on the defect diversity.

[0168] Set the criteria for determining the distribution of salient features in the comprehensive feature representation:

[0169] (17)

[0170] In formula (17), Indicates the first The significance score of each feature, This indicates the number of dimensions in the comprehensive feature representation. Indicates the first The weight coefficients of each feature Indicates the first The numerical values ​​of each feature, The threshold parameter representing the significance judgment, when the first... Significance score of each feature Greater than the threshold parameter for significance judgment The existence of a significant feature distribution is considered to exist. The control logic of formula (17) is the determination of significant feature distribution by calculating the ratio of the feature weighted sum to the feature magnitude and comparing the threshold. The core is to calculate the significance score by the ratio of the feature weight to the weighted contribution of the value and the feature magnitude, and then compare it with the threshold to determine whether there is a significant feature.

[0171] Classification algorithms are used to analyze potential defect types based on the salient feature distribution in the comprehensive feature representation. Algorithms such as random forests or support vector machines can classify the feature distribution and determine defect types such as scratches, cracks, or dents. For aluminum alloy trays, assuming the salient feature distribution shows high gradient value regions concentrated in a 0.3 mm wide crack, the classification algorithm, through training samples, identifies this region as a crack rather than a spurious feature caused by material reflection. This method accurately distinguishes multiple defect types through the differences in feature distribution.

[0172] Step S440: Based on the potential defect type, use clustering methods to group the defect regions, and determine the final defect classification map based on the defect distribution characteristics.

[0173] The optimal defect cluster centers are determined by minimizing the sum of squared intra-class distances, thus achieving efficient defect grouping.

[0174] (18)

[0175] In formula (18), Indicates the first Cluster centers for each defect category This means finding the parameter that minimizes the value of the following expression. Indicates belonging to the first Number of defect samples of the class Indicates the first The feature vector of a defective sample Indicates the first The centroid coordinates of the defect class. The control logic of formula (18) is to determine the defect cluster center by minimizing the sum of squared distances from samples within the class to the centroid. The core is to find the centroid (mean) of the samples in each class so that the sum of squared distances from samples within the class to the centroid is minimized, thereby achieving effective grouping of defects.

[0176] Based on the Bayesian method, the defect distribution characteristics are calculated, and the final defect classification probability map is generated:

[0177] (19)

[0178] In formula (19), Indicates the defect area Types of defects appearing in The conditional probability, Indicates in the region Types observed in The number of defects This indicates the total number of defect types. The smoothing parameter is represented. The control logic of formula (19) is the calculation of the conditional probability of regional defect types under Bayesian smoothing. The core is to calculate the conditional probability of a specific defect type in the target region by smoothing the number of defect types in the region, and then generate a defect classification probability map.

[0179] Clustering methods based on potential defect types group defect regions. K-means clustering or DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithms group defects based on their geometry and distribution characteristics. For example, for multiple pits on the surface of a battery tray, the clustering algorithm divides them into independent defect groups based on the circular outline and 0.5 mm diameter of the pits. Preferably, a distance threshold of 5 pixels is set during the clustering process to ensure that adjacent defects are correctly grouped. This method can clearly delineate the defect distribution, providing a clear basis for subsequent defect localization and analysis.

[0180] Furthermore, in the deep learning-based defect detection method for new energy vehicle components provided in this embodiment, step S500 includes:

[0181] Step S510: Obtain multi-scale image data from the original image, use the image pyramid method to perform multi-resolution decomposition on the original image, extract edge features for different scales, and obtain multi-scale edge feature maps.

[0182] The final multi-scale edge feature map is obtained by weighted fusing edge features of different scales using the following formula:

[0183] (20)

[0184] In formula (20), Representing coordinates The multi-scale edge feature fusion results at the location, This indicates the total number of levels in the pyramid. Indicates the first Layer weight coefficients, Indicates the first Edge feature values ​​of the layer.

[0185] For surface defect detection of aluminum alloy battery trays in new energy vehicles, acquiring multi-scale image data is fundamental to achieving accurate feature extraction. The image pyramid method decomposes the original image into multi-resolution representations at different scales. Assuming the original image resolution is 5472×3648 pixels, Gaussian pyramid downsampling generates three layers of images with resolutions of 1 / 2, 1 / 4, and 1 / 8 of the original. Edge features are extracted from each layer using edge detection algorithms such as the Canny operator, forming a multi-scale edge feature map. These feature maps can capture various defect features, from large cracks to fine scratches. For example, at 1 / 4 resolution, a 0.3 mm wide crack edge is clearly visible, while at 1 / 8 resolution, a wider 1 mm pit contour can be detected. This multi-scale method ensures that features of defects of different sizes are effectively extracted.

[0186] Step S520: If a significant edge region is detected in the multi-scale edge feature map, a convolution operation is used to extract features from the significant edge region, and a depth feature representation is obtained based on the texture and shape characteristics.

[0187] The deep feature representation is derived using the following formula:

[0188] (twenty one)

[0189] In formula (21), This represents the final depth feature representation. The weighting coefficients represent the texture features. This represents the extracted texture feature vector. Weighting coefficients representing shape features This represents the extracted shape feature vector.

[0190] If significant edge regions are detected in the multi-scale edge feature map, depth features are extracted through convolutional operations. The convolutional neural network uses 3×3 convolutional kernels to process these significant edge regions, capturing texture and shape characteristics. For example, for a 0.2 mm wide scratch on an aluminum alloy tray surface, the convolutional operation extracts its linear texture features, while for a 0.5 mm diameter pit, it generates a depth feature representation of a circular outline. The network abstracts layer by layer through multiple convolutions, from low-level edges to high-level texture features, forming a depth feature map containing defect details. This method effectively characterizes the geometric properties of defects, providing rich information for subsequent analysis.

[0191] Step S530: Based on the deep feature representation, a weighted fusion method is used to integrate the multi-scale features, and a comprehensive feature distribution is obtained by considering feature consistency.

[0192] The degree of feature consistency is measured by calculating the squared Euclidean distance between each feature distribution and the mean distribution using the following formula:

[0193] (twenty two)

[0194] In formula (22), Represents the feature consistency loss function. This represents the total number of feature samples. Indicates the first The characteristic distribution of each sample This represents the mean of the feature distribution of all samples.

[0195] A weighted fusion method based on deep feature representation integrates multi-scale features to improve feature consistency. The fusion process assigns weights to features at different scales through a weighted average. For example, low-resolution features highlight the overall outline of a crack, while high-resolution features emphasize the detailed texture of a scratch. Assuming the weights are set to 0.4 for low resolution and 0.6 for high resolution, the fused feature distribution generates a comprehensive feature distribution that fully characterizes the shape and texture properties of the defect. This fusion method balances multi-scale information, ensuring the comprehensiveness and consistency of the feature distribution.

[0196] Step S540: If there are significant feature clusters in the comprehensive feature distribution, the K-means clustering method is used to group the significant feature clusters, and a quantitative description of the defect area and location coordinates is determined based on the characteristics of the defect area.

[0197] The following formula enables precise quantitative calculation of the defect area:

[0198] (twenty three)

[0199] In formula (23), This represents the total area of ​​the defective region. This represents the total number of pixels within the defect area. and Representing pixels in and Physical dimensions of the direction, Indicates the first The defect identification function for each pixel has a value of 1 when the pixel belongs to the defect area and 0 otherwise.

[0200] The center coordinates of the defect area were determined using a weighted average method.

[0201] (twenty four)

[0202] In formula (24), Indicates the location coordinates of the defect area. This indicates the number of pixels within the defective area. and They represent the first The horizontal and vertical coordinates of each pixel Indicates the first The weight value of each pixel.

[0203] For salient feature clusters in the comprehensive feature distribution, K-means clustering is used to group defect regions. Assuming the salient feature clusters show 0.3 mm wide cracks and 0.5 mm diameter pits, by setting the cluster size K=3, the algorithm groups based on the geometry and distribution characteristics of the defects. For example, crack areas are grouped together due to their high gradient linear features, while pits are grouped into another group due to their circular outline. The clustering results can quantify the defect area, such as a 0.8 square millimeter crack area, and determine its location coordinates, such as the area slightly to the right of the image center. This grouping method provides a clear basis for defect localization and quantitative analysis.

[0204] Furthermore, in the deep learning-based defect detection method for new energy vehicle components provided in this embodiment, step S600 includes:

[0205] Step S610: Obtain the quantitative description data of component defects transmitted from the production line, and send the quantitative description data of component defects to the real-time comparison module using the data transfer method. For high-cycle production environments, a structured defect data stream is obtained.

[0206] The quantitative description data of component defects is obtained through the following formula:

[0207] (25)

[0208] In formula (25), This represents quantitative description data of component defects. Indicates the sampling time period. This indicates the total number of defects detected. Indicates the first The weighting coefficient of each defect. Indicates the first A quantitative value for the severity of a defect. Indicates the first The spatial location of each defect is an influencing factor.

[0209] For processing quantitative descriptive data of component defects transmitted from the production line, data flow methods are key to achieving efficient data transfer. For example, in the scenario of detecting surface defects on aluminum alloy battery trays for new energy vehicles, the production line uses high-resolution cameras to acquire defect images in real time, generating quantitative descriptive data including area and location coordinates. The data flow method employs a message queue mechanism to ensure efficient data transmission to the real-time comparison module. For instance, the camera acquires 10 frames of 5472×3648 pixel images per second, generating approximately 100 sets of defect quantitative data per frame, including defect area (e.g., 0.5 square millimeters) and location coordinates (e.g., (2000, 1500)). Through the message queue, the data is transmitted sequentially in JSON format, ensuring data fluency and real-time performance in high-paced production environments.

[0210] Step S620: If the structured defect data stream is consistent with the preset classification standard, the feature comparison method is used to match the area and location coordinates in the defect data stream. Based on the matching consistency, the classification result of the new energy vehicle parts is determined.

[0211] The defect category with the highest matching degree is selected as the classification result for new energy vehicle parts by weighted summation:

[0212] (26)

[0213] In formula (26), This indicates the final classification result of new energy vehicle components. Indicating different defect category indexes, and These represent the weighting coefficients for area and location features, respectively. The score represents the area feature matching score. This represents the feature matching score for location coordinates.

[0214] In the real-time comparison module, the structured defect data stream is matched against preset classification standards. The feature comparison method is based on the Euclidean distance algorithm to calculate the similarity between the defect data and the standard template. The preset standard stipulates that the crack area of ​​a qualified part is less than 0.3 square millimeters, and the position coordinates deviate from the center by no more than 50 pixels. Assuming that the area of ​​a defect in the data stream is 0.2 square millimeters, and the coordinates are (2050, 1480), it meets the standard after comparison and is judged to be qualified. This method ensures rapid matching and adapts to the needs of high-cycle production.

[0215] Step S630: If the classification result of the new energy vehicle parts is qualified, the qualified identification mark is added to the new energy vehicle parts using the marking allocation method. Based on the data recording requirements of the production environment, the test data with the qualified identification mark is obtained.

[0216] Set the criteria for judging the classification results of new energy vehicle parts:

[0217] (27)

[0218] In formula (27), Indicates the first The allocation results of qualification labels for individual new energy vehicle components. Indicates the first The classification result of each component is as follows: when the classification result is 1, it means that the component is qualified and is assigned a qualified label of 1, and no alarm is required; when the classification result is 0, it means that the component is unqualified and is not assigned a qualified label of 0, and an alarm needs to be triggered.

[0219] For qualified parts, a qualified label is added to them using the marking and allocation method. For example, a qualified pallet is laser-marked with a QR code, recording the batch number and inspection time, such as "20250818-001". The inspection data is simultaneously stored in a database, including the labeling information, defect area, and coordinates, meeting the data traceability requirements of the production environment. This marking method facilitates subsequent quality management.

[0220] Step S640: If the classification result of the new energy vehicle parts is unqualified, an alarm is triggered by a signal generation method. In accordance with the result recording requirements, the alarm information is associated with the test data to obtain the final test output.

[0221] The final detection output is obtained using the following formula:

[0222] (28)

[0223] In formula (28), This indicates the final detection output result. This represents the raw test data. Indicates an alarm message. This represents the data association operator, which associates and merges detection data with alarm information.

[0224] If the classification result is unqualified, the signal generation method triggers an alarm. For example, if a 0.6 square millimeter crack is detected on a pallet, exceeding the standard, the system sends an audible and visual alarm signal through the PLC (Programmable Logic Controller) to prompt the operator to handle the issue. The alarm information includes the defect type, area, and coordinates, such as "crack, 0.6 square millimeters, (2100, 1600)", and is associated with the detection data and stored in a log file. This associated record facilitates problem tracing and process improvement.

[0225] Preferably, the deep learning-based defect detection method for new energy vehicle components provided in this embodiment includes step S700:

[0226] Step S710: Obtain a structured inspection data stream from the inspection output, use data parsing methods to extract the identifiers of qualified parts and the alarm information of unqualified parts, and obtain formatted inspection data according to the format requirements of the production database.

[0227] The matching degree of formatted test data is detected using the following formula:

[0228] (29)

[0229] In formula (29), This indicates the degree of matching of the formatted test data. This indicates the total number of data records to be formatted. Indicates the first The validity weight of each record. Indicates the first Functions for compatibility between data entries and the production database format. This indicates the standard format requirements for production databases.

[0230] In the scenario of surface defect detection for aluminum alloy battery trays in new energy vehicles, the structured data stream output from the inspection contains information on qualified and unqualified parts. Key content needs to be extracted and formatted using data parsing methods to meet the requirements of the production database. For example, the inspection data stream is transmitted in JSON format, containing QR code identifiers for qualified parts such as "20250818-002" and alarm information for unqualified parts such as "scratch, 0.4 square millimeters, (1800, 1400)". The data parsing method uses a JSON parser to extract fields such as identifier, defect type, area, and coordinates, generating records that conform to the database table structure. Preferably, the parsing process verifies data integrity, ensuring no missing fields before outputting formatted data, such as unifying the area unit to square millimeters and formatting the coordinates as integers.

[0231] Step S720: If the formatted test data meets the update standard of the production database, the test data stream is transmitted to the production database using the database writing method, and the updated database record is obtained in accordance with the data integrity requirements.

[0232] Set the criteria for determining whether the formatted test data conforms to the update standards of the production database:

[0233] (30)

[0234] In formula (30), Indicates detection data Whether it meets the production database update standards Indicates the first The weighting coefficients of each verification standard Representing data In the A scoring function under a standard, This indicates the total number of verification standards. This represents the threshold for data to be considered acceptable. When the weighted score is greater than or equal to the threshold, the data meets the standard and can be written into the database.

[0235] Formatted inspection data must meet the update standards of the production database, such as field length limits and data type requirements. The database write method involves transmitting data streams to the MySQL database via batch insert. For example, qualified component data, including batch number "20250818-002", inspection time "2025-08-18 10:00:00", and defect area of ​​0.2 square millimeters, is written to the "Qualified Record Table"; unqualified data, such as a scratch area of ​​0.4 square millimeters, is written to the "Defect Log Table". To ensure data integrity, transaction verification is performed before writing; after confirming data consistency, the transaction is committed, generating updated database records. This method facilitates subsequent traceability and quality analysis.

[0236] Step S730: Based on the updated database records, use statistical analysis methods to calculate the deviation between detection speed and accuracy, and determine the adjusted acquisition frequency and image quality parameters according to the parameter optimization requirements for image acquisition.

[0237] The deviation between detection speed and accuracy is calculated using the following formula:

[0238] (31)

[0239] In formula (31), This indicates the total number of records in the database. Indicates the first The actual time taken for each test Indicates the first The expected time for each test, This represents the average relative deviation of the detection speed, used to evaluate the speed stability of the detection system.

[0240] For the updated database records, statistical analysis methods are used to calculate the deviation between detection speed and accuracy. For example, detection records from one hour are extracted from the database, and the number of parts processed per minute is calculated, say 60, combined with a pass rate of 98%, to calculate the deviation between detection speed and accuracy. Accuracy deviation is analyzed by comparing database records with manual re-inspection results, e.g., a false positive rate of 0.5%. These deviations guide the optimization of image acquisition parameters. Preferably, if the detection speed is too low, the acquisition frequency is adjusted from 10 frames / second to 12 frames / second; if the false positive rate is too high, image quality parameters such as resolution are improved from 5472×3648 pixels to a higher resolution.

[0241] Step S740: By adjusting the acquisition frequency and image quality parameters, update the settings of the image acquisition device using the parameter configuration method, and obtain a reconfigured acquisition process to meet the requirements of optimizing the detection process.

[0242] Update the image acquisition device settings using the following formula:

[0243] (32)

[0244] In formula (32), This indicates the updated device settings. This represents the input sampling frequency parameter. This represents the input image quality parameters. This indicates a parameter configuration mapping function.

[0245] The reconfigured acquisition process is derived using the following formula:

[0246] (33)

[0247] In formula (33), This indicates the obtained reconfigured data acquisition process. This represents the set of image acquisition device settings for the application. This represents the function that generates the data acquisition process.

[0248] The parameter configuration method updates the image acquisition device settings through the device control interface. For example, the camera profile can be adjusted to set the acquisition frequency to 12 frames per second, increase the resolution to a higher standard, and update the light source intensity to improve image contrast. This reconfigured acquisition process reduces data latency and ensures inspection efficiency in high-volume production environments. Preferably, the adjusted process is validated in small-batch testing to ensure data flow stability and inspection accuracy, providing continuous optimization support for the production line.

[0249] Please see Figure 2This embodiment also provides a deep learning-based defect detection system for new energy vehicle components, used to execute the aforementioned deep learning-based defect detection method for new energy vehicle components. The system includes an initial image set formation module 10, a denoised image determination module 20, an edge feature map acquisition module 30, a defect type judgment module 40, a defect quantification description acquisition module 50, a final detection output determination module 60, and a detection process acquisition module 70. The initial image set formation module 10 acquires images of the surface of the new energy vehicle components using a camera, obtaining raw image data containing potential defect areas and background interference to form an initial image set. The denoised image determination module 20 performs denoising processing on the initial image set using a filtering method, effectively suppressing noise effects for complex shapes and multiple material interferences of the components, and determining a denoised image. The edge feature map acquisition module 30 extracts edge features from the denoised image and uses edge detection... The algorithm identifies contour changes and potential abnormal boundaries for defect diversity, obtaining edge feature maps. The defect type judgment module 40, if the intensity of abnormal boundaries in the edge feature map exceeds a preset threshold, performs deep feature learning on the abnormal boundary region using a neural network model, fusing multi-layer image extraction information to determine the defect type. The defect quantification description acquisition module 50 calculates the defect area and location coordinates using the defect type results, integrating multi-scale feature information to obtain a quantitative defect description for accurate classification. The final detection output determination module 60 performs real-time comparison based on the quantitative defect description in a high-paced production environment. If the quantitative description meets the preset classification standards, it is marked as a qualified part; otherwise, an alarm is triggered, determining the final detection output. The detection process acquisition module 70 updates the production database based on the final detection output, adjusting the next image acquisition parameters to balance detection speed and accuracy, obtaining an optimized detection process.

[0250] The deep learning-based defect detection method and system for new energy vehicle components provided in this embodiment, compared with existing technologies, effectively suppresses background noise interference in the original image through filtering and denoising techniques, generating a clear denoised image. Subsequently, an edge detection algorithm is used to extract contour features and accurately identify potential abnormal boundaries. For areas where the intensity of abnormal boundaries exceeds a threshold, multi-scale features are fused using neural network deep learning to accurately determine the defect type and quantify its area and location. Finally, by comparing with preset standards in real time, qualified components are marked or alarms are triggered, and the database is dynamically updated to optimize detection parameters. This embodiment achieves high-precision and high-efficiency defect detection through the high integration of denoising, edge detection, deep learning, and real-time comparison, significantly improving production quality and automation levels.

[0251] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.

Claims

1. A method for defect detection of new energy vehicle components based on deep learning, characterized in that, Includes the following steps: S100: The camera acquires images of the surface of new energy vehicle parts, obtaining raw image data containing potential defect areas and background interference to form an initial image set; S200: Based on the initial image set, a filtering method is used to perform noise reduction processing, effectively suppressing the noise influence on the complex shape of the parts and the interference of multiple materials, and determining the denoised image; S300. Extract edge features from the denoised image, use an edge detection algorithm to identify contour changes, identify potential abnormal boundaries for defect diversity, and obtain an edge feature map. S400. If the intensity of the abnormal boundary in the edge feature map exceeds a preset threshold, then the abnormal boundary region is subjected to deep feature learning through a neural network model, and information extracted from multiple layers of images is fused to determine the defect type. S500: Calculate the defect area and location coordinates using the defect type results, and integrate multi-scale feature information to obtain a quantitative description of the defect for accurate classification. S600. Based on the quantitative description of the defect, a real-time comparison is performed in a high-cycle production environment. If the quantitative description meets the preset classification standard, it is marked as a qualified part; otherwise, an alarm is triggered, and the final inspection output is determined. S700: Update the production database through the final detection output, and adjust the next image acquisition parameters to balance detection speed and accuracy, thereby obtaining an optimized detection process; Step S500 includes: S510. Obtain multi-scale image data from the original image, perform multi-resolution decomposition on the original image using the image pyramid method, extract edge features for different scales, and obtain a multi-scale edge feature map. S520. If a significant edge region is detected in the multi-scale edge feature map, a convolution operation is used to extract features from the significant edge region to obtain a depth feature representation based on texture and shape characteristics. S530. Based on the depth feature representation, a weighted fusion method is used to integrate the multi-scale features, and a comprehensive feature distribution is obtained by considering feature consistency. S540. If there are significant feature clusters in the comprehensive feature distribution, the K-means clustering method is used to group the significant feature clusters, and a quantitative description of the defect area and location coordinates is determined based on the characteristics of the defect area. Step S700 includes: S710. Obtain a structured detection data stream from the detection output, use a data parsing method to extract the identifiers of qualified parts and the alarm information of unqualified parts, and obtain formatted detection data according to the format requirements of the production database. S720. If the formatted test data meets the update standard of the production database, the test data stream is transmitted to the production database using the database writing method, and the updated database record is obtained in accordance with the data integrity requirements. S730. Based on the updated database records, use statistical analysis methods to calculate the deviation between detection speed and accuracy, and determine the adjusted acquisition frequency and image quality parameters according to the parameter optimization requirements for image acquisition. The deviation between detection speed and accuracy is calculated using the following formula: ; in, This indicates the total number of records in the database. Indicates the first The actual time taken for each test Indicates the first The expected time for each test, The average relative deviation value representing the detection speed is used to evaluate the speed stability of the detection system; S740: By adjusting the acquisition frequency and image quality parameters, the settings of the image acquisition device are updated using a parameter configuration method to obtain a reconfigured acquisition process in accordance with the requirements of optimizing the detection process.

2. The method for detecting defects in new energy vehicle components based on deep learning as described in claim 1, characterized in that, In step S100, the composition model of the raw image data acquired by the camera is described by the following formula: ; in, Indicates position The original image pixel values ​​at that location, Indicates the number of image channels. Indicates the first The weighting coefficients of each channel Indicates the first Each channel is located in Pixel intensity at that location Represents the noise weighting coefficient. Indicates position Background noise components at the location; The degree of difference between potentially defective areas and normal surfaces is quantified using the following formula: ; in, Indicated by position The area defect detection value is centered on the center. and These represent the width and height of the detection window, respectively. Indicates position within the window Image pixel values, This represents the average standard pixel value on the surface of a normal component.

3. The method for detecting defects in new energy vehicle components based on deep learning as described in claim 2, characterized in that, In step S200, the pixel values ​​of the denoised image are obtained using the following formula: ; in, This represents the pixel values ​​of the denoised image. Represents the normalized weighting coefficients. Indicates the radius of the filtering window. Represents the spatial Gaussian weighting function. This represents the gray-level similarity weight function. Represents the spatial standard deviation parameter. This represents the standard deviation parameter for grayscale. Set a noise suppression intensity function to effectively suppress the impact of noise on components with complex shapes and multiple materials: ; in, This represents the noise suppression intensity function. Indicates the material characteristic response value. This represents a measure of shape complexity. This represents the estimated local noise level. This represents the material interference weighting coefficient. This represents the shape complexity weighting coefficient. Indicates the noise level weighting coefficient; An adaptive frequency domain filter response function is set to perform denoising processing on the initial image set: ; in, This represents the response function of the adaptive frequency domain filter. Represents the frequency domain transfer function. and Represents frequency domain coordinate variables, This represents the adaptive frequency domain standard deviation parameter. This represents the mask function for the component region. This represents an exponential function.

4. The method for detecting defects in new energy vehicle components based on deep learning as described in claim 1, characterized in that, Step S300 includes: S310. Edge features are extracted from the denoised image using the Canny edge detection algorithm. For complex shapes of parts and interference from multiple materials, an initial edge feature map containing contour information is obtained. S320. Based on the initial edge feature map, the Sobel operator is used to detect contour changes. Considering the diversity of defects, the gradient changes in the edge region are judged to obtain a contour change distribution map. S330. If there is a gradient anomaly in the contour change distribution map, the abnormal region is divided using a region segmentation method, and the abnormal boundary region is determined for the potential defect boundary. S340. By performing morphological processing on the abnormal boundary region, the boundary contour is optimized by using dilation and erosion operations, and a final edge feature map is generated based on the contour integrity.

5. The method for detecting defects in new energy vehicle components based on deep learning as described in claim 1, characterized in that, Step S400 includes: S410. If the intensity of the abnormal boundary in the edge feature map exceeds a preset threshold, a convolutional neural network is used to extract the depth features of the abnormal boundary region. For multi-layer image structures, a depth feature map containing texture and shape information is obtained. Set the criteria for determining the intensity of abnormal boundaries in the edge feature map: ; in, Indicates position Boundary strength value at that location, Indicates the image in Gradient of direction, Indicates the image in Gradient of direction, This represents the preset anomaly boundary detection threshold, when the location... Boundary strength value at Exceeding the preset anomaly boundary detection threshold Time-triggered deep feature extraction; The depth feature map, which contains texture and shape information, is derived using the following formula: ; in, This represents the fused, integrated depth feature map. This represents the extracted texture feature map. This represents the extracted shape feature map. Represents multi-layer image structure feature maps. , , These represent the fusion weight coefficients for texture, shape, and structural features, respectively. S420. Based on the depth feature map, a feature fusion method is used to integrate multi-layer image information, and a fused comprehensive feature representation is obtained by considering feature consistency. S430. If there is a significant feature distribution in the comprehensive feature representation, a classification algorithm is used to analyze the significant feature distribution and determine the potential defect type based on the defect diversity. S440. Based on the potential defect types, clustering methods are used to group the defect regions, and the final defect classification map is determined based on the defect distribution characteristics.

6. The method for detecting defects in new energy vehicle components based on deep learning as described in claim 5, characterized in that, In step S420, the fused comprehensive feature representation is obtained through the following formula: ; in, This represents the integrated feature representation after fusion. This indicates the number of layers in the depth feature map. Indicates the first The fusion weights of layer features Indicates the first Depth feature map of the layer The weight parameters represent the feature consistency constraints. The L2 distance between features of adjacent layers is used to ensure feature consistency.

7. The method for detecting defects in new energy vehicle components based on deep learning as described in claim 1, characterized in that, Step S600 includes: S610. Obtain the component defect quantitative description data transmitted from the production line, and send the component defect quantitative description data to the real-time comparison module using a data transfer method to obtain a structured defect data stream for high-cycle production environments. S620. If the structured defect data stream is consistent with the preset classification standard, the feature comparison method is used to match the area and position coordinates in the defect data stream. Based on the matching consistency, the classification result of the new energy vehicle parts is determined. S630. If the classification result of new energy vehicle parts is qualified, the qualified label shall be added to the new energy vehicle parts by the labeling and allocation method, and the test data with qualified label shall be obtained according to the data recording requirements of the production environment. S640. If the classification result of new energy vehicle parts is unqualified, an alarm is triggered by a signal generation method. In accordance with the result recording requirements, the alarm information is associated with the test data to obtain the final test output.

8. A deep learning-based defect detection system for new energy vehicle components, used to execute the deep learning-based defect detection method for new energy vehicle components as described in any one of claims 1 to 7, characterized in that, include: The initial image set forming module (10) is used to acquire images of the surface of new energy vehicle parts through a camera, obtain raw image data containing potential defect areas and background interference, and form an initial image set; The denoised image determination module (20) is used to perform denoising processing based on the initial image set using a filtering method, effectively suppressing the noise effect on the complex shape of the parts and the interference of multiple materials, and determining the denoised image. The edge feature map acquisition module (30) is used to extract edge features from the denoised image, use an edge detection algorithm to identify contour changes, identify potential abnormal boundaries for defect diversity, and obtain an edge feature map. The defect type determination module (40) is used to determine the defect type by performing deep feature learning on the abnormal boundary region through a neural network model and fusing multi-layer image extraction information if the intensity of the abnormal boundary in the edge feature map exceeds a preset threshold. The defect quantification description acquisition module (50) is used to calculate the defect area and location coordinates using the defect type results, and integrate multi-scale feature information to obtain the defect quantification description for the purpose of accurate classification. The final detection output determination module (60) is used to perform real-time comparison in a high-cycle production environment based on the defect quantitative description. If the quantitative description meets the preset classification standard, it is marked as a qualified part; otherwise, an alarm is triggered to determine the final detection output. The detection process acquisition module (70) is used to update the production database through the final detection output, adjust the next image acquisition parameters for a balance between detection speed and accuracy, and obtain an optimized detection process.

Citation Information

Patent Citations

  • Switch defect detection method based on LabVIEW deep learning

    CN114140373A

  • Forging flaw detection method and system based on real-time image recognition

    CN120013925A