CN111476307A - Lithium battery surface defect detection method based on depth field adaptation - Google Patents

Lithium battery surface defect detection method based on depth field adaptation Download PDF

Info

Publication number
CN111476307A
CN111476307A CN202010282872.7A CN202010282872A CN111476307A CN 111476307 A CN111476307 A CN 111476307A CN 202010282872 A CN202010282872 A CN 202010282872A CN 111476307 A CN111476307 A CN 111476307A
Authority
CN
China
Prior art keywords
domain
model
layer
classifier
feature
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
CN202010282872.7A
Other languages
Chinese (zh)
Other versions
CN111476307B (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 CN202010282872.7A priority Critical patent/CN111476307B/en
Publication of CN111476307A publication Critical patent/CN111476307A/en
Application granted granted Critical
Publication of CN111476307B publication Critical patent/CN111476307B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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
    • G06N3/084Backpropagation, e.g. using gradient descent
    • 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
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • 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]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • 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
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Mathematical Physics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a lithium battery surface defect detection method based on deep field adaptation, which designs an adaptation layer based on statistics such as Maximum Mean Difference (MMD) and K L divergence in a classifier, and designs a field discriminator for resisting and discriminating which field the extracted features come from after feature extraction.

Description

Lithium battery surface defect detection method based on depth field adaptation
Technical Field
The invention relates to the technical field of machine vision, and particularly provides a lithium battery surface defect detection method based on depth field adaptation.
Background
At present, lithium ion batteries are more and more widely applied, such as mobile phones, notebooks, electric vehicles, and the like, and form a huge industrial group. But some defects generated in the production process seriously affect the service life and the safety factor of the lithium battery. Such as edge sealing wrinkles, pole piece scratches, exposed foil, particles, perforations, dark spots, foreign matters, surface dents, stains, bulges, code spraying deformation and the like. The traditional method for battery defect detection is manual measurement and judgment. However, the battery detection result is influenced by human factors such as subjective will, emotion and visual fatigue of detection personnel, so that the conditions of missed detection and false detection appear. The machine vision detection system can overcome the defects of manual detection, so that the detection result is standard and quantifiable, and the automation degree of the whole production system is improved; not only saves the labor cost, but also avoids errors caused by manual data statistics.
Many scholars at home and abroad apply deep learning technology to surface defect detection of lithium batteries in a large number, wherein Zhou Jia He and Jiu Gong Yuan utilize a convolutional neural network to detect electrode defects [ J ] of the lithium batteries, an electronic measurement technology, 2019(19) provide a lithium battery electrode defect detection method taking a Convolutional Neural Network (CNN) as a core, and characteristics extracted from a battery electrode complete region image through the CNN are sent to a support vector SVM (support vector SVM) machine to give a final prediction detection result. The method needs a large amount of training data with labels, and the labeling of the data needs a large amount of manpower and material resource cost. The deep field adaptation technology can relieve the dependence of a deep learning model on the tag data. The depth domain adaptation method is a representative branch of depth migration learning, and uses a labeled data set similar to a data set to be detected as a source domain and the data set to be detected as a target domain (target domain data may not need to be labeled).
The existing deep field adaptation method cannot be directly applied to surface defect detection of the lithium battery, and the identification rate is not ideal.
Disclosure of Invention
The invention aims to solve the defects in the prior art, and designs a lithium battery surface defect detection method based on depth field adaptation.
In order to achieve the purpose, the invention adopts the technical scheme that:
a lithium battery surface defect detection method based on depth field adaptation comprises the following steps:
the characteristic extractor is a submodule which is built based on a convolutional neural network and is used for automatically extracting effective characteristics from an input image;
the classifier is a submodule which is composed of full connection layers and used for accurately classifying the features;
the domain discriminator is a submodule which is composed of full connection layers and is used for carrying out two-class discrimination on whether the characteristics come from a source domain or a target domain;
the model is connected with a domain discriminator behind a feature extractor in parallel, an adaptive layer is designed in the classifier, Maximum Mean Difference (MMD) and K L divergence are used as measurement criteria by the adaptive layer, the difference of feature distribution of a source domain and a target domain is calculated, the difference value is minimized to update model parameters, image data of the source domain is lithium battery surface defect data acquired on different production lines or defect images acquired by acquisition systems of different manufacturers, and the target domain is defect images acquired on a production line to be detected.
The adaptive layer introduces Maximum Mean Difference (MMD) and K L divergence as statistics to calculate the difference of two-domain feature distribution, and the adaptive loss function L of the adaptive layerconIs represented by formula (1):
Lcon=MMD(S,T)+λDKL(p||q) (1)
in the formula (I), the compound is shown in the specification,MMD (S, T) is a calculation formula of the MMD, wherein S and T respectively represent a source domain and a target domain; dKL(p | | q) is a calculation formula of K L divergence, wherein p represents the original distribution, q represents a simple distribution for approximating p, and λ is a balance coefficient calculated by formula (2):
Figure BDA0002447372760000021
wherein i is the current training step number, and N is the total training step number.
In the training process of the depth domain adaptive model, the data flow paths of a source domain and a target domain are different, and a total loss function comprises three terms:
Figure BDA0002447372760000023
where α is a balance parameter, the update rule of each loss in back propagation is:
Figure BDA0002447372760000022
wherein mu represents learning rate, theta represents corresponding module parameter, f represents feature extractor, c represents classifier, d represents domain discriminator, L is cross entropy loss function, d represents domain discriminators,dtDomain tags that are a source domain and a target domain;
adaptive loss function L during back propagationconUpdating parameters in front of the adaptive layers of the feature extractor F and the classifier; antagonism loss function
Figure BDA0002447372760000024
Responsible for updating the parameters of the feature extractor F and the domain discriminator D, a classification loss function LcFor updating the parameters of the feature extractor F and the whole classifier C.
The feature extractor of the depth field adaptation model is based on a VGG-16 network, comprises five groups of convolution operations, each group of convolution operation comprises two or three convolution layers, a batch layer and a pooling layer, the batch layer and the pooling layer are arranged behind the corresponding convolution layers, feature maps of 512 channels sampled by 32 times are finally output after the five groups of convolution operations, a multi-scale feature fusion strategy is fused in the feature extraction process, the strategy is that a branch is added after the output feature maps of the third group and the fourth group of convolution operations, each branch is subjected to convolution operation and pooling operation, the output of the fifth group of convolution operations of the VGG-16 is added to form three branches in total, the size of the final output feature map of each branch is 4, the output feature maps of the three branches are subjected to stretching operation, stretched into one-dimensional vectors and then spliced together to form a 4 3 one-dimensional vector, the one-dimensional vector is the size of all convolution kernels of the fused VGG-16 network is 3, the window size of the three groups of the convolution kernels is 1, the window size of the window is 2, the window size of the three groups of the convolution kernels is 2, and the window size of the third group of the convolution kernel is 2, the window size of the window is 2, the window size of the convolution kernel 2, the window size of the window 2, and the window size of the window.
The method for detecting the surface defects of the lithium battery comprises the following specific steps:
step 1: source domain and target domain data preparation:
the source domain data is similar to the target domain data, but different from the target domain data and has a common label space, and the source domain data needs to be labeled, and the target domain data does not need to be labeled;
step 2: designing a depth field adaptive model:
the depth domain adaptive model comprises a feature extractor, a classifier composed of a full connection layer and used for accurately classifying features, a domain discriminator composed of a full connection layer and used for carrying out a two-class discrimination on whether the features come from a source domain or a target domain,
designing an adaptive layer in the classifier, wherein the adaptive layer refers to the MMD and K L divergence as measurement criteria, calculates the difference of feature distribution of a source domain and a target domain, and updates model parameters by minimizing the difference value;
and step 3: training of the model:
1) cutting or scaling the source domain data and the target domain data into uniform size, adjusting the size of the picture to 128 × 128, and making a small batch of n data formats suitable for the input of the depth field adaptive model to form a data set;
2) simultaneously inputting source domain data and target domain data into a depth domain adaptive model, in a forward propagation stage, sending the source domain data into the model in small batches of n, dividing the source domain data into two branches after passing through a feature extractor, enabling one branch to enter a classifier, and arranging output ends on an adaptive layer and the last layer of the classifier; the other branch enters a domain discriminator and flows out from the last layer of the domain discriminator;
the target domain data stream is sent into the model in a small batch m, is divided into two branches after passing through the feature extractor, one branch enters the classifier and flows out through the adaptation layer, and the target domain data stream does not pass through the last layer of the classifier; the other branch flows out through a domain discriminator, and m is equal to n;
3) calculation of the loss function:
calculating an adaptive loss function L at the output of the adaptation layer for the data streams of the source domain and the target domainconThe source domain data stream computes a classification cross-entropy loss function L at the classifier outputcCalculating two-class cross entropy loss function at output end of domain discriminator for data stream of source domain and target domain
Figure BDA0002447372760000031
Namely the antagonism loss function;
4) the loss function reversely propagates the update parameters, the total loss function is an expression (7), and the update rule of the model parameters is an expression (8);
Figure BDA0002447372760000032
Figure BDA0002447372760000041
5) repeating the steps 2) -4), when the whole training data set is trained once, completing the training of the model for one period, and circularly training until the total loss function is converged and the training of the model is completed;
and 4, step 4: after the model training is finished, the model is stored and transplanted to a server of a detection system on a lithium battery production line, the model used on the production line only needs a trained feature extractor and a trained classifier, and an adaptation layer and a field discriminator need to be removed in a test stage;
and 5: an on-line testing stage:
and inputting the lithium battery surface image collected on line into the depth field adaptive model detection transplanted in the step 4, so as to realize the detection and identification of the lithium battery surface defects.
The types of the lithium battery surface defects are 7 types including surface dents, stains, surface bulges, folds, pole piece scratches, particles and dark spots, the identification accuracy rate of the pole piece scratches, the surface dents and the surface bulges is not lower than 85%, and the identification accuracy rate of other defects is not lower than 90%.
Compared with the prior art, the invention has the beneficial effects that:
the method is characterized in that an unsupervised deep field adaptive model is applied to the detection of the surface defects of the lithium battery, the method has an efficient detection effect of a deep learning technology, the dependency of the deep learning technology on label data is relieved, on the premise of ensuring the identification accuracy and real-time performance, a large amount of training data with labels is not needed, the labor cost is reduced, the trained model has better generalization capability on target field data, and the performance of the model is far superior to that of the traditional machine vision and a general field adaptive method.
The depth domain adaptive model of the invention comprises three parts, namely a feature extractor based on a depth convolutional neural network, a classifier based on a fully connected layer and a domain discriminator, different from other depth domain models, the depth domain adaptive model of the invention combines two feature distribution alignment modes of taking statistics as a measurement criterion and distinguishing domain confrontation to realize domain alignment, the model designs an adaptive layer in the classifier, the adaptive layer refers to a Maximum Mean Difference (MMD) and a divergence of K L as a measurement criterion, calculates the difference of two domain distributions, and minimizes the value to update model parameters, on the other hand, the model is connected with the domain discriminator behind the feature extractor in parallel, the discriminator performs two types of discrimination on whether the input feature distribution is from a source domain or a target domain, the feature extractor updates the parameters by confusing the result of the discriminator as much as possible, the discriminator updates the parameters by judging the source of the features as much as correctly as possible, and the discriminator can make the feature source of the convergence result not be powerful by the feature extractor, so that the result of the convergence is not able to be trained by the feature extractor, and the classifier can make the feature extraction of the target domain be more fully adaptive.
The method combines two characteristic distribution alignment modes of measuring criterion and field confrontation discrimination by taking statistics as a measurement criterion in the design of a depth field adaptive model to realize field alignment, on one hand, the degree of the two-field alignment is enhanced, on the other hand, the data of a target field can participate in the training of a classifier (calculating the characteristics of the MMD and K L which need the data of the target field), the generalization capability on the target field is strong, and the recognition rate of surface defects is improved.
Aiming at the defects of small scratches, dents, dark spots, particles and the like on the surface of a lithium battery, a simple convolutional neural network is difficult to extract effective characteristics of the small targets, therefore, a multi-scale characteristic fusion strategy is integrated into a depth model designed in the invention in the characteristic extraction process so as to solve the problem that the defects of the small targets are difficult to identify, a simple and effective multi-scale characteristic fusion strategy is added, the strategy can effectively integrate characteristic diagram information of different scales and receptive fields, and the comprehensive extraction capability of basic geometric characteristics and high-level semantic characteristics (the high-level semantic characteristics are macroscopic characteristics such as defect types, and the basic geometric characteristics are fine structure information such as outlines, textures and edges of the defects) is improved. The method has a good recognition effect on the small defects which are difficult to perceive, avoids the construction of a complex network structure, reduces the processing capacity of a computer, realizes light weight and has low calculation cost.
Drawings
FIG. 1 is a diagram of a lithium battery surface defect detection model based on depth domain adaptation according to the present disclosure;
FIG. 2 is a schematic diagram of a multi-scale feature fusion strategy disclosed in the present invention;
FIG. 3 is a flow chart of lithium battery surface defect detection based on depth domain adaptation according to the present disclosure;
reference numerals: 1. source domain data; 2. target domain data; 3. a convolution layer; 4. batching into one layer (BN); 5. a pooling layer; 6. a fully-connected layer; 7. an adaptation layer; 8. a source domain data stream; 9. a target domain data stream; 10. fused feature vectors; 11. a feature extractor; 12. a classifier; 13. a domain discriminator; 14. a third set of feature maps output by convolution operations; 15. a feature map output by the fourth group of convolution operations; 16. a fifth set of feature maps output by convolution operations; 17. performing convolution operation; 18. performing pooling operation; 19. and (4) stretching operation.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. 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.
As shown in fig. 1, the present invention relates to a depth domain adaptation-based lithium battery surface defect detection model, which includes three sub-modules: a feature extractor, a classifier and a domain discriminator. The model is a whole new domain adaptation model which combines the minimization statistics and the confrontation discrimination method to realize distribution alignment.
The feature extractor is a submodule built by utilizing a convolutional neural network and used for extracting effective features of an input sample, the feature extractor is developed on the basis of VGG-16 and comprises five groups of convolution operations, each group of convolution operation consists of two or three convolution layers 3, a batch layer 4 and a pooling layer 5, the sizes of all convolution kernels are 3 × 3, the step length is 1, the size of a pooling window is 2 x 2, and the step length is 2.
The input original image is calculated layer by layer to extract features, and feature maps of 512 channels sampled by 32 times are finally output after five groups of convolution operations. Unlike the original VGG-16, the feature extractor proposed by the present invention adds a Batch Normalization (BN) layer after the convolutional layer and applies a new feature fusion strategy on the output vector. BN is the operation of normalizing the intermediate results of a batch of data in the CNN, and can accelerate the training process and optimize the training model. As shown in fig. 2, the multi-scale feature fusion strategy is designed for the fine defects of the lithium battery, specifically, a branch is added after the feature graphs are output by the convolution operations of the third group and the fourth group, wherein the size of the feature graph 14 output by the convolution operations of the third group is 16 × 16, the size of the convolution kernel of the branch behind is 3 × 3, the step size is 2, the size of the pooling window is 2 × 2, and the step size is 2; the size of the feature map 15 output by the fourth group of convolution operation is 8 x 8, the branches of the feature map output by the fourth group of convolution operation are subjected to convolution operation 17 and pooling operation 18, the convolution kernel size is 3 x 3, the step size is 1, the pooling window size is 2 x 2, and the step size is 2; and adding the structure of the VGG-16 to obtain three branches, wherein the size of the final output characteristic diagram of each branch is 4 x 4, and the output characteristic diagrams on the three branches are stretched into one-dimensional vectors 19 and then spliced together to form a 4 x 3 one-dimensional vector which is the fused characteristic vector 10.
And converting the feature mapping with different scales into the same size as the last feature map. These feature maps are stretched into one-dimensional vectors and then spliced into a new fused vector, which is the output vector of the feature extractor. And inputting the obtained feature vector into a domain discriminator. The strategy can integrate feature map information of different scales and receptive fields, and improve the comprehensive extraction capability of basic geometric features and high-level semantic features. The method is favorable for effectively identifying the small defects which are difficult to perceive.
The classifier designed by the invention comprises an adaptive layer 7, wherein the adaptive layer refers to the Maximum Mean Difference (MMD) and the K L divergence as the difference measurement of the distribution of the characteristics of two domains, and the difference measurement is minimized in the optimization process of the whole model to obtain the common characteristics of the two domains.
Lcon=MMD(S,T)+λDKL(p||q) (1)
In the formula, MMD (S, T) is a calculation formula of MMD, where S, T represent a source domain and a target domain, respectively. DKL(p | | q) is a formula for calculating K L divergence, where p represents the original distribution and q represents a simple distribution used to approximate p.
Figure BDA0002447372760000061
Where i is the number of steps currently trained and N is the total number of training steps, the equations for MMD and K L divergence are as follows:
Figure BDA0002447372760000062
where phi (-) represents a mapping, xsRepresenting source domain samples, xtRepresenting a target domain sample. n and m are small batches (batch size) of source domain and target domain data. H denotes measuring distance by mapping data to a regenerated Hilbert space (RKHS).
Figure BDA0002447372760000063
In the formula, p (x)j) Is the distribution of the target domain, q (x)i) Is the distribution of the source domain, and as above, n-m is the small batch (batch size) of source and target domain data.
In addition to the loss of the adaptation layer, the cross-entropy loss function of the last layer in the classifier under supervised training of the source domain data is as follows:
Lc=L(C(F(xs)),ys) (5)
wherein L is a cross entropy loss function, F is a feature extractor mapping function, C is a classifier mapping function, xsRepresenting source domain samples, ysRepresenting a source domain sample label.
The structure of the domain discriminator is actually a two-class classifier, only one two-class discrimination needs to be carried out on the input feature vector, and in order to simplify the training step, the parameters of the domain discriminator and the feature extractor are alternately updated by using a feature inversion operation instead. This operation enables the confrontation discrimination to become completely an end-to-end conventional two-class problem at training. So far, the loss function of the domain discriminator is as follows:
Figure BDA0002447372760000077
where L is the cross entropy loss function, xs,xtSamples representing a source domain and a target domain, ds,dtIs the domain label of the source domain and the target domain, F is the mapping function of the feature extractor, and D is the mapping function of the domain discriminator.
Based on the above description of the three sub-modules, the final overall loss function is as follows:
Figure BDA0002447372760000071
where α is a balance parameter used to adjust the trade-off between these two quantities during learning.
Figure BDA0002447372760000074
Where μ is the learning rate and θ represents the corresponding module parameter, the adaptive loss function L is applied during back propagationconParameters in front of the feature extractor F and the classifier adaptation layer can be updated; antagonism loss function
Figure BDA0002447372760000075
Responsible for updating the parameters of the feature extractor F and the domain discriminator D, a classification loss function LcFor updating the parameters of the feature extractor F and the whole classifier C. The updating of equation (8) may be achieved by random gradient descent (SGD).
To better illustrate the training process and the parameter update rules, the training details and the overall detection flow are given in fig. 3.
Step 1: source domain and target domain data preparation. The source domain data is similar to the target domain data, but different from the target domain data and has a common label space, and is generally defect pictures acquired by different manufacturers or production lines of lithium batteries or defect images acquired by different acquisition systems. The target field is the image acquired on the production line where the defect detection is to be performed. For source domain data to be annotated, such annotation can be done already by domain participants, and is generally better obtained.
The method comprises the following steps of 2, designing a depth field adaptation model, combining two different feature distribution alignment modes to reduce inter-domain difference, providing a new adaptation layer to realize a minimum distribution method based on statistics, wherein the adaptation layer refers to the MMD and the K L divergence as statistics to calculate the feature distribution difference of two domains, the K L divergence is asymmetric measurement and can measure how much information is lost when the simple distribution is similar to the complex distribution, the introduction of the K L divergence can correct the problem that the MMD has common feature extraction on the two domains, particularly under the condition that the surface defects of a lithium battery have complex background interference, the introduction position of the adaptation layer is before the last layer in a classifier and is next to the last layer, and a multi-scale feature fusion strategy is integrated in the process of extracting a convolutional neural network.
And step 3: and (5) training a model.
1) And adjusting the source domain data and the target domain data, properly cutting or scaling the data into a uniform size, adjusting the size of the picture to 128 x 128, and manufacturing a small batch of n data to be suitable for a data format input by a depth field adaptive model to form a data set.
2) In the forward propagation stage, the source domain data is sent into the model in small batch n, and is divided into two branches after passing through the feature extractor, one branch enters the classifier, and an output end is arranged on an adaptation layer (the structure of the classifier in front of the adaptation layer can be trained by the target domain data, so that the generalization capability of the classifier on the target domain is stronger the later the adaptation layer is), and the last layer of the classifier. The other branch enters the domain discriminator and flows out from the last layer of the discriminator. The target domain data stream is sent into the model in a small batch m, and is divided into two branches after passing through the feature extractor, wherein one branch enters the classifier and flows out through the adaptation layer (not passing through the last layer of the classifier at this time). The other branch flows out through the domain discriminator.
3) Calculation of loss function the data stream of the source domain and the target domain calculates an adaptive loss function L at the output of the adaptation layerconThe source domain data stream computes a classification cross-entropy loss function L at the classifier outputcCalculating two-class cross entropy loss function at output end of domain discriminator for data stream of source domain and target domain
Figure BDA0002447372760000081
I.e. the antagonism loss function.
4) The loss function propagates the update parameters back. The total loss function is shown in equation (7), and the updating rule of the model parameters is shown in equation (8).
5) And (4) repeating the steps 2) -4), when the whole training data set is trained once, completing the training of the model for one period, and circularly training until the total loss function is converged and completing the training of the model.
And 4, step 4: and after the model training is finished, storing the model, and transplanting the model into a server of a detection system on a lithium battery production line. The model used on the production line only needs the trained feature extractor and classifier, and the adaptive layer and domain discriminator only needs to be used for training the model and needs to be removed in the testing stage.
And 5: an on-line test phase. The images collected on line are input into the model detection transplanted in the step 4 and used for the production line, the detection time of a single image is 0.2s, and the requirement of production efficiency is met.
In the embodiment, 7 defect images such as surface dents, stains, surface bulges, wrinkles, pole piece scratches, particles, dark spots and the like of the lithium battery are tested, wherein the recognition accuracy of the pole piece scratches, the surface dents and the surface bulges is respectively 87.32%, 85.41% and 85.46%, and the recognition rate of other defects is more than 90%.
The parameters are set in the training process and are related to specific data sets, for example, the cycle training period is determined according to the convergence degree of the total loss function, the convergence is early and fast, the cycle number is smaller appropriately, otherwise, the cycle number is larger, and the larger cycle training period is set according to experience during model training, so that the aim of realizing the convergence of the total loss function in the cycle training period can be fulfilled. The size of the training small batch is not suitable to be too small.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Nothing in this specification is said to apply to the prior art.

Claims (7)

1. A lithium battery surface defect detection method based on depth field adaptation comprises the following steps:
the characteristic extractor is a submodule which is built based on a convolutional neural network and is used for automatically extracting effective characteristics from an input image;
the classifier is a submodule which is composed of full connection layers and used for accurately classifying the features;
the domain discriminator is a submodule which is composed of full connection layers and is used for carrying out two-class discrimination on whether the characteristics come from a source domain or a target domain;
the model is connected with a domain discriminator behind a feature extractor in parallel, an adaptive layer is designed in the classifier, the adaptive layer refers to the maximum mean difference MMD and the K L divergence as measurement criteria, the difference of feature distribution of a source domain and a target domain is calculated, the difference value is minimized to update model parameters, image data of the source domain is lithium battery surface defect images acquired on different production lines or defect images acquired by acquisition systems of different manufacturers, and the target domain is defect images acquired on a production line to be detected.
2. The method for detecting surface defects of lithium batteries according to claim 1, wherein the adaptive layer introduces Maximum Mean Difference (MMD) and divergence K L as statistics to calculate the difference of two-domain feature distributions, and the adaptive loss function L of the adaptive layerconIs represented by formula (1):
Lcon=MMD(S,T)+λDKL(p||q) (1)
in the formula, MMD (S, T) is a calculation formula of MMD, wherein S and T respectively represent a source domain and a target domain; dKL(p | | q) is a calculation formula of K L divergence, wherein p represents the original distribution, q represents a simple distribution for approximating p, and λ is a balance coefficient calculated by formula (2):
Figure FDA0002447372750000011
wherein i is the current training step number, and N is the total training step number.
3. The method for detecting the surface defects of the lithium battery as claimed in claim 2, wherein in the training process of the deep domain adaptive model, the data flow paths of the source domain and the target domain are different, and the total loss function comprises three terms:
Figure FDA0002447372750000012
where α is a balance parameter, the update rule of each loss in back propagation is:
Figure FDA0002447372750000021
wherein mu represents learning rate, theta represents corresponding module parameter, f represents feature extractor, c represents classifier, d represents domain discriminator, L is cross entropy loss function, d represents domain discriminators,dtDomain tags that are a source domain and a target domain;
adaptive loss function L during back propagationconUpdating parameters in front of the adaptive layers of the feature extractor F and the classifier; antagonism loss function
Figure FDA0002447372750000022
Responsible for updating the parameters of the feature extractor F and the domain discriminator D, a classification loss function LcFor updating the parameters of the feature extractor F and the whole classifier C.
4. The method for detecting the surface defects of the lithium battery as claimed in claim 1, wherein the feature extractor is based on a VGG-16 network and comprises five groups of convolution operations, each group of convolution operation comprises two or three convolution layers, a batch normalization layer and a pooling layer, and the batch normalization layer and the pooling layer follow the corresponding convolution layers, and feature maps of 512 channels sampled by 32 times are finally output after the five groups of convolution operations; a multi-scale feature fusion strategy is fused in the feature extraction process, the strategy is that one branch is added after the output feature graphs of the third group and the fourth group of convolution operation respectively, the convolution operation and the pooling operation are carried out on each branch, the output of the fifth group of convolution operation of VGG-16 is added, three branches are provided in total, the size of the final output feature graph of each branch is 4 x 4, the output feature graphs of the three branches are stretched into one-dimensional vectors, the one-dimensional vectors are spliced together to form a 4 x 3 one-dimensional vector, and the one-dimensional vector is the fused feature vector.
5. The method of claim 4, wherein the VGG-16 network has all convolution kernel sizes of 3 × 3 with step size of 1, and the pooling window size of 2 x 2 with step size of 2, the third set of branches after convolution operation has convolution kernel sizes of 3 x 3 with step size of 2, and the pooling window size of 2 x 2 with step size of 2, and the fourth set of branches after convolution kernel sizes of 3 x 3 with step size of 1, and the pooling window size of 2 x 2 with step size of 2.
6. The method for detecting the surface defects of the lithium battery as claimed in any one of claims 1 to 5, wherein the method comprises the following steps:
step 1: source domain and target domain data preparation:
the source domain data is similar to the target domain data, but different from the target domain data and has a common label space, and the source domain data needs to be labeled, and the target domain data does not need to be labeled;
step 2: designing a depth domain adaptive model:
the depth domain adaptive model comprises a feature extractor, a classifier composed of a full connection layer and used for accurately classifying features, a domain discriminator composed of a full connection layer and used for carrying out a two-class discrimination on whether the features come from a source domain or a target domain,
designing an adaptive layer in the classifier, wherein the adaptive layer refers to the MMD and K L divergence as measurement criteria, calculates the difference of feature distribution of a source domain and a target domain, and updates model parameters by minimizing the difference value;
and step 3: training of the model:
1) cutting or scaling the source domain data and the target domain data into uniform size, adjusting the size of the picture to 128 × 128, and making a small batch of n data formats suitable for the input of a depth domain adaptation model to form a data set;
2) simultaneously inputting source domain data and target domain data into a depth domain adaptation model, in a forward propagation stage, sending the source domain data into the model in small batches of n, dividing the source domain data into two branches after passing through a feature extractor, enabling one branch to enter a classifier, and arranging output ends on an adaptation layer and the last layer of the classifier; the other branch enters a domain discriminator and flows out from the last layer of the domain discriminator;
the target domain data stream is sent into the model in a small batch m, is divided into two branches after passing through the feature extractor, one branch enters the classifier and flows out through the adaptation layer, and the target domain data stream does not pass through the last layer of the classifier; the other branch flows out through a domain discriminator, and m is equal to n;
3) calculation of the loss function:
calculating an adaptive loss function L at the output of the adaptation layer for the data streams of the source domain and the target domainconThe source domain data stream computes a classification cross-entropy loss function L at the classifier outputcCalculating two-class cross entropy loss function at output end of domain discriminator for data stream of source domain and target domain
Figure FDA0002447372750000033
Namely the antagonism loss function;
4) the loss function reversely propagates the update parameters, the total loss function is an expression (7), and the update rule of the model parameters is an expression (8);
Figure FDA0002447372750000031
Figure FDA0002447372750000032
5) repeating the steps 2) -4), when the whole training data set is trained once, the training of the model completes one period,
performing cyclic training until the total loss function is converged, and finishing model training;
and 4, step 4: after the model training is finished, the model is stored and transplanted to a server of a detection system on a lithium battery production line, the model used on the production line only needs a trained feature extractor and a trained classifier, and an adaptation layer and a field discriminator need to be removed in a test stage;
and 5: an on-line testing stage:
and inputting the lithium battery surface image collected on line into the depth domain adaptive model detection transplanted in the step 4, so as to realize the detection and identification of the lithium battery surface defects.
7. The method for detecting the surface defects of the lithium battery as claimed in claim 6, wherein the types of the surface defects of the lithium battery are 7 types of surface dents, stains, surface bulges, wrinkles, pole piece scratches, particles and dark spots, the identification accuracy of the pole piece scratches, the surface dents and the surface bulges is not less than 85%, and the identification accuracy of other defects is not less than 90%.
CN202010282872.7A 2020-04-13 2020-04-13 Lithium battery surface defect detection method based on depth field adaptation Active CN111476307B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010282872.7A CN111476307B (en) 2020-04-13 2020-04-13 Lithium battery surface defect detection method based on depth field adaptation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010282872.7A CN111476307B (en) 2020-04-13 2020-04-13 Lithium battery surface defect detection method based on depth field adaptation

Publications (2)

Publication Number Publication Date
CN111476307A true CN111476307A (en) 2020-07-31
CN111476307B CN111476307B (en) 2023-06-20

Family

ID=71751564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010282872.7A Active CN111476307B (en) 2020-04-13 2020-04-13 Lithium battery surface defect detection method based on depth field adaptation

Country Status (1)

Country Link
CN (1) CN111476307B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112232293A (en) * 2020-11-09 2021-01-15 腾讯科技(深圳)有限公司 Image processing model training method, image processing method and related equipment
CN112434602A (en) * 2020-11-23 2021-03-02 西安交通大学 Fault diagnosis method based on migratable common feature space mining
CN112540298A (en) * 2020-12-26 2021-03-23 福州大学 Lithium ion battery SOC estimation method based on deep-migration learning
CN112967245A (en) * 2021-03-01 2021-06-15 创新奇智(青岛)科技有限公司 Battery detection method and device, electronic equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062753A (en) * 2017-12-29 2018-05-22 重庆理工大学 The adaptive brain tumor semantic segmentation method in unsupervised domain based on depth confrontation study
US20180357777A1 (en) * 2015-12-10 2018-12-13 Siemens Aktiengesellschaft Method for Producing a Depth Map
CN109766921A (en) * 2018-12-19 2019-05-17 合肥工业大学 A kind of vibration data Fault Classification based on depth domain-adaptive
CN110111297A (en) * 2019-03-15 2019-08-09 浙江大学 A kind of injection-molded item surface image defect identification method based on transfer learning
WO2019169816A1 (en) * 2018-03-09 2019-09-12 中山大学 Deep neural network for fine recognition of vehicle attributes, and training method thereof
CN110348579A (en) * 2019-05-28 2019-10-18 北京理工大学 A kind of domain-adaptive migration feature method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180357777A1 (en) * 2015-12-10 2018-12-13 Siemens Aktiengesellschaft Method for Producing a Depth Map
CN108062753A (en) * 2017-12-29 2018-05-22 重庆理工大学 The adaptive brain tumor semantic segmentation method in unsupervised domain based on depth confrontation study
WO2019169816A1 (en) * 2018-03-09 2019-09-12 中山大学 Deep neural network for fine recognition of vehicle attributes, and training method thereof
CN109766921A (en) * 2018-12-19 2019-05-17 合肥工业大学 A kind of vibration data Fault Classification based on depth domain-adaptive
CN110111297A (en) * 2019-03-15 2019-08-09 浙江大学 A kind of injection-molded item surface image defect identification method based on transfer learning
CN110348579A (en) * 2019-05-28 2019-10-18 北京理工大学 A kind of domain-adaptive migration feature method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YAROSLAV GANIN.ETC: ""Domain-Adversarial Training of Neural Networks"" *
刘坤;张晓怿;陈宁纪;苏秀苹;: "融合深度信息的雾霾情况下显著性目标提取" *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112232293A (en) * 2020-11-09 2021-01-15 腾讯科技(深圳)有限公司 Image processing model training method, image processing method and related equipment
CN112434602A (en) * 2020-11-23 2021-03-02 西安交通大学 Fault diagnosis method based on migratable common feature space mining
CN112434602B (en) * 2020-11-23 2023-08-29 西安交通大学 Fault diagnosis method based on movable common feature space mining
CN112540298A (en) * 2020-12-26 2021-03-23 福州大学 Lithium ion battery SOC estimation method based on deep-migration learning
CN112540298B (en) * 2020-12-26 2022-05-10 福州大学 Lithium ion battery SOC estimation method based on deep-migration learning
CN112967245A (en) * 2021-03-01 2021-06-15 创新奇智(青岛)科技有限公司 Battery detection method and device, electronic equipment and readable storage medium
CN112967245B (en) * 2021-03-01 2022-11-08 创新奇智(青岛)科技有限公司 Battery detection method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN111476307B (en) 2023-06-20

Similar Documents

Publication Publication Date Title
CN111476307A (en) Lithium battery surface defect detection method based on depth field adaptation
CN110310262A (en) A kind of method, apparatus and system for detection wheel tyre defect
CN111898432B (en) Pedestrian detection system and method based on improved YOLOv3 algorithm
CN114841244B (en) Target detection method based on robust sampling and mixed attention pyramid
CN110969166A (en) Small target identification method and system in inspection scene
CN112949408B (en) Real-time identification method and system for target fish passing through fish channel
CN113139594B (en) Self-adaptive detection method for airborne image unmanned aerial vehicle target
CN112102424A (en) License plate image generation model construction method, generation method and device
CN110263790A (en) A kind of power plant's ammeter character locating and recognition methods based on convolutional neural networks
CN116681885B (en) Infrared image target identification method and system for power transmission and transformation equipment
CN113591948A (en) Defect pattern recognition method and device, electronic equipment and storage medium
CN112419268A (en) Method, device, equipment and medium for detecting image defects of power transmission line
CN114511710A (en) Image target detection method based on convolutional neural network
CN114332473A (en) Object detection method, object detection device, computer equipment, storage medium and program product
CN116883393A (en) Metal surface defect detection method based on anchor frame-free target detection algorithm
CN109919215B (en) Target detection method for improving characteristic pyramid network based on clustering algorithm
CN111144462A (en) Unknown individual identification method and device for radar signals
CN117516937A (en) Rolling bearing unknown fault detection method based on multi-mode feature fusion enhancement
CN116403071B (en) Method and device for detecting few-sample concrete defects based on feature reconstruction
CN116520154A (en) Performance evaluation method and system for lithium battery pole piece detection
CN116468935A (en) Multi-core convolutional network-based stepwise classification and identification method for traffic signs
CN116680578A (en) Cross-modal model-based deep semantic understanding method
CN113255701B (en) Small sample learning method and system based on absolute-relative learning framework
CN115937492A (en) Transformer equipment infrared image identification method based on feature identification
CN115424000A (en) Pointer instrument identification method, system, equipment and storage medium

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