CN117636079A - Image classification method and device and electronic equipment - Google Patents

Image classification method and device and electronic equipment Download PDF

Info

Publication number
CN117636079A
CN117636079A CN202410107885.9A CN202410107885A CN117636079A CN 117636079 A CN117636079 A CN 117636079A CN 202410107885 A CN202410107885 A CN 202410107885A CN 117636079 A CN117636079 A CN 117636079A
Authority
CN
China
Prior art keywords
image
class
classification
abnormal
confidence
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.)
Pending
Application number
CN202410107885.9A
Other languages
Chinese (zh)
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.)
Contemporary Amperex Technology Co Ltd
Original Assignee
Contemporary Amperex 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 Contemporary Amperex Technology Co Ltd filed Critical Contemporary Amperex Technology Co Ltd
Priority to CN202410107885.9A priority Critical patent/CN117636079A/en
Publication of CN117636079A publication Critical patent/CN117636079A/en
Pending legal-status Critical Current

Links

Abstract

The application discloses an image classification method, an image classification device and electronic equipment, comprising the following steps: acquiring a first tab image; inputting the first tab image into a classification model to obtain confidence degrees corresponding to each of a plurality of classifications, wherein the classifications comprise a normal class and a plurality of abnormal classes; under the condition that the first tab image belongs to the normal class according to the confidence coefficient corresponding to each of the plurality of classifications, if the confidence coefficient corresponding to each of the plurality of classifications meets the misjudgment condition, the classification of the first tab image is corrected to be a target abnormal class, the target abnormal class is determined according to the confidence coefficient corresponding to the plurality of abnormal classes, and the misjudgment condition is that: the confidence coefficient corresponding to the normal class of the first tab image is smaller than a first threshold value, and the confidence coefficient corresponding to at least one abnormal class in the plurality of abnormal classes of the first tab image is larger than a second threshold value corresponding to each abnormal class. The first tab image judged as the normal type can be further judged, the classification of the first tab image is corrected, the misjudgment rate is reduced, and the classification accuracy is improved.

Description

Image classification method and device and electronic equipment
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image classification method, an image classification device, and an electronic device.
Background
The tab turnover imaging image quality evaluation method can be used for pre-judging the problems of tab imaging so as to assist a lithium battery production line engineering engineer to adjust imaging equipment in time.
Because multiple defects may exist in one image, in the prior art, a classification model is used for classifying the tab image, the classification model outputs the confidence degrees corresponding to the multiple classifications, and several classifications with higher confidence degrees are used as classification results of the image, for example, if the first three classifications with higher confidence degrees are selected and all the three classifications are abnormal, the image is indicated to comprise the abnormality corresponding to the three classifications. However, if there are normal and abnormal classes in the three classifications, the images belong to both normal and abnormal classes, and the classification results of the images are contradictory, and the classification results are obviously wrong.
Disclosure of Invention
The application provides an image classification method, an image classification device and electronic equipment, which are used for further judging classification results of tab images, correcting wrong classification results and improving image classification accuracy.
In a first aspect, the present application provides an image classification method, including:
acquiring a first tab image;
inputting the first tab image into a classification model to obtain confidence degrees corresponding to each of a plurality of classifications, wherein the classifications comprise a normal class and a plurality of abnormal classes;
under the condition that the first tab image belongs to the normal class according to the confidence coefficient corresponding to each of the plurality of classifications, if the confidence coefficient corresponding to each of the plurality of classifications meets the misjudgment condition, the classification of the first tab image is corrected to be a target abnormal class, wherein the target abnormal class is determined according to the confidence coefficient corresponding to the plurality of abnormal classes;
the misjudgment condition is as follows:
the confidence coefficient corresponding to the normal class of the first tab image is smaller than a first threshold value, and the confidence coefficient corresponding to at least one abnormal class in the plurality of abnormal classes of the first tab image is larger than a second threshold value corresponding to each abnormal class.
In this embodiment, by analyzing the confidence levels corresponding to the multiple classifications of the first tab image, if the confidence levels corresponding to the multiple classifications satisfy the erroneous judgment condition in the case that the first tab image belongs to the normal class, the classification of the first tab image is corrected to the target abnormal class.
In an embodiment of the present application, the target exception class is an exception class with a maximum confidence in the at least one exception class.
In this embodiment, the classification of the first tab image is corrected to be the abnormal class with the maximum confidence, so as to improve the classification accuracy.
In an embodiment of the present application, before inputting the first tab image into the classification model, the method further includes:
acquiring a sample set, wherein the sample set comprises a plurality of second ear images, each second ear image is marked with a corresponding class, and the plurality of second ear images correspond to a plurality of classes;
and training the initial network model by adopting the sample set to obtain a classification model.
In this embodiment, the sample set is used to train the initial network model, so as to obtain the classification model, so that the classification model is convenient to be used for classifying the first tab image subsequently.
In an embodiment of the present application, the method further includes:
acquiring a plurality of third ear images, wherein the third ear images belong to the normal class;
inputting the plurality of third ear images into the classification model to obtain the confidence coefficient of each third ear image identified as a normal class;
and calculating the mean value of the confidence that each image is identified as the normal class, and obtaining the first threshold value.
In this embodiment, the first threshold is determined by calculating based on the confidence that the tab image is identified as the normal class, so that the determination of the first threshold is more accurate, the subsequent judgment of the erroneous judgment condition based on the first threshold is facilitated, and the classification of the first tab image is more accurate.
In an embodiment of the present application, the method further includes:
acquiring a plurality of fourth ear images, wherein the plurality of fourth ear images belong to a first abnormality class in a plurality of abnormality classes;
inputting the plurality of fourth ear images into the classification model to obtain the confidence coefficient of each fourth ear image being identified as a first abnormal class;
and calculating the mean value of the confidence coefficient of each fourth ear image identified as the first abnormal class, and obtaining a second threshold value corresponding to the first abnormal class.
In this embodiment, the second threshold corresponding to the first abnormal class is determined by calculating based on the confidence that the tab image is identified as the first abnormal class, so that the determination of the second threshold is more accurate, the subsequent judgment of the erroneous judgment condition based on the second threshold is facilitated, and the classification of the first tab image is more accurate.
In an embodiment of the present application, after obtaining the confidence degrees corresponding to each of the plurality of classifications, before correcting the classification of the first tab image into the target anomaly class, the method further includes:
sorting the confidence degrees corresponding to the multiple classifications of the first tab image from large to small to obtain a sorting result;
and if at least one confidence coefficient ranked in front in the ranking result comprises a confidence coefficient corresponding to a normal class, judging that the first tab image belongs to the normal class.
In this embodiment, when determining the classification of the first tab image, the classification corresponding to at least one confidence coefficient of the first tab image, which is ranked before, in the ranking result is taken as the classification of the first tab image, if the at least one confidence coefficient includes the confidence coefficient that the first tab image is identified as the normal class, the first tab image is determined to belong to the normal class, in this case, the first tab image has the possibility of being misjudged, and further determination needs to be performed to correct the classification of the first tab image, so that the misjudgment rate is reduced, and the classification accuracy is improved.
In an embodiment of the present application, the plurality of anomaly classes includes at least one of uneven lighting, dithering, excessive darkness, overexposure, blurring, excessive tail, prism smudging, and left supervision.
In this embodiment, a plurality of abnormal classes are set according to the problem occurring in the tab imaging, and when classifying the first tab image, the fineness of the image classification can be improved.
In a second aspect, an embodiment of the present application provides an image classification apparatus, including:
the first acquisition module is used for acquiring a first tab image;
the second acquisition module is used for inputting the first tab image into a classification model to obtain the confidence corresponding to each of a plurality of classifications, wherein the classifications comprise a normal class and a plurality of abnormal classes;
the correction module is used for correcting the classification of the first tab image into a target abnormal class when the first tab image belongs to the normal class according to the confidence degrees corresponding to the classification, wherein the target abnormal class is determined according to the confidence degrees corresponding to the abnormal classes if the confidence degrees corresponding to the classification meet the misjudgment condition;
the misjudgment condition is as follows:
the confidence coefficient corresponding to the normal class of the first tab image is smaller than a first threshold value, and the confidence coefficient corresponding to at least one abnormal class in the plurality of abnormal classes of the first tab image is larger than a second threshold value corresponding to each abnormal class.
In this embodiment, by analyzing the confidence levels corresponding to the multiple classifications of the first tab image, if the confidence levels corresponding to the multiple classifications satisfy the erroneous judgment condition in the case that the first tab image belongs to the normal class, the classification of the first tab image is corrected to the target abnormal class.
In an embodiment of the present application, the target exception class is an exception class with a maximum confidence in the at least one exception class.
In this embodiment, the classification of the first tab image is corrected to be the abnormal class with the maximum confidence, so as to improve the classification accuracy.
In an embodiment of the present application, the apparatus further includes:
the third acquisition module is used for acquiring a sample set, wherein the sample set comprises a plurality of second ear images, each second ear image is marked with a corresponding class, and the plurality of second ear images correspond to the plurality of classes;
and the training module is used for training the initial network model by adopting the sample set to obtain a classification model.
In this embodiment, the sample set is used to train the initial network model, so as to obtain the classification model, so that the classification model is convenient to be used for classifying the first tab image subsequently.
In an embodiment of the present application, the apparatus further includes:
the fourth acquisition module is used for acquiring a plurality of third ear images, and the third ear images belong to the normal class;
a fifth obtaining module, configured to input the plurality of third ear images to the classification model, to obtain a confidence level that each third ear image is identified as a normal class;
and the first calculation module is used for calculating the mean value of the confidence coefficient of each image identified as the normal class, and obtaining the first threshold value.
In this embodiment, the first threshold is determined by calculating based on the confidence that the tab image is identified as the normal class, so that the determination of the first threshold is more accurate, the subsequent judgment of the erroneous judgment condition based on the first threshold is facilitated, and the classification of the first tab image is more accurate.
In an embodiment of the present application, the apparatus further includes:
a sixth acquisition module, configured to acquire a plurality of fourth ear images, where the plurality of fourth ear images belong to a first abnormality class of a plurality of abnormality classes;
a seventh obtaining module, configured to input the plurality of fourth ear images to the classification model, to obtain a confidence level that each fourth ear image is identified as a first anomaly class;
and the second calculation module is used for calculating the mean value of the confidence coefficient of each fourth ear image identified as the first abnormal class, and obtaining a second threshold value corresponding to the first abnormal class.
In this embodiment, the second threshold corresponding to the first abnormal class is determined by calculating based on the confidence that the tab image is identified as the first abnormal class, so that the determination of the second threshold is more accurate, the subsequent judgment of the erroneous judgment condition based on the second threshold is facilitated, and the classification of the first tab image is more accurate.
In an embodiment of the present application, the apparatus further includes:
the sorting module is used for sorting the confidence degrees corresponding to the multiple classifications of the first tab image from large to small to obtain a sorting result;
and the judging module is used for judging that the first tab image belongs to the normal class if at least one confidence coefficient ranked in front in the ranking result comprises the confidence coefficient corresponding to the normal class.
In this embodiment, when determining the classification of the first tab image, the classification corresponding to at least one confidence coefficient of the first tab image, which is ranked before, in the ranking result is taken as the classification of the first tab image, if the at least one confidence coefficient includes the confidence coefficient that the first tab image is identified as the normal class, the first tab image is determined to belong to the normal class, in this case, the first tab image has the possibility of being misjudged, and further determination needs to be performed to correct the classification of the first tab image, so that the misjudgment rate is reduced, and the classification accuracy is improved.
In an embodiment of the present application, the plurality of anomaly classes includes at least one of uneven lighting, dithering, excessive darkness, overexposure, blurring, excessive tail, prism smudging, and left supervision.
In this embodiment, a plurality of abnormal classes are set according to the problem occurring in the tab imaging, and when classifying the first tab image, the fineness of the image classification can be improved.
In a third aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the image classification method according to the first aspect.
The foregoing description is only an overview of the technical solutions of the present application, and may be implemented according to the content of the specification in order to make the technical means of the present application more clearly understood, and in order to make the above-mentioned and other objects, features and advantages of the present application more clearly understood, the following detailed description of the present application will be given.
Drawings
Features, advantages, and technical effects of exemplary embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of an image classification method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an image classification device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, based on the embodiments herein, which would be apparent to one of ordinary skill in the art without making any inventive effort, are intended to be within the scope of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description and claims of the present application and in the description of the figures above are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order.
In the prior art, a classification model is used for classifying tab images, the classification model outputs confidence degrees corresponding to various classifications, and as a tab image possibly has various defects at the same time, if the classification with the largest confidence degree is selected as the classification result of the image, only the classification result of the image including one defect can be obtained, based on the classification result, a plurality of classifications with larger confidence degrees are often selected as the classification result of the image, for example, if three confidence degrees with larger values are selected, and the classifications corresponding to the three confidence degrees are all abnormal classifications, the three abnormalities are simultaneously included in the image. However, if the three confidence levels correspond to a normal class and an abnormal class, that is, the image belongs to both the normal class and the abnormal class, the classification result of the image is contradictory, and the classification result is obviously wrong. In order to improve the classification accuracy of tab images, the embodiment of the application provides an image classification method, an image classification device and electronic equipment.
Fig. 1 is a flow chart of an image classification method according to an embodiment of the present application, as shown in fig. 1, the method includes steps 101 to 103, where:
and step 101, acquiring a first tab image.
The first tab image refers to a tab image to be classified.
Step 102, inputting the first tab image into a classification model to obtain confidence degrees corresponding to each of a plurality of classifications, wherein the classifications comprise a normal class and a plurality of abnormal classes.
For example, the plurality of anomaly classes may include one or more of uneven lighting, dithering, overdriving, overexposure, blurring, excessive tail, prism smudging, and left supervision.
The classification model can be obtained by training a sample set in advance, and can output the confidence coefficient corresponding to the normal class and each abnormal class based on the input tab image, and the higher the confidence coefficient is, the higher the probability that the image is classified corresponding to the confidence coefficient is.
The first tab image may be an image obtained by normalizing the collected tab image, and similarly, an image in the sample set for training the classification model may be an image obtained by normalizing the collected tab image.
And inputting the first tab image into a classification model, wherein the classification model outputs the confidence coefficient corresponding to each of the plurality of classifications, for example, if the number of the plurality of classifications is 3, the classification model outputs the confidence coefficient corresponding to the normal class and the confidence coefficient corresponding to each of the 2 abnormal classes.
And step 103, when the first tab image is determined to belong to the normal class according to the confidence degrees corresponding to the classifications, if the confidence degrees corresponding to the classifications meet the misjudgment condition, correcting the classification of the first tab image into a target abnormal class, wherein the target abnormal class is determined according to the confidence degrees corresponding to the abnormal classes.
Whether the first tab image belongs to the normal class or not can be determined according to the confidence degrees corresponding to the multiple classifications, if so, the first tab image has the possibility of being judged to be the normal class or the abnormal class, and further judgment is needed to determine whether the classification of the first tab image needs to be corrected to be the abnormal class or not.
For example, the confidence degrees corresponding to the multiple classifications can be ranked from large to small, and the classification corresponding to the confidence degree of the Y position in the front ranking is used as the classification of the first tab image; if Y is 1, the classification corresponding to the confidence level of the first position is taken as the classification of the first tab image, and if the classification corresponding to the confidence level of the first position is a normal class, the first tab image belongs to the normal class, in which case there may be erroneous judgment, for example, the tab image of the prism dirt class is easily misjudged as the normal class, and further judgment is required; if Y is 2, the classification corresponding to the confidence coefficient of the 2 positions before sorting is taken as the classification of the first tab image, and if the confidence coefficient of the 2 positions before sorting is the confidence coefficient corresponding to the normal class and the confidence coefficient corresponding to the prism dirt respectively, the classification of the first tab image is both the normal class and the prism dirt class, and in this case, the classification of the first tab image has contradiction, and the possibility of erroneous judgment exists and needs further judgment.
The erroneous judgment condition is a condition that the first tab image is judged to be a normal class and belongs to erroneous judgment, and when it is determined that the plurality of confidences meet the erroneous judgment condition, the classification of the first tab image is corrected, for example, to an abnormal class corresponding to the largest confidence among the confidences corresponding to the plurality of abnormal classes, and in this case, the target abnormal class is the abnormal class corresponding to the largest confidence. It should be noted that, if the plurality of confidence degrees do not satisfy the erroneous judgment condition, the first tab image is a normal type in the specification, and in this case, the first tab image is only a normal type and does not belong to any abnormal type. The misjudgment condition is as follows:
the confidence coefficient corresponding to the normal class of the first tab image is smaller than a first threshold value, and the confidence coefficient corresponding to at least one abnormal class in the plurality of abnormal classes of the first tab image is larger than a second threshold value corresponding to each abnormal class.
Specifically, the first tab image is input into a classification model, and the classification model outputs a confidence level corresponding to a normal class and a confidence level corresponding to each of a plurality of abnormal classes. If the confidence coefficient corresponding to the normal class of the first tab image is smaller than the first threshold value and the confidence coefficient corresponding to at least one abnormal class in the plurality of abnormal classes is larger than the second threshold value corresponding to the abnormal class, the condition that the erroneous judgment condition is met is indicated, and the first tab image belongs to the normal class and is erroneous judgment and needs to be corrected. The first threshold and the second threshold may be set according to practical situations, for example, determined according to statistical experiments.
Taking the prism smudge class as an example, prism smudge is easily identified as a normal class. If a certain condition can be found, when the condition is met, the pictures which are misjudged to be normal can be corrected to be the prism dirty, meanwhile, the normal pictures which are originally and correctly identified are not affected as much as possible, the correct pictures are not misjudged to be the prism dirty, and the accuracy of the prism dirty can be improved.
If f (OK) is the confidence that the first tab image is identified as the normal class, f (NG) is the confidence that the first tab image is identified as the prism dirty class, g (OK) is a first threshold, the value may be 0.7, g (NG) is a second threshold corresponding to the prism dirty class, the value may be 0.24, and if the following misjudgment condition is satisfied:
it is indicated that the first tab image is misjudged as normal and should be corrected to be of the prism dirty type.
For each of the plurality of anomaly classes, the method can be used for processing the anomaly class in a similar manner, namely, the confidence coefficient corresponding to the anomaly class is compared with the second threshold value corresponding to the anomaly class, and if the confidence coefficient corresponding to the anomaly class is greater than the second threshold value corresponding to the anomaly class, the first tab image is wrongly judged as the normal class, and the anomaly class needs to be corrected to meet the misjudgment condition. If the number of the at least one abnormal class is greater than 2, it is indicated that the confidence corresponding to 2 or more abnormal classes is greater than the second threshold corresponding to each abnormal class, and in this case, the target abnormal class is the abnormal class with the highest confidence in the at least one abnormal class, and the classification of the first tab image is corrected to the target abnormal class, thereby improving the classification accuracy.
In the above, by setting the erroneous judgment condition, whether the first tab image belongs to the normal class or not can be judged, so that the classification of the first tab image is corrected, and the classification accuracy is improved.
In this embodiment, by analyzing the confidence levels corresponding to the multiple classifications of the first tab image, if the confidence levels corresponding to the multiple classifications satisfy the erroneous judgment condition in the case that the first tab image belongs to the normal class, the classification of the first tab image is corrected to the target abnormal class. In still other embodiments of the present application, before inputting the first tab image into the classification model, the method further comprises:
acquiring a sample set, wherein the sample set comprises a plurality of second ear images, each second ear image is marked with a corresponding class, and the plurality of second ear images correspond to a plurality of classes;
and training the initial network model by adopting the sample set to obtain a classification model.
Specifically, each second ear image may be labeled by a manual labeling method, if the second ear image is not abnormal, the second ear image is labeled as a normal class, and if the second ear image is abnormal, the second ear image is labeled as a corresponding abnormal class. The plurality of second tab images need to include tab images labeled as normal types and second tab images labeled as abnormal types.
The initial network model may be a neural network model, not limited herein. After training is completed, a classification model can be obtained, the classification model can classify the input tab images, and it is to be noted that the classification model outputs normal classes and confidence degrees corresponding to the abnormal classes, and the confidence degrees are larger, and the probability of the classification corresponding to the confidence degrees is larger.
Through the process, the sample set is adopted to train the initial network model, so that a classification model is obtained, and the classification model is convenient to classify the first tab image subsequently.
In some embodiments of the present application, the method further comprises:
acquiring a plurality of third ear images, wherein the third ear images belong to the normal class;
inputting the plurality of third ear images into the classification model to obtain the confidence coefficient of each third ear image identified as a normal class;
and calculating the mean value of the confidence coefficient of each image identified as the normal class, and obtaining the first threshold value.
In this embodiment, the plurality of third tab images may be tab images of a normal class obtained from the sample set, or tab images of a normal class obtained by re-shooting, which is not limited herein. And inputting each third ear image into the classification model, so that the confidence coefficient of each third ear image being identified as the normal class can be obtained, and the average value of the confidence coefficient of each third ear image being identified as the normal class is used as a first threshold value.
In this embodiment, the confidence coefficient of each third ear image identified as the normal class is obtained by inputting the third ear image of the normal class into the classification model, and the mean value of the confidence coefficients is obtained to obtain the first threshold value. In the above, the first threshold is determined by calculating the confidence that the tab image is identified as normal, so that the determination of the first threshold is more accurate, the subsequent judgment of the erroneous judgment condition based on the first threshold is facilitated, and the classification of the first tab image is more accurate.
In some embodiments of the present application, the method further comprises:
acquiring a plurality of fourth ear images, wherein the plurality of fourth ear images belong to a first abnormality class in a plurality of abnormality classes;
inputting the plurality of fourth ear images into the classification model to obtain the confidence coefficient of each fourth ear image being identified as a first abnormal class;
and calculating the mean value of the confidence coefficient of each image identified as the first abnormal class, and obtaining a second threshold value corresponding to the first abnormal class.
In the present embodiment, the plurality of fourth tab images may be tab images of the first abnormal type obtained from the sample set, or tab images of the first abnormal type obtained by re-shooting, and are not limited thereto. And inputting each fourth ear image into the classification model, so that the confidence coefficient of each fourth ear image being identified as the first abnormal class can be obtained, and the average value of the confidence coefficient of each fourth ear image being identified as the first abnormal class is used as a second threshold value.
And processing each abnormal class in the plurality of abnormal classes by adopting the processing mode of the first abnormal class to obtain a second threshold value corresponding to each abnormal class.
In this embodiment, the confidence coefficient of each fourth ear image identified as the first anomaly class is obtained by inputting the fourth ear image of the first anomaly class into the classification model, and the mean value of the confidence coefficients is obtained to obtain the second threshold value corresponding to the first anomaly class. In the above, the second threshold corresponding to the first abnormal class is determined by calculating the confidence that the tab image is identified as the first abnormal class, so that the determination of the second threshold is more accurate, the misjudgment condition is convenient to judge based on the second threshold, and the classification of the first tab image is more accurate.
In some embodiments of the present application, after obtaining the confidence degrees corresponding to each of the plurality of classifications, before correcting the classification of the first tab image into the target anomaly class, the method further includes:
sorting the confidence degrees corresponding to the multiple classifications of the first tab image from large to small to obtain a sorting result;
and if at least one confidence coefficient ranked in front in the ranking result comprises a confidence coefficient corresponding to a normal class, judging that the first tab image belongs to the normal class.
Specifically, the Y bits in the ranking result that are ranked first may be taken, if Y is 1, the classification corresponding to the confidence level of the ranking first bit is taken as the classification of the first tab image, if the classification corresponding to the confidence level of the ranking first bit is a normal class, the first tab image belongs to the normal class, in this case, there may be erroneous judgment, for example, the tab image of the prism dirt class is easily misjudged as the normal class, and further judgment is required; if Y is 2, the classification corresponding to the confidence coefficient of the 2 positions before sorting is taken as the classification of the first tab image, and if the confidence coefficient of the 2 positions before sorting is the confidence coefficient corresponding to the normal class and the confidence coefficient corresponding to the prism dirt respectively, the classification of the first tab image is both the normal class and the prism dirt class, and in this case, the classification of the first tab image has contradiction, and the possibility of erroneous judgment exists and needs further judgment.
That is, when determining the classification of the first tab image, the classification corresponding to at least one confidence coefficient of the first tab image, which is ranked before, in the ranking result is taken as the classification of the first tab image, if the at least one confidence coefficient includes the confidence coefficient that the first tab image is identified as the normal class, the first tab image is determined to belong to the normal class, in this case, the first tab image has the possibility of being misjudged, and further determination needs to be performed to correct the classification of the first tab image, so that the misjudgment rate is reduced, and the classification accuracy is improved.
Referring to fig. 2, a schematic structural diagram of an image classification apparatus according to an embodiment of the present application is shown in fig. 2, and the image classification apparatus 200 includes:
a first acquiring module 201, configured to acquire a first tab image;
a second obtaining module 202, configured to input the first tab image to a classification model, to obtain confidence degrees corresponding to a plurality of classifications, where the plurality of classifications includes a normal class and a plurality of abnormal classes;
the correction module 203 is configured to, when determining that the first tab image belongs to the normal class according to the confidence degrees corresponding to the multiple classifications, correct the classification of the first tab image to be a target abnormal class if the confidence degrees corresponding to the multiple classifications meet a misjudgment condition, where the target abnormal class is determined according to the confidence degrees corresponding to the multiple abnormal classes;
the misjudgment condition is as follows:
the confidence coefficient corresponding to the normal class of the first tab image is smaller than a first threshold value, and the confidence coefficient corresponding to at least one abnormal class in the plurality of abnormal classes of the first tab image is larger than a second threshold value corresponding to each abnormal class.
In this embodiment, by analyzing the confidence levels corresponding to the multiple classifications of the first tab image, if the confidence levels corresponding to the multiple classifications satisfy the erroneous judgment condition in the case that the first tab image belongs to the normal class, the classification of the first tab image is corrected to the target abnormal class.
In an embodiment of the present application, the target exception class is an exception class with a maximum confidence in the at least one exception class.
In this embodiment, the classification of the first tab image is corrected to be the abnormal class with the maximum confidence, so as to improve the classification accuracy.
In an embodiment of the present application, the apparatus further includes:
the third acquisition module is used for acquiring a sample set, wherein the sample set comprises a plurality of second ear images, each second ear image is marked with a corresponding class, and the plurality of second ear images correspond to the plurality of classes;
and the training module is used for training the initial network model by adopting the sample set to obtain a classification model.
In this embodiment, the sample set is used to train the initial network model, so as to obtain the classification model, so that the classification model is convenient to be used for classifying the first tab image subsequently.
In an embodiment of the present application, the apparatus further includes:
the fourth acquisition module is used for acquiring a plurality of third ear images, and the third ear images belong to the normal class;
a fifth obtaining module, configured to input the plurality of third ear images to the classification model, to obtain a confidence level that each third ear image is identified as a normal class;
and the first calculation module is used for calculating the mean value of the confidence coefficient of each image identified as the normal class, and obtaining the first threshold value.
In this embodiment, the first threshold is determined by calculating based on the confidence that the tab image is identified as the normal class, so that the determination of the first threshold is more accurate, the subsequent judgment of the erroneous judgment condition based on the first threshold is facilitated, and the classification of the first tab image is more accurate.
In an embodiment of the present application, the apparatus further includes:
a sixth acquisition module, configured to acquire a plurality of fourth ear images, where the plurality of fourth ear images belong to a first abnormality class of a plurality of abnormality classes;
a seventh obtaining module, configured to input the plurality of fourth ear images to the classification model, to obtain a confidence level that each fourth ear image is identified as a first anomaly class;
and the second calculation module is used for calculating the mean value of the confidence coefficient of each fourth ear image identified as the first abnormal class, and obtaining a second threshold value corresponding to the first abnormal class.
In this embodiment, the second threshold corresponding to the first abnormal class is determined by calculating based on the confidence that the tab image is identified as the first abnormal class, so that the determination of the second threshold is more accurate, the subsequent judgment of the erroneous judgment condition based on the second threshold is facilitated, and the classification of the first tab image is more accurate.
In an embodiment of the present application, the apparatus further includes:
the sorting module is used for sorting the confidence degrees corresponding to the multiple classifications of the first tab image from large to small to obtain a sorting result;
and the judging module is used for judging that the first tab image belongs to the normal class if at least one confidence coefficient ranked in front in the ranking result comprises the confidence coefficient corresponding to the normal class.
In this embodiment, when determining the classification of the first tab image, the classification corresponding to at least one confidence coefficient of the first tab image, which is ranked before, in the ranking result is taken as the classification of the first tab image, if the at least one confidence coefficient includes the confidence coefficient that the first tab image is identified as the normal class, the first tab image is determined to belong to the normal class, in this case, the first tab image has the possibility of being misjudged, and further determination needs to be performed to correct the classification of the first tab image, so that the misjudgment rate is reduced, and the classification accuracy is improved.
In an embodiment of the present application, the plurality of anomaly classes includes at least one of uneven lighting, dithering, excessive darkness, overexposure, blurring, excessive tail, prism smudging, and left supervision.
In this embodiment, a plurality of abnormal classes are set according to the problem occurring in the tab imaging, and when classifying the first tab image, the fineness of the image classification can be improved.
Fig. 3 shows a schematic hardware structure of an electronic device according to an embodiment of the present application.
The electronic device may include a processor 501 and a memory 502 storing computer program instructions.
In particular, the processor 501 may include a central processing unit (Central Processing Unit, CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more integrated circuits of embodiments of the present application.
Memory 502 may include mass storage for data or instructions. By way of example, and not limitation, memory 502 may comprise a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of the foregoing. In some examples, memory 402 may include removable or non-removable (or fixed) media, or memory 502 may be a non-volatile solid state memory. In some embodiments, the memory 502 may be internal or external to the battery device.
In some examples, memory 502 may be Read Only Memory (ROM). In one example, the ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
Memory 502 may include Read Only Memory (ROM), random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical/tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors) it is operable to perform the operations described by the image classification methods provided by embodiments of the present application.
The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement the image classification method in the embodiment shown in fig. 1, and achieves the corresponding technical effects achieved by executing the method/steps in the embodiment shown in fig. 1, which is not described herein for brevity.
In addition, embodiments of the present application may be implemented by providing a computer storage medium. The computer storage medium has stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the image classification methods of the above embodiments.
It should be clear that the present application is not limited to the particular arrangements and processes described above and illustrated in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps, after appreciating the spirit of the present application.
The functional blocks shown in the above block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be different from the order in the embodiments, or several steps may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus, devices, and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to being, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware which performs the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the embodiments, and are intended to be included within the scope of the claims and description. In particular, the technical features mentioned in the respective embodiments may be combined in any manner as long as there is no structural conflict. The present application is not limited to the specific embodiments disclosed herein, but encompasses all technical solutions falling within the scope of the claims.

Claims (9)

1. An image classification method, comprising:
acquiring a first tab image;
inputting the first tab image into a classification model to obtain confidence degrees corresponding to each of a plurality of classifications, wherein the classifications comprise a normal class and a plurality of abnormal classes;
under the condition that the first tab image belongs to the normal class according to the confidence coefficient corresponding to each of the plurality of classifications, if the confidence coefficient corresponding to each of the plurality of classifications meets the misjudgment condition, the classification of the first tab image is corrected to be a target abnormal class, wherein the target abnormal class is determined according to the confidence coefficient corresponding to the plurality of abnormal classes;
the misjudgment condition is as follows:
the confidence coefficient corresponding to the normal class of the first tab image is smaller than a first threshold value, and the confidence coefficient corresponding to at least one abnormal class in the plurality of abnormal classes of the first tab image is larger than a second threshold value corresponding to each abnormal class.
2. The image classification method according to claim 1, wherein the target abnormality class is an abnormality class having a highest degree of confidence among the at least one abnormality class.
3. The image classification method according to claim 1, characterized in that before inputting the first tab image into a classification model, the method further comprises:
acquiring a sample set, wherein the sample set comprises a plurality of second ear images, each second ear image is marked with a corresponding class, and the plurality of second ear images correspond to a plurality of classes;
and training the initial network model by adopting the sample set to obtain a classification model.
4. The image classification method according to claim 1, characterized in that the method further comprises:
acquiring a plurality of third ear images, wherein the third ear images belong to the normal class;
inputting the plurality of third ear images into the classification model to obtain the confidence coefficient of each third ear image identified as a normal class;
and calculating the mean value of the confidence that each image is identified as the normal class, and obtaining the first threshold value.
5. The image classification method according to claim 1, characterized in that the method further comprises:
acquiring a plurality of fourth ear images, wherein the plurality of fourth ear images belong to a first abnormality class in a plurality of abnormality classes;
inputting the plurality of fourth ear images into the classification model to obtain the confidence coefficient of each fourth ear image being identified as a first abnormal class;
and calculating the mean value of the confidence coefficient of each fourth ear image identified as the first abnormal class, and obtaining a second threshold value corresponding to the first abnormal class.
6. The image classification method according to any one of claims 1 to 5, characterized in that after obtaining the confidence levels corresponding to each of the plurality of classifications, before correcting the classification of the first tab image to the target abnormality class, the method further comprises:
sorting the confidence degrees corresponding to the multiple classifications of the first tab image from large to small to obtain a sorting result;
and if at least one confidence coefficient ranked in front in the ranking result comprises a confidence coefficient corresponding to a normal class, judging that the first tab image belongs to the normal class.
7. The image classification method according to any one of claims 1-5, wherein the plurality of anomaly classes includes at least one of uneven lighting, dithering, overdriving, overexposure, blurring, oversized tail, prismatic smudging, and left supervision.
8. An image classification apparatus, comprising:
the first acquisition module is used for acquiring a first tab image;
the second acquisition module is used for inputting the first tab image into a classification model to obtain the confidence corresponding to each of a plurality of classifications, wherein the classifications comprise a normal class and a plurality of abnormal classes;
and the correction module is used for correcting the classification of the first tab image into a target abnormal class when the first tab image belongs to the normal class according to the confidence degrees corresponding to the classifications, wherein the target abnormal class is determined according to the confidence degrees corresponding to the abnormal classes if the confidence degrees corresponding to the classifications meet the misjudgment condition.
9. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the image classification method of any of claims 1 to 7.
CN202410107885.9A 2024-01-25 2024-01-25 Image classification method and device and electronic equipment Pending CN117636079A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410107885.9A CN117636079A (en) 2024-01-25 2024-01-25 Image classification method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410107885.9A CN117636079A (en) 2024-01-25 2024-01-25 Image classification method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117636079A true CN117636079A (en) 2024-03-01

Family

ID=90025578

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410107885.9A Pending CN117636079A (en) 2024-01-25 2024-01-25 Image classification method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117636079A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951899A (en) * 2017-02-24 2017-07-14 李刚毅 Method for detecting abnormality based on image recognition
CN109270071A (en) * 2018-07-23 2019-01-25 广州超音速自动化科技股份有限公司 Coating method for detecting abnormality and tab welding detection system on a kind of tab
CN114882414A (en) * 2022-05-17 2022-08-09 北京达佳互联信息技术有限公司 Abnormal video detection method, abnormal video detection device, electronic equipment, abnormal video detection medium and program product
CN115205247A (en) * 2022-07-13 2022-10-18 上海商汤智能科技有限公司 Method, device and equipment for detecting defects of battery pole piece and storage medium
WO2023186051A1 (en) * 2022-03-31 2023-10-05 深圳市帝迈生物技术有限公司 Auxiliary diagnosis method and apparatus, and construction apparatus, analysis apparatus and related product

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951899A (en) * 2017-02-24 2017-07-14 李刚毅 Method for detecting abnormality based on image recognition
CN109270071A (en) * 2018-07-23 2019-01-25 广州超音速自动化科技股份有限公司 Coating method for detecting abnormality and tab welding detection system on a kind of tab
WO2023186051A1 (en) * 2022-03-31 2023-10-05 深圳市帝迈生物技术有限公司 Auxiliary diagnosis method and apparatus, and construction apparatus, analysis apparatus and related product
CN114882414A (en) * 2022-05-17 2022-08-09 北京达佳互联信息技术有限公司 Abnormal video detection method, abnormal video detection device, electronic equipment, abnormal video detection medium and program product
CN115205247A (en) * 2022-07-13 2022-10-18 上海商汤智能科技有限公司 Method, device and equipment for detecting defects of battery pole piece and storage medium

Similar Documents

Publication Publication Date Title
CN111931731B (en) Question judging method and device, electronic equipment and storage medium
CN109740689B (en) Method and system for screening error labeling data of image semantic segmentation
CN112200273B (en) Data annotation method, device, equipment and computer storage medium
CN111177505A (en) Training method, recommendation method and device of index anomaly detection model
CN111818318B (en) White balance tuning method, device, equipment and storage medium for image processor
CN109800717B (en) Behavior recognition video frame sampling method and system based on reinforcement learning
CN112580734B (en) Target detection model training method, system, terminal equipment and storage medium
CN115690108A (en) Aluminum alloy rod production quality evaluation method based on image processing
CN109740553B (en) Image semantic segmentation data screening method and system based on recognition
CN109685805B (en) Image segmentation method and device
CN111813618A (en) Data anomaly detection method, device, equipment and storage medium
CN113269042B (en) Intelligent traffic management method and system based on driving vehicle violation identification
CN113781391A (en) Image defect detection method and related equipment
CN115184807A (en) Battery fault detection method, device, equipment, medium and product
CN113723216A (en) Lane line detection method and device, vehicle and storage medium
CN111340041A (en) License plate recognition method and device based on deep learning
CN112949785A (en) Object detection method, device, equipment and computer storage medium
CN117636079A (en) Image classification method and device and electronic equipment
CN112614109A (en) Image quality evaluation method, device and computer readable storage medium
CN110517234B (en) Method and device for detecting characteristic bone abnormality
CN115345806A (en) Object detection method and device, electronic equipment and readable storage medium
CN112733669A (en) Artificial intelligence AI (artificial intelligence) identification method, device, equipment and computer storage medium
CN114629699B (en) Migratory network flow behavior anomaly detection method and device based on deep reinforcement learning
CN117710376A (en) Tab defect detection method and device and electronic equipment
CN116527329B (en) Intrusion detection method and system based on machine learning

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