CN111598877A - Lithium battery surface defect detection method based on generation of countermeasure network - Google Patents
Lithium battery surface defect detection method based on generation of countermeasure network Download PDFInfo
- Publication number
- CN111598877A CN111598877A CN202010417852.6A CN202010417852A CN111598877A CN 111598877 A CN111598877 A CN 111598877A CN 202010417852 A CN202010417852 A CN 202010417852A CN 111598877 A CN111598877 A CN 111598877A
- Authority
- CN
- China
- Prior art keywords
- image
- network
- generator
- discriminator
- connected domain
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000007547 defect Effects 0.000 title claims abstract description 70
- 238000001514 detection method Methods 0.000 title claims abstract description 46
- WHXSMMKQMYFTQS-UHFFFAOYSA-N Lithium Chemical compound [Li] WHXSMMKQMYFTQS-UHFFFAOYSA-N 0.000 title claims abstract description 33
- 229910052744 lithium Inorganic materials 0.000 title claims abstract description 33
- HBBGRARXTFLTSG-UHFFFAOYSA-N Lithium ion Chemical compound [Li+] HBBGRARXTFLTSG-UHFFFAOYSA-N 0.000 claims abstract description 29
- 229910001416 lithium ion Inorganic materials 0.000 claims abstract description 29
- 238000000034 method Methods 0.000 claims abstract description 21
- 238000012360 testing method Methods 0.000 claims abstract description 12
- 238000009826 distribution Methods 0.000 claims description 19
- 230000006870 function Effects 0.000 claims description 16
- 230000011218 segmentation Effects 0.000 claims description 13
- 238000012549 training Methods 0.000 claims description 13
- 230000002950 deficient Effects 0.000 claims description 7
- 238000005070 sampling Methods 0.000 claims description 6
- XAGFODPZIPBFFR-UHFFFAOYSA-N aluminium Chemical compound [Al] XAGFODPZIPBFFR-UHFFFAOYSA-N 0.000 claims description 4
- 229910052782 aluminium Inorganic materials 0.000 claims description 4
- 230000004913 activation Effects 0.000 claims description 3
- 230000003044 adaptive effect Effects 0.000 claims description 3
- 238000013527 convolutional neural network Methods 0.000 claims description 3
- 238000011478 gradient descent method Methods 0.000 claims description 3
- 238000007781 pre-processing Methods 0.000 claims description 3
- 238000010008 shearing Methods 0.000 claims description 3
- 238000012216 screening Methods 0.000 abstract 1
- 238000004519 manufacturing process Methods 0.000 description 8
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 4
- 238000005457 optimization Methods 0.000 description 4
- 238000013135 deep learning Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000003042 antagnostic effect Effects 0.000 description 1
- 230000020411 cell activation Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P70/00—Climate change mitigation technologies in the production process for final industrial or consumer products
- Y02P70/50—Manufacturing or production processes characterised by the final manufactured product
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a lithium battery surface defect detection method based on a generation countermeasure network, which is mainly used for detecting the surface image defects of a soft package lithium ion battery. According to the method, a generated countermeasure network is utilized to fit the normal surface of the lithium ion surface image acquired by a high-precision CMOS industrial camera. Aiming at the detection of various defects on the surface of the lithium ion battery, a pre-trained generator is used for test image reconstruction, and a difference operation is carried out by using a reconstructed image and a test image to obtain an interested region; and then, screening the size of a connected domain through a binary differential image to eliminate a false detection region. By the method, the defect area on the surface of the lithium ion battery can be accurately judged, and defect detection is realized.
Description
Technical Field
The invention belongs to the technical field of defect detection, and particularly relates to a lithium battery surface defect detection method based on a generated countermeasure network.
Background
The lithium ion battery is an environmentally friendly battery having a long life, a large storage capacity, and a high charging and discharging speed, and is widely used in portable information devices such as mobile phones, and is gradually extended to the field of electric tools. With the popularization and application of internet technology and the development of environment-friendly alternative tools, the demand of lithium ions is continuously increased, and the lithium ion battery has important significance for information development and green travel in China.
In the production process of the lithium ion battery, due to reasons such as incomplete production technology and product transportation process, the lithium ion battery, especially the soft package lithium ion battery, is easy to generate various defects such as aluminum exposure, scratches, dents, pinholes and pit defects before being assembled to a portable product. The existence of the surface defects not only affects the surface integrity of the battery, but also can cause damage to the battery core inside the battery, so that the performance of the battery is reduced, and even potential safety hazards are brought to users. In addition, due to the automation of the production process, when a certain type of defect is caused by the improper design of the production equipment, the product containing the defect flows to other subsequent production processes and appears in batch. Therefore, accurate detection and removal of defects generated during the production process is essential.
At present, the surface defect detection of the soft package lithium ion battery mainly depends on artificial naked eyes, human eyes are easy to generate fatigue in the detection process, the artificial judgment standards are different, and the detection efficiency and the detection precision are low. Meanwhile, the artificial participation may cause a secondary damage situation of the battery. Chinese patent CN107966447B proposes a surface defect detection method based on deep learning, which utilizes manually labeled labels to train and realize the segmentation of surface defects; in addition, Chinese patent CN110044921A utilizes the fast-RCNNs deep learning model to detect the surface defects of the lithium battery. The method can not avoid human subjective factors in the label making process, and additionally increases the investment of enterprises in the label making method.
Therefore, the non-contact machine vision detection mode of unsupervised detection is utilized, extra damage caused by contact in the lithium battery defect detection process is favorably avoided, the detection efficiency of the lithium battery defects is improved while the enterprise cost is reduced, and the production level is improved.
Disclosure of Invention
The invention aims to solve the defects of the existing soft package lithium ion battery surface defect detection method, and the problems to be solved by the invention are as follows: the defect detection technology for the soft package lithium battery in the prior art depends on a large amount of label data, so that the waste of manpower and material resources is greatly increased, and the detection precision is to be improved. Therefore, an unsupervised lithium battery surface defect detection method based on generation of a countermeasure network is provided.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a lithium battery surface defect detection method based on generation of a countermeasure network comprises the steps of firstly generating the countermeasure network and a corresponding loss function to learn normal surface distribution of a lithium battery, enabling a trained generator to be capable of fitting normal surface image distribution of the lithium battery, and utilizing the trained generator to reconstruct the surface of the lithium battery; then, carrying out difference operation on the reconstructed image and the original image, and segmenting a difference result by using a self-adaptive threshold segmentation method to obtain possible defective pixels; and finally, by setting the size of the communication domain, excluding the false detection area, and realizing the surface defect detection of the soft package lithium battery.
The method is divided into two parts, wherein the first part obtains the surface distribution of the lithium ion battery; the second part obtains possible defect areas and eliminates false detection to obtain a detection result. The concrete implementation steps comprise:
first, obtaining the surface distribution of the lithium ion battery
1-1, image acquisition: acquiring an image of the normal surface of the lithium ion battery by using a high-precision CMOS industrial camera, and storing the image by using a workstation computer;
1-2, image preprocessing: performing sliding shearing on each collected normal surface image from left to right and from top to bottom by using a sliding window with the size of 128 × 128 and the step length of 32 to obtain a data set of a training network;
1-3, creating a confrontation network model and setting up and initializing: the generation countermeasure network consists of a generator network and a discriminator network, and both the generator network and the discriminator network adopt a convolutional neural network;
the generator network is composed of 4 convolution units with the step length of 2 and 4 deconvolution units with the step length of 2, and the down sampling and the up sampling of the image are realized; sequentially performing 4 convolution units and then 4 deconvolution units, wherein the output of the last deconvolution unit is the output of the generator network; the activation function in the last deconvolution unit is a tanh function, and the network output of the generator is ensured to be within the range of the image value range;
1-4, training to generate a confrontation network model: when the model is trained, updating the network parameters of the generator and the discriminator by using a loss function and a gradient descent method until the model loss is converged; the trained generator can realize the fitting of the normal surface distribution of the lithium ion battery.
The network parameters were trained using the following loss functions:
wherein L isDisFor discriminator loss, LGenTo generator losses; l isgan_d、Lgan_g、LrThe discriminator countermeasure loss, the generator countermeasure loss, and the mean square error loss of the generator input image and the output image are expressed by the following equations:
where N is the total number of input images per batch, x(n)The nth real image in the input image is obtained; g (x)(n)) For a pseudo-image of the output after the image has been input to the generator, D (x)(n)) The output obtained by the discriminator is input for the real image, D (G (x)(n)) Is output obtained by the pseudo image input discriminator;
second part, defective area acquisition
2-1, image reconstruction: after training to generate network parameters of a confrontation network model, inputting the test image t into a generator network to obtain a reconstructed image t';
2-2, differential operation: on the basis of the step 2-1, carrying out differential operation on the test image and the reconstructed image output by the generator network, thereby obtaining an interested area;
2-3, binary segmentation: on the basis of the step 2-2, selecting a threshold value to carry out binary segmentation on the difference result so as to obtain a defect candidate region;
2-4, acquiring a connected domain, and on the basis of the step 2-3, selecting the connected domain for the binary segmentation result to obtain a candidate connected domain;
2-5, calculating the size of the candidate connected domain and detecting defects: on the basis of the step 2-4, extracting the area of the candidate connected domain, and eliminating the candidate connected domain which does not meet the condition by setting a threshold value of the connected domain to obtain a defect area; the connected domain threshold is half of the area of the smallest defect pixel among all defect types.
Specifically, the method is used for detecting the surface defects of the soft package lithium battery, including aluminum exposure, scratches, dents, pinholes and pit defects. The size of the applicable lithium battery is 46.0mm multiplied by 20.7mm multiplied by 11.3mm, and the size of the image collected by the camera is 2048 multiplied by 1088 pixels. When the method is used for detecting the surface defects, the outer surface of the whole battery is ensured to be scanned, so that the surface of the whole battery is integrally input.
The discriminator network is composed of 4 convolution units with step size 2, and the images are down sampled, and the final output value is used for distinguishing the truth of the input images.
The initialization of the network parameters for generating the countermeasure network model comprises the initialization of the generator network and the arbiter network parameters; generator network parameter θGIs randomly generated by a positive-Taiwanese distribution with a mean value of 0 and a variance of 0.02; discriminator network parameter thetaDIs randomly generated from a positive distribution subject to a mean of 0 and a variance of 0.02.
Specifically, in steps 1-4, the network parameter update formula is as follows:
wherein, the left side of the equation represents the parameter to be updated, and the right side of the equation represents the updated value;andrepresenting the gradients of the discriminator and the generator, respectively; l isgan_d、Lgan_g、LrRepresents the discriminator countermeasure loss, the generator countermeasure loss, the mean square error loss of the generator input image and the output image, respectively, and:
where N is the total number of input images per batch, x(n)The nth real image in the input image is obtained; g (x)(n)) For a pseudo-image of the output after the image has been input to the generator, D (x)(n)) The output obtained by the discriminator is input for the real image, D (G (x)(n)) Is output from the pseudo image input discriminator.
The model loss comprises a generator loss and a discriminator loss and is calculated by the following formula:
wherein L isDisFor discriminator loss, LGenTo generator losses;
wherein the total number of input images of each batch is 64, the generator adopts an Adaptive moment estimation (Adam) gradient descent optimization algorithm to update generator network parameters, and the learning rate is 0.0001; adam gradient descent optimization algorithm is adopted to update the network parameters of the discriminator, and the learning rate is set to be 0.00005.
Through the training, the generator of the final convergence model can fit the normal surface image distribution of the lithium ion battery, namely, the normal surface image of the lithium ion battery is input into the generator and the same image is output; the surface image with defects of the lithium battery is input into a generator, and a corresponding normal surface image is output.
Specifically, in step 2-2, the difference operation is as follows:
dif=|t-t′|
where dif is the difference result.
Specifically, in step 2-3, the binarization operation is as follows:
where S (i, j) represents a pixel division result at the (i, j) coordinate in the difference result, Th is a threshold value of binary division:
Th=mean(dif)+2.7std(dif)
where mean (dif) is the mean of the difference result plot, and std (dif) is the variance of the difference result plot.
Specifically, in step 2-4, when the candidate connected domain is obtained, 8 adjacent pixel points around the pixel are selected as connected domain candidate pixels, and the regions of the connected domain candidate pixels which are connected together form the candidate connected domain;
specifically, in step 2-5, the set connected component threshold is 32 pixels.
Compared with the prior art, the invention has the beneficial effects that:
the method can be suitable for image processing of complex objects with backgrounds containing characters and the like, and firstly, a pre-trained generator is used for reconstructing a normal image mode of the lithium ion battery; then, carrying out differential operation on the reconstruction result and the test image to extract an interested region; and finally, carrying out image segmentation on the difference result, and eliminating the suspected connected domain by using a connected domain threshold value to finally obtain a detection result.
The application field and the important significance of the invention are as follows:
the method is suitable for detecting the defects of aluminum exposure, scratches, dents, pinholes and pits on the surface of the soft package lithium ion battery. At present, the detection method based on deep learning, such as fast-RCNN and other deep learning methods, needs to artificially mark the defect position, increases artificial subjective factors, and is not beneficial to establishing a uniform detection standard. In addition, because the generation of the defect data has randomness, the collected defect data is few and cannot cover the real distribution condition of the defects, and the phenomenon of overfitting of the model to the defect data is easily caused by using a supervision mode, so that the detection precision is not favorably improved. According to the method, the normal surface data of the soft package lithium battery is fitted through the designed generated countermeasure network, the participation of defect data is not needed in the training process, and subjective factors can be effectively solved. And finally, performing normal surface fitting on the test image by using a generator with a self-coding function, and performing difference on the fitted surface image and the test image, so that whether the surface of the soft package lithium ion battery has defects can be accurately detected, and the mode of generating an antagonistic network and determining a defect area in the following mode in a connected domain mode improves the accuracy and stability of detection, improves the quality and production efficiency of lithium battery products, and is more suitable for industrial application.
Drawings
FIG. 1 is a schematic diagram of a generator network in a generative confrontation network model according to the present invention;
FIG. 2 is a schematic diagram of a network of discriminators in a model for generating a countermeasure network according to the present invention;
FIG. 3 shows the steps of defect detection according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 3, fig. 3 shows the steps of the detection method of the present invention,
a lithium battery surface defect detection method based on generation of a countermeasure network comprises the following two steps:
first, obtaining the surface distribution of the lithium ion battery
1-1, image acquisition: acquiring an image of the normal surface of the lithium ion battery by using a high-precision CMOS industrial camera, and storing the image by using a workstation computer;
1-2, image preprocessing: the image is cut in a sliding mode from left to right and from top to bottom through a sliding window with the size of 128 x 128 and the step length of 32, pictures of 2048 x 1088 pixels are cut into small blocks, and a plurality of small blocks of the normal surface image of a plurality of lithium batteries form a data set to obtain a data set of a training network;
1-3, creating a confrontation network model and setting up and initializing: the generation countermeasure network is composed of a generator network and a discriminator network module, and both the generator network and the discriminator network adopt a convolutional neural network;
the generator network is composed of 4 convolution units with the step size of 2 and 4 deconvolution units with the step size of 2, so that the down sampling and the up sampling of the image are realized, and the sizes of convolution kernels are 5 x 5. Sequentially performing 4 convolution units and then 4 deconvolution units, wherein the output of the last deconvolution unit is the output of the generator network module; and the activation function in the last deconvolution unit is a tanh function, so that the network output of the generator is ensured to be within the range of the image value range.
The discriminator network module is composed of 4 convolution units with step length of 2, the convolution kernel size is 5 x 5, the image is down sampled, and the final output value is used for distinguishing the truth of the input image. The convolution results are normalized using an example normalization function IN after each convolution operation and then activated using a leakage modified linear cell activation function leak Relu. And finally, compressing the features through full-connection operation FC to obtain the true and false output probability of the discriminator.
1-4, training to generate a confrontation network model: and when the model is trained, updating the generator and the network parameters of the discriminator by using a loss function and a gradient descent method until the model loss is converged, and fitting the surface distribution of the normal lithium battery by using the generator after training.
The network parameter initialization for generating the countermeasure network comprises the initialization of the generator network and the arbiter network parameters; generator network parameter θGIs randomly generated by a positive-Taiwanese distribution with a mean value of 0 and a variance of 0.02; discriminator network parameter thetaDIs randomly generated from a positive distribution subject to a mean of 0 and a variance of 0.02.
The network parameter update formula is as follows:
wherein the left side of the equation represents the parameter to be updated, and the right side of the equation represents the updated value;andrepresenting the gradients of the discriminator and the generator, respectively; l isgan_d、Lgan_g、LrRepresents the discriminator countermeasure loss, the generator countermeasure loss, the mean square error loss of the generator input image and the output image, respectively, and:
where N is the total number of input images per batch, N is set to 64, x in this embodiment(n)The nth real image in the input image is obtained; g (x)(n)) For a pseudo-image of the output after the image has been input to the generator, D (x)(n)) The output obtained by the discriminator is input for the real image, D (G (x)(n)) Is output from the pseudo image input discriminator.
The model loss comprises generator loss and discriminator loss, the generator loss comprises generator confrontation loss and mean square error loss of the generator input image and the generator output image, and the generator confrontation loss and the mean square error loss are calculated by the following formula:
wherein L isDisFor discriminator loss, LGenTo generator losses;
the input image N of each batch is 64, the generator updates generator network parameters by adopting an Adaptive moment estimation (Adam) gradient descent optimization algorithm, and the learning rate is 0.0001; adam gradient descent optimization algorithm is adopted to update the network parameters of the discriminator, and the learning rate is set to be 0.00005.
Through the training, the generator of the final convergence model can fit the normal surface image distribution of the lithium ion battery, namely, the normal surface image of the lithium ion battery is input into the generator and the same image is output; the surface image with defects of the lithium battery is input into a generator, and a corresponding normal surface image is output.
Second part, defective area acquisition
2-1, image reconstruction: giving the trained generator network parameters to a model, and inputting the test image t into a generator network to obtain a reconstructed image t';
2-2, differential operation: on the basis of the step 2-1, carrying out differential operation on the test image and the output image of the generator thereof so as to obtain an interested area;
the difference operation is as follows:
dif=|t-t′|
where dif is the difference result.
2-3, binary segmentation: on the basis of the step 2-2, selecting a threshold value to carry out binary segmentation on the difference result so as to obtain a defect candidate region;
the binarization operation is as follows:
where S (i, j) represents a pixel division result at the (i, j) coordinate in the difference result, Th is a threshold value of binary division:
Th=mean(dif)+2.7std(dif)
wherein mean (dif) is the mean of the difference result graph, std (dif) is the variance of the difference result graph;
if S (i, j) is 1, the pixel point is located in the defect candidate area.
2-4, acquiring a connected domain, and on the basis of the step 2-3, selecting the connected domain for the binary segmentation result to obtain a candidate connected domain;
when a candidate connected domain is obtained, taking any one pixel point with S (i, j) as 1 as a center, investigating whether S (i, j) corresponding to eight adjacent pixel points around the center is 1, taking the point with S (i, j) as 1 in the eight adjacent pixel points as a connected domain candidate pixel, namely an adjacent pixel, and forming the candidate connected domain by a closed region formed by connecting points of the adjacent pixels;
2-5, calculating the size of a connected domain and detecting defects: on the basis of the step 2-4, extracting the area of the candidate connected domain, eliminating the noise smaller than the threshold of the connected domain by setting the threshold of the connected domain (namely the calculated area of the candidate connected domain smaller than the threshold of the connected domain is regarded as the noise), obtaining a defect area, determining the position of the defect area, and further determining the existence of the surface defect of the lithium battery; otherwise, the surface of the lithium battery is non-defective. In the method, if the position of the defect area on the surface of the whole lithium ion battery needs to be determined, the image blocks at different positions are marked during the sliding and shearing of the image in the early stage, and the position of the defect can be determined in the later stage.
In the surface defects of the soft package lithium ion battery in the embodiment, the minimum defect is a pinhole defect, the minimum size of the pinhole defect is 8 × 8 pixels, and the threshold value of the connected domain is set to be half of the pinhole defect, that is, the threshold value of the connected domain is 32 pixels.
The invention is suitable for the size of the soft package lithium battery of 46.0mm multiplied by 20.7mm, and the size of the collected image is 2048 multiplied by 1088 pixels.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive. Many forms can be made without departing from the spirit of the invention and the scope of the claims, which fall within the scope of the invention.
Claims (9)
1. A lithium battery surface defect detection method based on generation of a countermeasure network is characterized in that the method firstly generates the countermeasure network and corresponding loss functions to learn normal surface distribution of a lithium battery, so that a trained generator can fit normal surface image distribution of the lithium battery, and the trained generator is utilized to reconstruct the surface of the lithium battery to obtain a reconstructed image; then, carrying out difference operation on the reconstructed image and the original image, and segmenting a difference result by using a self-adaptive threshold segmentation method to obtain possible defective pixels; and finally, by setting the size of the connected domain, excluding the false detection region, and realizing the detection of whether the surface of the lithium battery is defective.
2. The detection method according to claim 1, characterized in that it comprises in particular two parts:
first, obtaining the surface distribution of the lithium ion battery
1-1, image acquisition: acquiring an image of the normal surface of the lithium ion battery by using a high-precision CMOS industrial camera, and storing the image by using a workstation computer;
1-2, image preprocessing: performing sliding shearing on the collected images from left to right and from top to bottom by using a sliding window with the size of 128 × 128 and the step length of 32 to obtain a data set of a training network;
1-3, creating a confrontation network model and setting up and initializing: the generation countermeasure network consists of a generator network and a discriminator network, and both the generator network and the discriminator network adopt a convolutional neural network;
the generator network is composed of 4 convolution units with the step length of 2 and 4 deconvolution units with the step length of 2, and the down sampling and the up sampling of the image are realized; sequentially performing 4 convolution units and then 4 deconvolution units, wherein the output of the last deconvolution unit is the output of the generator network; the activation function in the last deconvolution unit is a tanh function, and the network output of the generator is ensured to be within the range of the image value range;
1-4, training to generate a confrontation network model: when the model is trained, updating the network parameters of the generator and the discriminator by using a loss function and a gradient descent method until the model loss is converged;
the network parameters were trained using the following loss functions:
wherein L isDisFor discriminator loss, LGenTo generator losses; l isgan_d、Lgan_g、LrThe discriminator countermeasure loss, the generator countermeasure loss, and the mean square error loss of the generator input image and the output image are expressed by the following equations:
where N is the total number of input images per batch, x(n)The nth real image in the input image is obtained; g (x)(n)) For a pseudo-image of the output after the image has been input to the generator, D (x)(n)) The output obtained by the discriminator is input for the real image, D (G (x)(n)) Is output obtained by the pseudo image input discriminator;
second part, defective area acquisition
2-1, image reconstruction: after training to generate network parameters of a confrontation network model, inputting the test image t into a generator network to obtain a reconstructed image t';
2-2, differential operation: on the basis of the step 2-1, carrying out differential operation on the test image and the reconstructed image output by the generator network, thereby obtaining an interested area;
2-3, binary segmentation: on the basis of the step 2-2, selecting a threshold value to carry out binary segmentation on the difference result so as to obtain a defect candidate region;
2-4, acquiring a connected domain, and on the basis of the step 2-3, selecting the connected domain for the binary segmentation result to obtain a candidate connected domain;
2-5, calculating the size of the candidate connected domain and detecting defects: on the basis of the step 2-4, extracting the area of the candidate connected domain, and eliminating the candidate connected domain which does not meet the condition by setting a threshold value of the connected domain to obtain a defect area; the connected domain threshold is half of the area of the smallest defect pixel among all defect types.
3. The detection method according to claim 1 or 2, characterized in that: the method is used for detecting the surface defects of the soft package lithium battery, including aluminum exposure, scratches, dents, pinholes and pit defects.
4. The detection method according to claim 3, characterized in that: the size of the soft package lithium battery is 46.0mm multiplied by 20.7mm multiplied by 11.3mm, and the size of an image collected by a camera is 2048 multiplied by 1088 pixels.
5. The detection method according to claim 4, characterized in that: during model training, the total number of input images in each batch is 64, the learning rate of the generator is 0.0001, and the learning rate of the discriminator is 0.00005.
6. The detection method according to claim 1, characterized in that: the discriminator network is composed of 4 convolution units with step length of 2, the image is down sampled, and the final output value is used for distinguishing the truth of the input image.
7. The detection method according to claim 2, characterized in that: the initialization of the network parameters for generating the countermeasure network model comprises the initialization of the generator network and the arbiter network parameters; generator network parameter θGIs randomly generated by a positive-Taiwanese distribution with a mean value of 0 and a variance of 0.02; discriminator network parameter thetaDIs randomly generated from a positive distribution subject to a mean of 0 and a variance of 0.02.
8. The detection method according to claim 2, characterized in that: in step 2-3, the threshold Th of binary segmentation is an adaptive threshold defined as:
Th=mean(dif)+2.7std(dif)
wherein dif is the difference result between the reconstructed image and the test image, mean (dif) is the mean value of the difference result image, and std (dif) is the variance of the difference result image.
9. The detection method according to claim 1, characterized in that: in step 2-5, the connected component threshold is 32 pixels.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010417852.6A CN111598877B (en) | 2020-05-18 | 2020-05-18 | Lithium battery surface defect detection method based on generation of countermeasure network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010417852.6A CN111598877B (en) | 2020-05-18 | 2020-05-18 | Lithium battery surface defect detection method based on generation of countermeasure network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111598877A true CN111598877A (en) | 2020-08-28 |
CN111598877B CN111598877B (en) | 2022-08-09 |
Family
ID=72187326
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010417852.6A Expired - Fee Related CN111598877B (en) | 2020-05-18 | 2020-05-18 | Lithium battery surface defect detection method based on generation of countermeasure network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111598877B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113592866A (en) * | 2021-09-29 | 2021-11-02 | 西安邮电大学 | Semiconductor lead frame exposure defect detection method |
CN114998344A (en) * | 2022-08-04 | 2022-09-02 | 南通金茂防爆电气有限公司 | Ion exchange membrane surface defect evaluation method and system based on image processing |
CN115984285A (en) * | 2023-03-21 | 2023-04-18 | 上海仙工智能科技有限公司 | Library bit state detection method and system based on generation countermeasure network and storage medium |
WO2024021662A1 (en) * | 2022-07-29 | 2024-02-01 | 宁德时代新能源科技股份有限公司 | Method and apparatus for detecting defect of battery cell surface |
JP7501264B2 (en) | 2020-09-15 | 2024-06-18 | 株式会社アイシン | Anomaly detection device, anomaly detection program, and anomaly detection system |
EP4350619A4 (en) * | 2022-08-08 | 2024-10-16 | Contemporary Amperex Tech Hong Kong Limited | Battery cell squeeze damage detection method, apparatus and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108734690A (en) * | 2018-03-02 | 2018-11-02 | 苏州汉特士视觉科技有限公司 | A kind of defects of vision detection device and its detection method |
CN108961217A (en) * | 2018-06-08 | 2018-12-07 | 南京大学 | A kind of detection method of surface flaw based on positive example training |
-
2020
- 2020-05-18 CN CN202010417852.6A patent/CN111598877B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108734690A (en) * | 2018-03-02 | 2018-11-02 | 苏州汉特士视觉科技有限公司 | A kind of defects of vision detection device and its detection method |
CN108961217A (en) * | 2018-06-08 | 2018-12-07 | 南京大学 | A kind of detection method of surface flaw based on positive example training |
Non-Patent Citations (2)
Title |
---|
KYOSUKE KOMOTO ET.AL: "A Performance Evaluation of Defect Detection by using Denoising AutoEncoder Generative Adversarial Networks", 《2018 INTERNATIONAL WORKSHOP ON ADVANCED IMAGE TECHNOLOGY (IWAIT)》 * |
王家晨 等: "基于背景重构X射线钢管焊缝缺陷检测方法", 《计算机系统应用》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7501264B2 (en) | 2020-09-15 | 2024-06-18 | 株式会社アイシン | Anomaly detection device, anomaly detection program, and anomaly detection system |
CN113592866A (en) * | 2021-09-29 | 2021-11-02 | 西安邮电大学 | Semiconductor lead frame exposure defect detection method |
WO2024021662A1 (en) * | 2022-07-29 | 2024-02-01 | 宁德时代新能源科技股份有限公司 | Method and apparatus for detecting defect of battery cell surface |
CN114998344A (en) * | 2022-08-04 | 2022-09-02 | 南通金茂防爆电气有限公司 | Ion exchange membrane surface defect evaluation method and system based on image processing |
EP4350619A4 (en) * | 2022-08-08 | 2024-10-16 | Contemporary Amperex Tech Hong Kong Limited | Battery cell squeeze damage detection method, apparatus and system |
CN115984285A (en) * | 2023-03-21 | 2023-04-18 | 上海仙工智能科技有限公司 | Library bit state detection method and system based on generation countermeasure network and storage medium |
CN115984285B (en) * | 2023-03-21 | 2023-07-04 | 上海仙工智能科技有限公司 | Method and system for detecting library bit state based on generation countermeasure network and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111598877B (en) | 2022-08-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111598877B (en) | Lithium battery surface defect detection method based on generation of countermeasure network | |
CN108562589B (en) | Method for detecting surface defects of magnetic circuit material | |
CN109118479B (en) | Capsule network-based insulator defect identification and positioning device and method | |
CN114627383B (en) | Small sample defect detection method based on metric learning | |
CN109596634B (en) | Cable defect detection method and device, storage medium and processor | |
CN109543606A (en) | A kind of face identification method that attention mechanism is added | |
CN107123111B (en) | Deep residual error network construction method for mobile phone screen defect detection | |
CN110992354A (en) | Abnormal region detection method for countering self-encoder based on introduction of automatic memory mechanism | |
CN113989716B (en) | Method, system, equipment and terminal for detecting foreign object target of underground coal mine conveyer belt | |
CN114387207B (en) | Tire flaw detection method and model based on self-attention mechanism and dual-domain self-adaption | |
CN111008959A (en) | Grading ring defect detection method, device, medium and equipment based on aerial image | |
CN112750113B (en) | Glass bottle defect detection method and device based on deep learning and linear detection | |
CN114782391A (en) | Method, system and device for constructing defect detection model of few-sample industrial image | |
CN113808180B (en) | Heterologous image registration method, system and device | |
CN114972759B (en) | Remote sensing image semantic segmentation method based on hierarchical contour cost function | |
CN113487563B (en) | EL image-based self-adaptive detection method for hidden cracks of photovoltaic module | |
CN107886065A (en) | A kind of Serial No. recognition methods of mixing script | |
CN114511521B (en) | Tire flaw detection method based on multiple representation and multiple sub-field self-adaption | |
CN115239672A (en) | Defect detection method and device, equipment and storage medium | |
CN116309483A (en) | DDPM-based semi-supervised power transformation equipment characterization defect detection method and system | |
CN115471463A (en) | Solar cell defect detection method based on countermeasure type generation network | |
CN114820541A (en) | Defect detection method based on reconstructed network | |
CN113888477A (en) | Network model training method, metal surface defect detection method and electronic equipment | |
CN116485802B (en) | Insulator flashover defect detection method, device, equipment and storage medium | |
CN108961322B (en) | Mismatching elimination method suitable for landing sequence images |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20220809 |