An AI algorithm-based energy storage socket full appearance visual detection method and system
By employing an AI-based full-appearance visual inspection method, combined with color imaging, black-and-white imaging, and multispectral components, efficient and accurate inspection of energy storage sockets has been achieved. This solves the problems of poor adaptability and high cost of traditional equipment, and improves inspection efficiency and accuracy.
Patent Information
- Application Number
- CN202511134770.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-14
AI Technical Summary
Existing energy storage socket appearance inspection technology has limited ability to identify complex defects, making it difficult to adapt to the inspection of products of different specifications. Furthermore, traditional equipment is costly and inefficient, making it difficult to meet the needs of large-scale mass production.
A full-appearance visual inspection method based on AI algorithms is adopted, which combines color imaging equipment, black and white imaging equipment and multispectral components. Through dynamic focusing, rotation drive device and pressure sensor, multi-field image stitching and multispectral data processing are realized to build a defect detection model and integrate multi-source data for consistency verification.
It achieves full coverage testing of energy storage sockets of different specifications, improves testing accuracy and efficiency, reduces equipment costs, identifies minute defects, and effectively solves the problems of cost and space constraints of traditional equipment that were not effectively addressed in the patent and the dedicated technology. It also improves the flexibility of the production line and the accuracy of testing.
Smart Images

Figure CN120629205B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy storage socket manufacturing, specifically to a method and system for full-appearance visual inspection of energy storage sockets based on AI algorithms. Background Technology
[0002] With the rapid development of the new energy industry, energy storage sockets, as key equipment for energy storage and transmission, directly affect their safety and reliability in terms of appearance quality and structural integrity. Currently, the appearance inspection of energy storage sockets mainly relies on traditional visual inspection techniques or manual sampling, which has the following significant drawbacks:
[0003] Existing technologies mostly use black and white cameras combined with traditional image processing algorithms for detection, which has limited ability to identify complex defects, low defect detection rate, and high rate of missed detection of defective products, especially in the case of subtle defects. The detection results are easily affected by the color difference of the product. For dark products such as black energy storage sockets, the detection fails due to insufficient contrast. As for the detection of whether the buckle is properly assembled, since traditional algorithms rely only on visual contour judgment, they cannot distinguish the phenomenon of false buckles that appear to be in place but are not actually locked.
[0004] Energy storage sockets come in various length, width, and height specifications. Traditional inspection equipment has a fixed camera position, which, limited by depth of field, cannot adapt to the inspection needs of products of different heights. When the height difference of products exceeds a certain value, the image is easily blurred, making it impossible to achieve full coverage inspection of products of different specifications. Frequent manual adjustments to equipment parameters are required, severely impacting production efficiency. At the same time, to cover complex areas such as the sides, traditional solutions require multiple sets of cameras, resulting in large equipment space occupation and high costs. Furthermore, the high proportion of manual verification further reduces inspection efficiency, making it difficult to meet the needs of large-scale mass production.
[0005] Therefore, in order to solve the problems existing in the prior art, this invention proposes a method and system for full-appearance visual inspection of energy storage sockets based on AI algorithms. Summary of the Invention
[0006] In view of the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for full-appearance visual inspection of energy storage sockets based on AI algorithms.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] A visual inspection method for the entire appearance of an energy storage socket based on an AI algorithm includes the following steps:
[0009] The image acquisition process involves adjusting the relative position of the imaging device and the energy storage socket based on the read specifications. A color imaging device is used to acquire images of the upper and lower surfaces, sides, and socket hole array of the energy storage socket to obtain a socket sample image. A black-and-white imaging device combined with a multispectral component is used to acquire images of the wiring copper posts to obtain a copper post sample image.
[0010] The data analysis and processing steps involve preprocessing the socket sample image and the copper pillar sample image, and generating a model training dataset through multi-view image stitching, key region feature extraction and multispectral data processing.
[0011] The socket defect detection steps involve constructing a defect detection model based on the model training dataset. The defect detection model includes a hole detection module, a plating detection module, a snap-fit detection module, and a sealing strip detection module. The real-time acquired image of the energy storage socket to be tested is input into the defect detection model, and the consistency is verified by combining the output results of each module. Finally, a comprehensive detection result including defect type, defect location, and confidence level is output.
[0012] As a further improvement of the present invention, the color imaging device is equipped with a dynamic focusing lens, which synchronously reads the real-time angle data of the rotation drive device during the acquisition process. When the rotation angle changes to a preset angle threshold, the dynamic focusing lens automatically adjusts the focal length to compensate for the defocus caused by motion offset. The color imaging device is linked with the ultraviolet light source component and adopts a segmented exposure mode for the sealing strip area. The exposure intensity is dynamically adjusted according to the curvature of the sealing strip and the rotation angle. When rotating to the corresponding station of the buckle, the color imaging device and the pressure sensing component are triggered synchronously to acquire the appearance image of the buckle and record the associated data at the time of pressure acquisition. The black and white imaging device works synchronously with the multispectral component to acquire time-series images of the wiring copper post. Its exposure parameters are dynamically adjusted with the rotation speed to avoid motion blur. At each preset rotation angle interval, a set of image data including the copper post size and coating spectral characteristics is acquired.
[0013] As a further improvement of the present invention, the data analysis and processing steps include: extracting features from the socket sample image to obtain a snap-fit area image, a hole image, and a sealing strip image; establishing a mapping model between rotation angle and pixel offset based on the encoder data of the rotary drive device; calibrating images acquired at different angles and completing multi-field motion compensation stitching; correcting the influence of rotation angle on spectral reflectance through polynomial fitting; associating the corrected multispectral data with the size data of the copper pillar sample image to generate a two-dimensional feature matrix of size and spectrum; performing motion blur removal on the snap-fit area image; and extracting the gap width between the snap-fit and the slot and the snap-fit deformation area after blur correction as snap-fit dynamic features.
[0014] As a further improvement of the present invention, the detection process of the hole position detection module includes: receiving a socket hole array image after multi-field motion compensation stitching; removing noise through an image preprocessing algorithm; calibrating the pixel coordinate system of the hole position area based on rotation angle data; extracting the inner edge contour of each socket hole using a high-precision edge detection algorithm; calculating the coordinates of the hole position center and mapping and aligning them with the hole position coordinates in the standard template; identifying the hole position offset through coordinate deviation calculation; performing dynamic threshold segmentation on the area inside the hole; identifying foreign objects inside the hole by combining morphological operations; and outputting the hole position defect type and location information as the hole position detection result.
[0015] As a further improvement of the present invention, the detection process of the coating detection module includes: acquiring the wiring copper pillar size data and the spectral data of the multispectral component of the copper pillar sample image; calibrating the coordinate system of the copper pillar image based on the position information output by the hole position detection module; extracting the characteristic bands of coating oxidation through a feature band extraction algorithm; correcting the influence of angle offset on reflectivity by combining rotation angle data; fusing the corrected spectral data with the size data; identifying coating oxidation, scratches and pinhole defects; and outputting the coating defect type and associated copper pillar size deviation information.
[0016] As a further improvement of the present invention, the detection process of the buckle detection module includes: receiving the buckle area image acquired by the color imaging device and the contact pressure value synchronously acquired by the pressure sensing component; locating the coordinate area of the buckle in the image based on the position information of the hole detection module; extracting the gap contour between the buckle and the slot through an edge detection algorithm; calculating the average gap width and buckle deformation curvature; establishing a pressure visual association model; when the contact pressure value is greater than a preset pressure threshold and the average gap width is less than a preset gap threshold, the assembly is determined to be qualified; otherwise, the buckle abnormality type and abnormal location information are output.
[0017] As a further improvement of the present invention, the buckle detection module also includes a pressure visual fusion judgment module. The detection process includes calibrating the time difference between the pressure acquisition time and the image acquisition time. When the time difference is greater than a preset difference value, the pressure change within the time difference is calculated based on the rotation speed, and the pressure value is corrected by an interpolation algorithm. The weights of the pressure value and the gap width are adjusted according to the rotation speed, and a comprehensive score of buckle defects is calculated by combining the gap width and the buckle deformation rate. When the comprehensive score is lower than a preset score threshold, it is determined to be a buckle assembly abnormality, and the score result, abnormality type, and abnormality location information are output.
[0018] As a further improvement of the present invention, the detection process of the sealing strip detection module includes: receiving a fluorescent image of the sealing strip excited by an ultraviolet light source; locating the sealing strip area based on the overall contour of the socket; extracting the strip contour through adaptive threshold segmentation; obtaining the central axis of the strip using a skeleton extraction algorithm; calculating the axis continuity; identifying areas within the contour whose gray values are higher than a preset gray value threshold based on the average value of the strip; and calculating their area and roundness; when the axis continuity is lower than a preset continuity threshold, or the area and roundness are greater than a preset feature threshold, or the offset of the strip contour compared with the standard position template is greater than a preset offset threshold, the detection result of the sealing strip defect is output.
[0019] As a further improvement of the present invention, a detection optimization step is also included, which compares the output detection results of various types of defects with high-precision labeled sample images to calculate the detection accuracy of different defect types; for defect types with detection accuracy lower than a preset accuracy threshold, feature samples of the defect type are automatically extracted, their weights are increased in the model training set, and the core parameters of the corresponding sub-model are adjusted based on the parameter adjustment algorithm; the adjusted model is redeployed to the detection process, detection is performed using newly collected test samples, and the accuracy of each defect type is calculated again; if the accuracy increases to above the preset accuracy threshold, the current model parameters are fixed; if the threshold is not reached, the above optimization process is repeated.
[0020] A visual inspection system for the entire appearance of an energy storage socket based on AI algorithms, comprising:
[0021] The detection image acquisition module adjusts the relative position of the imaging device and the energy storage socket according to the read specifications of the energy storage socket; it acquires images of the upper and lower surfaces, sides, and socket hole array of the energy storage socket using a color imaging device to obtain socket sample images; and it acquires images of the wiring copper posts using a black and white imaging device combined with a multispectral component to obtain copper post sample images.
[0022] The data analysis and processing module performs image preprocessing on the socket sample image and the copper pillar sample image, and generates a model training dataset through multi-view image stitching, key area feature extraction and multispectral data processing.
[0023] The socket defect detection module constructs a defect detection model based on the model training dataset. The defect detection model includes a hole position detection module, a plating detection module, a snap-fit detection module, and a sealing strip detection module. The real-time acquired image of the energy storage socket to be tested is input into the defect detection model, and the consistency is verified by combining the output results of each module. Finally, a comprehensive detection result including defect type, defect location, and confidence level is output.
[0024] The beneficial effects of this invention are:
[0025] (1) The position of the imaging device is automatically calibrated by the height adjustment device, which can adapt to the detection needs of energy storage sockets with different length, width and height specifications. In particular, it solves the problem of blurred product imaging caused by the fixed depth of field of traditional equipment due to height difference. It can achieve full coverage detection of multi-specification products without manual adjustment, which greatly improves the flexibility of the production line and the detection efficiency.
[0026] (2) By using color imaging equipment combined with dynamic focusing, segmented exposure and other optimization strategies, and with the help of AI deep learning algorithms, the problems of traditional black and white cameras being sensitive to color difference and having a low defect detection rate are effectively solved, especially the recognition accuracy of subtle defects is significantly improved; by using a rotating drive device to take multiple step-by-step pictures of the side, the complete detection of the side and thread structure is achieved, avoiding the irregular imaging defects of traditional line scanning cameras, while reducing the number of cameras and reducing equipment cost and space occupation; for key parts such as buckle assembly and sealing strips, multi-source data such as pressure sensing and ultraviolet fluorescence imaging are integrated to solve the problem of misjudgment of hidden defects such as false buckles and bubbles in adhesive strips in traditional vision, and the false detection rate is greatly reduced.
[0027] This invention specifically addresses the detection of key defects that directly affect product functionality, such as socket hole misalignment, plating defects in wiring copper posts, and broken sealing strips. Through high-precision feature extraction and multi-dimensional verification, it ensures the structural integrity and performance stability of products leaving the factory, thus avoiding potential safety hazards from the production stage. Attached Figure Description
[0028] Figure 1 This is a flowchart of a method for visual inspection of the full appearance of an energy storage socket based on an AI algorithm, according to the present invention.
[0029] Figure 2 This is a system block diagram of an AI-based visual inspection system for the full appearance of an energy storage socket according to the present invention.
[0030] Figure 3 This is a first photographic schematic diagram of the socket end face of the present invention;
[0031] Figure 4 This is a second photographic schematic diagram of the socket end face of the present invention. Detailed Implementation
[0032] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Identical components are denoted by the same reference numerals. It should be noted that the terms "front," "rear," "left," "right," "upper," and "lower" used in the following description refer to directions in the accompanying drawings, and the terms "bottom surface," "top surface," "inner," and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.
[0033] This invention proposes a visual inspection method for the entire appearance of energy storage sockets based on AI algorithms, such as... Figures 1 to 4 As shown, it includes the following steps:
[0034] The image acquisition process involves adjusting the relative position of the imaging device and the energy storage socket based on the read specifications. A color imaging device is used to acquire images of the upper and lower surfaces, sides, and socket hole array of the energy storage socket to obtain a socket sample image. A black-and-white imaging device combined with a multispectral component is used to acquire images of the wiring copper posts to obtain a copper post sample image.
[0035] The specifications of the energy storage socket refer to the structural parameters of the energy storage socket to be tested, including but not limited to the length and width of the upper and lower end faces, the side height, the arrangement spacing of the socket hole array, the number and distribution of the wiring copper posts, and the layout range of the buckles and sealing strips. These parameters are used to guide the initial positioning of the imaging equipment.
[0036] This is achieved through a height adjustment device, which includes a servo drive component. This device automatically adjusts the spatial height of the imaging equipment according to the height differences in the aforementioned specifications. Specifically, based on the depth-of-field characteristics of the imaging equipment, i.e., the distance range for clear imaging, the servo drive component receives height adjustment commands from the controller and moves both the color and monochrome imaging equipment vertically until the distance between the equipment and the detection surface of the energy storage socket is within the preset clear imaging range, ensuring that images of products of different specifications are blur-free.
[0037] The color imaging equipment uses six 130W color cameras for image acquisition, corresponding to the upper and lower surfaces and four sides of the energy storage socket, achieving full coverage through workstation division. The upper and lower surfaces are captured directly by cameras at fixed angles; the sides and socket hole array are captured using a rotary drive device. For the side inspection of the square energy storage socket, the rotary drive device rotates the product step-by-step at preset workstations, triggering a camera to take a picture after each rotation angle, thus covering the entire side area through multiple shots. Specifically, the socket hole array is captured by focusing the camera on the hole area, ensuring clear images of the hole's inner edge and opening contour; the fifth shot at workstation 2 simultaneously focuses on the side thread structure to detect the presence and integrity of the threads.
[0038] The image acquisition system, combining a monochrome imaging device with a multispectral component, utilizes a single 2000W monochrome camera as the monochrome imaging device, primarily for acquiring the dimensional characteristics of the copper terminals. The multispectral component works synchronously with the monochrome camera, acquiring spectral information in the 400-700nm visible light and 850nm near-infrared bands for analyzing the material properties of the copper terminal plating, such as the degree of oxidation. During acquisition, the monochrome camera and multispectral component are linked via a controller to ensure that the dimensional images and spectral data acquired at the same time correspond to the same copper terminal region, laying the foundation for subsequent fusion analysis.
[0039] The data analysis and processing steps involve preprocessing the socket sample image and the copper pillar sample image, and generating a model training dataset through multi-view image stitching, key region feature extraction and multispectral data processing.
[0040] Image preprocessing includes noise removal and distortion correction. For noise generated by equipment vibration and ambient light interference in the socket and copper pillar sample images, a Gaussian filtering algorithm is used for smoothing. For image distortion caused by lens optical characteristics, pixel-level correction is performed using pre-calibrated lens distortion parameters to ensure that the image geometry matches the actual product.
[0041] Multiple images captured for side detection are processed through multi-view image stitching. Based on encoder data from the rotation drive device, the angle of each rotation is recorded, and a mapping relationship between the rotation angle and pixel offset is established. The side images acquired at different angles are then calibrated. For example, the second image taken after rotating a certain side image by 30° needs to have its edge pixels radially shifted by the corresponding offset according to the coordinates of the rotation center. Finally, an image fusion algorithm is used to stitch the images together to form a complete panoramic side image, ensuring that no part of the side is missed.
[0042] For the socket sample images, key detection areas are located and features are extracted using image segmentation algorithms: for the socket hole array area, the edge contours of the holes and the gray-level distribution within the holes are extracted; for the buckle area, the contact edges between the buckle and the slot and the gap width are extracted; for the sealing strip area, the continuous contours and gray-level average of the sealing strip are extracted to provide a benchmark for subsequent fluorescence detection.
[0043] The spectral data of the copper pillar acquired by the multispectral component is standardized to eliminate the influence of different light intensities. The angular deviation of the spectral reflectance is corrected by combining the rotation angle data. For example, the change in the light angle caused by the rotation of the copper pillar surface will affect the reflectance. This deviation is compensated by a preset correction model. Finally, the processed spectral data is correlated with the copper pillar size data acquired by the black and white camera to form a size spectral feature pair, which serves as the basic data for coating defect detection.
[0044] The image feature data processed as described above, together with manually labeled defect tags, form a model training dataset for subsequent AI model training.
[0045] The socket defect detection steps involve constructing a defect detection model based on the model training dataset. The defect detection model includes a hole detection module, a plating detection module, a snap-fit detection module, and a sealing strip detection module. The real-time acquired image of the energy storage socket to be tested is input into the defect detection model, and the consistency is verified by combining the output results of each module. Finally, a comprehensive detection result including defect type, defect location, and confidence level is output.
[0046] The defect detection model is constructed using AI deep learning algorithms. A training strategy of one sub-model per workstation is adopted for different detection objects: For the hole detection module, training is based on the feature data of the socket hole array to learn the deviation pattern between the hole center coordinates and the standard template, enabling the identification of defects such as hole offset and foreign objects inside the hole; For the coating detection module, training is based on size and spectral feature pairs to learn the spectral differences between normal coating and oxidation / scratching states, enabling the simultaneous judgment of size deviations and coating defects; For the buckle detection module, training is based on the edge features of the buckle area and assembly standard data to learn the normal gap range between the buckle and the slot, enabling the identification of assembly anomalies such as loose fasteners and deformation; For the sealing strip detection module, training is based on the contour features of the sealing strip to learn the normal continuous shape of the strip, enabling the identification of defects such as breakage, misalignment, and bubbles.
[0047] After the real-time images of the energy storage socket to be inspected are processed through the data analysis and processing steps described above, they are input into the defect detection model. Each module outputs the corresponding defect detection results. Consistency verification is implemented through the controller, the core of which is to determine whether there are logical contradictions in the detection results of different modules. For example, if the buckle detection module determines that the assembly is abnormal, while the sealing strip detection module in the adjacent area shows that the sealing strip is misaligned, it is necessary to verify whether the two are caused by the same structural error, and to eliminate misjudgments caused by image noise or random errors.
[0048] After consistency verification, the output is structured data containing defect type, such as hole position offset, coating oxidation, etc., the specific location coordinates of the defect on the product, and the detection confidence level. The confidence level reflects the reliability of the model's judgment on the defect, providing a clear basis for sorting and rework on the production line.
[0049] Specifically, such as Figures 1 to 4 As shown, the color imaging device is equipped with a dynamic focusing lens. During the acquisition process, it synchronously reads the real-time angle data of the rotation drive device. When the rotation angle changes to a preset angle threshold, the dynamic focusing lens automatically adjusts the focal length to compensate for the defocus caused by the motion offset.
[0050] A dynamic focusing lens is an optical component that can change the focal length of the lens through a motor drive. Unlike a fixed focal length lens, it can adjust the focal length parameters in real time according to the distance between the object being photographed and the lens, ensuring that the object is clearly imaged at different distances.
[0051] The real-time angle data of the rotation drive device is output in real time by the encoder built into the rotary motor. This data is transmitted to the controller in the form of pulse signals, reflecting the current rotation angle of the energy storage socket and providing a position reference for lens focusing.
[0052] The preset angle threshold is set according to the structural complexity of the side of the energy storage socket, such as whether there are protrusions or grooves. For example, when the rotation angle changes by 5°, a focusing is triggered to ensure that the lens is always aligned with the current detection area during the product rotation. For example, when rotating from a flat surface to a protruding surface with a buckle, the blur caused by the distance change is offset by focusing.
[0053] The color imaging device is linked with the ultraviolet light source component and adopts a segmented exposure mode for the sealing strip area. The exposure intensity is dynamically adjusted according to the curvature and rotation angle of the sealing strip.
[0054] The ultraviolet light source component includes an array of ultraviolet LED beads with a wavelength of 365nm. The ultraviolet light emitted by the LEDs can excite the fluorescent agent pre-added in the sealing strip of the energy storage socket, causing the sealing strip to emit visible fluorescence, creating a significant grayscale difference with the non-fluorescent shell.
[0055] The segmented exposure mode refers to the color imaging device sequentially exposing and photographing different sections of the sealing strip as the energy storage socket rotates. For example, if the total length of the sealing strip is 100mm, each 10° rotation corresponds to photographing a 10mm segment, and multiple images are stitched together to cover the entire sealing strip.
[0056] The dynamic adjustment of exposure intensity is based on a preset curvature-angle-intensity mapping table. When the curvature of the sealing strip is detected to increase, the exposure intensity is increased by 20% to offset the attenuation of fluorescence reflection. When the rotation angle increases the angle between the light source and the sealing strip, the exposure intensity is increased by 10% to ensure that the fluorescence brightness of the sealing strip at different positions is consistent, which is convenient for subsequent contour extraction.
[0057] When rotated to the corresponding station of the buckle, the color imaging device and the pressure sensing component are triggered synchronously to acquire an image of the buckle's appearance and record the associated data at the time of pressure acquisition.
[0058] The corresponding station of the buckle refers to the preset rotation angle position according to the design drawings of the energy storage socket. This position is associated with the encoder data of the rotating motor through the controller to ensure that the buckle is in the same shooting angle during each test.
[0059] Synchronous triggering is achieved by the controller sending a synchronous pulse signal. When rotating to the target station, the controller simultaneously sends a trigger signal to the color imaging device and the pressure sensing component, so that both start working at the same time. This ensures that the acquired image and pressure data correspond to the buckle in the same state, thus avoiding slight displacement of the buckle when the image is acquired due to delay.
[0060] The associated data at the time of pressure acquisition includes pressure value, current rotation angle, and frame number of image acquisition. This data is packaged and stored for subsequent analysis of the correspondence of pressure visual features, such as determining whether the buckle image under a certain pressure value meets the assembly standard.
[0061] The black-and-white imaging device works synchronously with the multispectral component to acquire time-series images of the copper pillar. Its exposure parameters are dynamically adjusted with the rotation speed to avoid motion blur. At each preset rotation angle, a set of image data containing the size of the copper pillar and the spectral characteristics of the coating is acquired.
[0062] The monochrome imaging device is used to acquire the geometric contours of the copper pillar. It shares the same trigger signal with the multispectral component to ensure that the same area of the copper pillar is imaged at the same time, so that the dimensional data and spectral data have spatial correspondence.
[0063] Exposure parameters mainly refer to exposure time. When the speed of the rotary motor increases, the controller automatically shortens the exposure time to reduce image ghosting caused by the movement of the copper column and ensure the accuracy of dimensional measurement.
[0064] The preset rotation angle interval is set according to the circumferential uniformity requirements of the copper column. For example, a set of data is collected every 15° rotation. Six sets of data cover the 360° circumference of the copper column to ensure that no coating defects are missed. Each set of data includes black and white images and multispectral images, which are correlated into a size spectral dataset through coordinate mapping.
[0065] Specifically, such as Figures 1 to 4 As shown, the data analysis and processing steps include extracting features from the socket sample image to obtain the buckle area image, hole position image, and sealing strip image;
[0066] A deep learning-based object detection algorithm is used to locate key regions. A pre-trained region recognition model automatically selects the Regions of Interest (ROIs) containing the buckles, holes, and sealing strips from sample socket images. This process requires incorporating prior knowledge of the energy storage socket's structure, such as the fact that buckles are typically located on the side edges and the hole array is regularly arranged, to optimize the model's resistance to interference from complex backgrounds.
[0067] The selected ROI is cropped and its size normalized to obtain independent images of the buckle area, hole positions, and sealing strip. The hole position image must retain the complete hole array layout, and the sealing strip image must include the boundary edge between the sealing strip and the shell, laying the foundation for subsequent fine feature extraction.
[0068] Based on encoder data from the rotary drive device, a mapping model between rotation angle and pixel offset is established. Images acquired from different angles are calibrated and multi-field motion compensation stitching is completed.
[0069] The angle value obtained by decoding the pulse signal output by the encoder in the rotary drive device reflects the real-time position of the energy storage socket during rotation. Its accuracy can reach 0.1°, providing a position reference for image calibration.
[0070] A mapping relationship was established through calibration experiments. When the energy storage socket rotates by an angle θ around the rotation center, the offset of any pixel (x, y) in the image is related to the distance r from that point to the rotation center. The offset Δ = θ × r × π / 180, in pixels. The model is fitted using a two-variable linear equation: Δx = a × θ × r + b, Δy = c × θ × r + d (a, b, c, d are calibration coefficients), ensuring that pixel coordinates at different angles can be traced back to the same reference coordinate system.
[0071] Multi-field motion compensation stitching first performs pixel-level calibration on side images acquired from different angles based on a mapping model to correct image offset caused by rotation; then, it extracts matching feature points of the calibrated images, such as features of side threads and protrusions, using the SIFT algorithm to calculate the transformation matrix between images; finally, it uses a weighted fusion algorithm to stitch the images, eliminating stitching seams and forming a complete side panoramic image, ensuring that the geometric error of the stitched image is ≤0.5 pixels.
[0072] The effect of rotation angle on spectral reflectance is corrected by polynomial fitting. The corrected multispectral data is then correlated with the size data of the copper pillar sample image to generate a two-dimensional feature matrix of size and spectrum.
[0073] The effect of rotation angle on spectral reflectance: The reflectance of the coating on the copper pillar surface changes with the rotation angle. For example, when the angle between the illumination direction and the normal of the coating surface increases, the reflectance decreases, and this interference needs to be eliminated through correction.
[0074] Polynomial fitting correction is used to collect copper column spectral data at different rotation angles. With angle as the independent variable and reflectance as the dependent variable, cubic polynomial fitting is performed to correct the reflectance at any angle to the equivalent value at the reference angle, ensuring that the spectral characteristics only reflect the coating material state, such as oxidation and scratches.
[0075] The horizontal dimension of the two-dimensional feature matrix for size and spectrum represents the size parameters of the copper pillar, including diameter, length, and cylindricity, calculated from the black-and-white image through edge detection and Hough transform. The vertical dimension represents the corrected multispectral reflectance data, covering feature values in the 400-700nm visible light and 850nm near-infrared bands. Each element in the matrix represents the correlation value between a certain size parameter and the reflectance in a certain band, providing fusion features for the coating detection module.
[0076] Motion blur removal is performed on the image of the buckle area, and the gap width between the buckle and the slot and the buckle deformation area after blur correction are extracted as the dynamic features of the buckle.
[0077] The blurring of the buckle area image is caused by relative motion during rotation. The blur kernel follows a linear motion direction, and its length is positively correlated with the rotation speed. A blind deconvolution algorithm is used for correction. The blur kernel parameters are estimated through frequency domain analysis, and then Wiener filtering is used to recover the clear image, ensuring an edge sharpness improvement of ≥30%. Subpixel edge detection algorithms, such as Zernike moment edge localization, are used to identify the boundary edge between the buckle and the slot, calculating the shortest distance between the edges as the gap width, with an accuracy of up to 0.01mm. For buckle deformation region extraction, the corrected buckle image is compared differentially with a standard buckle template. Morphological dilation and erosion operations are used to extract grayscale difference regions, and the area and maximum deformation distance of the deformed region are calculated as dynamic features for judging the buckle assembly status.
[0078] Through the above processing, the data analysis and processing steps can transform the original image into structured, interference-resistant feature data, providing high-quality input for the subsequent training and inference of the defect detection model, and ensuring detection accuracy and robustness.
[0079] Specifically, such as Figures 1 to 4 As shown, the detection process of the hole position detection module includes receiving the socket hole array image after multi-field motion compensation stitching, removing noise through image preprocessing algorithm, and calibrating the pixel coordinate system of the hole position area based on rotation angle data.
[0080] The multi-field motion-compensated spliced socket hole array image refers to the complete hole area image formed by splicing through the aforementioned data analysis and processing steps, covering all socket holes on the upper and lower end faces of the energy storage socket, ensuring that the hole array has no omissions and no overlaps.
[0081] The image preprocessing algorithm for noise removal employs a bilateral filtering algorithm. This algorithm, by simultaneously considering spatial distance and grayscale similarity, smooths noise while preserving the edge details of holes, thus avoiding noise interference with subsequent edge detection.
[0082] The pixel coordinate system is calibrated based on rotation angle data. Using the encoder data of the rotary drive device as a reference, the pixel coordinates of the hole area image are mapped to the physical coordinate system. Specifically, by using a pre-calibrated pixel-to-physical size conversion coefficient, combined with the rotation angle, the coordinate offset caused by rotation is corrected. For example, after rotating by an angle θ, the pixel coordinates (x, y) of the hole position correspond to the physical coordinates (x×0.02×cosθ-y×0.02×sinθ, x×0.02×sinθ+y×0.02×cosθ), ensuring that the coordinate system is consistent and accurate.
[0083] A high-precision edge detection algorithm is used to extract the inner edge contour of each socket hole, calculate the coordinates of the hole center, and map and align them with the hole coordinates in the standard template.
[0084] The high-precision edge detection algorithm adopts a sub-pixel level edge detection algorithm, such as edge positioning based on Zernike moments. By performing polynomial fitting on the gray-scale distribution of pixels at the edge of the hole, the sub-pixel level position of the edge is determined. Compared with the traditional Canny algorithm, the edge positioning error is reduced to ≤0.002mm.
[0085] The inner edge contour extraction performs morphological processing on the detected edges, such as erosion and dilation operations, to remove interfering contours such as burrs at the orifice, and retain the continuous curve of the inner edge of the hole; through contour fitting, a regular hole position contour is obtained.
[0086] For hole center coordinate calculation, the center of the fitted circle is used as the hole center for circular holes; for irregularly shaped holes, the geometric center of the contour is used as the center coordinate, ensuring that the coordinate calculation error is ≤0.01mm.
[0087] Alignment is achieved with a standard template, which is a set of hole coordinates generated based on the design drawings of the energy storage socket, including the theoretical physical coordinates of each hole. A rigid transformation algorithm is used to match the actual hole center coordinates with the standard template coordinates, calculating the minimum mean square error. Alignment is considered successful when the error is ≤0.05mm, eliminating coordinate deviations caused by slight product placement offsets.
[0088] Hole position offset is identified by coordinate deviation calculation, dynamic threshold segmentation is performed on the area inside the hole, and foreign objects inside the hole are identified by morphological operation. The hole position defect type and location information are output as the hole position detection result.
[0089] Calculate the Euclidean distance between the actual hole center and the standard template center after alignment. When Δ exceeds the preset offset threshold, it is determined to be a hole position offset defect, and the offset direction and distance are recorded.
[0090] Dynamic threshold segmentation of the area inside the hole: For foreign objects such as metal debris and plastic residue that may exist inside the hole, adaptive threshold segmentation is adopted. The area inside the hole is defined by the edge contour of the hole. The gray mean μ and standard deviation σ of the pixels in the area are calculated. The segmentation threshold is dynamically set to μ+2σ. Areas higher than this threshold are judged as suspected foreign objects, which can adapt to gray value changes under different lighting conditions.
[0091] Morphological operations for foreign object identification: Morphological processing of the segmented suspected foreign object regions.
[0092] The opening operation is used to remove small noise points, i.e., areas with an area ≤ 5 pixels. The area and roundness of the remaining area are then calculated, and the roundness is calculated as follows: Area / Perimeter 2 When the area is greater than or equal to the preset foreign object area threshold and the roundness matches the foreign object shape, such as metal fragments which are mostly irregular in shape and have a roundness of ≤0.6, it is determined to be a foreign object defect inside the hole.
[0093] The hole location detection results output includes the defect type, such as hole location offset, foreign objects inside the hole, the number of the defective hole location, physical coordinates (x, y), and confidence level. The confidence level is calculated based on the probability of edge detection and foreign object identification, and is determined to be a valid defect when it is ≥95%.
[0094] Through the above process, the hole position detection module can achieve high-precision detection of the energy storage socket hole array, effectively identify minute hole position deviations and foreign objects inside the holes, and provide assurance for product assembly compatibility and usage safety.
[0095] Specifically, such as Figures 1 to 4 As shown, the detection process of the coating detection module includes acquiring the wiring copper pillar size data and the spectral data of the multispectral component of the copper pillar sample image, and calibrating the coordinate system of the copper pillar image based on the position information output by the hole position detection module.
[0096] The wiring copper post size data refers to the geometric parameters extracted from the copper post sample image acquired by the black and white imaging device, including the diameter, length, and cylindricity of the copper post. After sub-pixel level positioning of the copper post edge is calculated by edge detection and Hough transform algorithm, the cylindrical contour is fitted. The diameter is the maximum lateral distance of the contour, the length is the axial extension distance, and the cylindricity is the deviation value between the actual contour and the ideal cylinder.
[0097] The spectral data of the multispectral component is the reflectance data of the 400-700nm visible light band and the 850nm near-infrared band collected by the multispectral component. It is presented in the form of a spectral curve with wavelength on the horizontal axis and reflectance on the vertical axis, reflecting the material characteristics of the copper pillar coating. For example, after the nickel coating is oxidized, the reflectance in the 850nm band will decrease significantly.
[0098] Coordinate system calibration uses the hole center coordinates output by the hole position detection module as a reference. Coordinate transformation aligns the pixel coordinate system of the copper pillar image with the hole position coordinate system. Specifically, utilizing the fixed positional relationship between the copper pillar and adjacent socket holes (e.g., the theoretical distance L between the center of the copper pillar and the center of a certain hole position), the offset and rotation angle of the copper pillar image are calculated. After correction, the copper pillar coordinates are incorporated into a unified product coordinate system, ensuring spatial consistency between dimensional measurement and defect location.
[0099] The characteristic bands of the coating oxidation are extracted by a characteristic band extraction algorithm, and the influence of angular offset on reflectivity is corrected by combining rotation angle data.
[0100] The feature band extraction algorithm uses principal component analysis (PCA) to reduce the dimensionality of multispectral data and screen out the bands most sensitive to coating oxidation. For example, by comparing the spectral curves of normal coatings and oxidized coatings, it was found that the reflectance difference in the 850nm near-infrared band is the greatest, and the reflectance decreases by more than 30% after oxidation. This band is then extracted as the feature band for oxidation detection.
[0101] The correction of the effect of angular offset on reflectivity is based on encoder data from the rotary drive device, and a quadratic polynomial fitting correction model is used. Where θ is the rotation angle, and k2, k1, and k0 are fitting coefficients to eliminate the interference of changes in illumination angle caused by the rotation of the copper pillar on the reflectivity. For example, when the copper pillar is rotated by 30°, the reflectivity correction value is calculated through the model to ensure that the reflectivity data at different angles can be directly compared.
[0102] By fusing the corrected spectral data with the dimensional data, the system identifies coating oxidation, scratches, and pinhole defects, and outputs the coating defect types and associated copper pillar dimensional deviation information.
[0103] Data fusion method: Construct a spectral-size feature vector, and use the corrected feature band reflectivity and copper column size parameters as joint feature inputs to the defect identification model, so that the model can learn the relationship between material and geometric features at the same time.
[0104] Its defect identification logic is as follows:
[0105] For coating oxidation, when the corrected reflectance in the characteristic band (850nm) is lower than the normal threshold, such as when the normal coating reflectance is ≥70% and the oxidized reflectance is ≤40%, it is judged as an oxidation defect.
[0106] Scratches were identified by using spectral data to pinpoint areas of abrupt changes in reflectance (the reflectance at the scratch was more than 20% lower than the surrounding area). Combined with morphological features from dimensional data, the scratches exhibited a linear distribution, with a length ≥ 0.5 mm and a width ≤ 0.1 mm, thus eliminating interference from surface texture.
[0107] Pinholes appear as localized low reflectivity points in spectral data and are determined by combining morphological operations with location information from dimensional data.
[0108] The output information includes defect types such as oxidation, scratches, and pinholes, the specific location of the defect on the copper pillar based on a calibrated coordinate system (e.g., 2mm from the top of the copper pillar), defect dimensions such as scratch length and pinhole diameter, and associated copper pillar size deviation information such as diameter deviation +0.05mm, enabling collaborative detection of material defects and geometric accuracy.
[0109] Through the above process, the plating inspection module realizes integrated inspection of the size and material of the copper post, solving the problem that traditional single visual inspection cannot take into account both plating quality and geometric accuracy, and improving the reliability of the detection of the conductive safety of the energy storage socket.
[0110] Specifically, such as Figures 1 to 4 As shown, the detection process of the buckle detection module includes receiving the buckle area image acquired by the color imaging device and the contact pressure value synchronously acquired by the pressure sensing component, and locating the coordinate area of the buckle in the image based on the position information of the hole detection module.
[0111] The snap-fit area image is a local high-definition image captured by a color imaging device for the snap-fit part of the energy storage socket. This image focuses on the assembly and joint of the snap-fit and the slot, clearly showing the edge shape, gap distribution and surface condition of the two, providing detailed basis for subsequent contour extraction.
[0112] The contact pressure value is the force value generated when the pressure sensing component contacts the buckle protrusion. The mechanical force is converted into an electrical signal by the pressure sensor and obtained through analog-to-digital conversion. Its value directly reflects the tightness of the buckle assembly. The greater the force value, the more fully the buckle is engaged in the slot.
[0113] The process of locating the buckle coordinate area based on the position information of the hole position detection module is as follows: The hole position detection module has determined the precise coordinates of the socket hole array, while the relative position of the buckle and adjacent holes is fixed in the design, such as the fixed distance between the center of the buckle and the center of a certain hole. Using this fixed positional relationship, with the hole position coordinates as the reference, the coordinate range of the buckle in the image can be accurately calculated through coordinate translation and angle rotation calculations, ensuring that the positioning deviation does not exceed 1 pixel, thus defining an accurate area for subsequent detection.
[0114] The gap contour between the buckle and the slot is extracted using an edge detection algorithm, and the average gap width and buckle deformation curvature are calculated.
[0115] The edge detection algorithm employs the Canny operator, which smooths image noise using Gaussian filtering, determines candidate edge points by calculating gradient magnitude and direction, and finally extracts the continuous contour lines of the buckle and slot edges through non-maximum suppression and dual thresholding. Compared to traditional algorithms, its edge localization error can be controlled within 0.5 pixels, ensuring the accuracy of gap measurement.
[0116] Gap contour extraction targets the gap area between the buckle and the slot. Two parallel contour lines corresponding to the edges of the buckle and the slot, obtained through edge detection, constitute the gap contour, which reflects the degree of fit between the two.
[0117] The average gap width is calculated as follows: On the extracted gap profile, multiple sampling points are evenly selected along the buckle length direction. The vertical distance between the two profile lines at each point is calculated. Then, the average distance values of all sampling points are calculated to eliminate measurement errors caused by local burrs and make the results more representative.
[0118] The buckle deformation curvature is obtained by curve fitting of the buckle edge profile. The buckle edge profile is regarded as a continuous curve, and the least squares method is used to fit it into a quadratic curve. Then, the curvature value is calculated according to the curvature formula of the curve. The larger the curvature, the more significant the buckle bending deformation, thereby determining whether the buckle has undergone abnormal deformation due to assembly stress.
[0119] A pressure visual association model is established. When the contact pressure value is greater than the preset pressure threshold and the average gap width is less than the preset gap threshold, the assembly is deemed qualified; otherwise, the buckle abnormality type and abnormal location information are output.
[0120] The pressure visual correlation model is a comprehensive judgment model that integrates contact pressure value and average gap width. Its core is to establish the correlation rule between the two. Under normal assembly conditions, contact pressure value and average gap width are negatively correlated; the higher the pressure, the smaller the gap. The model determines the reasonable matching range between the two by learning from a large number of qualified sample pressure and gap data.
[0121] The preset pressure threshold is a minimum value determined based on the pressure data statistics of qualified products. It represents the minimum force required for the buckle to effectively engage. If the force is below this value, it indicates that the buckle is not fully engaged.
[0122] The preset gap threshold is the maximum value determined based on the gap data statistics of qualified products. It represents the maximum allowable gap when the buckle and the slot are properly fitted. Exceeding this value indicates that the two are not tightly fitted.
[0123] The assembly qualification judgment logic is as follows: only when the contact pressure value is greater than the preset pressure threshold and the average gap width is less than the preset gap threshold, the double qualification conditions are met and the assembly is judged to be qualified.
[0124] Output of buckle anomaly type and location information: If the qualification conditions are not met, the anomaly type is output according to the specific deviation. When the contact pressure value is lower than the preset pressure threshold but the average gap width meets the requirements, it is judged as a false buckle, that is, visually fit but not actually locked; when the average gap width exceeds the preset gap threshold but the pressure meets the requirements, it is judged as a buckle deformation, that is, poor fit due to deformation; when neither of the above conditions is met, it is judged as an assembly misalignment. At the same time, combined with the previously located buckle coordinate area, the specific location of the anomaly on the buckle is output, providing precise guidance for rework.
[0125] Through the above process, the buckle detection module achieves dual verification of the buckle assembly status, effectively avoiding misjudgment of hidden defects such as false buckles by single visual inspection, and improving the reliability of assembly quality inspection.
[0126] Specifically, such as Figures 1 to 4 As shown, the buckle detection module also includes a pressure visual fusion judgment module. Its detection process includes calibrating the time difference between the pressure acquisition time and the image acquisition time. When the time difference is greater than a preset difference, the pressure change within the time difference is calculated based on the rotation speed, and the pressure value is corrected by an interpolation algorithm.
[0127] The time difference between pressure acquisition and image acquisition refers to the interval between the time it takes for the pressure sensing component to acquire the contact pressure value and the time it takes for the color imaging device to capture the image of the latch area. This time difference is mainly caused by factors such as device trigger delay and signal transmission time. If not calibrated, it will cause a spatiotemporal mismatch between pressure data and image data. For example, when pressure is acquired, the latch may have already rotated to the next position, but the image may still show the previous position.
[0128] The calibration process uses a synchronized clock to configure a unified timestamp recording mechanism for the pressure sensing component and the color imaging device. After the data acquisition is completed, the timestamps of the two are compared, and the difference is calculated as the actual time difference.
[0129] The preset difference is the maximum allowable time difference determined based on the device's response speed. Exceeding this value will cause the data matching error to exceed the acceptable range, and correction is required.
[0130] The logic for calculating pressure change based on rotational speed is as follows: rotational speed reflects the movement rate of the buckle, and the rotation angle of the buckle within the time difference can be obtained by multiplying the rotational speed by the time difference. The pressure change is related to the rotation angle. For example, changes in the contact area between the buckle and the sensor during buckle rotation will cause pressure fluctuations. Through a pre-established model of the relationship between rotation angle and pressure change, the theoretical pressure change value within this time difference can be calculated.
[0131] The interpolation algorithm corrects the pressure value using linear interpolation: based on the pressure value at the time of pressure acquisition, and combined with the calculated pressure change, the pressure value corresponding to the time of image acquisition is estimated, so that the corrected pressure value and the buckle state reflected in the image are perfectly matched in time, ensuring the correlation between the two.
[0132] The weights of the pressure value and gap width are adjusted according to the rotation speed, and the overall score of the buckle defect is calculated by combining the gap width and the buckle deformation rate.
[0133] The basis for adjusting the weights is the impact of rotation speed on the reliability of pressure and visual data: when the rotation speed is low, the image acquisition is clearer and the reliability of visual features such as gap width is high, so the gap width is given a higher weight; when the rotation speed is high, the image is prone to motion blur and the error of visual features increases, while the pressure data is less affected by motion, so the weight of the pressure value is increased.
[0134] The weight adjustment method is achieved through a preset weight coefficient function: the rotation speed is set as the independent variable, and the pressure weight and gap width weight are the dependent variables. When the speed increases, the pressure weight increases linearly and the gap width weight decreases linearly. The sum of the two weights is always 1, ensuring the normalization of the score.
[0135] The buckle deformation rate is a parameter reflecting the degree of buckle deformation. It is calculated by extracting the actual outline of the buckle through edge detection, comparing it with the outline of a standard buckle, and calculating the ratio of the maximum deformation distance between the two to the buckle reference length. The larger the deformation rate, the more severe the buckle deformation.
[0136] The overall score is calculated as follows: (Pressure value / Preset pressure threshold) × Pressure weight + (1 - Gap width / Preset gap threshold) × Gap width weight + (1 - Buckle deformation rate) × Fixed weight. All parameters are normalized to the range of 0-1. The fixed weight is used to balance the influence of the deformation rate, ensuring that the score comprehensively reflects the state of pressure, gap, and deformation.
[0137] When the overall score is lower than the preset score threshold, it is determined to be an abnormality in the buckle assembly, and the score result, abnormality type and abnormality location information are output.
[0138] The preset scoring threshold is a critical value determined based on the scoring data of a large number of qualified and unqualified samples. It represents the minimum scoring standard for qualified buckle assembly. If it is lower than this value, it indicates that at least one indicator does not meet the requirements.
[0139] The logic for judging abnormal buckle assembly is as follows: the comprehensive score is a comprehensive reflection of pressure, gap, and deformation. When the score is lower than the preset threshold, it indicates that there are defects in the buckle in terms of tightness, fit, or structural integrity, and it is judged as an assembly abnormality.
[0140] If the score for the pressure value contribution is too low, it is judged as insufficient pressure (false fastening); if the score for the gap width contribution is too low, it is judged as excessive gap (poor fit); if the score for the buckle deformation rate contribution is too low, it is judged as buckle deformation (structural abnormality); if multiple parameters fail to meet the standards, it is judged as a comprehensive assembly defect.
[0141] The system outputs the specific numerical value of the comprehensive score, the above-mentioned anomaly types, and the precise location of the anomaly on the buckle, providing a quantitative basis for defect location and rework in the production process.
[0142] Through the above process, the pressure-visual fusion judgment module achieves deep integration of pressure data and visual data. By dynamically adjusting weights and comprehensively scoring, it effectively avoids the limitations of single data and significantly improves the accuracy of buckle assembly anomaly detection.
[0143] Specifically, such as Figures 1 to 4 As shown, the detection process of the sealing strip detection module includes receiving a fluorescent image of the sealing strip excited by an ultraviolet light source, locating the sealing strip area based on the overall contour of the socket, and extracting the strip contour through adaptive threshold segmentation.
[0144] Ultraviolet (UV) light-excited fluorescent images of sealing strips refer to images captured by color imaging equipment when the sealing strip of an energy storage socket is irradiated with UV light of a specific wavelength emitted by a UV light source component. This excites the fluorescent material within the sealing strip to produce visible fluorescence. In these images, the sealing strip exhibits high brightness due to the fluorescence, creating a significant grayscale difference compared to the non-fluorescent socket casing, facilitating subsequent area identification.
[0145] The process of locating the sealing strip area based on the overall outline of the socket is as follows: First, the overall outer outline of the energy storage socket is extracted using an edge detection algorithm. Then, combined with the preset layout features of the sealing strip on the socket, such as the sealing strip being distributed along the edge of the socket, the possible area where the sealing strip may exist is delineated from the overall outline. For example, if the socket is rectangular, the sealing strip is usually distributed along the four sides of the rectangle. Therefore, based on the edge of the rectangle, a certain distance is shrunk inward to match the width of the sealing strip, thus determining the preliminary detection area and ensuring that the positioning range covers the entire sealing strip.
[0146] Adaptive thresholding for sealing strip contour extraction is an algorithm that dynamically adjusts the segmentation threshold based on the local gray-level distribution of an image. Unlike fixed thresholding, it divides the image into multiple local regions and calculates a threshold for each region, such as based on the mean and standard deviation of gray levels within the region. This allows it to adapt to uneven fluorescence intensity, such as slightly lower fluorescence intensity at the corners of the sealing strip. In practice, adaptive thresholding is applied to the defined sealing strip region image, identifying areas with gray values higher than the local threshold as the sealing strip portion and areas with gray values lower than the threshold as the background, thereby extracting the continuous sealing strip contour line.
[0147] The skeleton extraction algorithm is used to obtain the central axis of the adhesive strip, calculate the continuity of the axis, identify the region within the contour whose gray value is higher than the preset gray value threshold based on the average value of the adhesive strip, and calculate its area and roundness.
[0148] The skeleton extraction algorithm for obtaining the central axis of the adhesive strip refers to extracting a central curve reflecting its geometric shape from the strip's contour through morphological operations. This algorithm repeatedly erodes the contour edges while preserving the contour's topological structure until a continuous curve of single-pixel width, i.e., the central axis, is obtained. The central axis simplifies the adhesive strip's shape, facilitating the analysis of its continuity and direction.
[0149] The continuity of the axis is calculated as follows: a break detection is performed on the extracted central axis, and the lengths of continuous line segments in the axis are counted. If a break exists, i.e. the distance between adjacent line segments exceeds a certain value, the ratio of the longest continuous line segment length to the total length of the axis is used as the continuity index; the lower the ratio, the more severe the break.
[0150] The process of identifying regions within the outline whose grayscale values exceed a preset grayscale threshold based on the average value of the adhesive strip is as follows: First, the average grayscale value of all pixels within the adhesive strip outline is calculated. Then, based on defect characteristics, such as bubbles exhibiting higher brightness due to light scattering, a preset grayscale threshold is set, typically 1.2-1.5 times the average grayscale value. Regions within the outline whose grayscale values exceed this threshold are marked as suspected defect areas. These areas often correspond to bubbles or impurities inside the sealing strip.
[0151] In calculating its area and roundness, the area is obtained by counting the number of pixels contained in the suspected defective area and combining the conversion coefficient between pixels and actual size; the roundness is calculated using the formula: Roundness = Area / Perimeter 2 The calculation shows that the closer the value is to 1, the closer the area is to a circle. Bubble-like defects are often nearly circular in shape and have a high degree of roundness, which can be used to distinguish them from other impurities.
[0152] When the continuity of the axis is lower than a preset continuity threshold, or the area and roundness are greater than a preset feature threshold, or the offset of the strip outline compared with the standard position template is greater than a preset offset threshold, the detection result of the sealing strip defect is output.
[0153] The preset continuity threshold is a minimum value determined based on the statistical analysis of the axial continuity of qualified sealing strips. A value below this threshold indicates that the sealing strip is broken. For example, if the axial continuity of qualified sealing strips is ≥95%, the preset continuity threshold can be set to 90%. When a continuity of <90% is detected, the sealing strip is determined to be broken.
[0154] The preset feature thresholds include an area threshold and a roundness threshold, both set based on the grayscale fluctuation characteristics of normal adhesive strips in qualified samples. The area threshold is used to distinguish between valid defects and minor noise; the roundness threshold is used to confirm the bubble shape. When both the area and roundness of a suspected defective area exceed the corresponding threshold, it is determined to be a bubble in the sealing strip.
[0155] The offset between the rubber strip profile and the standard position template refers to the maximum distance between corresponding points after registering the extracted actual rubber strip profile with the standard position template based on the theoretical position profile of the rubber strip generated from the design drawings. A preset offset threshold is the maximum allowable positional deviation. When the offset exceeds this value, it indicates that the rubber strip assembly position deviates from the design requirements, and is judged as a misalignment of the sealing strip.
[0156] When outputting the inspection results of sealing strip defects, it is necessary to specify the defect type, such as breakage, bubbles or misalignment, the specific location of the defect on the sealing strip, such as 50mm from the left end of the sealing strip, and the defect parameters, such as breakage length, bubble diameter, and offset distance, so as to provide a clear basis for quality judgment and rework.
[0157] Through the above process, the sealing strip detection module utilizes the high contrast characteristics of fluorescence imaging, combined with multi-dimensional feature analysis, to accurately identify defects such as sealing strip breakage, bubbles, and misalignment, effectively ensuring the sealing performance of the energy storage socket.
[0158] Specifically, such as Figures 1 to 4 As shown, the process also includes a detection optimization step, which compares the output detection results of each type of defect with high-precision labeled sample images to calculate the detection accuracy of different defect types. For defect types with a detection accuracy lower than a preset accuracy threshold, feature samples of that defect type are automatically extracted, their weights are increased in the model training set, and the core parameters of the corresponding sub-model are adjusted based on the parameter adjustment algorithm. The adjusted model is redeployed to the detection process, and detection is performed using newly collected test samples. The accuracy of each defect type is calculated again. If the accuracy increases to above the preset accuracy threshold, the current model parameters are fixed. If the threshold is not reached, the above optimization process is repeated.
[0159] High-precision labeled sample images refer to images processed by professional quality inspectors or automated labeling systems. In these images, all defects, such as hole misalignment, coating oxidation, buckle abnormalities, and broken sealing strips, are precisely marked in terms of type, location, and boundary. The labeling accuracy can reach the pixel level, serving as a benchmark for measuring the accuracy of the test results.
[0160] The defect location output by the defect detection module is compared with the defect location marked in the sample image. If the coordinate deviation between the two is within a preset range, such as no more than 2 pixels, it is determined to be a correct detection. If the detection module outputs a defect but there is no corresponding mark in the sample image, it is determined to be a false positive. If there is a mark in the sample image but the detection module does not output it, it is determined to be a false negative.
[0161] The detection accuracy is calculated as follows: for each defect type, the accuracy is obtained by dividing the number of correctly detected defects by the total number of defects of that type in the sample image. For example, if a sample image contains 100 hole misalignment defects, and the detection module correctly identifies 92 of them, then the detection accuracy for hole misalignment is 92%.
[0162] The preset accuracy threshold is the minimum acceptable standard set according to the production requirements for detection accuracy, for example, it is set to 95%. When the detection accuracy of a certain type of defect is lower than 95%, the optimization process is triggered.
[0163] Automatically extracting feature samples of this type of defect refers to screening typical image regions of this type of defect from historical detection data, such as hole array images with hole position displacement, copper column spectral images with coating oxidation, etc. These samples need to contain defect features of different forms, such as hole position displacement of different degrees and coating oxidation areas of different areas, to ensure the diversity of samples.
[0164] Increasing the weight of a sample in the model training set means assigning a higher loss weight to the feature samples of that type of defect during model training. For example, the weight of a normal sample is 1.0, while the weight of a sample with that type of defect is increased to 1.5-2.0, so that the model pays more attention to the feature learning of this type of sample during training and reduces misclassification.
[0165] The parameter adjustment algorithm employs an improved version of the gradient descent algorithm. It calculates the loss value between the model's prediction results and the labeled samples, and then backpropagates to adjust the core parameters of the corresponding sub-model. These core parameters include the convolutional kernel weights, activation function thresholds, and fully connected layer weights in the convolutional neural network. The adjustment objective is to minimize the loss value and improve the ability to identify this type of defect.
[0166] Redeploying to the inspection process refers to loading the model with adjusted parameters into the inspection system of the production line to replace the original model and perform real-time inspection tasks. The deployment process must ensure that the model is compatible with the interface of the image acquisition and data processing modules, and that the switching time does not affect the production rhythm.
[0167] Newly collected test samples refer to recent production samples that were not used in model training. These samples can reflect the defect characteristics of the current production batch, avoiding optimization bias caused by outdated training samples. The number of test samples must meet statistical requirements to ensure the reliability of accuracy calculations.
[0168] Solidifying the current model parameters means that when the detection accuracy of a certain type of defect is improved to above the preset accuracy threshold, the current parameters of the sub-model, such as convolution kernel weights and thresholds, are saved as a stable version and used as the benchmark parameters for subsequent detection, so as to avoid model fluctuations caused by frequent adjustments.
[0169] Through the above optimization steps, the model can dynamically adapt to changes in defect characteristics during the production process, such as changes in coating oxidation characteristics caused by batch differences in materials and changes in abnormal morphology of snap fasteners caused by fluctuations in assembly processes, continuously improving detection accuracy and ensuring long-term stable compliance with production quality control requirements.
[0170] A visual inspection system for the entire appearance of an energy storage socket based on AI algorithms, comprising:
[0171] The detection image acquisition module adjusts the relative position of the imaging device and the energy storage socket according to the read specifications of the energy storage socket; it acquires images of the upper and lower surfaces, sides, and socket hole array of the energy storage socket using a color imaging device to obtain socket sample images; and it acquires images of the wiring copper posts using a black and white imaging device combined with a multispectral component to obtain copper post sample images.
[0172] The data analysis and processing module performs image preprocessing on the socket sample image and the copper pillar sample image, and generates a model training dataset through multi-view image stitching, key area feature extraction and multispectral data processing.
[0173] The socket defect detection module constructs a defect detection model based on the model training dataset. The defect detection model includes a hole position detection module, a plating detection module, a snap-fit detection module, and a sealing strip detection module. The real-time acquired image of the energy storage socket to be tested is input into the defect detection model, and the consistency is verified by combining the output results of each module. Finally, a comprehensive detection result including defect type, defect location, and confidence level is output.
[0174] The foregoing has illustrated and described the basic features, principles, and advantages of the present invention. It should be noted that the present invention is not limited to the above embodiments, but only to some embodiments. Any improvements and additions made without departing from the spirit and scope of the present invention are considered to be within the scope of protection of the present invention.
Claims
1. A method for full-appearance visual inspection of energy storage sockets based on AI algorithms, characterized in that, Includes the following steps: The image acquisition process involves adjusting the relative position of the imaging device and the energy storage socket based on the read specifications. A color imaging device is used to acquire images of the upper and lower surfaces, sides, and socket hole array of the energy storage socket to obtain a socket sample image. A black-and-white imaging device, combined with a multispectral component, is used to acquire images of the copper pillars to obtain a copper pillar sample image. This copper pillar sample image includes the copper pillar's spectral reflectance as spectral data. The spectral data acquired by the multispectral component is standardized, and rotation angle data is used to correct angular deviations in the spectral reflectance. When changes in the illumination angle caused by rotation affect the reflectance of the copper pillar surface, a preset correction model compensates for this deviation. The processed spectral data is then correlated with the copper pillar size data acquired by the black-and-white camera to form a size-spectral feature pair, which serves as the basic data for coating defect detection. The data analysis and processing steps include image preprocessing of the socket sample image and copper pillar sample image, multi-view image stitching and key region feature extraction of the socket sample image, and multispectral data processing of the copper pillar sample image to generate a model training dataset. The socket defect detection steps involve constructing a defect detection model based on the model training dataset. The defect detection model includes a hole detection module, a plating detection module, a snap-fit detection module, and a sealing strip detection module. The real-time acquired image of the energy storage socket to be tested is input into the defect detection model, and the consistency is verified by combining the output results of each module. Finally, a comprehensive detection result including defect type, defect location, and confidence level is output.
2. The method for full-appearance visual inspection of energy storage sockets based on AI algorithms according to claim 1, characterized in that, The color imaging device is equipped with a dynamic focusing lens, which simultaneously reads the real-time angle data of the rotation drive device during the acquisition process. When the rotation angle changes to a preset angle threshold, the dynamic focusing lens automatically adjusts the focal length to compensate for defocus caused by motion offset. The color imaging device is linked with the ultraviolet light source component and adopts a segmented exposure mode for the sealing strip area. The exposure intensity is dynamically adjusted according to the curvature of the sealing strip and the rotation angle. When rotating to the corresponding station of the buckle, the color imaging device and the pressure sensing component are triggered synchronously to acquire the appearance image of the buckle and record the associated data at the time of pressure acquisition. The black and white imaging device works synchronously with the multispectral component to acquire time-series images of the wiring copper post. Its exposure parameters are dynamically adjusted with the rotation speed to avoid motion blur. At each preset rotation angle interval, a set of image data including the copper post size and coating spectral characteristics is acquired.
3. The method for full-appearance visual inspection of energy storage sockets based on AI algorithms according to claim 1, characterized in that, The data analysis and processing steps include: extracting features from the socket sample image to obtain the buckle area image, hole image, and sealing strip image; establishing a rotation angle and pixel offset mapping model based on the encoder data of the rotary drive device; calibrating the images acquired at different angles and completing multi-field motion compensation stitching; correcting the influence of rotation angle on spectral reflectance through polynomial fitting; and associating the corrected multispectral data with the size data of the copper pillar sample image to generate a two-dimensional feature matrix of size and spectrum. Motion blur removal is performed on the image of the buckle area, and the gap width between the buckle and the slot and the buckle deformation area after blur correction are extracted as the dynamic features of the buckle.
4. The method for full-appearance visual inspection of energy storage sockets based on AI algorithms according to claim 1, characterized in that, The detection process of the hole position detection module includes receiving the socket hole array image after multi-field motion compensation stitching, removing noise through image preprocessing algorithm, and calibrating the pixel coordinate system of the hole position area based on rotation angle data; A high-precision edge detection algorithm is used to extract the inner edge contour of each socket hole, calculate the coordinates of the hole center, and map and align them with the hole coordinates in the standard template. Hole offset is identified by coordinate deviation calculation, dynamic threshold segmentation is performed on the area inside the hole, and foreign objects inside the hole are identified by morphological operations. The hole defect type and location information are output as the hole detection result.
5. The method for full-appearance visual inspection of energy storage sockets based on AI algorithms according to claim 1, characterized in that, The detection process of the coating detection module includes acquiring the wiring copper pillar size data and the spectral data of the multispectral component of the copper pillar sample image, and calibrating the coordinate system of the copper pillar image based on the position information output by the hole position detection module. The characteristic bands of the coating oxidation are extracted by the characteristic band extraction algorithm, and the influence of the angle offset on the reflectivity is corrected by combining the rotation angle data. The corrected spectral data is fused with the size data to identify coating oxidation, scratches and pinhole defects, and output the coating defect type and the associated copper pillar size deviation information.
6. The method for full-appearance visual inspection of energy storage sockets based on AI algorithms according to claim 1, characterized in that, The detection process of the buckle detection module includes: receiving the buckle area image acquired by the color imaging device and the contact pressure value synchronously acquired by the pressure sensing component; locating the coordinate area of the buckle in the image based on the position information of the hole detection module; extracting the gap contour between the buckle and the slot through an edge detection algorithm; calculating the average gap width and buckle deformation curvature; establishing a pressure visual association model; and determining that the assembly is qualified when the contact pressure value is greater than a preset pressure threshold and the average gap width is less than a preset gap threshold. Otherwise, output the type and location of the latching error.
7. The method for full-appearance visual inspection of energy storage sockets based on AI algorithms according to claim 6, characterized in that, The buckle detection module also includes a pressure-visual fusion judgment module. Its detection process includes calibrating the time difference between the pressure acquisition time and the image acquisition time. When the time difference is greater than a preset difference value, the pressure change within the time difference is calculated based on the rotation speed, and the pressure value is corrected by an interpolation algorithm. The weights of the pressure value and the gap width are adjusted according to the rotation speed, and a comprehensive score of buckle defects is calculated by combining the gap width and the buckle deformation rate. When the comprehensive score is lower than a preset score threshold, it is determined to be a buckle assembly abnormality, and the score result, abnormality type, and abnormality location information are output.
8. The method for full-appearance visual inspection of energy storage sockets based on AI algorithms according to claim 1, characterized in that, The detection process of the sealing strip detection module includes: receiving a fluorescent image of the sealing strip excited by an ultraviolet light source; locating the sealing strip area based on the overall contour of the socket; extracting the strip contour through adaptive threshold segmentation; obtaining the central axis of the strip using a skeleton extraction algorithm; calculating the axis continuity; identifying areas within the contour whose gray values are higher than a preset gray value threshold based on the average value of the strip; and calculating their area and roundness; when the axis continuity is lower than a preset continuity threshold, or the area and roundness are greater than a preset feature threshold, or the offset of the strip contour compared with the standard position template is greater than a preset offset threshold, the detection result of the sealing strip defect is output.
9. The method for full-appearance visual inspection of energy storage sockets based on AI algorithms according to claim 1, characterized in that, The process also includes a detection optimization step, which compares the output detection results of various defect types with high-precision labeled sample images to calculate the detection accuracy of different defect types. For defect types with a detection accuracy lower than a preset accuracy threshold, feature samples of that defect type are automatically extracted, their weights are increased in the model training set, and the core parameters of the corresponding sub-model are adjusted based on the parameter adjustment algorithm. The adjusted model is redeployed to the detection process, and detection is performed using newly collected test samples. The accuracy of each defect type is calculated again. If the accuracy increases to above the preset accuracy threshold, the current model parameters are fixed. If the threshold is not reached, the above optimization process is repeated.
10. A visual inspection system for the full appearance of an energy storage socket based on an AI algorithm, applicable to the visual inspection method for the full appearance of an energy storage socket based on an AI algorithm as described in any one of claims 1 to 9, characterized in that, include: The detection image acquisition module adjusts the relative position of the imaging device and the energy storage socket according to the read specifications of the energy storage socket. Image samples of the energy storage socket are obtained by acquiring images of the upper and lower surfaces, sides, and socket hole array using a color imaging device; and image samples of the copper terminals are obtained by acquiring images of the wiring copper terminals using a black and white imaging device combined with a multispectral component. The data analysis and processing module performs image preprocessing on the socket sample image and the copper pillar sample image, and generates a model training dataset through multi-view image stitching, key area feature extraction and multispectral data processing. The socket defect detection module constructs a defect detection model based on the model training dataset. The defect detection model includes a hole position detection module, a plating detection module, a snap-fit detection module, and a sealing strip detection module. The real-time acquired image of the energy storage socket to be tested is input into the defect detection model, and the consistency is verified by combining the output results of each module. Finally, a comprehensive detection result including defect type, defect location, and confidence level is output.
Citation Information
Patent Citations
Five-jack socket panel defect intelligent detection method and system based on machine vision
CN114324350A
Pork intramuscular fat content portable determination method and device
CN119715383A