A target identification method and device
By combining the main attribute, sub-attribute and auxiliary attribute recognition branches in the target recognition model, and using the trained historical image set for image recognition, the impact of difficult-to-recognize images on the recognition effect is solved, and the accuracy of target recognition is improved.
Patent Information
- Application Number
- CN202110968767.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-23
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-08-23
AI Technical Summary
In image processing, especially during the target recognition process, difficult-to-recognize images (such as people wearing black hats) lead to reduced algorithm recognition effects, making it difficult to improve the accuracy of target recognition.
The target recognition model is adopted, which includes the main attribute recognition branch, the sub-attribute recognition branch and the auxiliary attribute recognition branch. By training different historical image sets, the main attribute, sub-attribute and auxiliary attribute are identified separately, and based on the sub-attribute and auxiliary attributes. The result corrects the main attribute recognition result to improve the recognition accuracy.
Through the synergistic recognition branch, the attribute feature recognition effect of the target to be identified is improved, the accuracy of target recognition is improved, and the impact of difficult-to-recognize images on the overall recognition effect is reduced.
Smart Images

Figure CN113762108B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a target recognition method and device. Background Art
[0002] When performing target recognition on an image, if the image includes a worker who is working while wearing a hat and an apron, the hat can be taken as the target to be recognized, and whether the worker is wearing a hat can be taken as the main attribute of the target to be recognized; alternatively, the apron can be taken as the target to be recognized, and whether the worker is wearing an apron can be taken as the main attribute of the target to be recognized.
[0003] In addition, when performing target recognition, there are often some difficult-to-recognize images. For example, if the hair color of a person wearing a hat is black and the color of the hat is also black, it is easy to cause the boundary of the black hat to be blurred, making the hat difficult to recognize. These difficult-to-recognize images will reduce the overall effect of algorithm recognition.
[0004] Therefore, how to avoid the influence of difficult-to-recognize images on the overall recognition effect and improve the accuracy of target recognition is a technical problem that needs to be solved urgently by technical personnel in this field. Summary of the invention
[0005] The embodiments of the present invention provide a target recognition method and device to avoid the influence of difficult-to-recognize images on the overall recognition effect and improve the accuracy of target recognition.
[0006] In a first aspect, an embodiment of the present invention provides a target recognition method, comprising:
[0007] Inputting the image to be processed into a trained target recognition model, wherein the target recognition model at least includes a main attribute recognition branch, a sub-attribute recognition branch and an auxiliary attribute recognition branch; the main attribute recognition branch is obtained by training using a first historical image set, and the auxiliary attribute recognition branch is obtained by training using a second historical image set, and the second historical image set is a subset of the first historical image set;
[0008] The main attribute recognition branch is used to recognize the main attribute of the target to be recognized, and obtain a first main attribute recognition result; and the sub-attribute recognition branch is used to recognize the sub-attribute of the main attribute, and obtain a sub-attribute recognition result; and the auxiliary attribute recognition branch is used to recognize the main attribute of the target to be recognized, and obtain a second main attribute recognition result;
[0009] Based on the sub-attribute recognition result and the second main attribute recognition result, the first main attribute recognition result is corrected, and the corrected first main attribute recognition result is determined as the attribute feature of the target to be recognized.
[0010] In a second aspect, an embodiment of the present invention provides a target recognition device, including:
[0011] A memory for storing program instructions;
[0012] The processor is used to call the program instructions stored in the memory and execute the above-mentioned target recognition method provided by the embodiment of the present invention according to the obtained program.
[0013] In a third aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium stores executable instructions, and the executable instructions are used to enable a target recognition device to execute the above-mentioned target recognition method provided by the embodiment of the present invention.
[0014] The beneficial effects of the present invention are as follows:
[0015] An embodiment of the present invention provides a target recognition method and device. Since the target recognition model includes at least: a main attribute recognition branch, a sub-attribute recognition branch and an auxiliary attribute recognition branch, when the target recognition model is used to perform target recognition, corresponding recognition results can be obtained respectively, and the first main attribute recognition result can be corrected based on the sub-attribute recognition result and the second main attribute recognition result. Finally, the corrected first main attribute recognition result is used to determine the attribute feature of the target to be recognized, that is, the final result of the target recognition is the result of the coordinated action of the three branches; therefore, through the auxiliary attribute recognition branch, the recognition effect of the attribute feature of the target to be recognized can be improved, so that the final result of the target recognition is more reliable and accurate, which is conducive to eliminating the influence of difficult-to-recognize images on the overall recognition effect, and improves the accuracy of target recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart of a target recognition method provided in an embodiment of the present invention;
[0017] Figure 2 A schematic diagram of the structure of a trained initial target recognition model provided in an embodiment of the present invention;
[0018] Figure 3 A schematic diagram of the structure of a target recognition model provided in an embodiment of the present invention;
[0019] Figure 4 A schematic diagram of a target recognition process provided in an embodiment of the present invention;
[0020] Figure 5 A schematic diagram of an image including a non-black hat provided in an embodiment of the present invention;
[0021] Figure 6 A schematic diagram of an image including a black hat provided in an embodiment of the present invention;
[0022] Figure 7 A schematic diagram of another target recognition process provided in an embodiment of the present invention;
[0023] Figure 8 This is a schematic diagram of an apron with a different color from a top provided in an embodiment of the present invention;
[0024] Fig. 9 This is a schematic diagram showing that the color of the apron is the same as the color of the top provided in an embodiment of the present invention;
[0025] Fig.10 A schematic diagram of the structure of a target recognition device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the accompanying drawings to describe in detail the specific implementation of a target recognition method and device provided by an embodiment of the present invention. It should be noted that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0027] The embodiment of the present invention provides a target recognition method, such as Figure 1 As shown, this may include:
[0028] S101, inputting the image to be processed into a trained target recognition model, wherein the target recognition model includes at least a main attribute recognition branch, a sub-attribute recognition branch and an auxiliary attribute recognition branch; the main attribute recognition branch is obtained by training using a first historical image set, and the auxiliary attribute recognition branch is obtained by training using a second historical image set, and the second historical image set is a subset of the first historical image set;
[0029] S102, using the main attribute recognition branch to recognize the main attribute of the target to be recognized, and obtaining a first main attribute recognition result; and using the sub-attribute recognition branch to recognize the sub-attribute of the main attribute, and obtaining a sub-attribute recognition result; and using the auxiliary attribute recognition branch to recognize the main attribute of the target to be recognized, and obtaining a second main attribute recognition result;
[0030] Specifically, taking the target to be identified as a hat as an example, the main attribute of the target to be identified can be understood as: whether to wear a hat, the sub-attribute of the main attribute can be understood as: the color of the hat or the shape of the hat, etc., and the auxiliary attribute of the target to be identified can be understood as: whether to wear a hat.
[0031] The difference between the first primary attribute recognition result and the second primary attribute recognition result is that the recognition accuracy rates for whether a hat is worn are different, and the accuracy rate of the second primary attribute recognition result may be greater than or equal to the accuracy rate of the first primary attribute recognition result.
[0032] Furthermore, the sub-attributes of the main attribute may include multiple sub-attributes such as, but not limited to, color, shape, style, and orientation, etc., which may be selected and set according to actual needs and are not limited here.
[0033] S103: Based on the sub-attribute recognition result and the second main attribute recognition result, the first main attribute recognition result is corrected, and the corrected first main attribute recognition result is determined as the attribute feature of the target to be recognized.
[0034] In this way, since the target recognition model includes at least: a main attribute recognition branch, a sub-attribute recognition branch and an auxiliary attribute recognition branch, when the target recognition model is used for target recognition, corresponding recognition results can be obtained respectively, and the first main attribute recognition result can be corrected based on the sub-attribute recognition result and the second main attribute recognition result, and finally the corrected first main attribute recognition result is used to determine the attribute feature of the target to be identified, that is, the final result of target recognition is the result of the synergistic effect of the three branches; thus, through the auxiliary attribute recognition branch, the recognition effect of the attribute feature of the target to be identified can be improved, so that the final result of target recognition is more reliable and accurate, which is conducive to eliminating the influence of difficult-to-identify images on the overall recognition effect and improving the accuracy of target recognition.
[0035] Optionally, in an embodiment of the present invention, the second historical image set includes difficult-to-identify historical images; wherein,
[0036] The deviation value between the first main attribute prediction result of the difficult-to-identify historical image and the first main attribute labeling result of the difficult-to-identify historical image is greater than or equal to the deviation value threshold; the first main attribute prediction result is: the result obtained by using the main attribute recognition branch to identify the main attributes of the target to be identified contained in the difficult-to-identify historical image.
[0037] Among them, taking the case where the target to be identified is a hat, and the main attribute of the target to be identified is whether to wear a hat, for a certain image, the first main attribute prediction result may include: the probability of wearing a hat, and the prediction result is obtained when the main attribute recognition branch recognizes the image, so the prediction result (that is, the probability of wearing a hat) is related to the recognition accuracy of the main attribute recognition branch;
[0038] Assuming that the image includes a hat, if the recognition accuracy is high, the first main attribute prediction result is high, and if the recognition accuracy is low, the first main attribute prediction result is low; and the prediction result may range from 0 to 100%.
[0039] The first main attribute labeling result may also include: the probability of wearing a hat, but since this result is a pre-labeled result and is related to the actual content of the image, the labeling result may be 0 or 100%;
[0040] That is, assuming that the image includes a hat, the first main attribute labeling result may be 100%; or, if the image does not include a hat, the first main attribute labeling result may be 0.
[0041] As for the deviation value threshold, it can be set according to the accuracy requirement and actual needs during the specific setting, and is not limited here.
[0042] For example, taking the target to be identified as a hat, and the main attribute of the target to be identified as whether to wear a hat, assuming that an image includes a hat, and the first main attribute prediction result of the image is still 20%, and the first main attribute labeling result of the image is 100%, if the deviation value threshold is assumed to be 20%, because the deviation between the first main attribute prediction result and the first main attribute labeling result is 80% and greater than the deviation value threshold, the image can be considered to be a difficult-to-identify historical image, and when the main attribute recognition branch is used to identify the image, the recognition accuracy of whether the image is wearing a hat is low.
[0043] In this way, since the second historical image set includes difficult-to-identify historical images, and the auxiliary attribute recognition branch is trained using the second historical image set, when the auxiliary attribute recognition branch is used to identify the main attributes of the target to be identified, the accuracy of the second main attribute recognition result will be higher than the accuracy of the first main attribute recognition result. Therefore, the second main attribute recognition result can be used for auxiliary judgment to achieve accurate recognition of difficult-to-identify images.
[0044] Optionally, in the embodiment of the present invention, the second historical image set further includes non-target images, where the non-target images are historical images that do not include the target to be identified.
[0045] In this way, when the second historical image set is used to train the auxiliary attribute recognition branch, the recognition accuracy of the target to be recognized can be increased, which is conducive to subsequent auxiliary judgment through the second main attribute recognition result to improve the target recognition effect.
[0046] Optionally, in the embodiment of the present invention, based on the sub-attribute recognition result and the second main attribute recognition result, the first main attribute recognition result is corrected, and the corrected first main attribute recognition result is determined as the attribute feature of the target to be recognized, including:
[0047] Based on the similarity between the sub-attribute recognition result and the determination result of the related sub-attribute, determining the second main attribute recognition result or the first main attribute recognition result as the attribute feature of the target to be recognized;
[0048] The relevant sub-attributes are: common sub-attributes of the target to be identified and the reference target, and the reference target is a target in the image to be processed that has a common boundary with the target to be identified.
[0049] Specifically, for the reference target, take the target to be identified as a hat as an example. Since hats are usually worn on the head and they usually have a common boundary with the hair, the hair can be used as the reference target. The relevant sub-attribute is the color of the hair, and the sub-attribute of the main attribute is the color of the hat.
[0050] Alternatively, taking the apron as an example, since the target to be identified is usually worn on the body, the apron usually has a common boundary with a top, so the top can be used as a reference target, the relevant sub-attribute is the color of the top, and the sub-attribute of the main attribute is the color of the apron.
[0051] In this way, based on the degree of similarity between the sub-attribute recognition result and the determination result of the related sub-attribute, it can be determined whether to use the first main attribute recognition result as the attribute feature of the target to be identified or the second main attribute recognition result as the attribute feature of the target to be identified, thereby improving the recognition processing result of the main attribute and thus improving the accuracy of recognition.
[0052] Optionally, in the embodiment of the present invention, based on the similarity between the sub-attribute recognition result and the determination result of the related sub-attribute, determining the second main attribute recognition result or the first main attribute recognition result as the attribute feature of the target to be recognized includes:
[0053] If the sub-attribute recognition result is the same as the related sub-attribute determination result, the second main attribute recognition result is determined as the attribute feature of the target to be recognized;
[0054] If the sub-attribute recognition result and the related sub-attribute determination result are different, the first main attribute recognition result is determined as the attribute feature of the target to be identified.
[0055] Among them, take the target to be identified as a hat, and the main attribute of the target to be identified is whether it is wearing a hat, and the sub-attribute of the main attribute is color as an example, then:
[0056] If the sub-attribute recognition result and the determination result of the related sub-attribute are the same, it can be understood that: the color of the hat is the same as the color of the hair, which makes the border of the hat blurred. When the main attribute recognition branch is used for recognition, it may be difficult to distinguish whether the person is wearing a hat. When the auxiliary attribute recognition branch is used for recognition, because the second historical image set used in the training includes difficult-to-recognize historical images, that is, targeted training is performed on images with the same or similar hat colors and hair colors, the accuracy of the second main attribute recognition result will be significantly higher than the accuracy of the first main attribute recognition result. Therefore, the second main attribute recognition result can be determined as the attribute feature of the target to be recognized.
[0057] If the sub-attribute recognition result is different from the determination result of the related sub-attribute, it can be understood that the color of the hat is different from the color of the hair, which makes the boundary of the hat clearer. When the main attribute recognition branch is used for recognition, it can be clearly distinguished whether the person is wearing a hat. Therefore, the accuracy of the first main attribute recognition result is higher. At this time, the first main attribute recognition result can be determined as the attribute feature of the target to be identified.
[0058] In this way, the first main attribute recognition result or the second main attribute recognition result can be selected according to the similarity between the sub-attribute recognition result and the determination result of the related sub-attribute, thereby effectively improving the accuracy of target recognition.
[0059] Optionally, in the embodiment of the present invention, before determining the second main attribute recognition result or the first main attribute recognition result as the attribute feature of the target to be recognized, the method further includes:
[0060] According to the sub-attributes of the preset reference target, determining the determination results of the relevant sub-attributes;
[0061] Alternatively, the sub-attribute of the reference target is identified using the relevant sub-attribute identification branch included in the target identification model, and the obtained relevant sub-attribute identification result is determined as the relevant sub-attribute determination result.
[0062] That is, when determining the determination result of the relevant sub-attribute, two methods can be used:
[0063] One of the ways is: determining according to the sub-attribute of the preset reference target, that is, determining according to the sub-attribute of the default reference target; for example, assuming that the reference target is hair and the target to be identified is a hat, because hats are generally worn on hair, and most of the hair is black, that is, hair is generally black by default, so at this time, the sub-attribute of the reference target can be preset to black;
[0064] Another way is to use the recognition result of the relevant sub-attribute recognition branch in the target recognition model (i.e., the relevant sub-attribute recognition result) to determine; for example, assuming that the reference target is a top and the target to be recognized is an apron, and the color of the top is not as universal as the hair, and the color of the top can be any color, so at this time it is necessary to use the relevant sub-attribute recognition branch in the target recognition model to identify the sub-attributes of the reference target and determine the relevant sub-attributes based on the recognition result.
[0065] In this way, the determination results of relevant sub-attributes can be determined according to different reference targets, thereby improving the flexibility of the design and meeting the needs of different application scenarios. At the same time, the amount of calculation can be reduced to a certain extent and the efficiency of recognition can be improved.
[0066] Optionally, in an embodiment of the present invention, the target recognition model is obtained by:
[0067] Determine a first historical image set; wherein each sample image in the first historical image set is provided with at least a label for a main attribute and a label for a sub-attribute;
[0068] The first historical image set is used to train a pre-established initial target recognition model; wherein the trained initial target recognition model includes: a main attribute recognition branch and a sub-attribute recognition branch;
[0069] Based on the main attribute, determining a second historical image set from the first historical image set;
[0070] An auxiliary attribute recognition branch is added to the trained initial target recognition model, and the second historical image set is used to train the trained initial target recognition model to which the auxiliary attribute recognition branch is added, so as to obtain a target recognition model.
[0071] Among them, the initial target recognition model before training can be pre-established as needed, and the structure of the initial target recognition model before training can be basically the same as that of the target recognition model, that is, the initial target recognition model before training can also include: main attribute recognition branch and sub-attribute recognition branch.
[0072] In this way, the determined target recognition model includes an auxiliary attribute recognition branch, which can assist in judging difficult-to-recognize images during target recognition, thereby achieving the purpose of improving the recognition effect of the main attribute.
[0073] Specifically, in an embodiment of the present invention, when a related sub-attribute identification branch is included in the target recognition model, each sample image in the first historical image set may be provided with a label for the related sub-attribute in addition to a label for the main attribute and a label for the sub-attribute, and the initial target recognition model before and after training includes the related sub-attribute identification branch, so that the final target recognition model includes the related sub-attribute identification branch, which is beneficial to obtaining the determination result of the related sub-attributes and realizing the determination of the attribute characteristics of the target to be identified.
[0074] Optionally, in an embodiment of the present invention, when the trained initial target recognition model includes: a shared layer structure and a branch structure, the second historical image set is used to train the trained initial target recognition model to which the auxiliary attribute recognition branch is added, specifically including:
[0075] The parameters of the shared layer structure are kept unchanged, and the auxiliary attribute recognition branch is trained using the second historical image set to determine the parameters of the auxiliary attribute recognition branch.
[0076] Specifically, the initial target recognition model after training is as follows: Figure 2 As shown, the model includes a shared layer structure and a branch structure, and the branch structure includes: a main attribute identification branch and a sub-attribute identification branch; wherein the shared layer structure is used to extract features, the branch structure is used to classify the main attributes, and each branch uses a fully connected layer, and the branches can remain consistent in structure.
[0077] And, the structure of the target recognition model is as follows Figure 3 As shown, the model can also include a shared layer structure and a branch structure, and the branch structure includes: a main attribute identification branch, a sub-attribute identification branch and an auxiliary attribute identification branch; wherein the shared layer structure is used to extract features, the branch structure is used to classify the main attributes, and each branch uses a fully connected layer, and the branches can remain consistent in structure.
[0078] In this way, when the second historical image set is used to train the model with the auxiliary attribute recognition branch added, there is no need to update the parameters of the shared layer structure. Only the parameters of the auxiliary attribute recognition branch need to be updated based on it, that is, the parameters of the shared layer structure are fixed, and only the auxiliary attribute recognition branch is trained. Therefore, fewer parameters need to be updated and the training speed is faster. At the same time, the second historical image set only includes the difficult-to-identify historical images and non-target images in the first historical image set. The data is relatively single and is not affected by other data, which can improve the recognition effect of the auxiliary attribute recognition branch on difficult-to-identify historical images.
[0079] It should be noted that, optionally, during target recognition, different targets to be recognized may have corresponding target recognition models, so as to improve recognition accuracy when the corresponding target recognition models are used for recognition.
[0080] The above method provided by the embodiment of the present invention is explained and illustrated in conjunction with specific embodiments below.
[0081] Example:
[0082] Combination Figure 4 shown.
[0083] The image to be processed ( Figure 4 Whether a person wears a hat is used as an example to illustrate, where the hat can be used as a target to be identified, and whether the person wears a hat is used as a sub-attribute of the target to be identified.
[0084] When the hat color is not similar to the hair color, such as Figure 5 As shown, the non-black hat is clearly different from the hair color and can be easily identified.
[0085] Since the black hat is similar to the black hair color (such as Figure 6 The black-haired person shown is wearing a black hat), so it is easy to be identified as having no hat, and the recognition effect is poor, so the color of the hat needs to be taken as a sub-attribute of the main attribute.
[0086] Therefore, the samples including black hats and no hats in the first historical image set can be selected as the second historical image set, and a branch (i.e., the auxiliary attribute recognition branch) can be trained using the second historical image set to obtain the final target recognition model.
[0087] Among them, Figure 4 In the target recognition model shown in , for this embodiment, the hat color branch is the sub-attribute recognition branch, the whether to wear a hat branch is the main attribute recognition branch, and the hat auxiliary branch is the auxiliary attribute recognition branch.
[0088] against Figure 4 In the process of correcting the recognition results:
[0089] If the target recognition model is used to recognize the image A1 to be processed, and the recognition result of the hat color branch ( Figure 4 The Z in the figure indicates that the hair color is black, and the two colors are the same, so the recognition result of the hat auxiliary branch ( Figure 4 denoted by B2 in the figure) as the attribute feature of the hat and output it to realize the correction and adjustment of the recognition result;
[0090] If the hat color branch recognition result Z is not black, which is different from the preset hair color, then the hat color branch recognition result ( Figure 4 denoted by B1 in the figure) as the attribute feature of the hat and output it.
[0091] Example:
[0092] Combination Figure 7 shown.
[0093] The image to be processed ( Figure 7 A2 represents whether a person wears an apron. The apron can be used as a target to be identified, and whether a person wears an apron can be used as a sub-attribute of the target to be identified.
[0094] When the color of the apron is different from that of the top, Figure 8 As shown in the figure, the boundary texture features of the apron are clear and easy to distinguish; when the color of the apron is similar or the same as the color of the top, such as Fig. 9 As shown, the boundary texture features of the apron are fuzzy and it is easier to identify that there is no apron. Therefore, this sample image is a difficult-to-identify historical image. It is difficult to determine whether an apron is worn. Therefore, the second historical image set needs to be divided according to the color of the apron and the color of the top.
[0095] Therefore, when determining the target recognition model, each sample image in the first historical image set is correspondingly provided with a label for the main attribute (i.e., a label for whether an apron is worn), a label for the sub-attribute (i.e., a label for the color of the apron), and a label for the related sub-attribute (i.e., a label for the color of the top);
[0096] In addition, difficult-to-identify historical images with similar or identical top and apron colors and non-target images without aprons are selected from the first historical image set to form a second historical image set, so as to facilitate the training of auxiliary attribute recognition branches, so that the target recognition model finally determined includes four branches, namely: a main attribute recognition branch (which can be understood as a recognition branch for whether an apron is worn), a sub-attribute recognition branch (which can be understood as a recognition branch for apron color), a related sub-attribute recognition branch (which can be understood as a recognition branch for top color) and an auxiliary attribute recognition branch (which can be understood as an auxiliary recognition branch for whether an apron is worn). The specific target recognition model can be as follows Figure 7 As shown;
[0097] Among them, Figure 7 In the target recognition model shown in , for this embodiment, the apron color branch is the sub-attribute recognition branch, the whether to wear an apron branch is the main attribute recognition branch, the apron auxiliary branch is the auxiliary attribute recognition branch, and the top color branch is the related sub-attribute recognition branch.
[0098] In the process of correcting the recognition results in 7:
[0099] If adopted Figure 7 The target recognition model shown recognizes the image A2 to be processed, and the color of the recognition result Z of the apron color branch is the same as the recognition result of the top color branch ( Figure 7 When the colors of the apron (indicated by X in the figure) are the same, the recognition result B2 of the apron auxiliary branch is used as the attribute feature of the apron and output to realize the correction of the target recognition result;
[0100] If the color of the recognition result Z of the apron color branch is different from the color of the recognition result X of the top color branch, the recognition result B1 of the whether to wear an apron branch is used as the attribute feature of the apron and output, that is, no correction is required at this time.
[0101] It should be noted that the above two embodiments are based on different targets to be identified. Although the target identification models used are slightly different, the overall structure is the same. Both need to include a shared layer structure and a branch structure. The branch structure includes: a main attribute identification branch, a sub-attribute identification branch, and an auxiliary attribute identification branch. For the relevant sub-attribute identification branch, it can be determined whether the branch is needed according to the different targets to be identified.
[0102] In other words, when determining the target recognition model, if the sample image is provided with a label for the relevant sub-attribute, then the obtained trained initial target recognition model and the target recognition model both include the relevant sub-attribute recognition branch; if the sample image is not provided with a label for the relevant sub-attribute, then the obtained trained initial target recognition model and the target recognition model both do not include the relevant sub-attribute recognition branch;
[0103] Therefore, based on the different targets to be identified, the structure of the target recognition model used may be the same or different, which needs to be determined according to the target to be identified and is not limited here.
[0104] Based on the same inventive concept, an embodiment of the present invention provides a target identification device. The implementation principle of the target identification device is similar to the implementation principle of the aforementioned target identification method. The specific implementation method of the target identification device can refer to the specific embodiment of the aforementioned target identification method, and the repeated parts will not be repeated.
[0105] Specifically, an embodiment of the present invention provides a target recognition device, such as Fig.10 As shown, this may include:
[0106] Memory 1001, used for storing program instructions;
[0107] The processor 1002 is used to call the program instructions stored in the memory 1001 and execute the above-mentioned target recognition method provided by the embodiment of the present invention according to the obtained program.
[0108] Based on the same inventive concept, an embodiment of the present invention provides a readable storage medium, which stores executable instructions. The executable instructions are used to enable a target recognition device to execute the above target recognition method provided by the embodiment of the present invention.
[0109] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A target recognition method, characterized in that: include: Inputting the image to be processed into a trained object recognition model, wherein the object recognition model at least includes a main attribute recognition branch, a sub-attribute recognition branch, and an auxiliary attribute recognition branch; The main attribute recognition branch is obtained by training using a first historical image set, and the auxiliary attribute recognition branch is obtained by training using a second historical image set, wherein the second historical image set is a subset of the first historical image set; The main attribute of the target to be identified is identified by using the main attribute identification branch to obtain a first main attribute identification result; and the sub-attribute identification branch is identified by using the sub-attribute identification branch to obtain a sub-attribute identification result; and the main attribute of the target to be identified is identified by using the auxiliary attribute identification branch to obtain a second main attribute identification result; Based on the similarity between the sub-attribute recognition result and the determination result of the related sub-attribute, determining the second main attribute recognition result or the first main attribute recognition result as the attribute feature of the target to be recognized; The relevant sub-attribute is: a common sub-attribute of the target to be identified and a reference target, wherein the reference target is a target in the image to be processed that has a common boundary with the target to be identified; Before determining the second main attribute recognition result or the first main attribute recognition result as the attribute feature of the target to be recognized, the method further includes: Determining the determination result of the relevant sub-attribute according to the preset sub-attribute of the reference target; Alternatively, the sub-attributes of the reference target are identified using the relevant sub-attribute identification branch included in the target identification model, and the obtained relevant sub-attribute identification result is determined as the relevant sub-attribute determination result.
2. The target recognition method according to claim 1, characterized in that: The second historical image set includes difficult-to-identify historical images; wherein, The deviation value between the first main attribute prediction result of the difficult-to-identify historical image and the first main attribute labeling result of the difficult-to-identify historical image is greater than or equal to the deviation value threshold; the first main attribute prediction result is: the result obtained by using the main attribute recognition branch to identify the main attribute of the target to be identified contained in the difficult-to-identify historical image.
3. The target recognition method according to claim 2, characterized in that: The second historical image set further includes non-target images, which are historical images that do not include the target to be identified.
4. The target recognition method according to claim 1, characterized in that: Determining the second main attribute recognition result or the first main attribute recognition result as the attribute feature of the target to be recognized based on the similarity between the sub-attribute recognition result and the determination result of the related sub-attribute includes: If the sub-attribute recognition result is the same as the related sub-attribute determination result, determining the second main attribute recognition result as the attribute feature of the target to be recognized; If the sub-attribute recognition result and the related sub-attribute determination result are different, the first main attribute recognition result is determined as the attribute feature of the target to be identified.
5. The target recognition method according to claim 1, characterized in that: The target recognition model is obtained by: Determine the first historical image set; wherein each sample image in the first historical image set is at least provided with a label for the main attribute and a label for the sub-attribute; The first historical image set is used to train a pre-established initial target recognition model; wherein the trained initial target recognition model includes: the main attribute recognition branch and the sub-attribute recognition branch; Based on the main attribute, determining the second historical image set from the first historical image set; An auxiliary attribute recognition branch is added to the trained initial target recognition model, and the second historical image set is used to train the trained initial target recognition model to which the auxiliary attribute recognition branch is added, so as to obtain the target recognition model.
6. The target recognition method according to claim 5, characterized in that: When the trained initial target recognition model includes: a shared layer structure and a branch structure, using the second historical image set to train the trained initial target recognition model to which the auxiliary attribute recognition branch is added specifically includes: The parameters of the shared layer structure are kept unchanged, and the auxiliary attribute recognition branch is trained using the second historical image set to determine the parameters of the auxiliary attribute recognition branch.
7. A target recognition device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory and execute the target recognition method according to any one of claims 1 to 6 according to the obtained program.
8. A readable storage medium, characterized in that: The readable storage medium stores executable instructions, and the executable instructions are used to: enable the target recognition device to execute the target recognition method according to any one of claims 1-6.
