Aluminum electrolytic capacitor surface defect detection method, device and equipment and storage medium

By acquiring multi-scale images and adaptively blocking and encoding based on regional gradient entropy, feature vectors are generated, which solves the problem of insufficient defect detection capabilities in the existing detection methods, and achieves more accurate surface defect detection of aluminum electrolytic capacitors.

CN120259306AInactive Publication Date: 2025-07-04SHENZHEN LIRON ELECTRONICS CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510740859.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-07-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing surface defect detection methods of aluminum electrolytic capacitors are difficult to take into account the details of micro defects and the macro judgment of the overall structure, resulting in missed detection and misjudgment.

Method used

The surface image of multi-scale aluminum electrolytic capacitors is collected, adaptive blocking is performed based on the regional gradient entropy, accurate correspondence between cross-resolution images is established, block locations are encoded, and feature vectors are generated for defect detection.

Benefits of technology

The detection ability of surface defects of aluminum electrolytic capacitors is improved, and defects of various types and sizes can be more accurately identified, reducing calculation amounts and improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259306A_ABST
    Figure CN120259306A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of aluminum electrolytic capacitor surface defect detection, and provides an aluminum electrolytic capacitor surface defect detection method, device and equipment and a storage medium, and the method comprises the steps: collecting a multi-scale aluminum electrolytic capacitor surface image; segmenting the image with the lowest resolution based on the region gradient entropy to obtain a plurality of first blocks; wherein the area of the block with the gradient entropy higher than the set threshold value is smaller than the area of the block with the gradient entropy lower than the set threshold value; determining an area corresponding to each first block in the image with the second low resolution; segmenting the region corresponding to each first block based on a region gradient entropy to obtain a plurality of second blocks; coding the position of each block according to the block space position relation; and generating a feature vector based on the blocks and the position coding information thereof for performing defect detection on the surface of the aluminum electrolytic capacitor. According to the invention, the capability of detecting the surface defects of the aluminum electrolytic capacitor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of defect detection of aluminum electrolytic capacitors, and particularly relates to a method, device, equipment and storage medium for detecting surface defects of aluminum electrolytic capacitors. Background Art

[0002] With the rapid development of computer vision technology and artificial intelligence technology, the method for detecting surface defects of aluminum electrolytic capacitors based on computer vision has gradually become a research hotspot. The existing computer vision detection methods for surface defects of aluminum electrolytic capacitors have problems of insufficient detection ability. For example, most of the existing methods analyze images based on a single scale. It is difficult for a single-scale image to simultaneously take into account the detail capture of tiny defects and the macroscopic judgment of the overall structure. For some defects with small sizes or low contrasts, there is a tendency to miss detections; for defects in complex backgrounds, misjudgments may also occur due to insufficient image information. Therefore, how to improve the detection ability for surface defects of aluminum electrolytic capacitors is a technical problem that urgently needs to be solved at present. Summary of the Invention

[0004] Aiming at the above technical problems, the purpose of this application is to provide a method, device, equipment and storage medium for detecting surface defects of aluminum electrolytic capacitors, aiming to improve the detection ability for surface defects of aluminum electrolytic capacitors.

[0005] In a first aspect, an embodiment of this application provides a method for detecting surface defects of aluminum electrolytic capacitors, including: Collecting surface images of aluminum electrolytic capacitors at multiple scales; wherein, the surface images of aluminum electrolytic capacitors at multiple scales include n surface images of aluminum electrolytic capacitors with different resolutions; Segmenting the surface image of the aluminum electrolytic capacitor with the lowest resolution based on regional gradient entropy to obtain a plurality of first blocks; wherein, the area of the block with a gradient entropy higher than the set threshold is smaller than the area of the block with a gradient entropy lower than the set threshold; Determining the regions corresponding to each first block in the surface image of the aluminum electrolytic capacitor with the second lowest resolution; Segmenting the regions corresponding to each first block based on regional gradient entropy to obtain a plurality of second blocks; And so on, until the surface image of the aluminum electrolytic capacitor with the highest resolution is processed, obtaining a plurality of nth blocks; Encoding the position of each block according to the block spatial position relationship to obtain the position encoding information of each block; Generating a feature vector based on the block and its position encoding information; Using the feature vectors of all blocks to detect surface defects of the aluminum electrolytic capacitor.

[0006] Further, the step of segmenting the surface image of the aluminum electrolytic capacitor with the lowest resolution based on regional gradient entropy to obtain a plurality of first blocks includes: Segment the surface image of the aluminum electrolytic capacitor with the lowest resolution into a plurality of blocks in an equally divided manner; For each block, calculate its gradient entropy. When its gradient entropy is less than or equal to the set threshold, keep the block unchanged; when its gradient entropy is greater than the set threshold, predict whether the size of the sub-blocks after its equal division is greater than or equal to the preset minimum block size according to the size of the block. If not, do not continue to divide it equally; if so, continue to divide it equally until the gradient entropy of the divided block is less than or equal to the preset threshold, or the size of the sub-blocks after the divided block is divided again is less than the preset minimum block size.

[0007] Further, the step of encoding the position of each block according to the block spatial position relationship to obtain the position encoding information of each block includes: For each block, encode the position of each block to reflect its spatial position relationship with its left block, right block, and parent block in space.

[0008] Further, the step of using the feature vectors of all blocks to detect defects on the surface of the aluminum electrolytic capacitor includes: Set the blocks of the surface image of the aluminum electrolytic capacitor with the highest resolution as the blocks at the bottom layer; Set the blocks of the surface image of the aluminum electrolytic capacitor with the second highest resolution as the blocks at the second-to-last layer, and so on. The blocks of the surface image of the aluminum electrolytic capacitor with the lowest resolution are the blocks at the top layer; Based on the feature vectors of each layer of blocks, calculate the feature vectors of each layer in a bottom-up recursive weighted coding manner; Concatenate the feature vectors from the second-to-last layer to the top layer, and input the concatenated result into a multi-layer perceptron to obtain the final feature vector; Perform defect detection based on the final feature vector.

[0009] Further, the step of performing defect detection based on the final feature vector includes: Input the final feature vector into the aluminum electrolytic capacitor surface defect detection model to output the aluminum electrolytic capacitor surface defect target box and type; wherein, the aluminum electrolytic capacitor surface defect types include hose atrophy, flattening, aluminum shell depression, hose warping, hose cutting, and holes.

[0010] Further, the calculation formula of the regional gradient entropy is: H = Wherein, H represents the regional gradient entropy, k represents the number of gradient levels in the region, is the probability of occurrence of the i-th gradient level.

[0011] The embodiment of the present application also provides a surface defect detection device for aluminum electrolytic capacitors. The device includes: An acquisition module, configured to acquire surface images of aluminum electrolytic capacitors at multiple scales; wherein, the surface images of aluminum electrolytic capacitors at multiple scales include n surface images of aluminum electrolytic capacitors with different resolutions; A first segmentation module, configured to segment the surface image of the aluminum electrolytic capacitor with the lowest resolution based on the regional gradient entropy to obtain a plurality of first blocks; wherein, the area of the block with a gradient entropy higher than the set threshold is smaller than the area of the block with a gradient entropy lower than the set threshold; A determination module, configured to determine the regions corresponding to the respective first blocks in the surface image of the aluminum electrolytic capacitor with the second lowest resolution; A second segmentation module, configured to segment the regions corresponding to the respective first blocks based on the regional gradient entropy to obtain a plurality of second blocks; A processing module, configured to continue in this way until the surface image of the aluminum electrolytic capacitor with the highest resolution is processed to obtain a plurality of n-th blocks; A position encoding module, configured to encode the position of each block according to the block spatial position relationship to obtain the position encoding information of each block; A generation module, configured to generate feature vectors based on the blocks and their position encoding information; A detection module, configured to perform defect detection on the surface of the aluminum electrolytic capacitor by using the feature vectors of all the blocks.

[0012] The embodiment of the present application has the following technical effects: (1) By acquiring images at multiple scales, information on the surface of the aluminum electrolytic capacitor can be obtained from multiple scales. High-resolution images are helpful for capturing subtle defect features, while low-resolution images can provide overall structural information. Comprehensive utilization of images with different resolutions can more comprehensively detect various types and sizes of defects.

[0013] (2) Segment the image according to the regional gradient entropy, and the area of the block with a gradient entropy higher than the set threshold is smaller than the area of the block with a gradient entropy lower than the set threshold. Usually, the areas with high gradient entropy are where the texture in the image changes violently and the details are rich, and defects are more likely to exist. Dividing them into smaller blocks can more finely analyze the features of these areas and capture tiny defects, improving the defect detection ability; while the areas with low gradient entropy are relatively smooth and uniform. Dividing them into larger blocks can reduce the calculation amount while ensuring the detection effect, improving the detection efficiency. This way of dividing blocks can be flexibly adjusted according to the actual features of the image, improving the rationality and pertinence of the block division.

[0014] (3) Determining corresponding regions in images with different resolutions and encoding the block positions can establish the association of image information at different resolutions. The position encoding information records the positional relationship of each block in the image, which helps to make full use of the spatial information of the image during subsequent feature extraction and analysis processes, avoid losing important clues related to the position, and thus more accurately locate and identify defects.

[0015] (4) Generating feature vectors based on the blocks and their position encoding information provides a comprehensive feature description for defect detection. These feature vectors integrate various information such as the texture, details, and spatial position of the image, and can better distinguish normal regions and defect regions. Using the feature vectors of all blocks for defect detection can fully exploit various features in the image, improve the recognition ability of the detection algorithm for different types of defects, and thus achieve more accurate defect detection.

[0016] In summary, the surface defect detection method for aluminum electrolytic capacitors in the embodiments of this application collects multi-resolution images, adaptively divides blocks based on regional gradient entropy, establishes accurate corresponding relationships between cross-resolution images and encodes the block positions, and finally generates feature vectors for defect detection, realizing the full utilization and analysis of the surface information of aluminum electrolytic capacitors and improving the detection ability for surface defects of aluminum electrolytic capacitors. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions of this application, the accompanying drawings required for the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of this application, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.

[0018] Figure 1 is a schematic flowchart of the surface defect detection method for aluminum electrolytic capacitors provided by an embodiment of this application; Figure 2 is a schematic structural diagram of the surface defect detection device for aluminum electrolytic capacitors provided by an embodiment of this application; Figure 3 is a schematic block diagram of the structure of the computer device provided by the embodiments of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0019] In order to make the purpose, technical solutions, and advantages of this application clearer, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain this application and are not used to limit this application.

[0020] Those skilled in the art of the present technology can understand that, unless specifically stated, the singular forms "a", "an", "above-mentioned", and "the" used herein may also include the plural forms. It should be further understood that the term "including" used in the specification of the present application means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or their groups. It should be understood that when we say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any module and all combinations of one or more related listed items.

[0021] Those skilled in the art of the present technology can understand that, unless otherwise defined, all terms used herein (including technical terms and scientific terms) have the same meaning as the general understanding of those of ordinary skill in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have a meaning consistent with the meaning in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless specifically defined as here.

[0022] Please refer to Figure 1 , the embodiment of the present application provides a method for detecting surface defects of an aluminum electrolytic capacitor, including steps S1 - S8: S1. Collect surface images of the aluminum electrolytic capacitor at multiple scales; wherein, the surface images of the aluminum electrolytic capacitor at multiple scales include n surface images of the aluminum electrolytic capacitor with different resolutions.

[0023] In step S1, in the surface detection device of the aluminum electrolytic capacitor, an industrial camera is installed, and multi - resolution shooting of the same industrial camera is achieved through electric focusing. After each shooting, the visible position of the capacitor is changed through an electric translation stage and / or a rotary stage to cover different areas. A ring - shaped LED light source provides uniform illumination to reduce reflection. A polarizer is added to the ring - shaped LED light source, and a polarizing mirror is installed at the front end of the industrial camera lens to reduce glare on the surface of the aluminum shell and enhance the defect contrast.

[0024] After collecting the surface images of the aluminum electrolytic capacitor at multiple scales, the surface images of the aluminum electrolytic capacitor at multiple scales are sorted in descending order according to the resolution, so as to facilitate processing the images according to the resolution level.

[0025] S2. Segment the surface image of the aluminum electrolytic capacitor with the lowest resolution based on regional gradient entropy to obtain a plurality of first blocks; wherein, the area of the block with a gradient entropy higher than the set threshold is smaller than the area of the block with a gradient entropy lower than the set threshold.

[0026] S3. Determine the regions corresponding to each first block in the surface image of the aluminum electrolytic capacitor with the second lowest resolution.

[0027] S4. Segment the regions corresponding to each first block based on the regional gradient entropy to obtain a plurality of second blocks.

[0028] S5. And so on until the surface image of the aluminum electrolytic capacitor with the highest resolution is processed to obtain a plurality of nth blocks.

[0029] In step S5, after the surface images of the aluminum electrolytic capacitor with the lowest resolution and the surface image of the aluminum electrolytic capacitor with the second lowest resolution are processed in steps S1 - S4, the surface images of the aluminum electrolytic capacitor with each resolution are processed in the same manner in ascending order of resolution until the surface image of the aluminum electrolytic capacitor with the highest resolution is processed to obtain a plurality of nth blocks.

[0030] S6. Encode the position of each block according to the block spatial position relationship to obtain the position encoding information of each block.

[0031] S7. Generate feature vectors based on the blocks and their position encoding information.

[0032] S8. Use the feature vectors of all blocks to detect defects on the surface of the aluminum electrolytic capacitor.

[0033] In the embodiment of the present application, the regional gradient entropy is the gradient entropy of the region, and the gradient entropy is a measure for describing the uncertainty or chaos degree of the gradient distribution within a certain region in the image. The regional gradient entropy is calculated according to the following formula (1): H = ; (1) where H represents the gradient entropy of the region, k represents the number of gradient levels in the region, is the probability that the i-th gradient level appears.

[0034] When calculating the regional gradient entropy using this formula, first, for each pixel in the region, calculate its horizontal gradient and vertical gradient, and then calculate its gradient amplitude using its horizontal gradient and its vertical gradient. Then discretize the continuous gradient amplitudes into a finite number of gradient levels. In this region, count the number of gradient levels in this region and count the probability that each gradient level appears, and then calculate the gradient entropy of this region using the number of gradient levels in this region and the probability that each gradient level appears in this region.

[0035] The embodiment of the present application has the following technical effects: (1)Collect images at multiple scales, which can obtain information on the surface of aluminum electrolytic capacitors from multiple scales. High-resolution images are helpful for capturing subtle defect features, while low-resolution images can provide overall structural information. By comprehensively using images with different resolutions, various types and sizes of defects can be detected more comprehensively.

[0036] (2)Segment the image according to the regional gradient entropy, and the area of the block with a gradient entropy higher than the set threshold is smaller than the area of the block with a gradient entropy lower than the set threshold. Usually, the area with a high gradient entropy is where the texture in the image changes violently and the details are rich, and defects are more likely to exist. Dividing it into smaller blocks can more finely analyze the characteristics of these areas, capture tiny defects, and improve the defect detection ability; while the area with a low gradient entropy is relatively smooth and uniform. Dividing it into larger blocks can reduce the computational amount while ensuring the detection effect, improving the detection efficiency. This block division method can be flexibly adjusted according to the actual characteristics of the image, improving the rationality and pertinence of the block division.

[0037] (3)Determine the corresponding areas in images with different resolutions and encode the positions of the blocks, which can establish the association of image information at different resolutions. The position encoding information records the position relationship of each block in the image, which helps to make full use of the spatial information of the image in the subsequent feature extraction and analysis process, avoid losing important clues related to the position, and thus more accurately locate and identify defects. (4)Generate feature vectors based on the blocks and their position encoding information, which provides a comprehensive feature description for defect detection. These feature vectors integrate various information such as the texture, details, and spatial position of the image, and can better distinguish normal areas and defect areas. Using the feature vectors of all blocks for defect detection can fully explore various features in the image, improve the recognition ability of the detection algorithm for different types of defects, and thus achieve more accurate defect detection.

[0038] In summary, the method for detecting surface defects of aluminum electrolytic capacitors in the embodiments of the present application collects multi-resolution images, performs adaptive block division based on regional gradient entropy, establishes a precise correspondence relationship between cross-resolution images and encodes the positions of the blocks, and finally generates feature vectors for defect detection, realizing the full utilization and analysis of the surface information of aluminum electrolytic capacitors and improving the detection ability of surface defects of aluminum electrolytic capacitors.

[0039] In one embodiment, the step of segmenting the surface image of the aluminum electrolytic capacitor with the lowest resolution based on the regional gradient entropy to obtain a plurality of first blocks includes: Segment the surface image of the aluminum electrolytic capacitor with the lowest resolution into a plurality of blocks in an equal division manner; For each block, its gradient entropy is calculated. When its gradient entropy is less than or equal to the set threshold, the block is kept unchanged; when its gradient entropy is greater than the set threshold, it is predicted whether the size of the sub-block after it is divided is greater than or equal to the preset minimum block size according to the size of the block. If not, it is not divided further; if yes, it is divided further until the gradient entropy of the divided block is less than or equal to the preset threshold, or the size of the sub-block after the divided block is divided again is less than the preset minimum block size.

[0040] In the embodiment of the present application, the surface image P of the aluminum electrolytic capacitor with the lowest resolution is segmented. For example, it is first segmented into two blocks of equal size in an equal manner, and then the gradient entropy of each block is calculated. Assuming that the set threshold is 100, for block A, the gradient entropy is calculated to be 80. Since 80 is less than 100, block A remains unchanged and no further segmentation is performed. For block B, the gradient entropy is calculated to be 120. Since 120 is greater than 100, further judgment is required. Assuming that the preset minimum block size is 10*10 pixels, the size of block B is 10*20 pixels, and the size of the sub-block after being divided is predicted to be 10*10 pixels (halved), which is equal to the preset minimum block size, so B is further divided to obtain two sub-blocks B1 and B2. The gradient entropy of sub-block B1 is calculated to be 90, which is less than 100, so B1 remains unchanged; the gradient entropy of B2 is calculated to be 110, which is greater than 100, and the sub-block size of B2 after being divided is predicted to be 5*10, which is less than 10*10 pixels, so B2 is not further divided. The size of the block mentioned here refers to the area of ​​the block.

[0041] The embodiment of the present application introduces a preset minimum block size condition when determining whether to continue the equal division. When the size of the sub-block after the block is equally divided is smaller than the minimum block size, even if its gradient entropy is greater than the threshold, the equal division will not be continued. This can avoid excessive segmentation caused by abnormally drastic grayscale changes in some local areas of the image, and prevent the image from being segmented into overly trivial small blocks, thereby ensuring the rationality and practicality of the segmentation result to a certain extent, and also reducing the complexity of subsequent processing.

[0042] It should be understood that the method of dividing the regions corresponding to the first blocks based on the regional gradient entropy to obtain multiple second blocks is the same as the method of dividing the surface image of the aluminum electrolytic capacitor with the lowest resolution based on the regional gradient entropy to obtain multiple first blocks, except that the objects are different, and the embodiments of the present invention are not described in detail here.

[0043] In one embodiment, the step of encoding the position of each block according to the spatial position relationship of the blocks to obtain the position encoding information of each block includes: For each block, encode the position of each block to reflect its spatial position relationship with its left block, right block, and parent block in space.

[0044] In the embodiments of the present application, the various blocks in the image do not exist in isolation, and their spatial relationships reflect the overall structure of the image. Through this encoding method, this structural information can be retained, so that when processing and analyzing the image, these spatial relationships can be used to understand the content and features of the image. For the surface image of the aluminum electrolytic capacitor, through this encoding, the connection and distribution between different regions can be understood, which helps to determine whether the defect is related to a specific structural region. When processing images with different resolutions, this encoding method based on spatial position relationships helps to establish corresponding relationships between images. Blocks at different resolutions can be matched and associated through their respective position encoding information, so as to realize the fusion and comprehensive utilization of multi-resolution image information and better detect defects at different scales.

[0045] In one embodiment, the step of using the feature vectors of all blocks to detect defects on the surface of the aluminum electrolytic capacitor includes: Set the blocks of the surface image of the aluminum electrolytic capacitor with the highest resolution as the blocks at the bottom layer; Set the blocks of the surface image of the aluminum electrolytic capacitor with the second highest resolution as the blocks at the second-to-last layer, and so on, and the blocks of the surface image of the aluminum electrolytic capacitor with the lowest resolution as the blocks at the top layer; Based on the feature vectors of the blocks at each layer, calculate the feature vectors of each layer by using a bottom-up recursive weighted encoding method; Concatenate the feature vectors from the second-to-last layer to the top layer, and input the concatenated result into a multi-layer perceptron to obtain the final feature vector; Perform defect detection based on the final feature vector.

[0046] In the embodiments of the present application, the final feature vector obtained through the above steps encodes the feature information on the surface images of aluminum electrolytic capacitors with different resolutions, which captures both local and local relationships and local and global relationships, making the final feature vector more discriminative.

[0047] In one embodiment, the step of calculating the feature vectors of each layer by using a bottom-up recursive weighted encoding method based on the feature vectors of the blocks at each layer includes: Let n be the bottom layer and n - 1 be the second-to-last layer. For the i-th block in the (n - 1)-th layer, according to formula (2): Calculate the weighted feature vector of the i-th block in the (n - 1)-th layer; where, is the weighted feature vector of the i-th block in the (n - 1)-th layer, is the feature vector of the i-th block in the (n - 1)-th layer, is the feature vector of the first sub-block under the i-th block in the (n - 1)-th layer, is the feature vector of the m-th sub-block under the i-th block in the (n - 1)-th layer, where m represents the number of sub-blocks under the i-th block in the (n - 1)-th layer, is a multi-layer perceptron, and [,] represents concatenation; And so on, calculate the weighted feature vectors of the remaining blocks in the (n - 1)-th layer; Concatenate the weighted feature vectors of all blocks in the (n - 1)-th layer to obtain the feature vector of the (n - 1)-th layer; where, ; represents the feature vector of the (n - 1)-th layer, represents the weighted feature vector of the first block in the (n - 1)-th layer, represents the weighted feature vector of the second block in the (n - 1)-th layer, represents the weighted feature vector of the p-th block in the (n - 1)-th layer, where p represents the number of blocks in the (n - 1)-th layer; And so on, from bottom to top, recursively, to obtain the feature vectors of each layer.

[0048] In the embodiments of the present application, it should be understood that the principle of formula 2 is that the feature vectors of all blocks in the sub-layer are first concatenated, and the feature vector of the parent layer is used as the weight.

[0049] In one embodiment, the step of generating a feature vector based on the block and its position encoding information includes: generating a feature vector through an encoder based on the block and its position encoding information; where, since the resolutions corresponding to different layers are different, therefore, each layer corresponds to an encoder, and the network structures of the encoders for different layers are the same, but the weights are different. It should be noted that since the resolutions corresponding to different layers are different, the weights of the encoders corresponding to different layers are different.

[0050] In one embodiment, the step of performing defect detection based on the final feature vector includes: Input the final feature vector into the surface defect detection model of the aluminum electrolytic capacitor, and output the surface defect target box and type of the aluminum electrolytic capacitor; where, the surface defect types of the aluminum electrolytic capacitor include hose atrophy, flattening, aluminum shell depression, hose warping, hose cutting, and hole.

[0051] In the embodiments of the present application, the surface defects of the aluminum electrolytic capacitor include multiple types, such as holes, unclean aluminum shell, depression, hose warping, holes, and hose atrophy. Among them, when the aluminum shell is exposed, hose atrophy is determined.

[0052] In the embodiment of the present application, it should be noted that the surface defects of aluminum electrolytic capacitors include not only the above-mentioned types, but there are actually many types of defects, such as bald heads, that is, the solder joint tube does not cover the edge of the aluminum shell, leaking solder joints, etc. In the embodiment of the present application, the surface defect detection model of aluminum electrolytic capacitors is trained in the following way: a large amount of surface image data of aluminum electrolytic capacitors with annotations (normal or defective, and defect type, etc.) is collected in advance, and the final feature vector is generated according to the above method of generating the final feature vector, and these feature vectors are used as input, and the corresponding annotation information is used as output to train a classification model, such as support vector machine (SVM), decision tree, random forest, neural network and other classifiers. During the training process, the model will learn the mapping relationship between different feature vectors and defect types, and finally obtain an aluminum electrolytic capacitor surface defect detection model that can detect surface defects of aluminum electrolytic capacitors and identify defect types.

[0053] like Figure 2 As shown, the embodiment of the present application also provides a surface defect detection device for aluminum electrolytic capacitors, the device comprising: An acquisition module 1 is used to acquire a multi-scale surface image of an aluminum electrolytic capacitor; wherein the multi-scale surface image of an aluminum electrolytic capacitor includes n surface images of an aluminum electrolytic capacitor with different resolutions; The first segmentation module 2 is used to segment the surface image of the aluminum electrolytic capacitor with the lowest resolution based on the regional gradient entropy to obtain a plurality of first blocks; wherein the area of ​​the block with a gradient entropy higher than a set threshold is smaller than the area of ​​the block with a gradient entropy lower than the set threshold; A determination module 3, used to determine the area corresponding to each first block in the surface image of the aluminum electrolytic capacitor with the second lowest resolution; A second segmentation module 4 is used to segment the regions corresponding to the first blocks based on regional gradient entropy to obtain a plurality of second blocks; Processing module 5, used for processing the surface image of the aluminum electrolytic capacitor with the highest resolution in the same manner as above, and obtaining a plurality of n-th blocks; A position coding module 6 is used to encode the position of each block according to the spatial position relationship of the blocks to obtain position coding information of each block; A generating module 7, used for generating a feature vector based on the block and its position coding information; The detection module 8 is used to perform defect detection on the surface of the aluminum electrolytic capacitor using the feature vectors of all blocks.

[0054] In one embodiment, the first segmentation module 2 includes: A first segmentation unit is used to segment the surface image of the aluminum electrolytic capacitor with the lowest resolution into a plurality of blocks in an equal manner; A processing unit is configured to calculate the gradient entropy for each block. When the gradient entropy is less than or equal to a set threshold, the block remains unchanged. When the gradient entropy is greater than the set threshold, it predicts whether the size of the sub-blocks after equal division of the block is greater than or equal to a preset minimum block size according to the size of the block. If not, it does not continue to divide the block. If so, it continues to divide the block until the gradient entropy of the divided block is less than or equal to the preset threshold, or the size of the sub-blocks after the divided block is divided again is less than the preset minimum block size.

[0055] In one embodiment, the position encoding module 6 is specifically configured to: For each block, encode the position of each block to reflect its spatial position relationship with its left block, right block, and parent block in space.

[0056] In one embodiment, the detection module 8 includes: A first equivalent unit is configured to set the block of the surface image of the aluminum electrolytic capacitor with the highest resolution as the block at the bottom layer; A second equivalent unit is configured to set the block of the surface image of the aluminum electrolytic capacitor with the second highest resolution as the block at the penultimate layer, and so on. The block of the surface image of the aluminum electrolytic capacitor with the lowest resolution is the block at the top layer; A calculation unit is configured to calculate the feature vectors of each layer in a bottom-up recursive weighted encoding manner based on the feature vectors of the blocks of each layer; A splicing unit is configured to splice the feature vectors from the penultimate layer to the top layer, and input the spliced result into a multi-layer perceptron to obtain a final feature vector; A detection unit is configured to perform defect detection based on the final feature vector.

[0057] In one embodiment, the detection unit is specifically configured to: Input the final feature vector into the aluminum electrolytic capacitor surface defect detection model, and output the aluminum electrolytic capacitor surface defect target box and type; wherein, the aluminum electrolytic capacitor surface defect types include hose atrophy, flattening, aluminum shell depression, hose warping, hose cutting, and hole.

[0058] In one embodiment, the calculation formula of the regional gradient entropy is: H = where H represents the regional gradient entropy, k represents the number of gradient levels in the region, is the probability of the occurrence of the i-th gradient level.

[0059] Referring to Figure 3 , the embodiment of the present application also provides a computer device, and the internal structure of the computer device can be as Figure 3As shown. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. Among them, the processor designed for the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating device, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a method for detecting surface defects of aluminum electrolytic capacitors. The network interface of the computer device is used to communicate with an external terminal via a network connection. Further, the above computer device may also be provided with an input device, a display screen, etc. The above computer program, when executed by the processor, implements a method for detecting surface defects of aluminum electrolytic capacitors. Those skilled in the art can understand that Figure 3 The structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.

[0060] Embodiment 4: An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a method for detecting surface defects of aluminum electrolytic capacitors is implemented.

[0061] Those of ordinary skill in the art can understand that all or part of the processes in the above-described embodiment methods can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the above-described method embodiments. Among them, any reference to a memory, storage, database, or other medium provided in the present application and used in the embodiments may include non-volatile and / or volatile memories. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or an external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0062] It should be noted that in this document, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article or method comprising a series of elements not only includes those elements but also other elements not expressly listed, or elements that are inherent to such process, apparatus, article or method. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, apparatus, article or method comprising such element.

[0063] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.

Claims

1. A method for detecting surface defects of an aluminum electrolytic capacitor, characterized in that, The method includes: Collecting surface images of multi-scale aluminum electrolytic capacitors; wherein, the surface images of the multi-scale aluminum electrolytic capacitors include n surface images of aluminum electrolytic capacitors with different resolutions; Segmenting the surface image of the aluminum electrolytic capacitor with the lowest resolution based on regional gradient entropy to obtain a plurality of first blocks; wherein, the area of the block with a gradient entropy higher than the set threshold is smaller than the area of the block with a gradient entropy lower than the set threshold; Determining the regions corresponding to each of the first blocks in the surface image of the aluminum electrolytic capacitor with the second lowest resolution; Segmenting the regions corresponding to each of the first blocks based on regional gradient entropy to obtain a plurality of second blocks; And so on until the surface image of the aluminum electrolytic capacitor with the highest resolution is processed to obtain a plurality of nth blocks; Encoding the position of each block according to the block spatial position relationship to obtain the position encoding information of each block; Generating a feature vector based on the block and its position encoding information; Using the feature vectors of all the blocks to perform defect detection on the surface of the aluminum electrolytic capacitor.

2. The surface defect detection method of the aluminum electrolytic capacitor according to claim 1, characterized in that, The step of segmenting the surface image of the aluminum electrolytic capacitor with the lowest resolution based on regional gradient entropy to obtain a plurality of first blocks includes: Segmenting the surface image of the aluminum electrolytic capacitor with the lowest resolution into a plurality of blocks in an equal division manner; For each block, calculating its gradient entropy. When its gradient entropy is less than or equal to the set threshold, keep the block unchanged; when its gradient entropy is greater than the set threshold, predict whether the size of the sub-blocks after its equal division is greater than or equal to the preset minimum block size according to the size of the block. If not, do not continue to divide it; if so, continue to divide it until the gradient entropy of the divided block is less than or equal to the preset threshold, or the size of the sub-blocks after the divided block is divided again is less than the preset minimum block size.

3. The surface defect detection method of an aluminum electrolytic capacitor according to claim 1, characterized in that, The step of encoding the position of each block according to the block spatial position relationship to obtain the position encoding information of each block includes: For each block, encoding the position of each block to reflect its spatial position relationship with its left block, right block and parent block in space.

4. The surface defect detection method of an aluminum electrolytic capacitor according to claim 1, characterized in that, The step of using the feature vectors of all the blocks to perform defect detection on the surface of the aluminum electrolytic capacitor includes: Setting the blocks of the surface image of the aluminum electrolytic capacitor with the highest resolution as the blocks at the bottom layer; Setting the blocks of the surface image of the aluminum electrolytic capacitor with the second highest resolution as the blocks at the penultimate layer, and so on, and setting the blocks of the surface image of the aluminum electrolytic capacitor with the lowest resolution as the blocks at the top layer; Based on the feature vectors of the blocks at each layer, calculating the feature vectors of each layer in a bottom-up recursive weighted encoding manner; Concatenating the feature vectors from the penultimate layer to the top layer, and inputting the concatenated result into a multi-layer perceptron to obtain the final feature vector; Performing defect detection based on the final feature vector.

5. The surface defect detection method of an aluminum electrolytic capacitor according to claim 4, characterized in that The step of performing defect detection based on the final feature vector includes: The final feature vector is input into the aluminum electrolytic capacitor surface defect detection model, and the aluminum electrolytic capacitor surface defect target frame and type are output; wherein the aluminum electrolytic capacitor surface defect types include hose shrinkage, flattening, aluminum shell dents, hose warping, hose cuts and holes.

6. The surface defect detection method of the aluminum electrolytic capacitor according to claim 1, characterized in that, The calculation formula of the regional gradient entropy is: H= Among them, H represents the regional gradient entropy, k represents the number of gradient levels in the region, is the probability that the i-th gradient level appears.

7. An aluminum electrolytic capacitor surface defect detection device, characterized in that, The device comprises: An acquisition module, used for acquiring multi-scale surface images of aluminum electrolytic capacitors; wherein the multi-scale surface images of aluminum electrolytic capacitors include n surface images of aluminum electrolytic capacitors with different resolutions; The first segmentation module is used to segment the surface image of the aluminum electrolytic capacitor with the lowest resolution based on the regional gradient entropy to obtain a plurality of first blocks; wherein the area of ​​the block with a gradient entropy higher than a set threshold is smaller than the area of ​​the block with a gradient entropy lower than the set threshold; A determination module, used to determine the area corresponding to each first block in the surface image of the aluminum electrolytic capacitor with the second lowest resolution; A second segmentation module, used for segmenting the regions corresponding to the first blocks based on regional gradient entropy to obtain a plurality of second blocks; A processing module is used to process the surface image of the aluminum electrolytic capacitor with the highest resolution by analogy until a plurality of n-th blocks are obtained; A position coding module is used to encode the position of each block according to the spatial position relationship of the blocks to obtain position coding information of each block; A generation module, used for generating a feature vector based on the block and its position encoding information; The detection module is used to detect defects on the surface of aluminum electrolytic capacitors using feature vectors of all blocks.

8. A computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, characterized in that, When the processor executes the computer program, the steps of the method for detecting surface defects of an aluminum electrolytic capacitor according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the surface defect detection method for an aluminum electrolytic capacitor according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Low-rank DCT compressed sensing algorithm realized based on FPGA

    CN120956909A

  • Bolt tension detection method and detection system

    CN121558502A

  • Bolt tensile testing methods and systems

    CN121558502B