CN-116342935-B - Image recognition method, image data set merging method and related equipment
Abstract
The application provides an image recognition method, an image data set merging method and related equipment. The image recognition method comprises the steps of obtaining an image to be recognized, determining the classification of the image to be recognized, determining a target data set corresponding to the classification of the image to be recognized, wherein the target data set is a target subset corresponding to the classification of the image to be recognized in a plurality of subsets of the image data set, and obtaining an image recognition result according to the image to be recognized and the target data set. The merging method of the image data sets comprises the steps of obtaining at least two data sets to be merged, wherein each data set comprises a plurality of images, each image comprises an image identifier, classifying each data set according to the attribute of the image, determining at least two target data subsets corresponding to target classifications in the plurality of classifications, respectively calculating target characteristics corresponding to each image identifier, merging the images in the at least two target data subsets according to the target characteristics corresponding to each image identifier, and determining the image data sets according to the merged target data subsets.
Inventors
- AN ZHANFU
Assignees
- 京东方科技集团股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230228
Claims (14)
- 1. An image recognition method, comprising: acquiring an image to be identified; Determining the classification of the image to be identified; Determining a target data set corresponding to the classification of the image to be identified, wherein the target data set is a target subset corresponding to the classification of the image to be identified in a plurality of subsets of the image data set; obtaining an image recognition result according to the image to be recognized and the target data set; the target data set comprises a plurality of data subsets, each data subset corresponds to an image identifier, and the image recognition result is obtained according to the image to be recognized and the target data set, and the method comprises the following steps: Respectively calculating the similarity between the image to be identified and the plurality of data subsets; determining a target data subset of the plurality of data subsets according to the similarity between the image to be identified and the plurality of data subsets; and obtaining the image recognition result according to the image identification of the target data subset.
- 2. The method of claim 1, wherein each of the data subsets comprises a plurality of images, and wherein the computing similarity between the image to be identified and the plurality of data subsets comprises: calculating the characteristics of the image to be identified and the average characteristics of a plurality of images of each data subset; and respectively calculating the similarity between the features of the image to be identified and the average features of the data subsets.
- 3. The image recognition method according to claim 1, wherein the determining the classification of the image to be recognized includes: inputting the image to be identified into a pre-trained classification model, and outputting the classification of the image to be identified.
- 4. The image recognition method according to claim 1, wherein the image to be recognized is a face image, and the plurality of subsets of the image dataset correspond to a plurality of classifications respectively, the plurality of classifications being classified according to gender and skin tone to which the face corresponds.
- 5. A method of merging image datasets, comprising: Acquiring at least two data sets to be combined, wherein each data set comprises a plurality of images, and each image comprises an image identifier; Classifying each data set according to the attribute of the image to obtain a plurality of data subsets to be combined, which correspond to the classifications respectively; determining at least two target data subsets corresponding to target classifications in the plurality of classifications; respectively calculating target characteristics of at least two images with the same image identifier in each target data subset to obtain target characteristics corresponding to each image identifier; Combining the images in the at least two target data subsets according to the target characteristics corresponding to each image identifier to obtain a combined target data subset; And determining the image data set according to the combined target data subset.
- 6. The method of merging image datasets of claim 5, wherein merging images in the at least two target datasets according to the target feature corresponding to each image identification includes: Calculating similarity for all image identifications in the at least two target data subsets according to the corresponding target features; and merging the images corresponding to the at least two image identifications with the similarity meeting the similarity condition.
- 7. The method of merging image datasets of claim 6, further comprising: and renaming the at least two image identifications to be the same image identification to obtain the combined image identification.
- 8. The method of merging image datasets of claim 5, wherein said classifying each of said datasets according to attributes of said image includes: and respectively inputting the multiple images of each data set into a pre-trained classification model, and outputting the classification of the multiple images.
- 9. The method of merging image datasets of claim 8, wherein said classifying each of said datasets in accordance with attributes of said image further includes: In response to determining that the image identifies the same classification of at least two images as a plurality, the highest-scoring classification is determined as the classification of the at least two images.
- 10. The method for merging image data sets according to claim 6, wherein the target feature is an average feature, the similarity satisfying a similarity condition includes similarity being greater than a preset threshold, the data set is a face data set, and the plurality of classifications are classified according to gender and skin color corresponding to a face.
- 11. An image recognition apparatus, comprising: the image acquisition module is used for acquiring an image to be identified; the image classification module is used for determining the classification of the images to be identified; The target data set determining module is used for determining a target data set corresponding to the classification of the image to be identified, wherein the target data set is a target subset corresponding to the classification of the image to be identified in a plurality of subsets of the image data set; the image recognition module is used for obtaining an image recognition result according to the image to be recognized and the target data set; the target data set comprises a plurality of data subsets, each data subset corresponds to an image identifier, and the image recognition result is obtained according to the image to be recognized and the target data set, and the method comprises the following steps: Respectively calculating the similarity between the image to be identified and the plurality of data subsets; determining a target data subset of the plurality of data subsets according to the similarity between the image to be identified and the plurality of data subsets; and obtaining the image recognition result according to the image identification of the target data subset.
- 12. A merging device of image data sets, comprising: The system comprises a data set acquisition module, a data set generation module and a data set generation module, wherein the data set acquisition module is used for acquiring at least two data sets to be combined, each data set comprises a plurality of images, and each image comprises an image identifier; The data set classification module is used for classifying each data set according to the attribute of the image to obtain a plurality of data subsets to be combined, which correspond to the classifications respectively; A target data subset determining module, configured to determine at least two target data subsets corresponding to target classifications in the multiple classifications; the target feature calculation module is used for calculating target features of at least two images with the same image identifications in each target data subset respectively to obtain target features corresponding to each image identification; the merging module is used for merging the images in the at least two target data subsets according to the target characteristics corresponding to each image identifier to obtain a merged target data subset; And the image data set determining module is used for determining a plurality of combined target data subsets as the image data set.
- 13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 4 or the method of any one of claims 5 to 10 when the program is executed.
- 14. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 4 or the method of any one of claims 5 to 10.
Description
Image recognition method, image data set merging method and related equipment Technical Field The present application relates to the field of image recognition technologies, and in particular, to an image recognition method, a method for merging image datasets, and related devices. Background At present, two methods for improving the performance (such as accuracy) of a computer vision classification algorithm or model are mainly two methods, namely, firstly, a designed recognition model structure and secondly, more training data are collected. For methods that collect more training data, such as in face recognition, it is often necessary to collect a dataset containing tens of thousands of face images. Among them, google uses 2 hundred million face image data of 8 tens of millions of IDs to train the model. However, obtaining training data with such a huge amount of data often has a time complexity problem. Therefore, it becomes important to reduce the time complexity when acquiring such huge data. Disclosure of Invention In view of the above, the present application is directed to an image recognition method, a merging method of image datasets and related devices. Based on the above object, in a first aspect, the present application provides an image recognition method, including: acquiring an image to be identified; Determining the classification of the image to be identified; Determining a target data set corresponding to the classification of the image to be identified, wherein the target data set is a target subset corresponding to the classification of the image to be identified in a plurality of subsets of the image data set; and obtaining an image recognition result according to the image to be recognized and the target data set. In a second aspect, an embodiment of the present application further provides a method for merging image datasets, including: Acquiring at least two data sets to be combined, wherein each data set comprises a plurality of images, and each image comprises an image identifier; Classifying each data set according to the attribute of the image to obtain a plurality of data subsets to be combined, which correspond to the classifications respectively; determining at least two target data subsets corresponding to target classifications in the plurality of classifications; respectively calculating target characteristics of at least two images with the same image identifier in each target data subset to obtain target characteristics corresponding to each image identifier; Combining the images in the at least two target data subsets according to the target characteristics corresponding to each image identifier to obtain a combined target data subset; And determining the image data set according to the combined target data subset. In a third aspect, an embodiment of the present application further provides an image recognition apparatus, including: the image acquisition module is used for acquiring an image to be identified; the image classification module is used for determining the classification of the images to be identified; The target data set determining module is used for determining a target data set corresponding to the classification of the image to be identified, wherein the target data set is a target subset corresponding to the classification of the image to be identified in a plurality of subsets of the image data set; And the image recognition module is used for obtaining an image recognition result according to the image to be recognized and the target data set. In a fourth aspect, an embodiment of the present application further provides an apparatus for merging image data sets, including: The system comprises a data set acquisition module, a data set generation module and a data set generation module, wherein the data set acquisition module is used for acquiring at least two data sets to be combined, each data set comprises a plurality of images, and each image comprises an image identifier; The data set classification module is used for classifying each data set according to the attribute of the image to obtain a plurality of data subsets to be combined, which correspond to the classifications respectively; a target data subset determining module for determining at least two target data subsets corresponding to target classifications in the plurality of classifications; the target feature calculation module is used for calculating target features of at least two images with the same image identifications in each target data subset respectively to obtain target features corresponding to each image identification; the merging module is used for merging the images in the at least two target data subsets according to the target characteristics corresponding to each image identifier to obtain a merged target data subset; And the image data set determining module is used for determining a plurality of combined target data subsets as the image data set. An embodiment of t