Image recognition method and apparatus
By constructing an information missing model and an image recognition model, image data that meets the conditions for information missing status is selected for recognition, which solves the accuracy problem caused by information missing in image recognition and improves the accuracy and efficiency of object category recognition.
Patent Information
- Application Number
- CN202211384613.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-11-07
AI Technical Summary
Existing image recognition technologies struggle to accurately identify object categories when information is missing, resulting in low recognition accuracy.
By constructing an information missing model and an image recognition model, the information missing model is trained using image data samples labeled with missing status tags to determine the information missing status of the image data, and image recognition is performed when the conditions are met, thereby improving the recognition accuracy.
By filtering out image data that meets the criteria for missing information, invalid recognition is reduced, thereby improving the accuracy and efficiency of object category recognition in image data.
Smart Images

Figure CN115620071B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an image recognition method and apparatus. Background Technology
[0002] In image recognition scenarios, it is necessary to combine image data, such as images or text, to identify the category to which an object belongs. For example, in a face recognition scenario, it is necessary to identify the user to whom a face in a face image belongs.
[0003] However, in the process of image recognition based on image data, there are often some situations where inaccurate recognition cannot be achieved, resulting in low accuracy of image recognition or even some invalid recognition. Summary of the Invention
[0004] This application provides an image recognition method and apparatus.
[0005] One image recognition method includes:
[0006] Obtain image data of the object to be identified;
[0007] The information missing state of the image data is determined using an information missing model, and the information missing state of the image data characterizes the information missing situation of the object to be identified in the image data.
[0008] If the information missing state of the image data meets the conditions, the image recognition model is used to perform image recognition on the image data to determine the object category of the object to be identified in the image data.
[0009] The information missing model is trained using multiple image data samples labeled with missing state tags, and the missing state tags are determined based on the image recognition model.
[0010] In one possible implementation, the image recognition model is trained using multiple image data samples labeled with object category labels, whereby the object category labels are used to characterize the object category of the objects in the image data samples.
[0011] In another possible implementation, the information missing model is trained using multiple image data samples labeled with missing state tags and used to train the image recognition model;
[0012] The missing status label of the image data sample is determined based on the probability that the object in the image data sample identified by the image recognition model belongs to the target object category. The target object category is the object category whose probability satisfies a set condition among at least one object category to which the object is identified by the image recognition model.
[0013] In another possible implementation, the image recognition model and the information missing model are trained in the following manner:
[0014] Obtain multiple image data samples labeled with object category tags;
[0015] Based on the object category labels annotated by the image data samples, the image recognition model to be trained is trained using the multiple image data samples to obtain the trained image recognition model;
[0016] Using a trained image recognition model, determine at least one object category to which an object in the image data sample may belong, and the probability that the object belongs to each of the at least one object category;
[0017] From at least one object category to which an object may belong in the image data sample, determine the target object category whose probability satisfies the set conditions.
[0018] Based on the probability of the target object category, label the missing state of the image data sample;
[0019] The information missing model to be trained is obtained by training each image data sample labeled with missing state labels.
[0020] In another possible implementation, after obtaining the trained information-missing model, the following is also included:
[0021] If the model training termination condition has not yet been reached, the information missing status of the image data sample is determined using the trained information missing model.
[0022] From the plurality of image data samples, image data samples whose information missing state meets the conditions are selected to obtain the plurality of selected image data samples;
[0023] The trained information-deficient model is used as the information-deficient model to be trained next, the trained image recognition model is used as the image recognition model to be trained next, and multiple filtered image data samples are used as multiple image data samples for training. The operation of returning to execute the object category label based on the image data sample is performed, and the image recognition model to be trained is trained using the multiple image data samples until the model training termination condition is reached.
[0024] In another possible implementation, both the information missing model and the image recognition model are network models, and the number of network layers in the information missing model is less than the number of network layers in the image recognition model.
[0025] Another possible implementation includes:
[0026] If the information missing status of the image data does not meet the conditions, the image data is determined to be image data that cannot be recognized.
[0027] In another possible implementation, the information missing state of the image data includes: the degree of information missing of the image data or the information missing category of the image data, wherein the information missing category belongs to one of two categories: information missing class and information not missing class.
[0028] The missing information state of the image data meets the following conditions:
[0029] The degree of information loss in the image data is lower than the set level;
[0030] or,
[0031] The image data is classified as missing information in the "not missing information" category.
[0032] In another aspect, this application also provides an image recognition device, comprising:
[0033] The image acquisition unit is used to acquire image data of the object to be identified;
[0034] The missing information determination unit is used to determine the missing information state of the image data using an information missing information model, wherein the missing information state of the image data characterizes the missing information of the object to be identified in the image data.
[0035] An image recognition unit is configured to perform image recognition on the image data using the image recognition model if the information missing state of the image data meets the conditions, so as to determine the object category of the object to be identified in the image data; wherein the information missing model is trained using multiple image data samples labeled with missing state labels, and the missing state labels are determined based on the image recognition model.
[0036] In another possible implementation, the image recognition model is trained using multiple image data samples labeled with object category labels, whereby the object category labels are used to characterize the object category of the objects in the image data samples.
[0037] As can be seen from the above, in this application, after obtaining the image data of the object to be identified, the information missing state of the image data is first determined using an information missing model. This information missing state characterizes the information missing status of the object to be identified in the image data. Furthermore, since the missing state labels of each image data sample used to train the information missing model are determined based on the image recognition model, the information missing state identified by the information missing model reflects the accuracy with which the image recognition model identifies the object category from the image data. Based on this, only when the information missing state of the image data identified by the information missing model meets certain conditions is the image recognition model used to perform image recognition. This reduces the likelihood of the image recognition model failing to accurately identify the object category due to information missing information in the image data, thus improving the accuracy of object category identification in image data. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0039] Figure 1 This paper illustrates a flowchart of an image recognition method provided in an embodiment of this application.
[0040] Figure 2 This paper illustrates a training process diagram of a training information missing model and an image recognition model in an embodiment of this application;
[0041] Figure 3 This illustration shows another training process diagram for training the information-deficient model and the image recognition model in the embodiments of this application;
[0042] Figure 4This diagram illustrates the principle of a training information-deficient model and an image recognition model.
[0043] Figure 5 This illustration shows another flowchart of the image recognition method provided in an embodiment of this application;
[0044] Figure 6 This illustration shows a schematic diagram of the composition structure of an image recognition device provided in an embodiment of this application;
[0045] Figure 7 A schematic diagram of the composition structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0046] The solution in this application embodiment can be applied to object recognition scenarios to improve the accuracy of identifying the object category based on the image data of the object to be recognized.
[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0048] like Figure 1 The illustration shows a flowchart of an image recognition method provided in an embodiment of this application. The method of this embodiment can be applied to electronic devices, such as independent computers, independent servers, clusters, or servers in distributed systems, without limitation.
[0049] The method in this embodiment may include:
[0050] S101, Obtain image data of the object to be identified.
[0051] Depending on the specific application scenario, the object to be identified can be of various kinds, such as a face, an animal, a vehicle, or a human body, without any restrictions.
[0052] Image data of the object to be identified refers to an image containing the object to be identified. For example, in the scenario of face recognition, the image data of the object to be identified can be a face image of the person to be identified.
[0053] S102, use the information missing model to determine the information missing status of the image data.
[0054] The information loss status of the image data represents the extent to which information about the object to be identified is missing in the image data. Since this application requires category identification of the object to be identified in the image data, the information loss status of the object to be identified actually affects the actual amount of information required for object category identification.
[0055] In this application, the information missing state of image data can be the degree of information missing in the image data or a state category that characterizes whether there is information missing in the image data, and there are no restrictions on this.
[0056] The information missing model is trained using multiple image data samples labeled with missing state tags. These missing state tags characterize the information missing state of the image data samples. For example, the missing state tags can be divided into two categories: tags indicating the presence of missing information and tags indicating the absence of missing information.
[0057] There are various ways to train this missing information model. For example, any supervised training method can be used to train the missing information model.
[0058] S103, if the information missing state of the image data meets the conditions, use the image recognition model to perform image recognition on the image data to determine the object category of the object to be identified in the image data.
[0059] The condition that the missing information state of image data meets the requirement means that the missing information state of the image data will not affect the identification of the object category of the object to be identified in the image data. In other words, meeting the condition that the missing information state of image data meets the requirement is a prerequisite for accurately identifying the object category of the object to be identified in the image data.
[0060] The specific form of this missing information state can be varied and is not restricted.
[0061] For example, the information loss status of the image data includes: the degree of information loss in the image data. The degree of information loss in the image data can represent the extent to which information about objects in the image data is missing. Correspondingly, the condition for the information loss status of the image data to be satisfied can be: the degree of information loss in the image data is lower than a set level.
[0062] For example, the information missing status of the image data can also be categorized as: information missing category. This information missing category belongs to one of two categories: information missing or information not missing. The information missing category indicates that information is missing, while the information not missing category indicates that information is not missing.
[0063] Correspondingly, the condition for the information missing state of image data to be met can be: the information missing category of the image data is the information not missing category.
[0064] Understandably, determining the degree or type of missing information in image data, and identifying objects with fewer missing information, is more conducive to image recognition models identifying the object category in the image data, and naturally improves the accuracy of image recognition models in identifying object categories in image data.
[0065] In this application, the image recognition model can be a model capable of identifying object categories. For example, in a face recognition scenario, the image recognition model can be a face recognition model, which identifies the user corresponding to a face in a face image. As another example, in a pose recognition scenario, the image recognition model can be a pose recognition model, which identifies the pose category of a user or other object in an image.
[0066] Of course, this is just an example. Object category recognition can also involve various scenarios such as facial expressions or text categories. The object categories recognized by the image recognition model will also be different depending on the application scenario. There are no specific restrictions on this.
[0067] In order to ensure that the information missing status predicted by the information missing model can reflect the accuracy of the image recognition model in identifying the object category of the object to be identified in the image data, in this application, the missing status identifier of the image data sample can be determined according to the image recognition model.
[0068] For example, for image data samples used to train a model with missing information, the missing status label of the image data sample can be determined based on the object category recognition of the objects in the image data sample by the image recognition model.
[0069] In this application, the image recognition model can be constructed in various ways, and no limitation is imposed. For example, in one possible implementation, the image recognition model is trained using multiple image data samples labeled with object category labels. The object category labels are used to characterize the object category of the objects in the image data samples.
[0070] The image recognition model can be trained using any supervised training method without any restrictions.
[0071] In this application, the image data samples used to train the image recognition model and the information-deficient model can be the same samples or different samples.
[0072] As can be seen from the above, in this application, after obtaining the image data of the object to be identified, the information missing state of the image data is first determined using an information missing model. This information missing state characterizes the information missing status of the object to be identified in the image data. Furthermore, since the missing state labels of each image data sample used to train the information missing model are determined based on the image recognition model, the information missing state identified by the information missing model reflects the accuracy with which the image recognition model identifies the object category from the image data. Based on this, only when the information missing state of the image data identified by the information missing model meets certain conditions is the image recognition model used to perform image recognition. This reduces the likelihood of the image recognition model failing to accurately identify the object category due to information missing information in the image data, thus improving the accuracy of object category identification in image data.
[0073] In this application, in order to make the information missing state predicted by the information missing model more accurately reflect the possibility that the image data can be accurately recognized by the image recognition model, the information missing model can be trained using multiple image data samples labeled with missing state labels and used to train the image recognition model.
[0074] Based on this, the missing state label for the image data sample is determined by the probability that an object in the image data sample, as identified by the image recognition model, belongs to a target object category. Specifically, the target object category can be any object category to which the image recognition model identifies the object in the image data sample, and the object category whose probability satisfies a predetermined condition.
[0075] The probability that satisfies the set condition can be the probability that is the first or second most likely probability in the order of probability from largest to smallest.
[0076] In practical applications, the category of a target object whose probability meets the set conditions is generally the category to which the object in the image data sample will ultimately belong.
[0077] In practical applications, the object category with the highest probability of belonging to the image data sample identified by the image recognition model is generally determined as the actual object category to which the object in the image data sample belongs. Therefore, the probability condition in this application can be: the highest probability.
[0078] It is understandable that the greater the probability that an object belongs to the target object category, the greater the probability that the image recognition model can accurately identify the object category to which the object in the image data sample belongs.
[0079] Meanwhile, the ability of an image recognition model to accurately identify the object category in an image data sample is closely related to the degree of missing information about that object in the image data sample. Specifically, the less missing information about the object in the image data sample, the more accurately the image recognition model can identify the object's category.
[0080] For example, in a facial recognition scenario, if part of the face in a facial image is obscured, the probability of the image recognition model identifying that the face belongs to any user is low. Moreover, the more severely the face is obscured, the less accurately the image recognition model can identify the user to which the face belongs. This may lead to misjudging that the face belongs to multiple users with roughly the same and low probability, resulting in the facial classification result failing to accurately represent the user to which the face belongs.
[0081] Therefore, the probability of an object in an image sample belonging to the target object category can reflect the degree of missing information in the object in the image sample data. Thus, the missing status label of the image data sample can be determined based on the probability of an object in the image data sample belonging to the target object category.
[0082] For example, in one possible implementation, if the image recognition model determines that the probability of an object in the image data sample belonging to the target object category is greater than a set threshold, the missing status label of the image data sample can be determined as a label category that represents that the image data sample does not have missing information.
[0083] For example:
[0084] The probability of a given condition being met is considered the highest. Furthermore, it is assumed that the image recognition model identifies objects in each image data sample as potentially belonging to three object categories: object category 1, object category 2, and object category 3. A threshold of 50% is assumed to be set.
[0085] Suppose that for image data sample 1, the image recognition model identifies that the probability of an object in image data sample 1 belonging to object category 1 is 90%, the probability of belonging to object category 2 is 10%, and the probability of belonging to object category 2 is 0%.
[0086] Therefore, object category 1 is the target object category to which the object in image data sample 1 belongs. Based on this, since the probability (90%) that the object in image data sample 1 belongs to object category 1 is greater than 50%, a missing status label of 1 can be assigned to this image data sample. The label 1 indicates that there is no missing information about the object in image data sample 1.
[0087] Suppose that for image data sample 2, the image recognition model identifies an object in image data sample 1 with a 20% probability of belonging to object category 1, a 45% probability of belonging to object category 2, and a 35% probability of belonging to object category 3. Therefore, the target object category to which the object in image data sample 2 belongs is object category 2.
[0088] Since the probability of the image recognition model identifying the objects in the image data sample as belonging to each object category is low, it can be said that there is a large degree of missing information in the objects in image data sample 2, which makes it impossible for the image recognition model to reliably identify the category to which the objects in image data sample 2 belong.
[0089] Meanwhile, since the probability of an object in image data sample 2 belonging to the target object category is 45%, which is less than the set threshold, image data sample 2 can be labeled with a missing status tag: 0. Tag 0 indicates that information about the object in image data sample 2 is missing.
[0090] The following describes one implementation of the image recognition model and the information missing model used in this application.
[0091] like Figure 2 As shown, this diagram illustrates a training process for the image recognition model and the information missing model in this application. The method in this embodiment may include:
[0092] S201, obtain multiple image data samples labeled with object category tags.
[0093] Among them, the object category label is used to characterize the object category to which the object in the image data sample belongs.
[0094] For example, suppose that in a certain object classification scenario, there are four possible object categories to which objects in image data may belong. These four object categories can be represented by the labels 0, 1, 2 and 3 respectively.
[0095] Of course, this is just an example, and this application does not limit the specific form of the object category labels annotated in the image data samples.
[0096] S202, based on the object category labels of the image data samples, the image recognition model to be trained is trained using multiple image data samples to obtain the trained image recognition model.
[0097] The process of training the image recognition model can employ any supervised training method without any restrictions.
[0098] For example, for each image data sample, the image data sample is input into the image recognition model to be trained, and the object category of the object in the image data sample predicted by the image recognition model is obtained. Based on this, according to the actual object category labels of each image data sample and the object category of the object in each image data sample predicted by the image recognition model, the loss function value of the target recognition model is calculated. If the loss function value converges, the training of the image recognition model is confirmed to be complete, and the trained image recognition model is obtained.
[0099] S203, for each image data sample, using a trained image recognition model, determine at least one object category to which the object in the image data sample may belong and the probability that the object belongs to at least one object category.
[0100] The probability that an object belongs to an object category is the probability predicted by the image recognition model that the object may belong to that object category.
[0101] For example, by inputting an image data sample into a trained image recognition model, the probability that an object in the image data sample may belong to at least one object category can be obtained from the output of the image recognition model.
[0102] S204, determine the target object category whose probability satisfies the set conditions from at least one object category to which the object may belong in the image data sample.
[0103] For example, the object category with the highest probability among at least one object category predicted by the image recognition model to which the object belongs can be determined as the target object category.
[0104] Of course, the target object category whose probability meets the set conditions can also be other possible cases mentioned above. Please refer to the relevant introduction above for details, which will not be repeated here.
[0105] S205, based on the probability of the target object category, label the missing state of the image data sample.
[0106] For example, if the probability that an object in an image data sample belongs to the target object category is greater than a set threshold, a missing status label can be generated for the image data sample to indicate that there is no missing information in the object; conversely, if the probability that the target object category is not greater than the set threshold, a missing status label can be generated for the image data sample to indicate that there is missing information in the image data sample.
[0107] It is understandable that there are other possible ways to label missing status tags, which can be found in the previous introductions and will not be repeated here.
[0108] S206, The information missing model to be trained is trained based on each image data sample labeled with missing state labels, and the trained information missing model is obtained.
[0109] The process of training this information-deficient model can also adopt any supervised training method. Except for the differences in the labels of the training samples and the loss function of the information-deficient model, the process of training the information-deficient model is similar to that of training the image recognition model, and will not be described in detail here.
[0110] As can be seen from the training process in this embodiment, the missing state label of an image data sample is obtained based on the probability that the object in the image data sample belongs to the target object category as identified by the image recognition model. Since the probability that the image recognition model identifies an object in the image data sample as belonging to the target object category reflects the degree to which the image recognition model accurately identifies the image data sample, labeling the missing state of the image data sample based on the probability that the object in the image data sample belongs to the target object category, and training the information missing model using image data samples labeled with missing state labels, allows the trained information missing model to more accurately analyze the information missing state of objects in the image data, and the information missing state can more reliably reflect the degree of influence of its accurate identification of the object category in the image data.
[0111] Understandably, in order to further improve the prediction accuracy of the image recognition model and the information missing model, this application may iteratively train the image recognition model and the information missing model multiple times.
[0112] like Figure 3 As shown, this illustrates another flowchart of training the image recognition model and the information missing model in this application. The method of this embodiment may include:
[0113] S301, obtain multiple image data samples labeled with object category tags.
[0114] S302, Based on the object category labels annotated in each image data sample, the image recognition model to be trained is trained using these multiple image data samples to obtain the trained image recognition model.
[0115] S303, for each image data sample, using a trained image recognition model, determine at least one object category to which the object in the image data sample may belong and the probability that the object belongs to each of the at least one object category.
[0116] S304, determine the target object category whose probability satisfies the set conditions from at least one object category to which the object may belong in the image data sample.
[0117] S305, based on the probability of the target object category, label the missing state of the image data sample.
[0118] S306, The information missing model to be trained is trained based on each image data sample labeled with missing state labels, and the trained information missing model is obtained.
[0119] The steps S301 to S306 above can be found in the relevant descriptions of the previous embodiments, and will not be described again here.
[0120] S307, Check if the current model training termination condition has been met. If yes, end the training; otherwise, proceed to step S308.
[0121] The model training termination condition can be set as needed.
[0122] For example, in one possible implementation, the training termination condition for the model can be that the number of training iterations exceeds a set number. In this case, the number of training iterations can be incremented by one after each execution of S306.
[0123] Accordingly, in step S307, if it is detected that the number of training iterations exceeds the set number, it is determined that the model training termination condition is met, the most recently trained information-deficient model is identified as the trained information-deficient model, the most recently trained image recognition model is identified as the trained information-deficient model, and training ends. If it is detected that the number of training iterations does not exceed the set number, then step S308 is executed.
[0124] In another possible implementation, the training termination condition for this model can be that the loss function values corresponding to the information-deficient model and the image recognition model both converge.
[0125] Specifically, a first loss function can be set for the information-deficient model, and a second loss function can be set for the image recognition model. Based on this, after each execution of S306, the loss function value of the information-deficient model can be calculated based on the first loss function, and the loss function value of the image recognition model can be calculated based on the second loss function. If the loss function values corresponding to these two models converge, the model training termination condition is determined to be met; otherwise, the subsequent step S308 is executed.
[0126] S308 uses a trained information loss model to determine the information loss status of image data samples.
[0127] Among them, the missing information state of the image data sample can represent the missing information of the object in the image data sample.
[0128] The information loss state of the image data sample can manifest in various ways. For example, the information loss state of the image data sample can be the degree of information loss of the objects in the image data sample, or the information loss category of the image data sample. The specific information loss states of the image data are similar to those mentioned above, and will not be elaborated on here.
[0129] S309, Select image data samples that meet the conditions for missing information from the multiple image data samples to obtain multiple selected image data samples.
[0130] The conditions for satisfying the missing information state here are similar to those mentioned earlier, and will not be repeated here.
[0131] S310, use the trained information missing model as the information missing model to be trained next time, use the trained image recognition model as the image recognition model to be trained next time, and use the selected multiple image data samples as multiple image data samples for training, and return to step S302.
[0132] It is understood that in this embodiment, after each round of training of the information missing model and the image recognition model, the image data samples will be screened. After the image data samples that can help optimize the two models are screened out, the training of the information missing model and the image recognition model will be repeated using the screened image data samples. This process will continue until the model training termination condition is met.
[0133] like Figure 4 As shown, it illustrates a schematic diagram of the principle of the iterative training model with missing information and the image recognition model in this application.
[0134] Depend on Figure 4 As can be seen, multiple image data samples labeled with object categories are input into the image recognition model 401 to perform object category recognition (e.g., Figure 4 (The direction indicated by the "reasoning" line in the middle), and train the image recognition model.
[0135] Based on this, the image data samples are labeled with missing state tags according to the probability of the target object category to which the object belongs in the image data samples output by the image recognition model 401. For example... Figure 4 This is illustrated in the branch of quantization labeling. Based on this, the information missing model 402 is trained using image data samples labeled with missing state labels.
[0136] Furthermore, the trained information missing model is used to predict the information missing state of the image data samples, and the image data samples are filtered based on the information missing state of the image data samples. Then, the filtered image data samples are used to continue training the image recognition model 401. This process is repeated until the model training termination condition is met.
[0137] As introduced above, if the information missing state of an image data sample meets the conditions, it indicates the degree of information missing of the object in the image data sample. The impact on the image recognition model's identification of the object category in the image data sample is relatively small, and it can be considered that the image recognition model can accurately identify the object category in the image data sample.
[0138] Based on this, this application selects multiple image data samples that meet the conditions for missing information states, and repeatedly trains the missing information model and the image recognition model using the selected multiple image data samples. This is beneficial for accurately determining the object category of the selected image data samples using the image recognition model, and naturally also beneficial for accurately determining the missing state label of the image data samples based on the probability of each object category to which the objects in the image data samples belong. Thus, through continuous iterative training, the prediction accuracy of both the missing information model and the image recognition model is gradually improved.
[0139] In this application, in order to efficiently identify the information missing state of image data before the image recognition model recognizes the image data, the information missing model is a lightweight model compared to the image recognition model.
[0140] For example, both the information missing model and the image recognition model are network models, but the information missing model has fewer network layers than the image recognition model.
[0141] Understandably, the number of network layers in a network model determines its structural complexity. The fewer the network layers, the simpler the model's structure and the faster its data processing speed. Therefore, using a network model with relatively few network layers is beneficial for information loss models to quickly determine the information loss state of image data, avoiding spending too much time in the information loss state recognition stage, which would affect the efficiency of object category recognition.
[0142] It is understood that in the above embodiments of this application, before the image recognition model recognizes the image data, the information missing state of the image data is first identified using the information missing model. In fact, the image data is first screened or filtered based on the information missing state of the image data. Only image data whose information missing state meets the conditions will be recognized.
[0143] In this application, image data whose information missing status does not meet the conditions are determined to be image data that cannot be recognized. Specifically, image data whose information missing status does not meet the conditions can be filtered out, such as by deletion, and there are no restrictions on this.
[0144] For ease of understanding, the following uses the information missing state identified by the information missing model as the degree of information missing as an example, and combines a specific implementation to illustrate the solution of this application.
[0145] like Figure 5 As shown, it illustrates another flowchart of an image recognition method provided in this application embodiment. The method of this embodiment may include:
[0146] S501, Obtain image data of the object to be identified.
[0147] S502, use the information missing model to determine the degree of information missing in the image data.
[0148] The degree of information missing indicates the extent or probability of missing information about the object to be identified in the image data. Furthermore, it indicates the likelihood that the image data can be accurately identified by an image recognition model; the lower the degree of information missing, the more accurately the image recognition model can identify the object category.
[0149] S503, detect whether the degree of missing information is lower than the set degree. If yes, proceed to step S504; otherwise, filter out the image data.
[0150] The degree setting can be configured as needed, such as a degree threshold, without any restrictions.
[0151] If the information loss model is not lower than a set level, it indicates that a significant amount of information about the object in the image data is missing. This prevents the subsequent image recognition model from accurately identifying the object's category. Therefore, the image data can be considered unrecognizable, i.e., invalid image data. Inputting this image data into a subsequent image recognition model will only increase the amount of data that the model needs to process.
[0152] In particular, when there is a large amount of image data that needs to be recognized, using an image recognition model to identify some invalid image data will inevitably lead to a lot of wasted resources and consume a lot of recognition time.
[0153] In this application, before the image recognition model recognizes the image data, it filters out image data with severe missing information about some objects. This can effectively reduce the number of invalid image data processed by the image recognition model, reduce some invalid recognitions by the image recognition model, and thus reduce the amount of data processing.
[0154] S504, The image recognition model is used to perform image recognition on the image data to determine the object category of the object to be recognized in the image data.
[0155] Corresponding to the image recognition method provided in the embodiments of this application, the embodiments of this application also provide an image recognition device.
[0156] like Figure 6 The diagram illustrates a structural composition of an image recognition device provided in this embodiment. The device in this embodiment may include:
[0157] Image acquisition unit 601 is used to acquire image data of the object to be identified;
[0158] The missing information determination unit 602 is used to determine the information missing status of the image data using an information missing model. The information missing status of the image data represents the information missing situation of the object to be identified in the image data.
[0159] The image recognition unit 603 is used to perform image recognition on the image data using the image recognition model if the information missing state of the image data meets the conditions, so as to determine the object category of the object to be identified in the image data; wherein, the information missing model is trained using multiple image data samples labeled with missing state labels, and the missing state labels are determined according to the image recognition model.
[0160] In one possible implementation, the image recognition model is trained using multiple image data samples labeled with object category labels, which are used to characterize the object category of the object in the image data sample.
[0161] Furthermore, the information missing model can be trained using multiple image data samples labeled with missing state tags and used to train the image recognition model.
[0162] The missing status label of the image data sample is determined based on the probability that the object in the image data sample identified by the image recognition model belongs to the target object category. The target object category is the object category whose probability satisfies the set conditions among at least one object category to which the object is identified by the image recognition model.
[0163] In yet another possible implementation, the device further includes:
[0164] The sample acquisition unit is used to acquire multiple image data samples labeled with object category tags before the image acquisition unit acquires image data;
[0165] The first training unit is used to train the image recognition model to be trained using the multiple image data samples based on the object category labels annotated by the image data samples, so as to obtain the trained image recognition model.
[0166] The category prediction unit is used to determine, using a trained image recognition model, at least one object category that an object in the image data sample may belong to, and the probability that the object belongs to the at least one object category respectively.
[0167] The category determination unit is used to determine the target object category whose probability satisfies a set condition from at least one object category to which the object may belong in the image data sample;
[0168] A labeling unit is used to label the missing state of the image data sample based on the probability of the target object category;
[0169] The second training unit is used to train the missing information model to be trained based on each of the image data samples labeled with missing state labels, so as to obtain the trained missing information model.
[0170] In yet another possible implementation, the device further includes:
[0171] The sample state determination unit is used to determine the information missing state of the image data sample by means of the trained information missing model after the second training unit has obtained the trained information missing model, if the model training termination condition has not yet been reached.
[0172] A sample filtering unit is used to filter out image data samples whose information missing state meets the conditions from the plurality of image data samples, thereby obtaining the plurality of filtered image data samples.
[0173] The retraining trigger unit is used to use the trained information-deficient model as the information-deficient model to be trained next, the trained image recognition model as the image recognition model to be trained next, and the selected multiple image data samples as multiple image data samples for training, and return to execute the operation of the first training unit until the model training termination condition is reached.
[0174] In another possible implementation, both the information missing model and the image recognition model are network models, and the number of network layers in the information missing model is less than that in the image recognition model.
[0175] In yet another possible implementation, the device further includes:
[0176] An image filtering unit is used to determine the image data as image data that cannot be recognized if the information missing state of the image data does not meet the conditions.
[0177] In another possible implementation, the missing information state of the image data determined by the missing information determination unit includes: the degree of missing information of the image data or the category of missing information of the image data, wherein the missing information category belongs to one of two categories: missing information and no missing information.
[0178] When the image recognition unit determines that the information missing state of the image data meets the conditions, specifically: the degree of information missing in the image data is lower than a set degree; or, the information missing category of the image data is the information not missing category, the information missing state of the image data is determined to meet the conditions.
[0179] Furthermore, this application also provides an electronic device, such as Figure 7 As shown, it illustrates a schematic diagram of the composition structure of the electronic device. The electronic device can be any type of electronic device, and the electronic device includes at least a processor 701 and a memory 702.
[0180] The processor 701 is used to execute the image recognition method as described in any of the above embodiments.
[0181] The memory 702 is used to store the programs required for the processor to perform operations.
[0182] It is understood that the electronic device may also include a display unit 703 and an input unit 704.
[0183] Of course, the electronic device can also have more than Figure 7 There are no restrictions on the number of components, whether more or fewer.
[0184] On the other hand, this application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the image recognition method as described in any of the above embodiments.
[0185] This application also proposes a computer program comprising computer instructions stored in a computer-readable storage medium. When executed on an electronic device, the computer program performs the image recognition method as described in any of the above embodiments.
[0186] It is understood that in this application, the terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar parts and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that illustrated herein.
[0187] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Furthermore, the features described in the various embodiments of this specification can be substituted or combined with each other, enabling those skilled in the art to implement or use this application. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0188] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0189] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0190] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An image recognition method, comprising: Obtain image data of the object to be identified; The information missing state of the image data is determined using an information missing model, and the information missing state of the image data characterizes the information missing situation of the object to be identified in the image data. If the information missing state of the image data meets the conditions, an image recognition model is used to perform image recognition on the image data to determine the object category of the object to be identified in the image data. The information missing model is trained using multiple image data samples labeled with missing status tags. The missing status tags are determined based on the probability that an object in the image data sample identified by the image recognition model belongs to a target object category. The target object category is an object category whose probability satisfies a set condition among at least one object category to which the object is identified by the image recognition model.
2. The method according to claim 1, wherein, The image recognition model is trained using multiple image data samples labeled with object category tags, whereby the object category tags are used to characterize the object category of the objects in the image data samples.
3. The method according to claim 2, wherein the information missing model is obtained by training multiple image data samples labeled with missing state tags and used to train the image recognition model.
4. The method according to claim 3, wherein the image recognition model and the information missing model are trained in the following manner: Obtain multiple image data samples labeled with object category tags; Based on the object category labels annotated by the image data samples, the image recognition model to be trained is trained using the multiple image data samples to obtain the trained image recognition model; Using a trained image recognition model, determine at least one object category to which an object in the image data sample may belong, and the probability that the object belongs to each of the at least one object category; From at least one object category to which an object may belong in the image data sample, determine the target object category whose probability satisfies the set conditions. Based on the probability of the target object category, label the missing state of the image data sample; The information missing model to be trained is obtained by training each image data sample labeled with missing state labels.
5. The method according to claim 4, further comprising, after obtaining the trained information missing model: If the model training termination condition has not yet been reached, the information missing status of the image data sample is determined using the trained information missing model. From the plurality of image data samples, image data samples whose information missing state meets the conditions are selected to obtain the plurality of selected image data samples; The trained information-deficient model is used as the information-deficient model to be trained next, the trained image recognition model is used as the image recognition model to be trained next, and multiple filtered image data samples are used as multiple image data samples for training. The operation of returning to execute the object category label based on the image data sample is performed, and the image recognition model to be trained is trained using the multiple image data samples until the model training termination condition is reached.
6. The method according to claim 2, wherein both the information missing model and the image recognition model are network models, and the number of network layers in the information missing model is less than the number of network layers in the image recognition model.
7. The method according to claim 1, further comprising: If the information missing status of the image data does not meet the conditions, the image data is determined to be image data that cannot be recognized.
8. The method according to claim 1, wherein the information missing state of the image data includes: The degree of information missing in the image data or the category of information missing in the image data, wherein the information missing category belongs to one of two categories: information missing class and information not missing class; The missing information state of the image data meets the following conditions: The degree of information loss in the image data is lower than the set level; or, The image data is classified as missing information in the "not missing information" category.
9. An image recognition device, comprising: The image acquisition unit is used to acquire image data of the object to be identified; The missing information determination unit is used to determine the missing information state of the image data using an information missing information model, wherein the missing information state of the image data characterizes the missing information of the object to be identified in the image data. An image recognition unit is configured to perform image recognition on the image data using an image recognition model if the information missing state of the image data meets certain conditions, so as to determine the object category of the object to be identified in the image data; wherein, the information missing model is obtained by training multiple image data samples labeled with missing state labels, the missing state labels are determined based on the probability that the object in the image data sample identified by the image recognition model belongs to a target object category, and the target object category is the object category whose probability satisfies a set condition among at least one object category to which the object is identified by the image recognition model.
10. The apparatus according to claim 9, wherein, The image recognition model is trained using multiple image data samples labeled with object category labels, whereby the object category labels are used to characterize the object category of the objects in the image data samples.
Citation Information
Patent Citations
Face quality label value obtaining method and device, server and storage medium
CN111814759A
Image determination method and device, storage medium and electronic equipment
CN113408496A
