CN114897901A - Battery quality detection method and device based on sample expansion and electronic equipment - Google Patents

Battery quality detection method and device based on sample expansion and electronic equipment Download PDF

Info

Publication number
CN114897901A
CN114897901A CN202210818616.4A CN202210818616A CN114897901A CN 114897901 A CN114897901 A CN 114897901A CN 202210818616 A CN202210818616 A CN 202210818616A CN 114897901 A CN114897901 A CN 114897901A
Authority
CN
China
Prior art keywords
image data
identified
data
label
battery
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
CN202210818616.4A
Other languages
Chinese (zh)
Other versions
CN114897901B (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.)
Dongsheng Suzhou Intelligent Technology Co ltd
Original Assignee
Dongsheng Suzhou Intelligent Technology Co ltd
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 Dongsheng Suzhou Intelligent Technology Co ltd filed Critical Dongsheng Suzhou Intelligent Technology Co ltd
Priority to CN202210818616.4A priority Critical patent/CN114897901B/en
Publication of CN114897901A publication Critical patent/CN114897901A/en
Application granted granted Critical
Publication of CN114897901B publication Critical patent/CN114897901B/en
Active 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
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a method and a device for detecting battery quality based on sample expansion and an electronic device, wherein the method comprises the following steps: acquiring original image data to be identified, wherein the image data comprises characteristic data for judging the quality of the battery; forming one or more pieces of image data to be identified based on the original image data, wherein each piece of image data to be identified comprises label information of one battery quality type; inputting the image data to be identified into a discriminator in a trained identification model based on sample expansion for analysis, and outputting an authenticity identification result of the image data to be identified through the discriminator; and determining the battery quality type represented by the original image data according to the authenticity identification result. The method and the device can solve the problem that the quality of the battery is accurately and efficiently identified automatically under the condition of lacking enough samples.

Description

Battery quality detection method and device based on sample expansion and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for battery quality detection based on sample expansion, a readable medium, and an electronic device.
Background
In the production process of the battery, the quality of the battery needs to be detected before the battery leaves a factory, so as to avoid the risk that the defective battery is applied to some electronic products. For the detection of the quality of the battery, an image of the battery is usually taken, and whether the battery has defects or not is reflected on the image.
The conventional method is to detect the quality of the battery by naked eyes, but the manual detection method is inefficient. With the rise of artificial intelligence technology, some artificial intelligence technologies are tried to be adopted in the market for flaw detection of battery quality images, but the quality of an artificial intelligence model depends heavily on the number of training samples, and under the condition of lacking enough samples, the accuracy requirement for automatically judging the quality of the battery cannot be met in an artificial intelligence mode. However, in reality, the number of samples of the battery image is small, and it is not realistic to manually capture and mark the battery quality type to generate a sample that meets the number requirement.
Disclosure of Invention
In view of the above, there is a need to provide a method, an apparatus, a readable medium and an electronic device for battery quality detection based on sample expansion, so as to solve the problem that it is difficult to accurately and efficiently identify the quality of a battery automatically in the absence of a sufficiently real sample.
In a first aspect of the present application, a method for detecting battery quality based on sample expansion is provided, where the method includes:
acquiring first original image data to be identified, wherein the first original image data comprises characteristic data for judging the quality of a battery;
forming one or more pieces of first image data to be identified based on the first original image data, each piece of the first image data to be identified containing label information of one battery quality type;
inputting the image data to be identified into a discriminator in a trained identification model based on sample expansion for analysis, and outputting a first authenticity identification result of the first image data to be identified through the discriminator;
and determining the battery quality type represented by the first original image data according to the first authenticity identification result.
In one embodiment, the method further comprises:
taking the first original image data with the determined battery quality type as an expansion sample, and training a preset image classification model according to the expansion sample to form a trained image classification model;
acquiring second original image data to be identified, wherein the second original image data comprises characteristic data used for judging the quality of the battery;
forming one or more pieces of second image data to be identified and one or more pieces of image data to be classified based on the second original image data, wherein each piece of the second image data to be identified comprises label information of one battery quality type, and the image data to be classified does not comprise the label information;
inputting the second image data to be identified into a discriminator in the trained recognition model based on sample expansion for analysis, and outputting a second authenticity identification result of the second image data to be identified through the discriminator;
inputting the image data to be classified into the trained image classification model for analysis, and outputting a classification result of the image data to be classified through the image classification model;
and determining the battery quality type represented by the second original image data according to the second authenticity identification result and the classification result.
In one embodiment, the tag information includes a first tag and a second tag; the determining the battery quality type represented by the first raw image data according to the first authenticity identification result includes:
when the identification result of the first image data to be identified with the first label is true and the identification result of the first image data to be identified with other labels is false, the battery quality type represented by the first original image data is determined to be the battery type corresponding to the first label.
In one embodiment, the tag information includes a bump, a wrinkle, and a normality, and the determining the battery quality type represented by the first raw image data according to the first authenticity identification result includes:
when the identification result of the first to-be-identified image data with the wrinkle label and/or the first to-be-identified image data with the bump label is true and the identification result of the first to-be-identified image data with the normal label is false, determining that the battery quality type represented by the first original image data is the type of the bump and/or the wrinkle; and/or
When the identification result of the first to-be-identified image data with the normal label is true and the identification result of the first to-be-identified image data with the wrinkle label and/or the first to-be-identified image data with the bump label is also true, determining that the battery quality type represented by the first original image data is the type of the bump and/or the wrinkle; and/or
And when the identification result of the first to-be-identified image data with the normal label is true, and the identification results of the first to-be-identified image data with the wrinkle label and the first to-be-identified image data with the bump label are both false, determining that the battery quality type represented by the first original image data is a normal type.
In one embodiment, the training step of the recognition model includes:
acquiring real sample data with label information;
inputting the real sample data into a generator in a model to be trained for analysis, wherein the generator generates simulation sample data according to the real sample data;
inputting the simulation sample data into an identifier in the model to be trained for analysis, wherein the identifier outputs a first authenticity identification result of the simulation sample data;
calculating the classification cross entropy of the first authenticity identification result and the simulation sample data;
and adjusting parameters of a generator and/or a discriminator in the model to be trained based on the classification cross entropy to obtain a trained recognition model.
In one of the embodiments, according to
Figure M_220713101406237_237501001
Calculating the classification cross entropy;
when the classified cross entropy reaches a preset value, finishing the training of the model to be trained, wherein
Figure M_220713101406270_270210001
Is an expected value for identifying the image data x with the label y as real image data,
Figure M_220713101406300_300104002
image data x with a label y is an expected value of real image data, and z represents a random vector.
In one embodiment, the forming one or more first to-be-authenticated image data based on the first original image data includes:
cropping image data containing characteristic data of battery quality from the first original image data;
performing resolution reduction processing on the cut image data to form one or more parts of image data to be marked;
and splicing one label information into one image data to be marked by adopting one-hot coding aiming at each image data to be marked to form first image data to be identified.
In a second aspect of the present application, there is provided a battery quality detection apparatus based on sample expansion, the apparatus comprising:
the data acquisition module is used for acquiring first original image data to be identified, wherein the first original image data comprises characteristic data used for judging the quality of the battery; forming one or more pieces of first image data to be identified based on the first original image data, each piece of the first image data to be identified containing label information of one battery quality type;
the type identification module is used for inputting the image data to be identified into a discriminator in a trained identification model based on sample expansion for analysis, and outputting a first authenticity identification result of the first image data to be identified through the discriminator;
and the type determining module is used for determining the battery quality type represented by the first original image data according to the first authenticity identification result.
In a third aspect of the present application, there is provided an electronic device, including:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of the embodiments of the present application.
In a fourth aspect of the present application, there is provided a computer readable medium having stored thereon executable instructions, which when executed by a processor, cause the processor to perform a method as described in any of the embodiments of the present application.
According to the battery quality detection method and device based on sample expansion, the battery quality can be detected by using the identification model based on sample expansion under the condition that a sample is insufficient, the type of the data to be detected is marked firstly, then the marked type is identified for the authenticity of the identifier of the identification model, the correctness of the marked type can be deduced according to the authenticity identification result, the quality type of the battery reflected by the image can be further determined, and the battery quality can be accurately and efficiently identified automatically under the condition that enough real samples are insufficient.
Compared with the method that enough simulation samples are generated by utilizing the extended trained recognition model, then the simulation samples are taken to train a classification model special for image type recognition, and finally the image to be recognized is sent to the classification model for classification recognition, so that the battery quality type corresponding to the image is obtained. According to the method and the device, the battery quality type can be obtained at one time by directly utilizing the trained recognition model based on sample expansion under the condition of insufficient samples, the step of sample expansion is omitted, and the model special for classification is trained by utilizing enough expanded samples, so that the occupation of computing resources of electronic equipment is greatly reduced, and the battery quality type distinguishing efficiency is also improved.
Drawings
FIG. 1 is a flow chart of a battery quality detection method in one embodiment;
FIG. 2A is a graphical illustration of an embodiment in which bump quality issues may exist;
FIG. 2B is a graphical illustration of a wrinkle quality problem in one embodiment;
FIG. 2C is a diagram of a normal quality image in one embodiment;
FIG. 3 is a partial image schematic of one embodiment showing a bump problem, a normal quality, and a wrinkle problem, respectively;
FIG. 4 is a schematic diagram of training recognition models and battery quality testing using the recognition models in one embodiment;
FIG. 5 is a schematic diagram of training a recognition model in one embodiment;
FIG. 6 is a flow diagram of a model training process in one embodiment;
FIG. 7 is a flowchart of a battery quality detection method in another embodiment;
FIG. 8 is a schematic diagram of the operation of the VGG16 model in one embodiment;
FIG. 9 is a schematic diagram of recognition model training and classification model training in one embodiment;
FIG. 10 is a schematic diagram of battery quality testing using recognition and classification models in one embodiment;
FIG. 11 is a block diagram showing the construction of a battery quality detection apparatus according to an embodiment;
fig. 12 is a block diagram showing the construction of a battery quality detection apparatus according to another embodiment;
FIG. 13 is a diagram illustrating the internal architecture of an electronic device in one embodiment.
Detailed Description
Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. It is to be understood that such description is merely illustrative and not intended to limit the scope of the present application. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present application.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The words "a", "an" and "the" and the like as used herein are also intended to include the meanings of "a plurality" and "the" unless the context clearly dictates otherwise. Furthermore, the terms "comprises," "comprising," or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
In addition, although the terms "first", "second", etc. are used herein several times to describe various elements (or various thresholds or various applications or various instructions or various operations), etc., these elements (or thresholds or applications or instructions or operations) should not be limited by these terms. These terms are only used to distinguish one element (or threshold or application or instruction or operation) from another element (or threshold or application or instruction or operation). For example, the first original image data may be referred to as second original image data, and the second original image data may also be referred to as first original image data, without departing from the scope of the present invention, the first original image data and the second original image data being both original image data, except that they are not the same image data.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
In one embodiment, a method for battery quality detection based on sample expansion is provided, as shown in fig. 1, the method comprising:
step 102, obtaining original image data to be identified.
In this embodiment, the original image data may be original data of a battery to be detected, which is prepared in advance, and the data may be an image of the battery to be detected, which is directly photographed. The image data includes characteristic data for determining the battery quality. Through the analysis of the characteristic data, whether the quality of the battery is qualified or not can be identified.
For example, as shown in fig. 2A to 2C, the images are of different defect types. Wherein the image in fig. 2A is an image of a battery with a bump problem, and there is a bump feature at an upper position of the image (e.g., region a in the figure), so that through analysis of the feature, it can be identified whether the battery is qualified. The image in fig. 2B is an image of a battery having a wrinkle problem, and the wrinkle is characterized at a left position (e.g., region B in the figure) of the image. The image in fig. 2C is an image of a battery of acceptable or normal quality.
As shown in fig. 3, is a partial image data in one embodiment, in which characteristic data of the presence of a bump problem, a wrinkle problem, or a normal battery quality is shown, respectively.
And 104, forming one or more pieces of image data to be identified based on the original image data, wherein each piece of image data to be identified comprises label information of one battery quality type.
In this embodiment, the image data to be authenticated is input data for use as a recognition model, and the data includes label information of the set battery quality type, each label corresponding to one quality type. For example, if the battery quality type includes two or more types, for example, a normal type and an abnormal type, the tag information may be normal or abnormal. For another example, as described above, the battery quality type may include a bump type, a wrinkle type, and a normal type, and the tag information is a bump tag, a wrinkle tag, or a normal tag, respectively.
The electronic device may directly copy the original image data into one or more copies, each copy being labeled with a label as the image to be authenticated. Or the original image is preprocessed, the preprocessed image is formed into one or more parts, and each preprocessed image is marked with a label to be used as an image to be identified.
The preprocessing mode comprises one or more processing of extracting characteristic data containing battery quality, reducing image resolution, cutting image and the like on the original image, so that the formed image to be identified can be used as input data of the identification model. By preprocessing the original image data, the processed image is used as the input of the recognition model, so that the consumption of resources in the subsequent model operation process can be reduced, and the recognition speed can be improved.
In one embodiment, step 104 includes: forming one or more image data to be marked based on the original image data; and splicing one label information into one image data to be marked by adopting one-hot coding aiming at each image data to be marked to form the image data to be identified.
The image data to be marked may be the original image data itself, or may be formed by performing preprocessing such as cropping and/or resolution reduction on a portion of the original image data that includes characteristic data representing a quality type. The original image data is used as image data to be marked, so that characteristic data representing the quality of the battery can be reserved as much as possible; therefore, the subsequent identification model can judge the quality type more accurately, the preprocessed image is used as the image data to be marked, the resource occupation of the image can be reduced, the resource occupation of the analysis of the identification model is reduced, and the identification efficiency of the identification model can be improved.
For the image data to be marked, the electronic device may adopt a one-hot encoding mode to splice one type of label information into one copy of image data to be marked, so as to form image data to be identified. For example, the electronic device may use "0" to represent a first type of tag information, "1" to represent a second type of tag information, "3" to represent a third type of tag information, and so on. By using the one-hot encoding, the efficiency of labeling the image data to be recognized and the efficiency of recognizing the subsequent recognition model can be improved.
In one embodiment, forming one or more copies of image data to be marked based on raw image data comprises: cropping image data containing characteristic data of battery quality from the original image data; and performing resolution reduction processing on the cut image data to form one or more pieces of image data to be marked.
In this embodiment, as shown in fig. 2A to 2C, the original image data includes complete feature data for determining the battery quality, but the data resource occupied by the data is large, and if the original image is directly used as the image to be marked, the recognition speed of the recognition model is slow.
The electronic equipment can firstly adopt a pre-training model of semantic segmentation to position a characteristic data part which can embody the battery quality type, and the positioned part is subjected to image cutting and is cut into an area with a preset size. For the cut region, the electronic device performs further resolution reduction processing on the region, so that the resource size of data input into the recognition model is further reduced, and the analysis efficiency of the recognition model can be improved.
For example, if the resolution of the original image data is 2025 × 180 pixels, such as the images in fig. 2A to 2C are the original image data and the resolution is 2025 × 180 pixels, the electronic device performs cropping to form 180 × 180 pixels after locating the region to be cropped, where the data includes the characteristic data portion of the battery quality, and after cropping, the electronic device may further perform resolution reduction processing on the data, such as down-sampling the data, to form 96 × 96 pixels. For example, the image data of fig. 3 is finally formed, and the resolution is 96 × 96.
Thus, for an RGB original image data, the total number of RGB pixel values occupied is reduced from 2025 × 180 × 3=1093500 to 96 × 3=27648, so that the input of the subsequent recognition model is reduced to 2.5% of the total number, and the resource consumption of the model operation can be greatly reduced.
In one embodiment, for raw image data to be tagged as different types, the electronic device may take corresponding different raw image data. Specifically, for the same original image data to be identified, the formed image data to be marked are not necessarily the same, for example, for the image data to be marked as the first label, the electronic device may perform preprocessing in a preprocessing manner adapted to the first label, where the preprocessing is used to extract and retain feature data with a type adapted to the first label, so as to obtain corresponding image data to be marked, and mark the image data to be marked as the first label.
For example, since the bumps typically have an upper end in the image, the electronic device may focus on extracting data of the upper end region in the original image data, thereby forming image data to be marked as bump type. And wrinkles usually exist at the side edges, the electronic device can extract the data of the upper end area in the original image data by side, so as to form the image data to be marked as the wrinkle type.
And 106, inputting the image data to be identified into a discriminator in a trained identification model based on sample expansion for analysis, and outputting an authenticity identification result of the image data to be identified through the discriminator.
In the embodiment, the electronic device has previously trained a recognition model for battery quality detection, which is a model trained by lacking a large number of real samples. Specifically, the recognition model comprises a generator and a discriminator, both of which can be artificial intelligence models, and the models of the generator and the discriminator can be the same or different, such as a neural network model or a binary model.
As shown in conjunction with fig. 4 and 5, wherein the generator generates simulated samples based on real samples, the real samples including training data; and the discriminator discriminates the authenticity of the input sample and outputs the true and false discrimination results of the sample, and the input data of the discriminator comprises the simulation sample data and the real sample data generated by the generator. Wherein the samples used for training are all labeled with type labels, as shown in fig. 2A to 2C, different types of samples have different characteristics. The electronic device may be trained on each type of sample such that the sample generated by the generator is sufficiently close to its corresponding type of authentic sample, while the authenticity of the different types of samples is sufficiently accurate for the authenticator.
In the trained recognition model, the generator is vivid enough for the generated simulation sample, and when the accuracy of the discriminator for authenticity discrimination of the input sample meets the preset requirement, the two are balanced, and then the training of the recognition model can be completed. The recognition model can be trained by itself based on the sample expansion mode, so as to complete the model training, and the trained model is usually used for generating the sample identified by the identifier and training other models.
In this embodiment, the authenticity identification result is a true or false identification result in a given tag type, the electronic device may input the image data to be identified marked with the tag into the identifier of the identification model for identification, the identifier analyzes matching between the feature data carried in the image data to be identified with the tag and the feature data of the corresponding tag obtained by training based on a pre-training result, and if the matching is sufficient, the identification result is output as true data; if not, outputting the identification result as false data.
And step 108, determining the battery quality type represented by the original image data according to the authenticity identification result.
In this embodiment, since the user does not know the type of the image data to be recognized in advance, the image data to be recognized may be labeled, the image data with a certain label is sent to the discriminator in the recognition model, and the discriminator determines whether the data with the label is real data or false data.
If the image data to be identified is identified as real data, the marked image data to be identified of the type is sufficiently matched with the characteristics of the corresponding type, and the marked type high probability is correct, and if the result identified by the identifier is false data, the marked image data to be identified of the type is not sufficiently matched with the characteristics of the corresponding type, and the marked type high probability is wrong. In this way, the electronic device can derive the battery quality type represented by the raw image data based on the output of the discriminator of the recognition model.
According to the battery quality detection method, under the condition that a sample is insufficient, the identification model based on sample expansion can be used for battery quality detection, the type of the data to be detected is marked first, then authenticity identification is carried out on the marked type by the identifier of the identification model, the correctness of the marked type can be deduced according to the authenticity identification result, and then the quality type of the battery reflected by the image can be determined.
Compared with the method that enough simulation samples are generated by utilizing the extended trained recognition model, then the simulation samples are taken to train a classification model special for image type recognition, and finally the image to be recognized is sent to the classification model for classification recognition, so that the battery quality type corresponding to the image is obtained. According to the method and the device, the battery quality type can be obtained at one time by directly utilizing the trained recognition model based on sample expansion under the condition of insufficient samples, the step of sample expansion is omitted, and the model special for classification is trained by utilizing enough expanded samples, so that the occupation of computing resources of electronic equipment is greatly reduced, and the battery quality type distinguishing efficiency is also improved.
In one embodiment, the tag information includes a first tag and a second tag; step 108 comprises: and when the identification result of the image data to be identified with the first label is true and the identification result of the image data to be identified with other labels is false, determining that the battery quality type represented by the original image data is the battery type corresponding to the first label.
In this embodiment, the types of the labels may include two types, i.e., a first label and a second label, wherein the first label may be a normal type and the second label may be an abnormal type, i.e., a defective type.
The electronic device may form two copies of the image data to be authenticated from the raw image data, where one copy is labeled with the first label and the other copy is labeled with the second label. The recognition model can be trained aiming at the first label sample and the second label sample in advance to form a trained recognition model.
The electronic equipment leads the two pieces of image data to be identified into the identifier for analysis and outputs an identification result. If the output identification result is that the identification result with the first label is true, and other identification results are false, the quality problem that the battery reflected by the image belongs to the first label type is indicated.
For example, if the first label indicates that there is a defective label, the discrimination result with the defective label is true, and the discrimination result with the other label is false, it is determined that the battery quality type indicated by the original image data is a defective type.
In one embodiment, the number of image data to be authenticated formed by the electronic device may be N times the number of battery quality types, where N is a number greater than or equal to 1. Specifically, the number of the carbon atoms may be a positive integer of 1 or more.
The electronic device can label each piece of formed image data to be identified with corresponding different information, so that each piece of label information has N pieces of corresponding image data to be identified. When N is 1, each type of label information has 1 piece of image data to be identified, so that the electronic device can identify each type of label. When N is larger than 1, each label has a plurality of data to be identified, so that the electronic equipment can determine the battery quality type according to the identification results for a plurality of times by correspondingly identifying each label for N times of true and false, and the accuracy of judging the battery quality type can be improved.
In one embodiment, the electronic device may form the image data to be authenticated in an amount that is one less than the battery quality type amount. Thus, the quality type of the original image data can be determined according to the identification result of each copy. For example, when there are only two types, only one piece of image data to be identified may be formed, the electronic device may randomly mark one label on the piece of data and perform authenticity identification, if the identification result is true, it is indicated that the original image data is the marked battery quality type, and if the identification result is false, it indicates that the battery quality type is not the marked battery quality type, but another battery quality type. For another example, the battery quality types include three types, namely, bump, wrinkle and normal, the formed image data to be identified is divided into two, and one quality type label does not have corresponding image data, so that the quality type of the original image data can still be determined according to the identification results of the two image data. For example, two types of bumps and wrinkles are respectively marked on the two pieces of formed image data to be identified for authenticity identification, when the identification results are false, the quality type of the original image data is normal, and if one type of the identification results is true, the quality type of the original image data is the quality type represented by the label which is judged to be true.
In one embodiment, the tag information includes bumps, wrinkles, and normality. And when the identification result of the image data to be identified with the wrinkle label and/or the image data to be identified with the bump label is true and the identification result of the image data to be identified with the normal label is false, determining the battery quality type represented by the original image data as the type of the bump and/or the wrinkle.
And when the identification result of the image data to be identified with the normal label is true and the identification result of the image data to be identified with the wrinkle label and/or the image data to be identified with the bump label is also true, determining the battery quality type represented by the original image data as the type of the bumps and/or the wrinkles.
And when the identification result of the image data to be identified with the normal label is true, and the identification results of the image data to be identified with the wrinkle label and the image data to be identified with the bump label are false, determining that the battery quality type represented by the original image data is a normal type.
In this embodiment, the image data to be identified formed by the electronic device may be 3 × N, which are N pieces of image data to be identified marked as a bump label, N pieces of image data to be identified marked as a wrinkle label, and N pieces of image data to be identified marked as a normal label. Wherein N is a positive integer greater than or equal to 1.
For each type of image data to be identified, the electronic device can perform corresponding preprocessing according to the type of the corresponding preparation mark to form the image data to be identified, so that the formed image data to be identified can keep characteristic data of battery quality of the corresponding type as much as possible.
And when the identification result indicates that one type is true and the other type is false, the battery quality type is indicated as the type with the true identification result. For example, if only the wrinkles or the bumps are true, the battery quality type is the wrinkles or the bumps. When the types of the wrinkles and the salient points are true and the normal type is false, the battery has the defects of the wrinkles and the salient points, namely the quality type of the battery is the wrinkles and the salient points.
In one embodiment, when the image data of the normal tag is identified as true and the other two types of image data are also identified as true, the feature data that truly reflects the quality of the battery may not be sufficiently extracted from the image data to be identified due to the preprocessing. For example, the original image data may be a wrinkle type, but when preparing an image marked as a normal label, the extracted data is preprocessed to be data at an upper edge position, and when image data to be identified formed based on the data is marked as a normal label, the judgment result of the identifier is true; for the original image data, by extracting data of the left edge position thereof, when the image data to be authenticated formed based on the data is marked as a wrinkle label, the determination result of the discriminator is also true. Therefore, if both the wrinkle type and the normal type are true, the electronic device may determine that the type of the battery quality is the wrinkle type.
In this embodiment, the accuracy of battery quality type identification can be improved by performing true and false identification on each type of image data to be identified and determining the battery quality type based on the identification result. The battery quality type with defects is subjected to bump and wrinkle subdivision, so that on one hand, the defects of a manufacturer in the defect type judging process are improved, and the yield is improved; on the other hand, different defects can be applied to different products, for example, the bump products can be discarded due to battery explosion, and the folded products can be recycled under the condition of not influencing the performance of the battery so as to reduce the cost.
In one embodiment, as shown in fig. 5 and fig. 6, the electronic device may train the recognition model in advance to form a trained recognition model, where the training process includes:
step 602, acquiring real sample data with tag information.
In this embodiment, the real sample data is image data that has been marked with a battery quality type, and may be original image data of a type label, or may be image data that carries a type label after preprocessing the original image data, where the image data is input data for training a recognition model. For example, the real sample data may be the original image data with marks as in fig. 2A to 2C, or may be the image data in which the feature data of each quality type is retained after the original image data is preprocessed as in fig. 3. The real sample data can be encoded to carry the tagging information, for example, one-hot encoding is adopted to assign the real sample data to one of a bump, a wrinkle or a normal tag.
In one embodiment, the tag information carried in the real sample data can be artificially marked information with high accuracy, and the data volume of the real sample data is less than that required by a general artificial intelligence model.
And step 604, inputting the real sample data into a generator in the model to be trained for analysis, and generating simulation sample data according to the real sample data by the generator.
In this embodiment, the model to be trained includes a generator network and a discriminator network. After receiving the real sample data, the generator may perform downsampling on the real sample data, extract data features therein, further supplement random vectors or random noise to perform upsampling, restore the upsampling to the same resolution as the real sample data, and encode the class tag same as the real sample data into the data to form simulated sample data. In the iterative training process, the generator and the discriminator are updated with parameters, for example, by using a gradient algorithm, so that the generator can continuously learn and understand the data features in each type of sample data when performing down-sampling, and the formed simulation sample data can retain the data features of the corresponding type as much as possible when performing up-sampling.
For example, when the real sample is the image data with the label category shown in fig. 2A to fig. 2C or fig. 3, the identifier learns the features shown in the area a shown in fig. 2A or the salient points shown in fig. 3 for the type of the salient points, and generates random noise to be added after down-sampling the real data, so as to simulate the data features of the salient points, and further, the label with the salient points is spliced to form simulation sample data.
In one embodiment, the generator generates the simulation sample data according to the principle of maximizing the classification cross entropy, so as to continuously improve the similarity between the generated simulation sample data and the real sample data. Wherein, the model to be trained can generate the confrontation network model for the condition.
Step 606, inputting the simulation sample data into the discriminator in the model to be trained for analysis, and outputting the authenticity discrimination result of the simulation sample data by the discriminator.
In this embodiment, the discriminator performs authenticity discrimination on the input data, where the input data includes simulation sample data and real sample data, and the discriminator does not know in advance whether the input data is the real sample data or the simulation sample data. Therefore, through continuous iterative training, the relevant parameters are optimized, so that the accuracy of the discriminator for identifying the real sample data and identifying the simulation sample data as false is improved to the maximum extent.
Step 608, calculate the classification cross entropy of the authenticity identification result and the simulation sample data.
And step 610, adjusting parameters of a generator and/or a discriminator in the model to be trained based on the classification cross entropy to obtain a trained recognition model.
In this embodiment, the training result of the model to be trained may be embodied according to the result of the classification cross entropy, where the generator aims to maximize the classification cross entropy, and the discriminator aims to minimize the classification cross entropy, and when the final classification cross entropy is balanced in the training process of the two networks, the training of the model may be ended.
In one embodiment, according to
Figure M_220713101406331_331240001
Calculating a classification cross entropy; and when the classification cross entropy reaches a preset value, finishing the training of the model to be trained.
The conditional generation countermeasure network model differs from the generation countermeasure network model in that the conditional generation countermeasure network model has more tag information y than the input to the generation countermeasure network model, and therefore the tag information y and the image data x and y need to be combined as the input to the generator and the discriminator. Compared with the generation of the confrontation network model, the conditional generation confrontation network model can realize training and analysis of image data under different labels by utilizing one model.
Where x is image data output by the generator or image data input by the discriminator, and y is label information given to the image data. D (x | y) is the probability that the discriminator is true for the image data x given the class label y, G (z | y) is the output of the generator with the random vector z given the class label y, and D (G (z | y)) is the probability that the output of the generator with the random vector z given the class label y is true.
Figure M_220713101406362_362484001
Is an expected value for identifying the image data x with the label y as real image data,
Figure M_220713101406393_393751002
it is the expected value of the image data x with the label y as the real image data. The class cross entropy can be understood as a very small loss, the goal of the generator is to maximize the computation, while the result of the discriminator is to minimize the computation.
And after multiple iterations, considering that the model training is finished when the calculation result reaches a preset threshold value finally. The threshold value may be a fixed value or may be in a range of values. For example, 0.5 or 0.49-0.51, and when the final calculation result is 0.5 or in the range of 0.49-0.51, the model training is considered to be finished. Otherwise, the electronic equipment optimizes the related parameters in the discriminator and the generator according to the calculation result, and performs a new iteration based on the optimized parameters.
In one embodiment, as shown in connection with FIG. 8, the discriminator and/or generator may be a binary network or convolutional neural network model, such as the discriminator is a VGG16 model. The input data of the generator can be three channels of vectors of 3 x 3 pixels, and the vectors are amplified into 96-96 RGB images through the convolution full-time layer. The discriminator performs two downsampling using a convolutional layer of 128 neurons, with kernel (3,3) and stride (2, 2). Each layer was activated using the LeakyReLU, while the output settings were scaled for tanh and trained using the ADAM optimizer. The electronic equipment can also set a preset iteration number, and when the iteration number is finished, the model training is stopped to form a trained recognition model. For example, the number of training times may be 2000, the electronic device executes 2000 epochs, and the batch size is 128.
As shown in fig. 8, the number of neurons in its interpretation layer is optimized by a linear search of (8, 16, 32, 64.., 12288) neurons. The network has a maximum of 100 epochs to train, but if no further learning occurs within 10 epochs, the training is stopped prematurely.
The electronic equipment further performs analog image data analysis by combining gradient weighted activation mapping (Grad-CAM), takes the weight amplitude in the model as a pruning standard, takes out the weight of each network, arranges the weights from large to small, and sets the first few percent of the arranged weights from small to large as 0 based on the sparse percentage. A preset sparsity A can be used as the final use network, and the weight sparsity A is 100% of the original size, wherein A can be 0.1-0.9, such as 0.5. By setting the sparsity, the resource consumption of model training can be reduced, and the efficiency of model training is improved.
In one embodiment, in conjunction with fig. 7 and 10, another method for battery quality detection based on sample expansion is provided, the method comprising:
step 702, obtaining first original image data to be identified, wherein the first original image data comprises characteristic data for judging battery quality.
Step 704, forming one or more first image data to be identified based on the first original image data, each of the first image data to be identified including label information of one battery quality type.
Step 706, inputting the image data to be identified into a trained identifier in the identification model based on sample expansion for analysis, and outputting a first authenticity identification result of the first image data to be identified through the identifier.
At step 708, the battery quality type represented by the first raw image data is determined based on the first authenticity identification result.
In this embodiment, the above steps 702 to 708 are the same as the implementation of the steps 102 to 108, and only the "original image data", "image data to be authenticated", and "authenticity identification result" in the steps 102 to 108 are changed to "first original image data", "first image data to be authenticated", and "first authenticity identification result", respectively. It is to be understood that "first original image data", "first image data to be authenticated", and "first authenticity discrimination result" in the present embodiment are merely for distinguishing from "second original image data", "second image data to be authenticated", and "second authenticity discrimination result" described below.
The "first raw image data" in the present embodiment is image data for training an image classification model described below, and the "second raw image data" described below is image data for classification recognition of the image classification model described below. The "first image data to be authenticated" and the "first authenticity authentication result" correspond to the "first original image data", and the "second image data to be authenticated" and the "second authenticity authentication result" correspond to the "second original image data".
And 710, taking the first original image data with the determined battery quality type as an expansion sample, and training a preset image classification model according to the expansion sample to form a trained image classification model.
In this embodiment, the electronic device further presets an image classification model, and the image classification model may be used for image quality classification. Due to the lack of enough training samples, the classified original image data identified by the identification model can be used as the samples of the image classification model, so that enough samples are available for training the image classification model.
In one embodiment, the image classification model may be a convolutional neural network model or a binary classification model, such as the VGG16 model described above. Similar to the input of the recognition model, the input of the image classification model may be the first raw image data itself, or the raw image data after being preprocessed, except that the input as the image classification model does not carry the label information, but the type corresponding to the image data is known.
In one embodiment, cropped image data containing battery quality characteristic data is cropped from first original image data; and performing resolution reduction processing on the cut image data to form one or more parts of image data to be marked, and training the image data to be marked as an image classification model.
The model of VGG16 in fig. 8 is taken as an example, wherein the input data of the model may be a three channel 3 × 3 pixel vector, and the model is finally amplified into an RGB image of 96-96 by using a convolution full-time layer. The discriminator performs two downsampling using a convolutional layer of 128 neurons, with kernel (3,3) and stride (2, 2). Each layer was activated using the LeakyReLU, while the output settings were scaled for tanh and trained using the ADAM optimizer. The electronic equipment can also set a preset iteration number, and when the iteration number is finished, the model training is stopped to form a trained recognition model. For example, the number of training times may be 2000, the electronic device executes 2000 epochs, and the batch size is 128.
The number of neurons in its interpretation layer is optimized by a linear search of (8, 16, 32, 64.., 12288) neurons. The network has a maximum of 100 epochs to train, but if no further learning occurs within 10 epochs, the training is stopped prematurely.
The electronic equipment further performs analog image data analysis by combining gradient weighted activation mapping (Grad-CAM), takes the weight amplitude in the model as a pruning standard, takes out the weight of each network, arranges the weights from large to small, and sets the first few percent of the arranged weights from small to large as 0 based on the sparse percentage. A preset sparsity A can be used as the final use network, and the weight sparsity A is 100% of the original size, wherein A can be 0.1-0.9, such as 0.5. By setting the sparsity, the resource consumption of model training can be reduced, and the efficiency of model training is improved.
In one embodiment, illustrated in connection with FIG. 9, the samples of the image classification model include image data used to train the recognition model in addition to the first raw image data of the battery quality type determined by the recognition model. The samples of the image classification model also comprise simulation sample data generated by the trained recognition model, the simulation sample data is generated by a generator in the recognition model and is identified by the identifier, so that the generated simulation sample data is vivid enough, and the image classification model is trained by ensuring enough sample amount. Wherein, no matter the training data of the recognition model or the training data of the classification model, the image quality type corresponding to the data is determined,
the difference is that the image quality type in the training data and the verification data in fig. 9 is usually manually labeled data, and the sample expansion data is data of quality type recognized by the recognition model, and both the data are real data. In this way, the respective models may continuously learn the feature data of each quality type during the training process.
For example, the training data set may contain 1700 cells of mobile phone battery data with a resolution of 2025 × 180 pixels, which is labeled in a custom way, all pictures are placed in the same folder, and a json file is used to record their categories. In one embodiment, whereas each picture only describes one category, i.e. a cell phone battery showing both bumps and wrinkles will have two separate entries, the electronic device will discard data of the two separate entries, preventing interference with the training of the model, and only data with a single label will be used as training data.
In step 712, second raw image data to be identified is obtained, and the second raw image data includes characteristic data for determining battery quality.
In the present embodiment, the difference from the first original image data is that the second original image data is also used as an input of the image classification model.
Step 714, forming one or more second image data to be identified and one or more image data to be classified based on the second original image data, wherein each second image data to be identified comprises label information of one battery quality type, and the image data to be classified does not comprise label information.
In one embodiment, the second image data to be authenticated may be second original image data including label information, or may be cropped image data including characteristic data of battery quality cropped from the second original image data; performing resolution reduction processing on the cut image data to form one or more parts of image data to be marked; and splicing one label information into one image data to be marked by adopting one-hot coding aiming at each image data to be marked to form second image data to be identified.
Similarly, the image data to be classified may be the second original image data not including the label information, or may be the label image data. The image data to be classified is different from the image data to be identified in that the image data to be classified does not contain label information, and the image data to be identified is given label information.
And 716, inputting the second image data to be identified into a trained identifier in the identification model based on the sample expansion for analysis, and outputting a second authenticity identification result of the second image data to be identified through the identifier.
In this embodiment, in a manner similar to step 106, the corresponding authenticity identification result may be output by the identifier, where the authenticity identification result includes a result of authenticity of the image to be identified carrying various tag information.
Step 718, inputting the image data to be classified into the trained image classification model for analysis, and outputting the classification result of the image data to be classified through the image classification model.
In this embodiment, the image classification model is trained to recognize the label type matched with the classified image data, and output a corresponding classification result based on the matching result. The classification result includes the battery quality type, such as one or more of a bump, a wrinkle or a normal type.
In one embodiment, the execution sequence between step 716 and step 718 is not limited, and step 716 and step 718 may be executed simultaneously, or step 716 may be executed first and then step 718 is executed.
And step 720, determining the battery quality type represented by the second original image data according to the second authenticity identification result and the classification result.
In this embodiment, the electronic device may first determine, based on the second authenticity identification result, a battery quality type represented by the second original image data, where the battery quality type may be a pre-classification type, and then compare the pre-classification type with a classification result determined by the image classification model, and when the two types are consistent, determine that the type corresponding to the image data is the battery quality type determined by the two models. And if the output battery quality types are inconsistent, judging that the output battery quality types are wrong, determining by a worker instead, and determining whether the training of the recognition model or the image classification model is required to be continued according to the ratio of the times of judging that the output battery quality types are wrong. If the training is needed, the training can be performed again according to the above embodiment, so as to further optimize the recognition model or the image classification model.
In the battery quality detection method, the image classification model is preset, and the first original image data with the battery quality type identified is used as the extended sample, so that after the identification model identifies a large number of battery quality types of the first original image data, a large number of training samples are accumulated, the image classification model is trained by using the sample, and an image classification model which is used for classifying the battery quality types of the original image data is formed besides the identification model.
In one embodiment, the electronic device may use the image classification model alone for battery quality classification of the second raw image data, in addition to completing the training of the image classification model. After the step 712, the method further includes: forming one or more pieces of image data to be classified based on the second original image data; inputting image data to be classified into a trained image classification model for analysis, and outputting a classification result of the image data to be classified through the image classification model; the classification result is taken as the battery quality type represented by the second raw image data.
In the present embodiment, the battery quality type of the image data can also be automatically determined accurately and efficiently by performing image classification using a model dedicated to image classification.
In one embodiment, as shown in fig. 11, there is provided a sample-expansion-based battery quality detection apparatus, including:
a data obtaining module 1102, configured to obtain first original image data to be identified, where the first original image data includes feature data used for determining battery quality; forming one or more first image data to be identified based on the first original image data, each of the first image data to be identified including label information of one battery quality type;
the type identification module 1104 is used for inputting the image data to be identified into a trained identifier in the identification model based on sample expansion for analysis, and outputting a first authenticity identification result of the first image data to be identified through the identifier;
a type determining module 1106, configured to determine a battery quality type represented by the first raw image data according to the first authenticity identification result.
In one embodiment, the tag information includes a first tag and a second tag; the type determining module 1106 is further configured to determine that the battery quality type represented by the first original image data is the battery type corresponding to the first label when the authentication result of the first to-be-authenticated image data with the first label is true and the authentication result of the first to-be-authenticated image data with other labels is false.
In one embodiment, the tag information includes a bump, a wrinkle, and a normal, and the type determining module 1106 is further configured to determine the battery quality type represented by the first original image data as a bump and/or a wrinkle type when the first image data to be authenticated with a wrinkle tag and/or the first image data to be authenticated with a bump tag is true and the first image data to be authenticated with a normal tag is false.
In one embodiment, the type determining module 1106 is further configured to determine that the battery quality type represented by the first original image data is a bump and/or wrinkle type when the authentication result of the first to-be-authenticated image data with a normal tag is true and the authentication result of the first to-be-authenticated image data with a wrinkle tag and/or the authentication result of the first to-be-authenticated image data with a bump tag is also true.
In one embodiment, the type determining module 1106 is further configured to determine that the battery quality type represented by the first original image data is a normal type when the authentication result of the first to-be-authenticated image data with the normal label is true and the authentication results of the first to-be-authenticated image data with the wrinkle label and the first to-be-authenticated image data with the bump label are false.
In one embodiment, as shown in fig. 12, the battery quality detection apparatus further includes:
a model training module 1108 for obtaining real sample data with tagged information; inputting the real sample data into a generator in the model to be trained for analysis, and generating simulation sample data by the generator according to the real sample data; inputting the simulation sample data into a discriminator in a model to be trained for analysis, and outputting a first authenticity discrimination result of the simulation sample data by the discriminator; calculating the classification cross entropy of the first authenticity identification result and the simulation sample data; and adjusting parameters of a generator and/or a discriminator in the model to be trained based on the classification cross entropy to obtain the trained recognition model.
In one embodiment, model training module 1108 is further configured to train a model based on
Figure M_220713101406424_424985001
Calculating a classification cross entropy; when the classified cross entropy reaches a preset value, finishing the training of the model to be trained, wherein
Figure M_220713101406456_456265002
Is an expected value for identifying the image data x with the label y as real image data,
Figure M_220713101406487_487580003
image data x with a label y is an expected value of real image data, and z represents a random vector.
In one embodiment, the data acquisition module 1102 is further configured to form one or more pieces of image data to be marked based on the original image data; and splicing one label information into one image data to be marked by adopting one-hot coding aiming at each image data to be marked to form the image data to be identified.
In one embodiment, the data acquisition module 1102 is further configured to crop cropped image data from the raw image data that includes characteristic data of battery quality; and performing resolution reduction processing on the cut image data to form image data to be identified.
In an embodiment, the model training module 1108 is further configured to train a preset image classification model according to the extended sample, using the first original image data with the determined battery quality type as the extended sample, and forming a trained image classification model.
The data obtaining module 1102 is further configured to obtain second original image data to be identified, where the second original image data includes feature data used for determining battery quality; one or more second image data to be identified and one or more image data to be classified are formed based on the second original image data, each second image data to be identified comprises label information of one battery quality type, and the image data to be classified does not comprise the label information.
The type identification module 1104 is further configured to input the second image data to be identified into a trained identifier in the identification model based on the sample expansion for analysis, and output a second authenticity identification result of the second image data to be identified through the identifier.
The type identification module 1104 is further configured to input the image data to be classified into a trained image classification model for analysis, and output a classification result of the image data to be classified through the image classification model.
The type determining module 1106 is further configured to determine a battery quality type represented by the second raw image data according to the second authenticity identification result and the classification result.
In one embodiment, an electronic device is proposed, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the battery quality detection method of any of the above embodiments.
In one embodiment, a computer-readable medium is provided, having stored thereon computer-executable instructions that, when executed by a processor, cause the processor to perform the steps of the battery quality detection method of any of the above embodiments.
In one embodiment, an electronic device is provided, and the electronic device may specifically be a terminal or a server. As shown in fig. 13, the electronic apparatus 1300 includes a Central Processing Unit (CPU) 1301 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1302 or a program loaded from a storage section 1308 into a Random Access Memory (RAM) 1303. In the RAM 1303, various programs and data necessary for the operation of the electronic apparatus 1300 are also stored. The CPU 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304. An input/output (I/O) interface 1305 is also connected to bus 1304.
The following components are connected to the I/O interface 1305: an input portion 1306 including a keyboard, a mouse, and the like; an output section 1307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 1308 including a hard disk and the like; and a communication section 1309 including a network interface card such as a LAN card, a modem, or the like. The communication section 1309 performs communication processing via a network such as the internet. A drive 1310 is also connected to the I/O interface 1305 as needed. A removable medium 1311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1310 as necessary, so that a computer program read out therefrom is mounted into the storage portion 1308 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer-readable medium bearing instructions that, in such embodiments, may be downloaded and installed from a network via communications component 1309 and/or installed from removable media 1311. The instructions, when executed by a Central Processing Unit (CPU) 1301, perform the various method steps described in the present invention.
Although example embodiments have been described, it will be apparent to those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the inventive concept. Accordingly, it should be understood that the above-described exemplary embodiments are not limiting, but illustrative.

Claims (10)

1. A method for battery quality detection based on sample expansion, the method comprising:
acquiring first original image data to be identified, wherein the first original image data comprises characteristic data for judging the quality of a battery;
forming one or more pieces of first image data to be identified based on the first original image data, each piece of the first image data to be identified containing label information of one battery quality type;
inputting the image data to be identified into a discriminator in a trained identification model based on sample expansion for analysis, and outputting a first authenticity identification result of the first image data to be identified through the discriminator;
and determining the battery quality type represented by the first original image data according to the first authenticity identification result.
2. The method of claim 1, further comprising:
taking the first original image data with the determined battery quality type as an expansion sample, and training a preset image classification model according to the expansion sample to form a trained image classification model;
acquiring second original image data to be identified, wherein the second original image data comprises characteristic data used for judging the quality of the battery;
forming one or more pieces of second image data to be identified and one or more pieces of image data to be classified based on the second original image data, wherein each piece of the second image data to be identified comprises label information of one battery quality type, and the image data to be classified does not comprise the label information;
inputting the second image data to be identified into a discriminator in the trained recognition model based on sample expansion for analysis, and outputting a second authenticity identification result of the second image data to be identified through the discriminator;
inputting the image data to be classified into the trained image classification model for analysis, and outputting a classification result of the image data to be classified through the image classification model;
and determining the battery quality type represented by the second original image data according to the second authenticity identification result and the classification result.
3. The method of claim 1, wherein the tag information comprises a first tag and a second tag; the determining the battery quality type represented by the first raw image data according to the first authenticity identification result includes:
and when the identification result of the first image data to be identified with the first label is true and the identification result of the first image data to be identified with other labels is false, determining that the battery quality type represented by the first original image data is the battery type corresponding to the first label.
4. The method of claim 1, wherein the tag information includes a bump, a wrinkle, and a normality, and the determining the type of battery quality represented by the first raw image data from the first authenticity discrimination result includes:
when the identification result of the first to-be-identified image data with the wrinkle label is true and the identification result of the first to-be-identified image data with the normal label is false, determining that the battery quality type represented by the first original image data is the wrinkle type; or
When the identification result of the first to-be-identified image data with the normal label is true and the identification result of the first to-be-identified image data with the wrinkle label is also true, determining that the battery quality type represented by the first original image data is the wrinkle type; or
And when the identification result of the first to-be-identified image data with the normal label is true, and the identification results of the first to-be-identified image data with the wrinkle label and the first to-be-identified image data with the bump label are both false, determining that the battery quality type represented by the first original image data is a normal type.
5. The method of claim 1, wherein the training step of the recognition model comprises:
acquiring real sample data with label information;
inputting the real sample data into a generator in a model to be trained for analysis, wherein the generator generates simulation sample data according to the real sample data;
inputting the simulation sample data into an identifier in the model to be trained for analysis, wherein the identifier outputs a first authenticity identification result of the simulation sample data;
calculating the classification cross entropy of the first authenticity identification result and the simulation sample data;
and adjusting parameters of a generator and/or a discriminator in the model to be trained based on the classification cross entropy to obtain a trained recognition model.
6. The method of claim 5, wherein the method is based on
Figure M_220713101403331_331246001
Calculating the classification cross entropy;
when the classified cross entropy reaches a preset value, finishing the training of the model to be trained, wherein
Figure M_220713101403425_425009001
Is an expected value for identifying the image data x with the label y as real image data,
Figure M_220713101403456_456250002
is that the image data x with label y is the expected value of the real image data, z tableA random vector is shown.
7. The method of claim 1, wherein forming one or more first to-be-authenticated image data based on the first original image data comprises:
cropping image data containing characteristic data of battery quality from the first original image data;
performing resolution reduction processing on the cut image data to form one or more parts of image data to be marked;
and splicing one label information into one image data to be marked by adopting one-hot coding aiming at each image data to be marked to form first image data to be identified.
8. A sample expansion based battery quality detection apparatus, the apparatus comprising:
the data acquisition module is used for acquiring first original image data to be identified, wherein the first original image data comprises characteristic data used for judging the quality of the battery; forming one or more pieces of first image data to be identified based on the first original image data, each piece of the first image data to be identified containing label information of one battery quality type;
the type identification module is used for inputting the image data to be identified into a discriminator in a trained identification model based on sample expansion for analysis, and outputting a first authenticity identification result of the first image data to be identified through the discriminator;
and the type determining module is used for determining the battery quality type represented by the first original image data according to the first authenticity identification result.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-7.
10. A computer readable medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 7.
CN202210818616.4A 2022-07-13 2022-07-13 Battery quality detection method and device based on sample expansion and electronic equipment Active CN114897901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210818616.4A CN114897901B (en) 2022-07-13 2022-07-13 Battery quality detection method and device based on sample expansion and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210818616.4A CN114897901B (en) 2022-07-13 2022-07-13 Battery quality detection method and device based on sample expansion and electronic equipment

Publications (2)

Publication Number Publication Date
CN114897901A true CN114897901A (en) 2022-08-12
CN114897901B CN114897901B (en) 2022-11-01

Family

ID=82729324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210818616.4A Active CN114897901B (en) 2022-07-13 2022-07-13 Battery quality detection method and device based on sample expansion and electronic equipment

Country Status (1)

Country Link
CN (1) CN114897901B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111310531A (en) * 2018-12-12 2020-06-19 北京京东尚科信息技术有限公司 Image classification method and device, computer equipment and storage medium
CN111340748A (en) * 2018-12-17 2020-06-26 汉能移动能源控股集团有限公司 Battery defect identification method and device, computer equipment and storage medium
CN111709408A (en) * 2020-08-18 2020-09-25 腾讯科技(深圳)有限公司 Image authenticity detection method and device
CN112529806A (en) * 2020-12-15 2021-03-19 哈尔滨工程大学 SAR image data enhancement method based on generation of countermeasure network information maximization
CN113537031A (en) * 2021-07-12 2021-10-22 电子科技大学 Radar image target identification method for generating countermeasure network based on condition of multiple discriminators

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111310531A (en) * 2018-12-12 2020-06-19 北京京东尚科信息技术有限公司 Image classification method and device, computer equipment and storage medium
CN111340748A (en) * 2018-12-17 2020-06-26 汉能移动能源控股集团有限公司 Battery defect identification method and device, computer equipment and storage medium
CN111709408A (en) * 2020-08-18 2020-09-25 腾讯科技(深圳)有限公司 Image authenticity detection method and device
CN112529806A (en) * 2020-12-15 2021-03-19 哈尔滨工程大学 SAR image data enhancement method based on generation of countermeasure network information maximization
CN113537031A (en) * 2021-07-12 2021-10-22 电子科技大学 Radar image target identification method for generating countermeasure network based on condition of multiple discriminators

Also Published As

Publication number Publication date
CN114897901B (en) 2022-11-01

Similar Documents

Publication Publication Date Title
CN110348319B (en) Face anti-counterfeiting method based on face depth information and edge image fusion
CN111950453A (en) Optional-shape text recognition method based on selective attention mechanism
CN111950497B (en) AI face-changing video detection method based on multitask learning model
CN111950528B (en) Graph recognition model training method and device
CN111767883B (en) Question correction method and device
CN111401374A (en) Model training method based on multiple tasks, character recognition method and device
CN111626279A (en) Negative sample labeling training method and highly-automated bill identification method
CN114360038B (en) Weak supervision RPA element identification method and system based on deep learning
CN114972316A (en) Battery case end surface defect real-time detection method based on improved YOLOv5
CN113870254A (en) Target object detection method and device, electronic equipment and storage medium
CN115239672A (en) Defect detection method and device, equipment and storage medium
CN113011246A (en) Bill classification method, device, equipment and storage medium
CN115620083B (en) Model training method, face image quality evaluation method, equipment and medium
CN114897901B (en) Battery quality detection method and device based on sample expansion and electronic equipment
CN116958736A (en) RGB-D significance target detection method based on cross-modal edge guidance
CN116188361A (en) Deep learning-based aluminum profile surface defect classification method and device
CN114387553B (en) Video face recognition method based on frame structure perception aggregation
CN115565178A (en) Font identification method and apparatus
CN115861595A (en) Multi-scale domain self-adaptive heterogeneous image matching method based on deep learning
CN114927236A (en) Detection method and system for multiple target images
CN114373178A (en) Picture character detection and identification method and system
CN113516148A (en) Image processing method, device and equipment based on artificial intelligence and storage medium
CN113139932A (en) Deep learning defect image identification method and system based on ensemble learning
CN112070060A (en) Method for identifying age, and training method and device of age identification model
CN111582057A (en) Face verification method based on local receptive field

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