Square power battery shell visual defect rapid detection method and system
The multi-angle image acquisition system with deep learning and edge detection algorithms addresses the incomplete detection of power battery shell defects, achieving precise and efficient identification of scratches, pits, and bubbles.
Patent Information
- Application Number
- CN202510803667.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-06-17
AI Technical Summary
In the prior art, the detection of square power battery case has problems such as insufficient viewing angle coverage, low detection accuracy, and weak intelligent recognition capabilities, which leads to multiple types of surface defects being easily missed or misjudged, making it difficult to meet the needs of automated quality inspection.
Using a method of combining a multi-view image acquisition device and a deep learning model, the rapid identification and accurate positioning of multiple types of surface defects in the battery case through multi-view image acquisition, image preprocessing, front visual scratch detection, main defect recognition and bubble defect recognition are achieved.
It realizes efficient and comprehensive multi-type surface defect detection of square power battery case, improves detection coverage and accuracy, reduces missed and missed inspections, and improves the automation and accuracy of quality inspections.
Smart Images

Figure CN120318234A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, and particularly relates to a method and system for rapid visual defect detection of the outer shell of a square power battery. Background Art
[0002] With the rapid development of the new energy vehicle industry, as one of the core components, the manufacturing quality of the outer shell structure of the power battery has an important impact on the performance, safety and service life of the whole vehicle. In particular, square power batteries are widely used in electric vehicles, power tools and energy storage devices due to their advantages such as compact structure and flexible grouping. However, in the actual production process, the outer shell of square batteries is extremely prone to surface defects such as scratches, pits, dirt, and bubbles in the process of stamping, welding, coating, assembly, etc. These defects not only affect the appearance quality of the battery, but may also cause safety hazards such as leakage and short circuit.
[0003] Currently, the quality inspection of the outer shell of power batteries still mainly relies on manual visual inspection. Although some enterprises have introduced visual inspection equipment based on traditional image processing, it uses a single-view camera and is difficult to comprehensively detect multiple sides and corner areas of the battery outer shell, resulting in a relatively high missed inspection rate. Summary of the Invention
[0004] This application provides a method and system for rapid visual defect detection of the outer shell of a square power battery, which solves the problem in the prior art that due to the lack of multi-view imaging and intelligent defect recognition mechanisms, it is impossible to comprehensively, efficiently and accurately detect various types of surface defects of the battery outer shell, and achieves the technical effect of realizing rapid recognition and accurate positioning of various defects such as scratches, pits, bubbles, dirt, etc., thereby significantly improving the efficiency of outer shell quality control and the automation level in the production process of power batteries.
[0005] In view of the above problems, the first aspect of the present application provides a method for rapid detection of visual defects of a square power battery shell, the method comprising: using a multi-view image acquisition device to acquire images of multiple planes and angles of a square power battery shell to obtain a high-resolution multi-view image sequence, the multi-view image acquisition device comprising a plurality of industrial cameras, which are respectively arranged in the top view, oblique view and side view directions to form a three-dimensional imaging array around the top and side of the shell; preprocessing the image sequence to output standardized image data; performing front visual scratch detection on the standardized image data, performing rapid scratch recognition based on edge features, and outputting the scratch defect position and Features: the front vision scratch detection is based on the linear structure enhancement algorithm combined with morphological processing to identify the slender scratch area; the deep learning model is used to identify the main defects of the preprocessed image, and the scratch defect position is comprehensively detected, and the defect candidate area containing the confidence score is output. The main defect identification is to identify pits, dirt, uneven coating, and foreign matter; low-confidence defect candidate areas are obtained, and local image enhancement, texture analysis and secondary classification operations are performed on the low-confidence defect candidate areas to identify bubble defects; the recognition results of the defect candidate areas are summarized and annotated images are generated, and the defect type, location and severity information are output to the quality inspection system.
[0006] A second aspect of the present application provides a system for rapid detection of visual defects of a square power battery housing, the system comprising: a multi-view image acquisition module, the multi-view image acquisition module being used to use a multi-view image acquisition device to acquire images of multiple planes and angles of a square power battery housing to obtain a high-resolution multi-view image sequence, the multi-view image acquisition device comprising a plurality of industrial cameras, which are respectively arranged in top view, oblique view and side view directions to form a three-dimensional imaging array around the top and side of the housing; An image preprocessing module, the image preprocessing module is used to preprocess the image sequence and output standardized image data; A front vision scratch detection module, which is used to perform front vision scratch detection on the standardized image data, perform fast scratch recognition based on edge features, and output the scratch defect position and features. The front vision scratch detection is based on a linear structure enhancement algorithm combined with morphological processing to identify slender scratch areas; A main defect recognition module, which is used to use a deep learning model to perform main defect recognition on the preprocessed image, perform comprehensive defect detection on the scratch defect position, and output a defect candidate area including a confidence score. The main defect recognition is to identify pits, dirt, uneven coating, and foreign matter; The bubble - type defect recognition module is used to obtain low - confidence defect candidate regions, perform local image enhancement, texture analysis, and secondary classification operations on the low - confidence defect candidate regions, and identify bubble - type defects; The data output module is used to summarize the recognition results of defect candidate regions and generate an annotated image, and at the same time output defect type, position, and severity information to the quality inspection system.
[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages: A method and system for rapid visual defect detection of a square power battery shell provided in this application relate to the field of graphics processing technology. It obtains a high - resolution multi - perspective image sequence, outputs standardized image data, performs front - vision scratch detection, outputs the position and characteristics of scratch defects, outputs defect candidate regions containing confidence scores, identifies bubble - type defects, and summarizes the recognition results of defect candidate regions and generates an annotated image. By fusing multi - perspective high - resolution image information, combining front - vision scratch detection with deep - learning main defect recognition, it realizes the accurate recognition and positioning of various types of defects on the battery shell surface, including scratches and bubbles, significantly improving the detection coverage rate and accuracy. Introducing a secondary recognition mechanism based on confidence scoring, performing texture feature analysis and classification on candidate regions with insufficient confidence in the main detection stage can effectively fill in the detection of small defects such as bubble - type defects and improve the overall detection sensitivity. Through combined geometric - texture feature extraction, the combination of deep learning and rule screening, and the coordination of spatial registration and feature fusion, it effectively solves the problem of insufficient accuracy of traditional detection schemes caused by image distortion, limited perspective, or weak defect features. This application solves the problem in the prior art that due to the lack of multi - perspective imaging and intelligent defect recognition mechanisms, it is impossible to comprehensively, efficiently, and accurately detect various types of surface defects of the battery shell, achieving the technical effect of rapid recognition and accurate positioning of various defects such as scratches, pits, bubbles, and dirt, thereby significantly improving the shell quality control efficiency and automation level in the production process of power batteries.
[0008] In summary, by constructing a multi - perspective industrial camera array and an integrated deep - learning recognition model, this application can achieve high - resolution image acquisition of multiple surface positions and corner regions of the square power battery shell, and perform comprehensive multi - category defect recognition and positioning analysis, reducing defect undetected and misdetected due to detection blind spots or insufficient recognition accuracy, avoiding the problems of low efficiency, poor stability of manual visual inspection, and poor adaptability of traditional algorithms to complex defects. It can output structured defect information and link with the backend quality inspection system, improving the automation degree and accuracy of the quality inspection of the power battery shell, and contributing to promoting quality traceability and intelligent manufacturing upgrade in the power battery manufacturing process.
[0009] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of this application more obvious and understandable, the specific embodiments of this application are hereinafter given. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0011] Figure 1 It is a schematic flow chart of a method for quickly detecting visual defects of a square power battery housing provided by an embodiment of this application.
[0012] Figure 2 It is a schematic structural diagram of a system for quickly detecting visual defects of a square power battery housing provided by an embodiment of this application.
[0013] Description of reference numerals: multi-view image acquisition module 10, image preprocessing module 20, front vision scratch detection module 30, main defect recognition module 40, bubble defect recognition module 50, data output module 60. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0014] This application provides a method and system for quickly detecting visual defects of a square power battery housing, which is used to solve the problems of insufficient view coverage, low detection accuracy, and weak intelligent recognition ability in the process of detecting defects in the existing power battery housing, resulting in easy omission or misjudgment of various types of surface defects and difficulty in meeting the requirements of automated quality inspection. The technical effect is achieved by combining multi-view image acquisition and deep learning recognition to realize efficient, comprehensive, and accurate detection of surface defects such as scratches, pits, and bubbles.
[0015] The following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the drawings in the embodiments of this application. Obviously, the described embodiments are only some embodiments of this application, rather than all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.
[0016] It should be noted that the terms "first", "second", etc. in the specification of this application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or modules that are not clearly listed or are inherent to these processes, methods, products or devices.
[0017] Embodiment 1, as Figure 1 shown, this application provides a method for quickly detecting visual defects of a square power battery housing, and the method includes: S100: Use a multi-view image acquisition device to perform image acquisition on multiple surface positions and angles of the square power battery housing to obtain a high-resolution multi-view image sequence. The multi-view image acquisition device includes a plurality of industrial cameras, which are respectively arranged in the top view, oblique view, and side view directions to form a three-dimensional imaging array around the top and side of the housing.
[0018] Specifically, the multi-view image acquisition device is used to perform image acquisition on multiple surface positions and angles of the power battery housing to obtain a high-resolution multi-view image sequence. To achieve comprehensive coverage of defects at different positions (including the top, edges, and side walls) of the square housing, the device constructs a three-dimensional imaging array with a reasonable spatial layout and complementary perspectives.
[0019] The multi-view image acquisition device includes a plurality of high-resolution industrial cameras, and each camera is respectively fixedly arranged in the top view, oblique view, and side view directions of the detection station. The top view camera is used to collect the plane image of the housing top cover. The oblique view camera is installed at a certain inclination angle with the top surface and can capture the detailed information of the top edge and corners. The side view camera is used to obtain the image information of the side wall. Through this spatial multi-angle arrangement, the formed three-dimensional imaging array can synchronously complete the image acquisition of multiple key surface positions of the square battery housing in one detection process. To reduce image distortion and acquisition blind spots, the position, angle, and focal length parameters of the cameras are calibrated and optimally configured to ensure that the acquired images have a unified spatial resolution and geometric alignment accuracy. The system can automatically control the synchronous acquisition of each camera according to the detection beat, and finally output a multi-view image sequence, which is sent to the subsequent image processing and intelligent recognition module for further analysis and processing. It realizes the full-view and dead-angle-free image perception ability of the square power battery housing, provides high-quality input for subsequent defect detection, and significantly improves the comprehensiveness and accuracy of detection.
[0020] S200: Preprocess the image sequence and output standardized image data.
[0021] Specifically, perform lens distortion correction, image alignment and spatial registration, denoising, enhancement, and format unification processing on the image sequence to output standardized image data with unified size, clarity, and color space.
[0022] Furthermore, step S200 of the embodiment of the present application further includes: S201: Perform lens distortion correction on the image sequence to correct the geometric distortion caused by industrial camera imaging; S202: Perform image alignment and spatial registration on images from different angles to establish a unified spatial reference coordinate system; S203: Denoise the image using Gaussian filtering and non-local means methods; S204: Perform image enhancement operations, including contrast enhancement, edge sharpening, and brightness equalization; S205: Uniformly convert the image into a predetermined grayscale or color space and adjust it to a unified resolution and data format to obtain standardized image data.
[0023] It should be understood that for the geometric distortion problem caused by lens characteristics during the imaging process of industrial cameras, a distortion model (such as the pinhole model combined with radial and tangential distortion parameters) is used to perform geometric correction on the image to restore the true spatial structure and edge morphology of the object. This process usually includes camera calibration, distortion parameter estimation, and image remapping steps. For example, when detecting defects on the metal surface, if the camera installation angle or lens type causes obvious barrel distortion at the image edge, the uncorrected image will distort the straight scratch and distort the area size, affecting subsequent scratch extraction and defect localization. After distortion correction, the straight boundaries in the image are restored to the standard form, ensuring the accuracy of geometric measurement and defect analysis. The internal and external parameters of the camera are calibrated for each frame of the acquired image, and the radial distortion and tangential distortion are corrected using the pinhole model or the wide-angle lens distortion model to keep the spatial geometric relationship of the image consistent. For the possible perspective deviation of multi-view images, through feature point matching or template alignment technology, spatial registration and unified scale cropping are performed on the image sequence to ensure the regional correspondence between images. Image alignment and spatial registration are performed on images from different angles, aiming to solve the parallax and position inconsistency problems brought by multi-view imaging, and ensure that the same defect or target in different images has a consistent position expression in the unified spatial reference coordinate system. This process usually includes feature point extraction, image pairing and matching, transformation matrix estimation (such as homography matrix or rigid transformation), image resampling and alignment, etc. For example, when performing multi-view defect detection on the battery shell, the images collected by different cameras may have rotation, translation, or scale differences due to different installation positions and angles. If registration is not performed, the positions of the same scratch defect in each view will not be aligned, affecting defect fusion judgment and positioning accuracy. Through image registration processing, all perspective images can be mapped to a unified reference plane, enabling accurate correspondence between defect regions and providing a reliable basis for multi-view information fusion and subsequent determination. Algorithms such as brightness histogram equalization, gamma correction, and adaptive enhancement are used to enhance the image contrast and texture details, and improve the visibility of tiny scratches or low-contrast defect regions. For the interference such as salt-and-pepper noise and sensor thermal noise that may exist in the acquired images, median filtering, Gaussian filtering, or non-local means (NLM) filtering is used for image smoothing, suppressing noise while retaining edge information. If the subsequent recognition task is based on gray-scale features, the color image can be converted to gray-scale. For the color texture recognition task, color space normalization (such as RGB→Lab or HSV) is performed to maintain feature consistency. All images are finally uniformly scaled or cropped to the standard resolution size (such as 512×512 or 640×480). Finally, a standardized image dataset with consistent structure, unified quality, and clear texture is obtained as the basic input for subsequent scratch recognition and main defect detection.
[0024] S300: Perform pre-visual scratch detection on the standardized image data, execute fast scratch recognition based on edge features, and output the scratch defect positions and features.
[0025] Specifically, performing pre-visual scratch detection on the standardized image data includes edge extraction, morphological processing, and connected component analysis, quickly identifying scratch regions with slender structures and direction consistency, extracting feature information such as their positions, lengths, and directions, and outputting the scratch defect positions and feature data.
[0026] Further, step S300 of the embodiment of the present application further includes: S301: Extract the front-view image data corresponding to the top region of the battery housing in the multi-view image sequence as the detection input image; S302: Perform edge enhancement processing on the front-view image, use an edge detection operator to extract the directional and continuous linear structures in the image to obtain an edge image, and the edge detection operator is a combination of Sobel and Canny; S303: Perform morphological processing on the edge image and combine the connected component analysis algorithm to extract candidate scratch regions that are slender and have consistent directions; S304: Perform geometric and texture feature analysis on the candidate scratch regions, including calculating features such as the region length, width, and gray gradient direction consistency, and screening the true scratch regions based on a threshold; S305: Output the position information and feature parameters of the true scratch regions, including position coordinates, size parameters, and optional confidence scores and defect level labels.
[0027] It should be understood that the front-view image data corresponding to the top area of the square power battery housing is extracted from the multi-view image sequence as the input image for scratch defect detection. This front-view image covers the key detection area of the housing top, ensuring the complete collection of details such as scratches. Specifically, after synchronously obtaining image frames of the battery housing from multiple angles such as the top, left, and right through the image acquisition system, the image frame containing the top area is identified using the camera calibration parameters or the preset spatial positioning information in the image, and it is used as the input image for subsequent surface defect detection such as scratches and pits. For example, in a set of image sequences collected by three industrial cameras, the image frame numbered "Cam_Front" is the front-view image of the battery housing top. The system analyzes the positioning marks or housing structure features contained in this frame image to confirm that it corresponds to the upper surface of the battery, and then selects it for defect recognition input of the deep learning model or image processing algorithm, ensuring that the detection result focuses on the key surface area and improving the detection efficiency and accuracy. Edge enhancement processing is performed on the front-view image, using a combination of edge detection operators, including the Sobel operator and the Canny operator. First, the Sobel operator is used to extract the gradient information in the horizontal and vertical directions of the image, highlighting the edge details in the image; then, combined with the Canny operator, through non-maximum suppression and double-threshold processing, linear edge structures with directionality and continuity are screened out, effectively enhancing the recognition ability of scratch contours. For the binary edge image obtained after edge detection, morphological processing methods such as dilation and erosion operations are applied to connect broken edge lines and remove isolated noise points. Then, combined with the connected component analysis algorithm, all slender and directionally consistent connected regions in the image are identified and extracted as scratch candidate regions. These regions meet the preset length-width ratio and direction consistency conditions, which are conducive to screening out potential scratches. For example, when processing the edge image of a front view of a battery case, several thin line regions are obtained after morphological operations, and the system uses connected component analysis to identify three slender regions numbered "C1", "C2", and "C3", each with an aspect ratio of more than about 10:1 and a basically consistent direction. Based on these characteristics, they are determined to be possible scratch regions, and the system includes them in the scratch candidate region set for subsequent defect confirmation and classification. Detailed geometric and texture feature analysis is performed on the scratch candidate regions. Specifically, it includes calculating the length and width of the circumscribed rectangle of the candidate region to obtain the aspect ratio; evaluating the area size of the region; analyzing the consistency of the gray gradient direction to judge the scratch direction; screening based on preset thresholds (such as aspect ratio threshold, area threshold, and direction consistency threshold) to eliminate stray regions that are not scratches, and finally confirming the real scratch region. The position information and characteristic parameters of the confirmed scratch defect region are output. Specifically, it includes the two-dimensional coordinate position of the defect, the size parameters of the scratch (such as length, width), the direction angle, and optionally, the confidence score and defect level label of the scratch defect are output for subsequent defect classification and quality inspection determination.To achieve rapid and accurate identification and positioning of scratch defects on the top of the square power battery shell, providing precise data support for subsequent defect handling.
[0028] Further, step S303 of the embodiment of the present application further includes: Specifically, first apply morphological opening operation to the edge image, perform erosion and dilation operations using an elongated structuring element to remove noise and connect broken edges, then perform thinning operation on the processed image to extract the edge skeleton with a single-pixel width; then identify all connected regions through the connected component labeling algorithm, and calculate the geometric features of each region, including the aspect ratio of the circumscribed rectangle and the main direction consistency, and screen out the regions with a larger aspect ratio and high direction consistency as candidate scratch regions that are slender and have consistent directions for subsequent detection and analysis.
[0029] S303-1: Perform opening operation processing on the edge image, where the opening operation includes performing erosion and dilation operations on the image using an elongated structuring element; S303-2: Perform thinning processing on the edge image after morphological processing to extract a linear edge skeleton structure with a single-pixel width; S303-3: Perform connected component labeling on the thinned image, extract all connected regions and obtain their geometric shape parameters; S303-4: Calculate the aspect ratio, area, and main direction linearity of the circumscribed rectangle of each connected region, perform feature extraction and classification recognition on the regions with an aspect ratio greater than the preset threshold and high direction consistency, extract candidate scratch regions, and establish a set of candidate scratch regions.
[0030] It should be understood that a morphological opening operation is performed on the binary edge image obtained after edge detection. The opening operation uses an elongated structural element. First, the image is eroded to remove isolated noise points and fine noise, and then dilated to restore the continuity and elongated structure of the edges, thereby effectively connecting broken edge lines and filtering out irregular noise, and highlighting the elongated contour features of potential scratches. A thinning process is performed on the edge image processed by the morphological opening operation. The thinning algorithm shrinks the edge region to a single-pixel width and extracts the skeleton linear structure of the edge. For example, when processing the edge map of a battery case image, an opening operation is performed on the image using a horizontal linear structural element with a length of 15 pixels and a width of 1 pixel. After erosion, most of the non-linear small spot noises in the original image are removed; then through dilation, the remaining elongated scratch edges are restored to form a clear and continuous contour of the candidate scratch area. This operation significantly improves the accuracy and integrity of scratch extraction in subsequent connected component analysis. This step can preserve the shape and orientation features of the scratches, facilitating subsequent connected region analysis and accurate identification. For the thinned binary skeleton map, a connected component labeling operation is performed. The system scans all connected pixel points in the image, identifies and extracts each independent connected region, calculates and records its geometric shape parameters, including the area of the region, the boundary shape, and the contour information, providing basic data for subsequent feature analysis. For each connected region, calculate the aspect ratio, area, and main direction linearity of its minimum bounding rectangle. The aspect ratio is used to measure the elongation degree of the region, the area is used to exclude too small noise regions, and the main direction linearity evaluates the direction stability of the region by analyzing the gray gradient or edge direction consistency. Connected regions with an aspect ratio greater than a preset threshold and high direction consistency are selected as scratch candidate regions, and further feature extraction and classification recognition are performed on them. Finally, a set of scratch candidate regions is established for subsequent scratch detection and positioning. That is, regions with an aspect ratio greater than a preset threshold (such as >5:1) and a high main direction linearity (such as the main axis direction consistency exceeding 0.8) are regarded as candidate regions with typical scratch morphology. For example, in a battery case detection image, the length of the minimum bounding rectangle of a connected region is 50 pixels and the width is 6 pixels, and the aspect ratio is approximately 8.3; the main direction of its gray distribution is consistent with the overall scratch direction, the linearity is 0.87, and the area is within the preset range. This region meets the scratch determination conditions and is thus included in the scratch candidate region set. All regions that meet the conditions are screened to form a preliminary scratch candidate region set, providing target inputs for subsequent feature extraction and classification recognition, and improving the accuracy and robustness of scratch recognition.
[0031] Furthermore, step S303-4 in the embodiment of the present application further includes: Specifically, for each connected region, first calculate the aspect ratio and area of its minimum bounding rectangle to characterize the geometric structure characteristics of the region. At the same time, use the principal component analysis (PCA) method to determine the principal direction of the region and evaluate its linearity based on this, which is used to characterize whether the region has an obvious linear arrangement trend. Subsequently, according to the preset screening conditions, including whether the aspect ratio is greater than the slenderness threshold, whether the area exceeds the minimum significance threshold, the degree of consistency between the principal direction and the expected scratch direction (for example, whether the principal direction angle deviation is less than the angle threshold), and whether the linear fitting residual is lower than the fitting quality threshold, etc., multi-dimensional feature extraction and preliminary classification recognition are performed on the above calculation results. Through the above condition judgment, regions with obvious slenderness, direction consistency, and good linear structure are extracted as scratch candidate regions, and finally a complete set of scratch candidate regions is established for subsequent defect recognition and analysis modules to call.
[0032] S303-4-1: Calculate the aspect ratio, area, and principal direction linearity of the minimum bounding rectangle for the connected regions of each scratch candidate region; S303-4-1-2: Screen the connected regions based on the preset threshold conditions. The preset screening conditions include that the aspect ratio is greater than the first threshold, the area is greater than the second threshold, the difference between the principal direction angle and the direction of the adjacent region is less than the preset angle threshold, and the linear fitting residual is less than the third threshold; S303-4-1-3: Extract multi-dimensional feature vectors including geometric features and texture features for the connected regions that meet the screening conditions, extract the scratch candidate regions, and establish a set of scratch candidate regions.
[0033] It should be understood that for each connected component of the scratch candidate region, geometric analysis operations are performed. First, the aspect ratio and area of its minimum bounding rectangle are calculated to characterize the slenderness and spatial occupancy characteristics of the region. At the same time, the principal component analysis (PCA) method is used to extract the principal direction vector of the connected component, and its principal direction linearity index is calculated to measure whether the region has obvious linear arrangement characteristics. Based on the set structural screening criteria, multi-condition constraints are imposed on the above geometric parameters and direction information to screen out suspected scratch regions. The screening rules include, but are not limited to: the aspect ratio is greater than the first threshold (e.g., 3.5), indicating that the region presents a slender structure; the area is greater than the second threshold (e.g., a certain number of pixel area units) to ensure that the region has a significant presence in the image; the angle difference between the principal direction of the region and the principal direction of its adjacent region is less than the preset angle threshold (e.g., 10°) to ensure the consistency of the overall scratch structure direction. For example, in the image of the top of the battery case, the aspect ratio of a connected region is 6.2, the area is 78 pixel², the angle of the principal direction only differs by 7° from the direction angle of the adjacent scratch region, and the average residual of the fitted line is 1.5. This region meets all four screening conditions and is therefore retained as a suspected scratch region and included in the candidate scratch region set. This fine screening method based on multiple geometric and directional indicators significantly improves the accuracy and robustness of scratch defect recognition. In addition, the least squares residual of the region contour fitting line is less than the third threshold to verify the quality of the linear fitting of the region edge. For all connected component regions that meet the above screening conditions, their multi-dimensional feature vectors are further extracted. The feature dimensions include geometric structure features (such as length, width, and the angle of the bounding rectangle), texture features (such as gray variance, gradient direction consistency, edge energy distribution, etc.), so as to construct a scratch candidate region set and provide high-confidence input candidate regions for the subsequent classification and recognition module.
[0034] S400: Use a deep learning model to perform primary defect recognition on the preprocessed image, comprehensively detect the scratch defect positions, and output defect candidate regions containing confidence scores. The primary defect recognition is to identify pits, dirt, coating unevenness, and foreign objects.
[0035] Specifically, first, the preprocessed standardized image is input into the main defect recognition module. Based on a pre-trained deep learning model (such as an improved convolutional neural network CNN or a multi-scale feature fusion network), this module extracts features and classifies and identifies various possible defect types in the image. This model has the ability to perceive minute features under complex backgrounds and can accurately identify typical main defect types including pits, dirt, uneven coatings, and foreign objects. By combining the spatial position relationships in the feature map, it determines the overlap with the scratch candidate regions to achieve comprehensive defect detection for the scratch-related regions. During the recognition process, the model outputs candidate detection results containing defect type labels, confidence scores, and regional position coordinates for each suspected defect region, thus forming a structured set of defect candidate regions for subsequent confidence screening and multi-category determination processing.
[0036] Furthermore, step S400 of the embodiment of the present application further includes: S401: Input the preprocessed standardized image data into a multi-category object detection deep learning model, and the multi-category object detection deep learning model is constructed based on a convolutional neural network; S402: The multi-category object detection deep learning model generates candidate defect regions through multi-layer feature extraction and classifies each candidate defect region to identify main defect categories including pits, dirt, and foreign objects; S403: Output a category label and the corresponding confidence score for each candidate defect region and screen out effective defect regions through a preset confidence threshold; S404: Perform fusion determination on the same defect in multi-view images; S405: For the scratch defect positions obtained from the front vision scratch detection, combined with the detection results of the deep learning model, perform comprehensive defect detection and output a set of defect candidate regions including scratches and main defects, along with position and confidence information.
[0037] It should be understood that in step S401, the image data after being normalized by the image preprocessing module is input into a multi-class object detection deep learning model. The multi-class object detection deep learning model is constructed based on an improved convolutional neural network (CNN) and has multi-scale perception and feature fusion capabilities, enabling the recognition and localization of various surface defects in the image. The image data after being normalized by the image preprocessing module is input into the multi-class object detection deep learning model. This model is constructed based on the architecture of an improved convolutional neural network (CNN) and has multi-scale perception and feature fusion capabilities, capable of simultaneously capturing defect features of different sizes and shapes, and realizing the accurate recognition and localization of various surface defects in the image. For example, when detecting the surface of a battery casing, this model can effectively identify defects such as pits, stains, uneven coatings, and foreign objects. Regardless of the significant differences in defect sizes, it can accurately label their positions and categories through multi-scale feature fusion, thereby greatly improving the comprehensiveness and accuracy of defect detection. In step S402, the model extracts key feature information such as the space, texture, and edges of the image through a multi-layer convolution and feature extraction network, and then generates multiple candidate defect regions, and performs category prediction on each candidate region to identify the main defect types including pits, stains, uneven coatings, and foreign objects. In step S403, each candidate defect region outputs the corresponding defect category label and confidence score, and eliminates the low-confidence regions according to a preset confidence threshold, only retaining the valid defect regions with high confidence. In step S404, for the recognition results of the same defect in multi-view images, the system performs fusion determination on the defect candidate regions from different views through methods such as feature matching and spatial position verification, and uniformly determines the final position and category information of the defect. For example, when suspected pit defects are detected on the surface of a battery casing in both the front and side views, the system will merge these candidate regions into a single defect entity according to the spatial coordinates and feature similarities of the defects in different images, avoiding duplicate counting, and comprehensively using multi-view information to improve the accuracy and reliability of defect recognition. In step S405, the system integrates the scratch defect positions output by the aforementioned scratch detection module with the candidate results of the main defect recognition model, conducts joint analysis and supplementation of the multi-type defect information in the same region, and realizes the comprehensive recognition of typical defects such as scratches, pits, stains, uneven coatings, and foreign objects on the surface of the battery casing. Finally, a set of defect candidate regions including defect categories, position coordinates, and confidence scores is output, providing basic data support for the subsequent quality inspection strategy execution. For example, when detecting the battery casing, the system not only identifies the elongated scratch regions on the surface, but also accurately locates the pit defects on the surface in combination with the deep learning model, forming a complete set of defect information, improving the comprehensiveness and accuracy of defect detection.
[0038] Furthermore, step S403 of the embodiment of the present application further includes: S403-1: Set a set of confidence threshold parameters for each type of defect in advance. The confidence threshold can be flexibly configured according to actual detection requirements; S403-2: Perform multi-class classification operations on each defect candidate region identified by the deep learning model, and output defect category labels including pits, dirt, uneven coating, foreign objects, etc. and their corresponding confidence scores; S403-3: Compare the confidence scores with the pre-set confidence thresholds corresponding to various types of defects, and retain the candidate regions with confidence higher than their corresponding category thresholds as effective defect regions; S403-4: When there is overlap between candidate regions, retain the region with the highest confidence based on the non-maximum suppression algorithm NMS; S403-5: Output the structured defect information result, including the position coordinates, defect category label, confidence score, and image perspective identifier of each effective defect region.
[0039] It should be understood that for each candidate defect area detected by the deep learning model, the system outputs the corresponding defect category label (such as pit, dirt, uneven coating, foreign object, etc.) and the corresponding confidence score based on the multi-class classification result, which is used to quantify the reliability of the model's judgment that the area belongs to a specific defect category. For example, for the critical defect of pit, a relatively high confidence threshold (such as 0.8) is set to ensure that only highly reliable detection results are adopted; while for the relatively minor dirt defect, a lower threshold (such as 0.5) can be set to avoid missing relatively minor stains. By flexibly configuring the confidence threshold, the system can balance the accuracy and recall rate of detection and meet the quality control requirements in different application scenarios. Subsequently, the confidence score is compared with the preset confidence thresholds for various types of defects, and only the candidate areas with a confidence higher than the threshold of their respective categories are retained as valid defect areas, thereby filtering out uncertain or misjudged detection results and improving the accuracy and credibility of the final output. A set of corresponding confidence threshold parameters is preset for each main defect category, and the threshold can be flexibly configured and adjusted according to different application scenarios, detection accuracy requirements, and actual sample statistics results. For each defect candidate area identified by the deep learning model, a multi-class classification operation is performed to output prediction labels for defect categories including pits, dirt, uneven coating, and foreign objects, and a corresponding confidence score is generated for each label. The above confidence scores are compared one by one with the preset confidence thresholds for various types of defects, and the defect candidate areas with a confidence higher than the corresponding category thresholds are retained as valid defect areas, thereby eliminating low-confidence or misdetected areas and improving the detection accuracy. When there is overlap or partial coincidence between multiple candidate areas, the non-maximum suppression (NMS) algorithm is further applied to process the overlapping areas, and only the defect area with the highest confidence score is retained to avoid duplicate marking or redundant identification. Finally, a structured defect information result is output, and this structured result includes the position coordinates of each valid defect area in the image, the corresponding defect category label, the confidence score value, and the perspective identifier of the current image (such as top view, oblique view, or side view), providing a basic basis for subsequent defect fusion and quality assessment.
[0040] S500: Obtain low-confidence defect candidate areas, perform local image enhancement, texture analysis, and secondary classification operations on the low-confidence defect candidate areas to identify bubble-like defects.
[0041] Specifically, for the defect candidate regions with confidence levels lower than the preset threshold but still having suspicious features, the system marks them as low-confidence regions and extracts them separately. Subsequently, local image enhancement processing is performed to enhance the detail contrast and edge structure within the regions for more accurate subsequent analysis. Based on the enhanced image, local texture features such as gray-level co-occurrence matrix, local binary pattern (LBP), etc. are further extracted to analyze their texture distribution characteristics and local structure rules. Combining the extracted texture features, a lightweight secondary classifier is used to re-identify the region, and modeling judgments are made specifically for the typical features such as blurred edges, uneven texture, and local circularity of bubble-like defects, so as to achieve effective supplementary identification of bubble-like defects with unclear initial identification and improve the defect identification integrity and robustness of the overall detection system.
[0042] Furthermore, step S500 of the embodiment of the present application further includes: S501: Based on the output of the main defect recognition stage, filter the candidate defect regions with confidence scores lower than the preset first threshold to form a low-confidence candidate region set; S502: Perform local image enhancement processing on the low-confidence candidate regions, and the enhancement processing includes local contrast enhancement, edge enhancement, and image sharpening; S503: Extract texture features from the enhanced image region, including local binary pattern LBP, gray-level co-occurrence matrix GLCM features, and Gabor filter responses; S504: Input the texture features into a binary classifier for bubble recognition to perform secondary defect recognition and output the recognition label and corresponding confidence score of the bubble-like defect; S505: If the confidence score corresponding to the output bubble-like defect is higher than the second threshold, determine the current candidate region as a bubble-like defect and add it to the final defect region set.
[0043] It should be understood that in the defect identification process of the present invention, for the candidate defect regions with confidence scores lower than the preset first threshold in the main defect identification stage, the following operations are specifically performed to identify potential bubble-like defects: S501, first, screen out all candidate regions with insufficient confidence to form a set of low-confidence candidate regions; judge the confidence scores of all candidate defect regions output by the deep learning model, and screen out the regions with confidence lower than the preset first threshold. These regions are not included in the main defect detection results due to insufficient scores, but may still contain weak or marginal defects that have not been accurately identified. Through this screening operation, an independent set of low-confidence candidate regions is constructed, providing a target region basis for subsequent local enhancement processing and fine identification, and ensuring the comprehensiveness and reliability of the overall detection results in terms of coverage and recognition accuracy. For example, during the detection process, the confidence scores of some scratch regions are 0.55 and 0.50, both lower than the threshold of 0.6. Therefore, these regions will be classified into the set of low-confidence candidate regions and wait for subsequent enhancement and secondary identification processing, so as to prevent defect omission caused by uncertain preliminary identification and improve the integrity and accuracy of the overall detection. S502, perform local image enhancement processing on these regions to improve the distinguishability of weak features in the local image by enhancing its contrast, edge sharpness, and overall sharpness; S503, extract representative texture features on the enhanced image, including local binary pattern (LBP) to capture fine-grained texture, gray-level co-occurrence matrix (GLCM) to describe the gray-level distribution relationship, and Gabor filter response to identify texture information in specific directions and scales; S504, the extracted texture features will be input into a pre-trained binary classifier for bubble defects for secondary identification, and output a determination label indicating whether it is a bubble defect and its corresponding confidence score; the extracted texture features will be input into a pre-trained binary classifier for bubble defects for targeted secondary identification. This classifier is trained based on typical bubble defect samples and can effectively identify small circular or semi-transparent regions with specific texture patterns. The input texture features include the local structural distribution reflected by the local binary pattern (LBP), the pixel gray-level co-occurrence characteristics described by the gray-level co-occurrence matrix (GLCM), and the directional texture frequency information revealed by the Gabor filter response. The classifier outputs a determination label (such as "yes" or "no") indicating "whether it is a bubble defect" for each input region, and gives the corresponding confidence score (such as 0.92 indicating a highly credible bubble defect). For example, for a certain candidate region, the texture features extracted after image enhancement show a fine radial texture structure. After being input into the classifier, the output result is "yes, it is a bubble defect" with a confidence score of 0.87, that is, this region is determined to be a bubble-like defect and has a high recognition credibility. This step improves the recognition ability of weakly dominant bubble defects and enhances the detection robustness of the system in a complex defect environment.S505. If the confidence score is higher than the set second threshold, the candidate region is confirmed as a bubble - type defect and added to the set of defect regions in the final output, realizing the supplementary detection of bubble defects missed in the main recognition stage. If the confidence score of the bubble defect output by the binary classifier is higher than the preset second threshold (e.g., 0.75), the system determines that the candidate region is a bubble - type defect and incorporates it into the final defect region set, thus supplementing the bubble defects not recognized in the main recognition stage due to low confidence. For example, if a certain image region only obtains a confidence of 0.6 in the main defect recognition stage and fails the initial screening, but after the texture analysis enhanced by the binary classifier, the confidence is increased to 0.8, the system will recognize it as a valid bubble defect, ensuring more comprehensive and accurate detection results.
[0044] S600: Summarize the recognition results of defect candidate regions and generate an annotated image, and at the same time output the defect type, location, and severity information to the quality inspection system.
[0045] Specifically, summarize all the screened and classified defect candidate regions, combine the defect category labels, location information, and confidence scores of each region to generate a defect image with clear annotations, indicating the location and category of the defects. At the same time, according to the confidence and preset severity rules, assign a corresponding severity level to each defect, and synchronously output the structured data including the defect type, specific location coordinates, and severity level to the backend quality inspection system to realize the visual display of defect information and support for subsequent quality management decisions.
[0046] Furthermore, step S600 of the embodiment of the present application further includes: S601: Summarize the recognition results of multiple defect candidate regions, where the defect candidate regions include defect type, defect location, and defect severity information; S602: Merge the defect candidate regions with spatial overlap or adjacency according to a preset overlap degree threshold to generate a non - duplicate set of defect regions; S603: Classify and count the merged defect regions according to the defect type to obtain the quantity and proportion of each defect category; S604: Grade the severity of the defects based on indicators such as the confidence score and area of the defects; S605: Annotate the merged defect regions on the original high - resolution image, use different colors or graphics to identify different defect types, and add text labels of the defect type and severity at the corresponding positions to generate an annotated image; S606: Package the defect type, defect location, and severity information into a structured data format and upload it to the quality inspection system through a preset communication interface; S607: The quality inspection system receives the defect detection results and the annotated image, and automatically triggers an alarm notification for defects whose severity exceeds the preset threshold.
[0047] It should be understood that in step S601, the recognition results of multiple defect candidate regions are first summarized, and these results include information such as the type, specific location, and severity of the defects; when summarizing the recognition results of multiple defect candidate regions, the system will integrate the defect types of each region (such as scratches, pits, bubbles, etc.), specific spatial position coordinates (such as pixel coordinates or physical size positions of the center point at the top of the outer shell), and the severity level of the defects (such as minor, medium, severe), etc., to form a complete defect information list. For example, the system may identify a slender scratch located in the upper left corner of the battery outer shell with a medium severity; another pit on the right side with a severe severity; and a bubble defect in the top region with a minor severity. All these information will be unified and summarized for subsequent statistical analysis and quality assessment. In step S602, for defect regions that overlap or are adjacent in space, they are merged according to a preset overlap threshold to eliminate duplicates and generate a unique and clear set of defect regions; for defect regions that overlap or are adjacent in space, the system will judge according to a preset overlap threshold (for example, the intersection-over-union ratio of two defect regions exceeds 70%), and merge multiple overlapping or closely adjacent defect regions into a unified defect region, so as to avoid duplicate statistics and redundant annotation. For example, if two scratch candidate regions are detected on the surface of the battery outer shell, they partially overlap in the image and the intersection-over-union ratio reaches 80%, the system will merge these two regions into a larger scratch region to ensure that each defect in the output set of defect regions is uniquely and clearly represented, improving the accuracy and readability of the detection results. In step S603, the merged defect regions are classified and counted according to the defect type, and the number and proportion of each type of defect are calculated to provide data support for subsequent analysis; in step S604, the severity level of the defects is determined by grading according to key indicators such as the confidence score and defect area of each defect; according to key indicators such as the confidence score and defect area of each defect, the system will determine the severity level of the defects by grading. For example, when a certain defect has a high confidence score and a large defect area, the system will classify it as the "severe" level and needs to be prioritized for attention and handling; while defects with a low confidence and a small area are classified as the "minor" level and recorded as secondary defects. For example, a pit on the battery outer shell with a confidence of 0.95 and an area exceeding 50 square millimeters will be marked as a "severe defect", while a stain with a confidence of 0.6 and an area of only 5 square millimeters will be judged as a "minor defect", thus realizing scientific and reasonable defect management and quality control.In step S605, visual annotation is performed on the merged defect regions on the original high-resolution image. Different defect types are identified by different colors or shapes, and at the same time, text labels are added at the corresponding positions to display the defect category and severity level, generating a clear annotation image. On the original high-resolution image, visual annotation is performed on the defect regions that have undergone merging processing. Different types of defects are distinguished by different colors or shapes. For example, a red box is used to identify pits, a blue circle is used to identify dirt, and a yellow triangle is used to identify uneven coating. At the same time, text labels are added beside each annotation area to display the category name and severity level of the defect, such as "pit - severe" or "dirt - minor", thereby generating an intuitive and information-rich annotation image, which is convenient for quality inspection personnel to quickly identify and judge the defect situation. For example, on the battery housing image, a red rectangle appears in the upper left corner with the text "pit - severe", and "dirt - minor" is marked beside the blue circle on the right, improving the readability of the defect detection results and the on-site application efficiency. In step S606, information such as the type, location, and severity of the defects is encapsulated into structured data and uploaded to the quality inspection system through a preset communication interface to achieve real-time synchronization and management of the data. The key information such as the detected defect type, specific position coordinates, and severity level is encapsulated according to a predefined data structure to form a standardized structured data format (such as JSON or XML), and is uploaded to the quality inspection system in real time through a preset communication interface (such as TCP / IP protocol, HTTP API, or industrial fieldbus) to achieve instant synchronization and centralized management of the defect data. For example, when a defect of "uneven coating - medium severity" is detected on a certain battery housing, the system encapsulates the type, specific coordinate position in the image, and severity level of the defect and sends it to the quality inspection platform in real time to ensure that quality inspection personnel can obtain the latest defect information in a timely manner, facilitating subsequent tracking and processing and quality control. Finally, in step S607, the quality inspection system automatically identifies the defects whose severity exceeds the preset threshold based on the received defect detection results and annotation images and triggers an alarm notification to ensure timely response and processing.
[0048] In summary, the embodiments of the present application at least have the following technical effects: Through the preprocessing method combining image edge enhancement, morphological processing, and connected component analysis, the present application determines the scratch candidate regions with directional and slender characteristics and constructs a multi-stage defect detection framework including main defect recognition, bubble supplementary recognition, and result visualization output.
[0049] By integrating a multi-class object detection model based on deep learning with a traditional texture feature analysis algorithm, high-precision recognition and screening of multiple types of defects such as pits, dirt, foreign objects, and bubbles are achieved. Combining a multi-view defect fusion strategy with a confidence dynamic threshold mechanism, the purpose of improving the recognition accuracy and robustness is achieved, and the structured output of the defect type, location, and severity is realized, and it is linked with the quality inspection system in real time.
[0050] Embodiment 2, based on the same inventive concept as the method for rapid visual defect detection of a square power battery case in the foregoing embodiment, as Figure 2 shown, the present application provides a rapid visual defect detection system for a square power battery case. The system in the embodiment of the present application and the method embodiment are based on the same inventive concept. Among them, the system includes: A multi-view image acquisition module 10, which is used to use a multi-view image acquisition device to acquire images of multiple surface positions and angles of the square power battery case to obtain a high-resolution multi-view image sequence. The multi-view image acquisition device includes multiple industrial cameras, which are respectively arranged in the top view, oblique view, and side view directions to form a three-dimensional imaging array around the top and side of the case; An image preprocessing module 20, which is used to preprocess the image sequence and output standardized image data; A front vision scratch detection module 30, which is used to perform front vision scratch detection on the standardized image data, execute rapid scratch recognition based on edge features, and output the scratch defect position and features. The front vision scratch detection is to identify the slender scratch area based on the linear structure enhancement algorithm combined with morphological processing; A main defect recognition module 40, which is used to use a deep learning model to perform main defect recognition on the preprocessed image, perform comprehensive defect detection on the scratch defect position, and output a defect candidate area including a confidence score. The main defect recognition is to identify pits, dirt, coating unevenness, and foreign objects; A bubble defect recognition module 50, which is used to obtain a low-confidence defect candidate area, perform local image enhancement, texture analysis, and secondary classification operations on the low-confidence defect candidate area, and identify bubble defects; A data output module 60, which is used to summarize the recognition results of the defect candidate area and generate an annotated image, and at the same time output the defect type, location, and severity information to the quality inspection system.
[0051] It should be noted that the above order of the embodiments of the present application is only for description and does not represent the superiority or inferiority of the embodiments. In addition, the specific embodiments of this specification have been described. Moreover, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0052] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
[0053] This specification and the drawings are only exemplary descriptions of the present application and are considered to have covered any and all modifications, variations, combinations, or equivalents within the scope of the present application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalent technologies, the present application is intended to include these changes and modifications.
Claims
1. A rapid visual defect detection method for a square power battery housing, characterized in that, The method includes: S100. Using a multi-view image acquisition device, acquire images of multiple faces and angles of the square power battery housing to obtain a high-resolution multi-view image sequence. The multi-view image acquisition device includes multiple industrial cameras, which are respectively arranged in the top view, oblique view, and side view directions to form a three-dimensional imaging array around the top and side of the housing; S200. Preprocess the image sequence and output standardized image data; S300. Perform pre-visual scratch detection on the standardized image data, execute fast scratch recognition based on edge features, and output the scratch defect position and features; S400. Use a deep learning model to perform main defect recognition on the preprocessed image, perform comprehensive defect detection on the scratch defect position, and output defect candidate regions including confidence scores. The main defect recognition is to identify pits, dirt, and foreign objects; S500. Obtain low-confidence defect candidate regions, perform local image enhancement, texture analysis, and secondary classification operations on the low-confidence defect candidate regions to identify bubble-like defects; S600. Summarize the recognition results of the defect candidate regions and generate an annotated image, and at the same time output the defect type, position, and severity information to the quality inspection system.
2. The rapid visual defect detection method for a square power battery housing according to claim 1, characterized in that, The preprocessing of the image sequence and outputting standardized image data includes: Perform lens distortion correction on the image sequence to correct the geometric distortion caused by the industrial camera imaging; Perform image alignment and spatial registration on the images from different angles to establish a unified spatial reference coordinate system; Perform denoising processing on the image using the methods of Gaussian filtering and non-local means; Perform image enhancement operations, including contrast enhancement, edge sharpening, and brightness equalization; Uniformly convert the image to a predetermined gray or color space, and adjust it to a unified resolution and data format to obtain standardized image data.
3. A rapid visual defect detection method for a square power battery housing as described in claim 1, characterized in that The pre-visual scratch detection of the standardized image data, executing fast scratch recognition based on edge features, and outputting the scratch defect position and features includes: S301. Extract the front-view image data corresponding to the top region of the battery housing in the multi-view image sequence as the detection input image; S302. Perform edge enhancement processing on the front-view image, use an edge detection operator to extract the linear structures with directionality and continuity in the image to obtain an edge image. The edge detection operator is a combination of Sobel and Canny; S303. Perform morphological processing on the edge image, and combine the connected component analysis algorithm to extract slender and directionally consistent candidate scratch regions; S304. Perform geometric and texture feature analysis on the candidate scratch regions, including calculating features such as region length, width, and gray gradient direction consistency, and screening the real scratch regions based on a threshold; S305. Output the position information and feature parameters of the real scratch region, including position coordinates, size parameters, and optional confidence scores and defect level labels.
4. The rapid visual defect detection method for a square power battery housing as described in claim 3, characterized in that, The morphological processing of the edge image and combining the connected component analysis algorithm to extract slender and directionally consistent candidate scratch regions includes: S303-1. Perform an opening operation on the edge image. The opening operation includes eroding and dilating the image using an elongated structuring element. S303-2. Perform a thinning operation on the edge image after morphological processing to extract a single-pixel-width linear edge skeleton structure. S303-3. Perform connected component labeling on the thinned image to extract all connected components and obtain their geometric shape parameters. S303-4. Calculate the aspect ratio, area, and main direction linearity of the circumscribed rectangle for each connected component. Based on preset screening conditions, perform feature extraction and classification recognition on the calculation results, extract scratch candidate regions, and establish a set of scratch candidate regions.
5. A rapid visual defect detection method for a square power battery housing according to claim 4, characterized in that, The step of calculating the aspect ratio, area, and main direction linearity of the circumscribed rectangle for each connected component, performing feature extraction and classification recognition on the calculation results based on preset screening conditions, extracting scratch candidate regions, and establishing a set of scratch candidate regions includes: Calculate the aspect ratio, area, and main direction linearity of the minimum circumscribed rectangle for the connected component of each scratch candidate region. Screen the connected components based on preset threshold conditions. The preset screening conditions include an aspect ratio greater than a first threshold, an area greater than a second threshold, a difference in the main direction angle from the direction of the neighboring region less than a preset angle threshold, and a linear fitting residual less than a third threshold. Extract a multi-dimensional feature vector including geometric features and texture features for the connected components that meet the screening conditions, extract scratch candidate regions, and establish a set of scratch candidate regions.
6. A rapid visual defect detection method for a square power battery housing as described in claim 1, characterized in that, The step of using a deep learning model to perform main defect recognition on the preprocessed image, perform comprehensive defect detection on the scratch defect positions, and output a set of defect candidate regions including confidence scores. The main defect recognition is to identify pits, stains, and foreign objects, and includes: Input the preprocessed standardized image data into a multi-class object detection deep learning model, which is constructed based on a convolutional neural network. The multi-class object detection deep learning model generates candidate defect regions through multi-layer feature extraction and classifies each candidate defect region to identify the main defect categories including pits, stains, and foreign objects. Output a class label and the corresponding confidence score for each candidate defect region, and screen the effective defect regions through a preset confidence threshold. Perform fusion determination on the same defect in multi-view images. For the scratch defect positions obtained from the front vision scratch detection, combined with the detection results of the deep learning model, perform comprehensive defect detection and output a set of defect candidate regions including scratches and main defects, along with position and confidence information.
7. A rapid visual defect detection method for a square power battery housing as described in claim 6, characterized in that, The step of outputting a class label and the corresponding confidence score for each candidate defect region and screening the effective defect regions through a preset confidence threshold includes: Pre-set a set of confidence threshold parameters for each type of defect. The confidence threshold can be flexibly configured according to actual detection requirements. Perform multi-class classification operations on each defect candidate region recognized by the deep learning model and output the defect class labels including pits, stains, coating unevenness, foreign objects, etc., and their corresponding confidence scores. Compare the confidence scores with the preset confidence thresholds corresponding to various types of defects, and retain the candidate regions with confidence higher than their corresponding category thresholds as valid defect regions; When there is an overlap between candidate regions, retain the region with the highest confidence based on the non-maximum suppression algorithm NMS; Output the structured defect information results, including the position coordinates, defect category labels, confidence scores, and image perspective identifiers of each valid defect region.
8. The rapid visual defect detection method for a square power battery housing as described in claim 1, characterized in that, Obtain the low-confidence defect candidate regions, and perform local image enhancement, texture analysis, and secondary classification operations on the low-confidence defect candidate regions to identify bubble-like defects, including: Based on the output of the main defect recognition stage, filter the candidate defect regions with confidence scores lower than the preset first threshold to form a set of low-confidence candidate regions; Perform local image enhancement processing on the low-confidence candidate regions, and the enhancement processing includes local contrast enhancement, edge enhancement, and image sharpening; Extract texture features from the enhanced image regions, including local binary pattern LBP, gray-level co-occurrence matrix GLCM features, and Gabor filter responses; Input the texture features into a binary classifier for bubble recognition, perform secondary defect recognition, and output the recognition labels and corresponding confidence scores of bubble-like defects; If the confidence score corresponding to the output bubble-like defect is higher than the second threshold, determine the current candidate region as a bubble-like defect and add it to the final defect region set.
9. A rapid visual defect detection method for a square power battery shell as described in claim 1, characterized in that, Summarize the recognition results of the defect candidate regions and generate an annotated image, and at the same time output the defect type, position, and severity information to the quality inspection system, including: Summarize the recognition results of multiple defect candidate regions, and the defect candidate regions include defect type, defect position, and defect severity information; Merge the defect candidate regions with spatial overlap or adjacency according to the preset overlap degree threshold to generate a set of non-repeated defect regions; Classify and count the merged defect regions according to the defect type to obtain the quantity and proportion of each defect category; Based on indicators such as the confidence score and area of the defect, classify the severity of the defect; Annotate the merged defect regions on the original high-resolution image, use different colors or graphics to identify different defect types, and add text labels of the defect type and severity at the corresponding positions to generate an annotated image; Package the defect type, defect position, and severity information into a structured data format and upload it to the quality inspection system through a preset communication interface; The quality inspection system receives the defect detection results and the annotated image, and automatically triggers an alarm notification for defects with a severity exceeding the preset threshold.
10. A rapid visual defect detection system for the shell of a square power battery, characterized in that, The system includes: A multi-perspective image acquisition module, which is used to use a multi-perspective image acquisition device to acquire images of multiple surface positions and angles of a square power battery housing to obtain a high-resolution multi-perspective image sequence. The multi-perspective image acquisition device includes multiple industrial cameras, which are respectively set in the top view, oblique view, and side view directions to form a three-dimensional imaging array around the top and side of the housing; An image preprocessing module, which is used to preprocess the image sequence and output standardized image data; Front vision scratch detection module, which is used to perform front vision scratch detection on the standardized image data, execute fast scratch recognition based on edge features, and output the scratch defect position and features; Main defect recognition module, which is used to perform main defect recognition on the preprocessed image by using a deep learning model, perform comprehensive defect detection on the scratch defect position, and output defect candidate regions including confidence scores. The main defects are recognized as pits, dirt, coating unevenness, and foreign objects; Bubble-like defect recognition module, which is used to obtain low-confidence defect candidate regions, perform local image enhancement, texture analysis and secondary classification operations on the low-confidence defect candidate regions, and identify bubble-like defects; Data output module, which is used to summarize the recognition results of defect candidate regions and generate an annotated image, and at the same time output defect type, position and severity information to the quality inspection system.
Citation Information
Patent Citations
Improved YOLOv5-based battery case end face defect real-time detection method
CN114972316A
Battery shell appearance defect image processing method and device
CN116228684A
Visual detection method and system for surface defects of battery cover plate
CN117152129A
On-line detection method and system for coating quality of automobile skylight glass
CN119915841A
Method for size measurement and appearance detection of O-shaped ring
CN119919410A
Cited By
Gamma camera resolution imaging data processing method and system
CN120563327A
A method and system for processing resolution imaging data of a gamma camera
CN120563327B
SiC MOSFET device internal structure defect identification method and system
CN120744387A
Hull surface defect detection system based on machine vision
CN120807528A
Mobile phone shell assembly defect detection method and system
CN120852371A