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 PDF

Info

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
Application number
CN202010417852.6A
Other languages
Chinese (zh)
Other versions
CN111598877B (en
Inventor
刘坤
文�熙
韩江锐
陈海永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei University of Technology
Original Assignee
Hebei University of Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hebei University of Technology filed Critical Hebei University of Technology
Priority to CN202010417852.6A priority Critical patent/CN111598877B/en
Publication of CN111598877A publication Critical patent/CN111598877A/en
Application granted granted Critical
Publication of CN111598877B publication Critical patent/CN111598877B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P70/00Climate change mitigation technologies in the production process for final industrial or consumer products
    • Y02P70/50Manufacturing 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

Lithium battery surface defect detection method based on generation of countermeasure network
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:
Figure BDA0002495745030000031
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:
Figure BDA0002495745030000041
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:
Figure BDA0002495745030000051
wherein, the left side of the equation represents the parameter to be updated, and the right side of the equation represents the updated value;
Figure BDA0002495745030000052
and
Figure BDA0002495745030000053
representing 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:
Figure BDA0002495745030000054
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:
Figure BDA0002495745030000055
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:
Figure BDA0002495745030000061
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:
Figure BDA0002495745030000091
wherein the left side of the equation represents the parameter to be updated, and the right side of the equation represents the updated value;
Figure BDA0002495745030000092
and
Figure BDA0002495745030000093
representing 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:
Figure BDA0002495745030000094
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:
Figure BDA0002495745030000101
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:
Figure BDA0002495745030000111
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:
Figure FDA0002495745020000021
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:
Figure FDA0002495745020000022
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.
CN202010417852.6A 2020-05-18 2020-05-18 Lithium battery surface defect detection method based on generation of countermeasure network Expired - Fee Related CN111598877B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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