A method for identifying defects in energy-saving power bank batteries
By chunking, edge detection and texture complexity analysis of the electrode image of lithium-ion battery, the probability of abnormality is calculated, and the problem of poor recognition effect of traditional methods is solved and the accuracy of identification of battery defects is improved.
Patent Information
- Application Number
- CN202411346346.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-26
AI Technical Summary
During the manufacturing process of lithium-ion battery electrode sheets, the conductive agent fails to completely disperse, resulting in aggregate particles appearing on the surface of the electrode sheets, affecting battery performance and safety, and the traditional detection methods are not effective.
By collecting electrode images, blocked edge detection is performed, the texture complexity curve and grayscale curve difference is calculated, the image is adjusted to obtain the grayscale run matrix, and the abnormal probability is calculated to identify battery defects.
It improves the accuracy of identifying defects in the energy-saving power bank battery, obtains accurate texture information between grayscale levels in the electrode image, and enhances the detection ability of battery defects.
Smart Images

Figure CN118887207B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pattern recognition, and in particular to a method for identifying defects in an energy-saving power bank battery. Background Art
[0002] At present, there are two main types of energy-saving power bank batteries: lithium-ion batteries and lithium polymer batteries. Both batteries are commonly used rechargeable batteries in modern electronic products. Generally speaking, lithium-ion batteries are more common in energy-saving power banks, with advantages such as high energy density, high charging and discharging efficiency, relatively wide operating temperature range, long service life, and relatively low cost. These batteries are usually designed with efficient energy management, low power consumption and long life to reduce energy waste, achieve energy saving and provide reliable charging solutions.
[0003] However, in the manufacturing process of lithium-ion battery pole pieces, the conductive agent is not fully dispersed, resulting in the appearance of polymer particles on the pole piece surface. Due to the appearance of these defects, the performance of the battery is reduced, and the safety during use will also be affected. The traditional method of detecting polymer particles on the surface of battery pole pieces is to obtain an image of the pole piece surface and then obtain the grayscale run matrix of the image for abnormal recognition analysis. However, the grayscale run matrix is obtained by analyzing the grayscale of the image. Due to the difference in grayscale, it has a great impact on the effect of identifying polymer particles on the surface of the battery pole piece. Summary of the invention
[0004] The present invention provides a method for identifying defects in an energy-saving power bank battery to solve the existing problems.
[0005] The present invention provides a method for identifying defects in energy-saving power bank batteries using the following technical solutions:
[0006] An embodiment of the present invention provides a method for identifying defects in an energy-saving power bank battery, the method comprising the following steps:
[0007] Acquiring electrode images;
[0008] Divide the electrode image into blocks to obtain a number of pixel blocks, perform edge detection on each pixel block to obtain all edge pixel points in each pixel block, obtain the average gradient amplitude of all edge pixel points in each pixel block, obtain the proportion of edge pixel points in each pixel block according to the number of edge pixel points in each pixel block, obtain the texture complexity of each pixel block according to the average gradient amplitude of all edge pixel points in each pixel block and the proportion of edge pixel points in each pixel block, obtain the texture complexity curve of the pixel block according to the texture complexity of each pixel block, obtain a grayscale curve, obtain the difference between the texture complexity curve and the grayscale curve of the pixel block according to the texture complexity of the pixel block and the number of pixels corresponding to the grayscale in the grayscale curve, obtain the optimal grayscale curve according to the difference between the texture complexity curve and the grayscale curve of the pixel block, obtain an adjusted electrode image according to the optimal grayscale curve, and obtain a grayscale run matrix according to the adjusted electrode image;
[0009] Obtain a first probability defect parameter and a second probability defect parameter according to the grayscale run matrix, and obtain an abnormal probability of the image according to the first probability defect parameter and the second probability defect parameter;
[0010] Anomaly detection is performed on the electrode image according to the abnormal probability of the image.
[0011] Furthermore, the electrode image is divided into blocks to obtain a plurality of pixel blocks, and edge detection is performed on each pixel block to obtain all edge pixel points in each pixel block, including the following specific steps:
[0012] Divide the electrode image equally into pixel blocks, perform edge detection on each pixel block using the Canny operator to obtain all edge pixel points in each pixel block, where H is a preset threshold.
[0013] Further, the texture complexity of each pixel block is obtained according to the average gradient amplitude of all edge pixels in each pixel block and the proportion of edge pixels in each pixel block, and the texture complexity curve of the pixel block is obtained according to the texture complexity of each pixel block, including the following specific steps:
[0014] The product of the average gradient amplitude of all edge pixels in each pixel block and the proportion of edge pixels in each pixel block obtains the texture complexity of each pixel block; all pixel blocks are sorted from large to small according to the average gradient amplitude, and the sorted result is recorded as a pixel block gradient sequence, and the pixel block gradient sequence is marked as 1, 2, 3, ..., n from the first element to the last element; where n represents the number of pixel blocks; with the texture complexity of each pixel block as the vertical axis and the label value of each pixel block as the horizontal axis, the texture complexity of the pixel block is curve fitted according to the least squares method to obtain the texture complexity curve of the pixel block.
[0015] Furthermore, the specific steps of obtaining the grayscale curve are as follows:
[0016] The grayscale histogram of the electrode image is obtained, the number of pixels corresponding to the first m grayscale levels in the grayscale histogram is selected, and the number of pixels corresponding to the grayscale levels is curve fitted according to the least squares method to obtain a grayscale curve; wherein m is a preset threshold.
[0017] Further, the texture complexity of the pixel block according to the texture complexity of the pixel block and the number of pixel points corresponding to the gray level in the gray level curve, obtaining the difference between the texture complexity curve and the gray level curve of the pixel block, and obtaining the optimal gray level curve according to the difference between the texture complexity curve and the gray level curve of the pixel block, comprises the following specific steps:
[0018] The calculation formula for the difference between the texture complexity curve and the grayscale curve of the pixel block is:
[0019]
[0020] In the formula, represents the texture complexity of the i-th pixel block, represents the texture complexity of the i-1th pixel block, represents the mean value of the texture complexity of all pixel blocks, n represents the number of all pixel blocks, Represents the number of pixels of the jth gray level of the gray level curve, Represents the number of pixels of the j-1th gray level of the gray level curve, Represents the average number of pixels of the first m gray levels of the gray level curve, m represents the number of gray levels in the gray level curve, Indicates the degree of difference between the texture complexity curve and the grayscale curve. Indicates the absolute value sign;
[0021] The grayscale curve with the smallest difference from the texture complexity curve is selected and recorded as the optimal grayscale curve.
[0022] Furthermore, the step of obtaining an adjusted electrode image according to the optimal grayscale curve and obtaining a grayscale run matrix according to the adjusted electrode image includes the following specific steps:
[0023] Perform k-means clustering on the grayscale of the optimal grayscale curve according to the number of pixels at each grayscale level, and use the elbow method to obtain the optimal number of clusters C;
[0024] The gray level of each pixel in the electrode image is linearly mapped to between 0 and C to obtain an adjusted electrode image, and a gray level run length matrix is obtained according to the adjusted electrode image.
[0025] Furthermore, the specific steps of obtaining the first probability defect parameter are as follows:
[0026] Divide the same data in the bth column of the grayscale run matrix into one class, and obtain several classes in the bth column;
[0027] The calculation formula for the abnormality of each column of data in the grayscale run matrix is:
[0028]
[0029] In the formula, Represents the data value of the ath row and bth column in the grayscale run matrix. Represents the number of all rows in the grayscale run matrix, represents the number of q-th category data in the b-th column of the grayscale run matrix, and R represents the total number of all categories in the b-th column of the grayscale run matrix. represents an exponential function with a natural constant as base, Indicates the degree of abnormality of the data in column b of the grayscale run matrix. represents a Boolean-valued function, represents the logarithmic function with base 10;
[0030] The first probability defect parameter is obtained by averaging the abnormality levels of all column data in the grayscale run matrix.
[0031] Furthermore, the specific steps of obtaining the second probability defect parameter are as follows:
[0032] The calculation formula for the abnormality of each row of data in the grayscale run matrix is:
[0033]
[0034] In the formula, represents the data value of the ath row and bth column in the grayscale run matrix, b is the bth column, and B represents the number of all columns in the grayscale run matrix. represents an exponential function with a natural constant as base, Indicates the abnormality of the data in the ath row of the grayscale run matrix;
[0035] The second probability defect parameter is obtained by averaging the abnormality levels of all row data in the grayscale run matrix.
[0036] Furthermore, the specific steps of obtaining the abnormal probability of the image are as follows:
[0037] The average of the first probability defect parameter and the second probability defect parameter is taken as the abnormality probability of the image.
[0038] Furthermore, the abnormality detection of the electrode image according to the abnormality probability of the image includes the following specific steps:
[0039] When the abnormal probability of the image is greater than or equal to the preset threshold T, the energy-saving power bank battery has defects in the production process; when the abnormal probability of the image is less than the preset threshold T, the energy-saving power bank battery has no defects in the production process.
[0040] The beneficial effects of the technical solution of the present invention are as follows: the present invention obtains a texture complexity curve and a grayscale curve by analyzing and processing the electrode image, obtains the degree of difference between the two curves according to the texture complexity of the pixel block in the texture complexity curve of the pixel block and the number of pixel points corresponding to the grayscale in the grayscale curve, determines the optimal grayscale curve according to the degree of difference and obtains the grayscale run matrix, thereby obtaining accurate texture information between grayscales in the electrode image; obtains a first probability defect parameter and a second probability defect parameter according to the grayscale run matrix, obtains the abnormal probability of the image according to the first probability defect parameter and the second probability defect parameter, and performs abnormal identification on the electrode image according to the abnormal probability of the image, thereby improving the accuracy of identifying defects in energy-saving power banks. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 The present invention is a flowchart of the steps of a method for identifying battery defects of an energy-saving power bank. DETAILED DESCRIPTION
[0043] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the energy-saving power bank battery defect identification method proposed by the present invention, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0044] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0045] The specific scheme of the energy-saving power bank battery defect identification method provided by the present invention is described in detail below with reference to the accompanying drawings.
[0046] See also Figure 1 , which shows a flowchart of a method for identifying defects in an energy-saving power bank battery provided by an embodiment of the present invention, the method comprising the following steps:
[0047] Step S001: Acquire a lithium battery electrode image, and preprocess it to obtain a processed electrode image.
[0048] It should be noted that in order to analyze the abnormal situation of polymer particles appearing on the surface of battery electrodes during the production process of lithium batteries, it is necessary to collect images of lithium battery electrodes and perform electrode abnormality detection based on the collected images.
[0049] Specifically, the electrode image of the lithium battery is captured by a scanning electron microscope on a defect recognition electronic device to obtain a lithium battery electrode image, which is then preprocessed by grayscale and mean filtering. The noise in the electrode image is filtered out by mean filtering to obtain a processed electrode image.
[0050] The defect recognition electronic device includes: a storage table, a scanning electron microscope, a light source, and an automatic control device.
[0051] At this point, the electrode image is obtained.
[0052] Step S002: Divide the electrode image into blocks to obtain several pixel blocks, obtain the proportion of edge pixels in each pixel block according to the number of edge pixels in each pixel block, obtain the texture complexity of each pixel block according to the average gradient amplitude and proportion of all edge pixels in each pixel block, obtain a texture complexity curve according to the texture complexity of the pixel block, obtain a grayscale curve, and then obtain the degree of difference between the texture complexity curve and the grayscale curve, obtain an optimal grayscale curve according to the degree of difference between the curves, obtain an adjusted electrode image according to the optimal grayscale curve, and obtain a grayscale run matrix according to the adjusted electrode image.
[0053] It should be noted that since the normally distributed conductive agent is relatively uniform, and when the conductive agent is unevenly distributed, the defective area is free of conductive agent distribution. Generally speaking, the conductive agent part has a higher grayscale value under the electron microscope. Since the internal texture details of the scanning electron microscope image of the electrode sheet are relatively complex, it is difficult to directly extract the texture features of the image in order to obtain the feature model of the image defect area. However, since there is a part of the conductive agent evenly distributed in the image, the grayscale run matrix can be used to assist the texture analysis and the construction of the defect probability model. The construction of the grayscale run matrix requires manual input of the run matrix parameters, and if the run matrix constructed by automatically obtaining the parameters directly through the existing method may not be a reference for the construction of the probability model. In the electrode image under the scanning electron microscope, the normal conductive agent material is relatively uniformly distributed, and there are certain gaps between the conductive agents; when the conductive agent is unevenly distributed, the gaps between these conductive agents are of different sizes; when the gaps are too large, there may be uneven distribution of the conductive agent, so the analysis is performed based on the grayscale distribution differences in different areas of the electrode image.
[0054] It should be further explained that, since the grayscale run length matrix is obtained through the adjacent and connected lengths in one direction, the electrode image is evenly divided to obtain several pixel blocks, and the analysis is performed based on the differences between the pixel blocks. Since the conductive agent on the electrode sheet of the battery is evenly distributed under normal production conditions, the conductive agent particles in each pixel block are uniform, that is, the number of gradient pixel points between the conductive agent particles and the gap is not much different, so the analysis is performed based on the gradient differences between the pixel blocks.
[0055] Specifically, a threshold value H is preset, wherein this embodiment is described by taking H=45 as an example, and this embodiment is not specifically limited, wherein H may be determined according to specific implementation conditions.
[0056] Further preprocessing of the electrode image: the electrode image is equally divided into Pixel blocks. Perform edge detection on each pixel block using the Canny operator to obtain all edge pixels in each pixel block, calculate the average gradient amplitude of all edge pixels in each pixel block, denoted as t, and obtain the proportion of edge pixels in each pixel block based on the number of edge pixels in each pixel block. The formula is expressed as: , where g represents the number of edge pixels in each pixel block, and G represents the total number of all pixels in each pixel block. Among them, the canny operator for edge detection is a formula technology, which will not be repeated here.
[0057] This embodiment extracts the texture complexity of each pixel block in the electrode image according to the average gradient amplitude of all edge pixels in each pixel block and the proportion of edge pixels in each pixel block. The formula is expressed as follows: , where z represents the proportion of edge pixels in each pixel block, and t represents the average gradient amplitude of all edge pixels in each pixel block.
[0058] All pixel blocks are sorted from large to small according to the average gradient amplitude, and the sorted result is recorded as a pixel block gradient sequence. The pixel block gradient sequence is marked as 1, 2, 3, ..., n from the first element to the last element; wherein n represents the number of elements in the pixel block gradient sequence, that is, the number of pixel blocks. With the texture complexity of each pixel block as the vertical axis and the label value of each pixel block as the horizontal axis, the texture complexity of the pixel block is curve-fitted by a quintic polynomial according to the least squares method to obtain a texture complexity curve of the pixel block, which is recorded as W. In this embodiment, a quintic polynomial is used for fitting, but it is not specifically limited. In this embodiment, the least squares method is a well-known technology and will not be described in detail here.
[0059] It should be noted that, since the grayscale value of the conductive agent particles collected on the electrode sheet during normal production is relatively high, while the grayscale value of the gaps between the conductive particles is relatively low, the gradient amplitude in the electrode image should be relatively large under normal circumstances; and when the conductive agent particles aggregate, the gaps between the conductive agent become larger, causing the grayscale value of the enlarged gaps to increase, and the grayscale value of the conductive agent particles on the electrode sheet is relatively high, then the gradient amplitude in the image should decrease at this time; that is, under normal circumstances, the texture complexity curve of the fitted pixel block should fluctuate around a value, without any obvious trend characteristics, and when the conductive agent particles of the electrode sheet aggregate and anomalies occur, the texture complexity curve of the fitted pixel block has an increasing trend from left to right, because when anomalies occur, a small number of pixel blocks with smaller gradient amplitudes will appear, then the average gradient of the pixel block decreases, resulting in a decrease in the texture complexity of the pixel block, that is, the texture complexity curve of the fitted pixel block is a process from low to high.
[0060] It should be further explained that, since in this embodiment, the texture features of the electrode image are obtained by the grayscale run matrix for analysis, the more grayscale levels of the electrode image, the better the data in the grayscale run matrix can represent the texture features in the electrode image, but the more grayscale levels, the more complex the calculation, which will reduce the efficiency of the calculation. Since it is analyzed that when an abnormality occurs on the electrode sheet, the texture complexity curve of the fitted pixel block will change, that is, the grayscale of the electrode image can describe the abnormality of the electrode image and it is optimal when there are not too many grayscale levels in the electrode image, therefore, a discriminant analysis is performed based on the texture complexity curve of the pixel block and the grayscale histogram of the electrode image. When the similarity between the texture complexity curve of the pixel block and the curve fitted by the first few grayscale levels of the grayscale histogram of the electrode image is very high, it can be considered that the number of these grayscale levels can express the texture information of the electrode image.
[0061] Specifically, a threshold value m is preset, wherein this embodiment is described by taking m=5 as an example, and this embodiment is not specifically limited, wherein m may be determined according to the specific implementation situation. The grayscale histogram of the electrode image is obtained, and the number of pixels corresponding to the first m grayscale levels in the grayscale histogram is selected, and the number of pixels corresponding to the grayscale levels is curve-fitted by a fifth-order polynomial according to the least squares method to obtain a grayscale curve. Among them, in the grayscale histogram of this embodiment, one grayscale level corresponds to one grayscale value, that is, there are a total of 256 grayscale levels in the grayscale histogram. The degree of difference between the two curves is obtained according to the texture complexity of the pixel block of the texture complexity curve of the pixel block and the number of pixels corresponding to the grayscale level in the grayscale curve, which is expressed by the formula:
[0062]
[0063] In the formula, represents the texture complexity of the i-th pixel block, represents the texture complexity of the i-1th pixel block, represents the mean value of the texture complexity of all pixel blocks, n represents the number of all pixel blocks, Represents the number of pixels of the jth gray level of the gray level curve, Represents the number of pixels of the j-1th gray level of the gray level curve, Represents the average number of pixels of the first m gray levels of the gray level curve, m represents the number of gray levels in the gray level curve, Indicates the degree of difference between the texture complexity curve and the grayscale curve. Indicates the absolute value sign.
[0064] in, Indicates the degree of fluctuation of the texture complexity curve. Indicates the fluctuation degree of the grayscale curve. The greater the difference in the fluctuation degree between the two curves, the greater the difference between the two curves. Indicates the amplitude change of adjacent data in the texture complexity curve, It indicates the amplitude change of adjacent data in the grayscale curve. The greater the difference in amplitude change between the two curves, the greater the degree of difference between the two curves.
[0065] The gray level corresponding to the first peak in the gray level histogram corresponding to the electrode image is recorded as G. Add 1 to the preset threshold m to obtain a new gray level curve, recorded as , calculate the texture complexity curve W and grayscale curve The difference between them; add 2 to the preset threshold m to obtain a new grayscale curve, recorded as , calculate the texture complexity curve W and grayscale curve The difference between them; add 3 to the preset threshold m to obtain a new grayscale curve, recorded as , calculate the texture complexity curve W and grayscale curve The difference between them; and so on, the preset threshold continues to be accumulated until the accumulation reaches the rth time. When , stop accumulating, calculate the difference between each gray level curve and the texture complexity curve, select the gray level curve with the smallest difference between the gray level curve and the texture complexity curve, and record it as the optimal gray level curve; perform k-means clustering on the gray level of the optimal gray level curve according to the number of pixels of each gray level, and obtain several clusters, wherein each cluster contains several gray levels, and the number of pixels of all gray levels in each cluster is close; then select the optimal number of clusters according to the elbow method, and record the optimal number of clusters as the optimal number of gray levels, denoted by C. Among them, k-means clustering and elbow method are well-known technologies, and will not be described in detail here.
[0066] The gray level of each pixel in the electrode image is linearly mapped to between 0 and C, wherein the decimals are rounded off according to the rounding method to obtain the adjusted gray level of each pixel; thus, the adjusted electrode image is obtained.
[0067] The grayscale run-length matrix is obtained according to the adjusted electrode image. The grayscale run-length matrix of the image is obtained as a known technique and will not be described in detail here.
[0068] At this point, the grayscale run-length matrix of the adjusted electrode image is obtained.
[0069] Step S003: obtaining a first probability defect parameter and a second probability defect parameter according to the grayscale run-length matrix, and obtaining the abnormal probability of the image according to the first probability defect parameter and the second probability defect parameter.
[0070] It should be noted that since the size of the grayscale run matrix is the product of the number of grayscale levels of the image and the size of the product image, the horizontal rows in the grayscale run matrix represent the length of the same grayscale level, and the vertical columns in the grayscale run matrix represent the length of different grayscale levels. Because in a normal image, the length of adjacent grayscale levels connected to each other should not be much different. When the image is abnormal, the length of adjacent grayscale levels connected to each other will change. Therefore, the abnormality of the image is judged based on the different data proportions of each column of data in the grayscale run matrix and the information entropy of each column of data.
[0071] Specifically, the same data in the bth column of the grayscale run matrix is divided into one class, and several classes in the bth column are obtained. According to the different data proportions of each column of data in the grayscale run matrix and the information entropy of each column of data, the abnormality degree of each column of data in the grayscale run matrix is obtained, which is expressed by the formula:
[0072]
[0073] In the formula, Represents the data value of the ath row and bth column in the grayscale run matrix. Represents the number of all rows in the grayscale run matrix, represents the number of q-th category data in the b-th column of the grayscale run matrix, and R represents the total number of all categories in the b-th column of the grayscale run matrix. represents an exponential function with a natural constant as base, represents the logarithmic function with base 10, Indicates the degree of abnormality of the data in column b of the grayscale run matrix. Represents a Boolean function, that is, when the input is 0, the function outputs 0, and when the data is non-zero, the function outputs 1.
[0074] in, Represents the information entropy of the data in the bth column of the grayscale run matrix. The larger the value, the more abnormal the data in this column is. It indicates the proportion of non-zero data in the b-th column of the grayscale run matrix. The larger the value, the more abnormal the data in this column is.
[0075] This embodiment extracts the abnormality degree of each column of data in the grayscale run matrix through the different data proportions of each column of data in the grayscale run matrix and the information entropy of each column of data.
[0076] The first probability defect parameter is obtained according to the abnormal degree of each column of data in the grayscale run matrix, which is expressed as follows:
[0077]
[0078] In the formula, Indicates the abnormality of the b-th column data in the grayscale run matrix, B indicates the number of all columns in the grayscale run matrix, Represents the first probability defect parameter.
[0079] This embodiment further extracts the characteristics of the first probability defect parameter through the abnormality degree of each column of data in the grayscale run matrix.
[0080] At this point, the first probability defect parameter is obtained.
[0081] It should be noted that for the relatively densely distributed conductive agent particle gaps, the grayscale value is extremely low. Therefore, the distribution of low grayscale intervals under the same run can reflect the defect probability of relatively high grayscale intervals to a certain extent, that is, the distribution characteristics of elements between the same column and different rows in the grayscale run matrix. In addition, for different grayscale intervals, the lower the grayscale level, if there are more elements with longer runs, the higher the possibility that it is a larger gap, that is, the higher the probability of uneven distribution of conductive agent particles; therefore, analysis is performed based on the data differences between different rows.
[0082] Specifically, the abnormality degree of each row of data in the grayscale run matrix is obtained according to each data and the weight of each data in the grayscale run matrix, which is expressed as follows:
[0083]
[0084] In the formula, represents the data value of the ath row and bth column in the grayscale run matrix, b is the bth column, and B represents the number of all columns in the grayscale run matrix. represents an exponential function with a natural constant as base, Indicates the degree of abnormality of the data in the ath row in the grayscale run matrix.
[0085] in, It is expressed as the weight of each column of data in each row. When the corresponding grayscale is smaller, it means that the data weight should be larger, and the image is more normal, that is, the corresponding data abnormality is smaller; when the corresponding grayscale is larger, it means that the data weight should be smaller, and the image is more abnormal, that is, the corresponding data abnormality is greater.
[0086] The abnormality of each row of data in the grayscale run matrix is extracted through each data and the weight of each data.
[0087] The second probability defect parameter is obtained according to the abnormal degree of each row of data in the grayscale run matrix, which is expressed as follows:
[0088]
[0089] In the formula, It represents the abnormal degree of the data in the ath row of the grayscale run matrix, and A represents the number of all rows in the grayscale run matrix. Represents the second probability defect parameter.
[0090] At this point, the second probability defect parameter is obtained.
[0091] The abnormal probability of the image is obtained according to the first probability defect parameter and the second probability defect parameter, which is expressed as follows:
[0092]
[0093] In the formula, represents the first probability defect parameter, represents the second probability defect parameter, Represents the abnormal probability of the image.
[0094] At this point, the abnormal probability of the image is extracted.
[0095] Step S004: performing abnormality detection on the electrode image according to the abnormality probability of the image.
[0096] A threshold value T is preset, wherein this embodiment is described by taking T=0.35 as an example, and this embodiment is not specifically limited, wherein T can be determined according to the specific implementation situation. The image is classified according to the magnitude of the abnormal probability: when the abnormal probability of the image is greater than or equal to the preset threshold value T, it is determined that there are defects in the electrode image, that is, there are defects in the clustering of conductive agents in the energy-saving power bank battery, and the electrode image with defects is classified into the defective class; when the abnormal probability of the image is less than the preset threshold value T, it is determined that there are no defects in the electrode image, that is, the energy-saving power bank battery has no defects, and the electrode image without defects is classified into the non-defective class, and the classification and recognition result of the electrode image is obtained.
[0097] At this point, this embodiment is completed.
[0098] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for identifying defects in energy-saving power bank batteries, characterized in that: The method comprises the following steps: Acquiring electrode images; Divide the electrode image into blocks to obtain a number of pixel blocks, perform edge detection on each pixel block to obtain all edge pixel points in each pixel block, obtain the average gradient amplitude of all edge pixel points in each pixel block, obtain the proportion of edge pixel points in each pixel block according to the number of edge pixel points in each pixel block, obtain the texture complexity of each pixel block according to the average gradient amplitude of all edge pixel points in each pixel block and the proportion of edge pixel points in each pixel block, obtain the texture complexity curve of the pixel block according to the texture complexity of each pixel block, obtain a grayscale curve, obtain the difference between the texture complexity curve and the grayscale curve of the pixel block according to the texture complexity of the pixel block and the number of pixels corresponding to the grayscale in the grayscale curve, obtain the optimal grayscale curve according to the difference between the texture complexity curve and the grayscale curve of the pixel block, obtain an adjusted electrode image according to the optimal grayscale curve, and obtain a grayscale run matrix according to the adjusted electrode image; Obtain a first probability defect parameter and a second probability defect parameter according to the grayscale run matrix, and obtain an abnormal probability of the image according to the first probability defect parameter and the second probability defect parameter; Perform abnormality detection on the electrode image according to the abnormal probability of the image; The method of obtaining the texture complexity of each pixel block according to the average gradient amplitude of all edge pixels in each pixel block and the proportion of edge pixels in each pixel block, and obtaining the texture complexity curve of the pixel block according to the texture complexity of each pixel block includes the following specific steps: The product of the average gradient amplitude of all edge pixels in each pixel block and the proportion of edge pixels in each pixel block obtains the texture complexity of each pixel block; all pixel blocks are sorted from large to small according to the average gradient amplitude, and the sorted result is recorded as a pixel block gradient sequence, and the pixel block gradient sequence is marked as 1, 2, 3, ..., n from the first element to the last element; wherein n represents the number of pixel blocks; with the texture complexity of each pixel block as the vertical axis and the label value of each pixel block as the horizontal axis, the texture complexity of the pixel block is curve-fitted according to the least squares method to obtain a texture complexity curve of the pixel block; According to the texture complexity of the pixel block of the texture complexity curve of the pixel block and the number of pixel points corresponding to the gray level in the gray level curve, the difference between the texture complexity curve and the gray level curve of the pixel block is obtained, and according to the difference between the texture complexity curve and the gray level curve of the pixel block, the optimal gray level curve is obtained, including the specific steps as follows: The calculation formula for the difference between the texture complexity curve and the grayscale curve of the pixel block is: In the formula, represents the texture complexity of the i-th pixel block, represents the texture complexity of the i-1th pixel block, represents the mean value of the texture complexity of all pixel blocks, n represents the number of all pixel blocks, Represents the number of pixels of the jth gray level of the gray level curve, Represents the number of pixels of the j-1th gray level of the gray level curve, Represents the average number of pixels of the first m gray levels of the gray level curve, m represents the number of gray levels in the gray level curve, Indicates the degree of difference between the texture complexity curve and the grayscale curve. Indicates the absolute value sign; The grayscale curve with the smallest difference from the texture complexity curve is selected and recorded as the optimal grayscale curve.
2. According to claim 1, a method for identifying defects in energy-saving power bank batteries, characterized in that: The electrode image is divided into blocks to obtain a plurality of pixel blocks, and edge detection is performed on each pixel block to obtain all edge pixel points in each pixel block, including the following specific steps: Divide the electrode image equally into pixel blocks, perform edge detection on each pixel block using the Canny operator to obtain all edge pixel points in each pixel block, where H is a preset threshold.
3. According to claim 1, a method for identifying defects in energy-saving power bank batteries, characterized in that: The specific steps of obtaining the grayscale curve are as follows: The grayscale histogram of the electrode image is obtained, the number of pixels corresponding to the first m grayscale levels in the grayscale histogram is selected, and the number of pixels corresponding to the grayscale levels is curve fitted according to the least squares method to obtain a grayscale curve; wherein m is a preset threshold.
4. According to claim 1, a method for identifying defects in energy-saving power bank batteries, characterized in that: The step of obtaining an adjusted electrode image according to the optimal grayscale curve and obtaining a grayscale run matrix according to the adjusted electrode image includes the following specific steps: Perform k-means clustering on the grayscale of the optimal grayscale curve according to the number of pixels at each grayscale level, and use the elbow method to obtain the optimal number of clusters C; The gray level of each pixel in the electrode image is linearly mapped to between 0 and C to obtain an adjusted electrode image, and a gray level run length matrix is obtained according to the adjusted electrode image.
5. According to claim 1, a method for identifying defects in energy-saving power bank batteries, characterized in that: The specific steps of obtaining the first probability defect parameter are as follows: Divide the same data in the bth column of the grayscale run matrix into one class, and obtain several classes in the bth column; The calculation formula for the abnormality of each column of data in the grayscale run matrix is: In the formula, Represents the data value of the ath row and bth column in the grayscale run matrix. Represents the number of all rows in the grayscale run matrix, represents the number of q-th category data in the b-th column of the grayscale run matrix, and R represents the total number of all categories in the b-th column of the grayscale run matrix. represents an exponential function with a natural constant as base, Indicates the abnormality of the data in column b in the grayscale run matrix. represents a Boolean-valued function, represents the logarithmic function with base 10; The first probability defect parameter is obtained by averaging the abnormality levels of all column data in the grayscale run matrix.
6. According to claim 1, a method for identifying defects in energy-saving power bank batteries, characterized in that: The specific steps for obtaining the second probability defect parameter are as follows: The calculation formula for the abnormality of each row of data in the grayscale run matrix is: In the formula, represents the data value of the ath row and bth column in the grayscale run matrix, b is the bth column, and B represents the number of all columns in the grayscale run matrix. represents an exponential function with a natural constant as base, Indicates the abnormality of the data in the ath row of the grayscale run matrix; The second probability defect parameter is obtained by averaging the abnormality levels of all row data in the grayscale run matrix.
7. The method for identifying defects in energy-saving power bank batteries according to claim 1, characterized in that: The specific steps for obtaining the abnormal probability of the image are as follows: The average of the first probability defect parameter and the second probability defect parameter is taken as the abnormality probability of the image.
8. The method for identifying defects in energy-saving power bank batteries according to claim 1, characterized in that: The specific steps of performing abnormality detection on the electrode image according to the abnormality probability of the image are as follows: When the abnormal probability of the image is greater than or equal to the preset threshold T, the energy-saving power bank battery has defects in the production process; when the abnormal probability of the image is less than the preset threshold T, the energy-saving power bank battery has no defects in the production process.
Citation Information
Patent Citations
Method for detecting textile defects on surface of bed sheet
CN115861310A
Defect identification method for strip steel surface
CN115953398A
