Target identification method and device and storage medium
By performing target recognition and category correction on the image, and using the similarity of false detection and missed detection to correct the initial target category, the problems of false detection and missed detection in the existing technology are solved, and the accuracy and reliability of target recognition are improved.
Patent Information
- Application Number
- CN202411249615.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Existing target recognition technology leads to frequent false detections and missed detections when the image quality is poor, the target objects are blocked, or there are many types, which reduces the reliability of the recognition results.
By performing target recognition on the input image to be recognized, the initial target category and category confidence are obtained, the confidence threshold is calculated, image features are extracted, category correction is performed based on the similarity between false detections and missed detections, and false detection and missed detection target features are assigned to Correct the initial target category to reduce the probability of false detection or missed detection.
Without the need to retrain the model, the accuracy of target recognition is improved, the probability of false detection and missed detection is reduced, and the reliability of the recognition result is enhanced.
Smart Images

Figure CN118762201A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a target recognition method, device and storage medium. Background Art
[0002] In recent years, with the continuous development of science and technology, the classification of different targets in the target scene can help manage and analyze the target scene. Object detection is one of the basic tasks in the field of computer vision, and the final result of object detection is to give the position of the detected target in the form of a bounding box (Bbox) and the corresponding category of the detected target.
[0003] However, due to various reasons such as poor image quality, occlusion of target objects, a wide variety of target objects, and the accuracy of the trained target detection model not meeting the preset requirements, the target recognition results may suffer from false detections and missed detections, which reduces the reliability of the target recognition results. Summary of the invention
[0004] In order to solve the above technical problems, the present application at least provides a target recognition method, device and storage medium.
[0005] In a first aspect, the present application provides a target recognition method, which includes: performing target recognition on an input image to be recognized, obtaining an initial target category corresponding to each target object and a category confidence corresponding to the initial target category; obtaining a confidence threshold, and comparing the size relationship between the category confidence and the confidence threshold; and extracting image features corresponding to the target object in the input image to obtain input target features; if the category confidence is greater than the confidence threshold, obtaining falsely detected target features, calculating the similarity between the input target features and the falsely detected target features, obtaining the falsely detected similarity, and correcting the initial target category based on the size of the falsely detected similarity to obtain a category correction result; wherein the falsely detected target features are obtained by extracting features from an image that does not contain a specified target but detects a specified target; and / or, if the category confidence is not greater than the confidence threshold, obtaining missed target features, calculating the similarity between the input target features and the missed target features, obtaining the missed detection similarity, and correcting the initial target category based on the size of the missed detection similarity to obtain a category correction result; wherein the missed target features are obtained by extracting features from an image that contains a specified target but does not detect the specified target.
[0006] In one embodiment, the initial target category is corrected based on the size of the false detection similarity to obtain a category correction result, including: obtaining a false detection threshold; if the false detection similarity is greater than the false detection threshold, the initial target category corresponding to the target object is discarded; if the false detection similarity is not greater than the false detection threshold, the initial target category corresponding to the target object is retained.
[0007] In one embodiment, the initial target category is corrected based on the size of the false detection similarity to obtain a category correction result, including: obtaining a correct category and an error category corresponding to the false detection target feature, dividing the false detection target features corresponding to the same error category to obtain a plurality of candidate error category sets, dividing the false detection target features corresponding to the same correct category to obtain a plurality of candidate correct category sets; if the false detection similarity between the input target feature and at least one false detection target feature is greater than the false detection threshold, then obtaining a candidate correct category set corresponding to the false detection target feature whose false detection similarity is greater than the false detection threshold to obtain a matching correct category set; and, obtaining a candidate error category set whose error category is consistent with the initial target category of the input target feature to obtain a matching error category set; calculating the similarity between the input target feature and the false detection target feature in the matching correct category set to obtain a correct set similarity; and, calculating the similarity between the input target feature and the false detection target feature in the matching error category set to obtain an error set similarity; determining a correction strategy for the initial target category based on the size relationship between the correct set similarity and the error set similarity; and correcting the initial target category according to the correction strategy to obtain a category correction result.
[0008] In one embodiment, based on the size relationship between the correct set similarity and the error set similarity, a correction strategy for the initial target category is determined, including: if the correct set similarity is greater than the error set similarity, and the initial target category is consistent with the correct category corresponding to the matching correct category set, then the correction strategy is to retain the initial target category corresponding to the target object; if the correct set similarity is not greater than the error set similarity, then the correction strategy is to discard the initial target category corresponding to the target object.
[0009] In one embodiment, the initial target category is corrected based on the size of the missed detection similarity to obtain a category correction result, including: obtaining a missed detection threshold; if the missed detection similarity is greater than the missed detection threshold, the initial target category corresponding to the target object is modified according to the correct category preset by the missed detection target feature; if the missed detection similarity is not greater than the missed detection threshold, the initial target category corresponding to the target object is not modified.
[0010] In one embodiment, if the missed detection similarity is greater than the missed detection threshold, the initial target category corresponding to the target object is modified according to the correct category preset by the missed detection target feature, including: using the correct category corresponding to the missed detection target feature as the corrected target category of the target object, and using the missed detection similarity as the category confidence corresponding to the corrected target category to obtain a category correction result.
[0011] In one embodiment, obtaining a confidence threshold includes: obtaining a category confidence of a target category corresponding to missed target features and / or falsely detected target features; and calculating a confidence threshold based on the category confidence corresponding to the missed target features and / or falsely detected target features.
[0012] In one embodiment, multiple recognition computing units are deployed; target recognition is performed on an input image to be recognized to obtain an initial target category corresponding to each target object and a category confidence corresponding to the initial target category, including: obtaining the computational load of each recognition computing unit; determining to select a target computing unit from multiple recognition computing units based on the computational load of each recognition computing unit; sending the input image to be recognized to the target computing unit so that the target computing unit performs target recognition on the input image to obtain an initial target category corresponding to each target object and a category confidence corresponding to the initial target category.
[0013] The second aspect of the present application provides a target recognition device, which includes: an initial recognition module, which is used to perform target recognition on an input image to be recognized, and obtain an initial target category corresponding to each target object and a category confidence corresponding to the initial target category; a threshold comparison and feature extraction module, which is used to obtain a confidence threshold, compare the size relationship between the category confidence and the confidence threshold; and extract image features corresponding to the target object in the input image to obtain input target features; a false detection re-verification module, which is used to obtain false detection target features if the category confidence is greater than the confidence threshold, calculate the similarity between the input target features and the false detection target features, and obtain False detection similarity, based on the size of the false detection similarity, the initial target category is corrected to obtain a category correction result; wherein, the false detection target feature is obtained by extracting features of an image that does not contain the specified target but detects the specified target; and / or, a missed detection re-verification module is used to obtain the missed detection target feature if the category confidence is not greater than the confidence threshold, calculate the similarity between the input target feature and the missed detection target feature, and obtain the missed detection similarity, and based on the size of the missed detection similarity, the initial target category is corrected to obtain a category correction result; wherein, the missed detection target feature is obtained by extracting features of an image that contains the specified target but does not detect the specified target.
[0014] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned target recognition method.
[0015] A fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, which implement the above-mentioned target identification method when the program instructions are executed by a processor.
[0016] The above scheme performs target recognition on the input image to be recognized to obtain the initial target category corresponding to each target object and the category confidence corresponding to the initial target category; obtains the confidence threshold, compares the size relationship between the category confidence and the confidence threshold; and extracts the image features corresponding to the target object in the input image to obtain the input target features; if the category confidence is greater than the confidence threshold, the similarity between the input target features and the falsely detected target features is calculated to obtain the false detection similarity, and the initial target category is corrected based on the size of the false detection similarity; and / or, if the category confidence is not greater than the confidence threshold, the similarity between the input target features and the missed detection target features is calculated to obtain the missed detection similarity, and the initial target category is corrected based on the size of the missed detection similarity, so as to divide the target objects into objects that need to be falsely detected and re-inspected and objects that are missed and re-inspected according to the category confidence corresponding to the initial target category, thereby determining whether to use the falsely detected target features to correct the initial target category, or to use the missed detection target features to correct the initial target category, so as to reduce the probability of false detection or missed detection without retraining the model.
[0017] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0019] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application; Figure 2 is a flow chart of a target recognition method shown in an exemplary embodiment of the present application; Figure 3 is a schematic diagram of obtaining features of a misdetected target and / or features of a missed detected target, shown in an exemplary embodiment of the present application; Figure 4 is a schematic diagram of target recognition shown in an exemplary embodiment of the present application; Figure 5 is a schematic diagram showing an exemplary embodiment of the present application showing a comparison module rechecking and correcting an initial target category; Figure 6 is a schematic diagram of an identification calculation unit shown in an exemplary embodiment of the present application; Figure 7 is a block diagram of a target recognition device shown in an exemplary embodiment of the present application; Figure 8 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present application; Fig. 9 It is a schematic diagram of the structure of a computer-readable storage medium shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0020] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0021] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0022] The term "and / or" in this article is only an association information describing the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and next associated objects are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0023] The target recognition method provided in the embodiment of the present application is described below.
[0024] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment may include a terminal 110 and a server 120, and the terminal 110 and the server 120 are connected to each other in communication.
[0025] The number of the terminal 110 may be one or more. The terminal 110 may be a camera, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, etc., but is not limited thereto.
[0026] Server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0027] In one example, the server 120 may perform target recognition for the input image to be recognized obtained from the terminal 110 to obtain a target recognition result. Of course, the server 120 may store the target recognition result locally, transmit it back to the terminal 110, or transmit it to other terminals.
[0028] In one example, a client of a target application is installed and running in the terminal 110. For example, the target application may be an application that provides a target recognition function. The target recognition result is obtained by performing target recognition on the input image to be recognized through the client of the target application. The server 120 may be a background server of the target application, which is used to provide background services for the client of the target application.
[0029] In the target recognition method provided in the embodiment of the present application, the execution subject of each step can be the terminal 110, or the server 120, or the terminal 110 and the server 120 can cooperate with each other to execute, that is, part of the steps of the method are executed by the terminal 110 and the other steps are executed by the server 120.
[0030] See also Figure 2 , Figure 2 is a flow chart of a target recognition method shown in an exemplary embodiment of the present application. The target recognition method can be applied to Figure 1 It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.
[0031] like Figure 2 As shown, the target recognition method at least includes steps S210 to S240, which are described in detail as follows: Step S210: performing target recognition on the input image to be recognized, and obtaining an initial target category corresponding to each target object and a category confidence corresponding to the initial target category.
[0032] Among them, the input image can be pre-stored in the memory, and the server obtains the input image to be identified from the memory; it can also be that the terminal captures the image of the target scene and sends the generated video stream data to the server, and the server uses the image frame in the received video stream data as the input image to be identified. This application does not limit this.
[0033] In addition, the types of input images include but are not limited to visible light images, infrared images, X-ray images, etc., which are not limited in this application.
[0034] The pre-trained target recognition model is used to perform target recognition on the input image to be recognized, and the category and position of the target object contained in the recognized input image are output. The category of the recognized target object is used as the initial target category, and the initial target category corresponds to the category confidence.
[0035] Among them, the target recognition model has the function of performing target recognition on the input image. The target recognition model can be implemented based on network architectures such as Convolutional Neural Networks (CNN) and Recurrent Neural Networks (RNN), and this application does not limit this.
[0036] For example, the target recognition model identifies the location of the target object contained in the input image, and calculates the probability that the target object belongs to each category, and selects the category with the highest probability as the initial target category of the target object output by the model, and its corresponding probability as the category confidence corresponding to the initial target category.
[0037] Step S220: obtaining a confidence threshold, comparing the size relationship between the category confidence and the confidence threshold; and extracting image features corresponding to the target object in the input image to obtain input target features.
[0038] The confidence threshold may be a value preset based on experience, or a value flexibly calculated based on actual conditions.
[0039] Exemplarily, the category confidence of the target category corresponding to the missed target feature and / or the falsely detected target feature is obtained; and the confidence threshold is calculated based on the category confidence corresponding to the missed target feature and / or the falsely detected target feature.
[0040] The falsely detected target features and the missed-detected target features are obtained based on the falsely detected images in the falsely detected image library and the missed-detected images in the missed-detected image library.
[0041] A falsely detected image refers to an image that does not contain a specified target but has been detected by the target recognition model. For example, if an image P1 contains object A, and image P1 is input into the target recognition model, the target recognition model identifies the category of object A as object B. Therefore, image P1 is regarded as a falsely detected image, and object A in the falsely detected image is regarded as a falsely detected target. Image feature extraction is performed on object A in the falsely detected image to obtain falsely detected target features.
[0042] A missed detection image refers to an image that contains a specified target but is not detected by the target recognition model. For example, if the image P2 contains object C, and the image P2 is input into the target recognition model, the target recognition model input image P2 does not contain any object (such as the newly added target object that needs to be detected, but the target recognition model does not use the sample corresponding to the newly added target object during the training process). Therefore, the image P2 is regarded as a missed detection image, and the object C in the missed detection image is regarded as a missed detection target. The image feature extraction of the object C in the missed detection image is performed to obtain the features of the missed detection target.
[0043] For each missed target feature and / or falsely detected target feature, there is a corresponding target category obtained through target recognition and a category confidence corresponding to the target category. It should be noted that for missed targets, the target recognition model may identify missed targets when performing target recognition on missed images, but because the category confidence is lower than the threshold, the result will be that the missed image does not contain missed targets, but the missed target essentially still has a target category and a category confidence corresponding to the target category.
[0044] The confidence threshold is calculated based on the category confidence corresponding to the missed target features and / or the falsely detected target features.
[0045] For example, the average value corresponding to the category confidence corresponding to each missed detection target feature is calculated to obtain the missed detection confidence mean, and / or the average value corresponding to the category confidence corresponding to each falsely detected target feature is calculated to obtain the false detection confidence mean, and the confidence threshold is calculated based on the missed detection confidence mean and / or the false detection confidence mean. For example, a weighted calculation is performed on the missed detection confidence mean and the false detection confidence, and the calculation result is used as the confidence threshold; or, a subtraction operation is performed on the false detection confidence mean and a preset value, and the calculation result is used as the confidence threshold; or, an addition operation is performed on the missed detection confidence mean and a preset value, and the calculation result is used as the confidence threshold.
[0046] The method for determining the confidence threshold can be flexibly determined according to the actual application scenario, and this application does not limit this.
[0047] Compare the size relationship between the category confidence and the confidence threshold to classify the target objects whose category confidence is greater than the confidence threshold into one category, and / or classify the target objects whose category confidence is not greater than the confidence threshold into another category, so as to perform false detection re-inspection and / or missed detection re-inspection.
[0048] Specifically, the false detection target features are used to perform false detection re-inspection, and the missed detection target features are used to perform missed detection re-inspection.
[0049] See also Figure 3 , Figure 3FIG. 1 is a schematic diagram showing an exemplary embodiment of the present application for obtaining features of a misdetected target and / or features of a missed target, as shown in FIG. Figure 3 As shown, a falsely detected image and / or a missed detection image and the corresponding image information are obtained, and the image information includes but is not limited to the real position and real type of the falsely detected target and / or the missed detection target. According to the real position corresponding to the falsely detected target and / or the missed detection target, the image block of the falsely detected target and / or the missed detection target is cropped, and the image block of the falsely detected target and / or the missed detection target is subjected to feature extraction through a feature extraction network, and the extracted features are stored in a feature database, and the feature database includes falsely detected target features corresponding to the falsely detected target and / or the missed detection target features corresponding to the missed detection target.
[0050] Optionally, the feature database may be synchronously stored in a cloud server or other storage device to facilitate subsequent false detection rechecking and / or missed detection rechecking.
[0051] In addition, image features corresponding to the target object in the input image are extracted to obtain input target features. The same feature extraction network is used to extract image features corresponding to the target object in the input image, falsely detected target features, and missed target features. The feature extraction network can be implemented based on a pre-trained D2-Net CNN network, and the feature extraction network can be a network independent of the target recognition model.
[0052] Step S230: If the category confidence is greater than the confidence threshold, the falsely detected target feature is obtained, the similarity between the input target feature and the falsely detected target feature is calculated to obtain the false detection similarity, and the initial target category is corrected based on the size of the false detection similarity to obtain a category correction result; wherein, the falsely detected target feature is obtained by extracting features from an image that does not contain a specified target but detects a specified target.
[0053] For target objects whose category confidence is greater than the confidence threshold, there may be category recognition errors. Therefore, the falsely detected target features are obtained, the similarity between the input target features and the falsely detected target features is calculated to obtain the false detection similarity, and the initial target category is corrected according to the size of the false detection similarity to obtain the category correction result.
[0054] Specifically, a correction strategy is determined according to the magnitude of the false detection similarity. The correction strategy includes but is not limited to discarding the initial target category, modifying the initial target category, modifying the category confidence corresponding to the initial target category, etc. The initial target category is corrected according to the correction strategy.
[0055] Step S240: If the category confidence is not greater than the confidence threshold, the missed target feature is obtained, the similarity between the input target feature and the missed target feature is calculated to obtain the missed detection similarity, and the initial target category is corrected based on the size of the missed detection similarity to obtain a category correction result; wherein the missed target feature is obtained by extracting features from an image that contains a specified target but has not detected the specified target.
[0056] For target objects whose category confidence is not greater than the confidence threshold, there may be cases where target object recognition is missed. Therefore, the missed target features are obtained, and the similarity between the input target features and the missed target features is calculated to obtain the missed similarity. The initial target category is corrected according to the size of the missed similarity to obtain the category correction result.
[0057] Specifically, a correction strategy is determined according to the size of the missed detection similarity. The correction strategy includes but is not limited to discarding the initial target category, modifying the initial target category, modifying the category confidence corresponding to the initial target category, etc. The initial target category is corrected according to the correction strategy.
[0058] After rechecking and correcting the initial target category of the target object according to step S230 and / or step S240, a final target recognition result of the input image is obtained.
[0059] Next, some embodiments of the present application are described in detail.
[0060] In some embodiments, in step S230, the initial target category is corrected based on the size of the false detection similarity to obtain a category correction result, including: obtaining a false detection threshold; if the false detection similarity is greater than the false detection threshold, the initial target category corresponding to the target object is discarded; if the false detection similarity is not greater than the false detection threshold, the initial target category corresponding to the target object is retained.
[0061] When the false detection similarity is greater than the false detection threshold, it indicates that the target object is similar to the existing false detection target. Under the premise that the target recognition model incorrectly identifies the false detection target, there is a high probability that the target recognition model will also incorrectly identify the target object when identifying the target object. Therefore, the initial target category corresponding to the target object can be discarded; conversely, if the false detection similarity is not greater than the false detection threshold, the initial target category corresponding to the target object will be retained.
[0062] Among them, the cosine similarity, Euclidean distance, etc. between the input target features and the false detection target features can be calculated to obtain the false detection similarity.
[0063] In another embodiment, the correct category and the error category corresponding to the falsely detected target features are obtained, the falsely detected target features corresponding to the same error category are divided to obtain multiple candidate error category sets, and the falsely detected target features corresponding to the same correct category are divided to obtain multiple candidate correct category sets.
[0064] The error category corresponding to the false detection target feature is the false target category identified by the current target recognition model. The correct category corresponding to the false detection target feature can be obtained in response to the labeling operation or according to other target recognition models with higher accuracy, which is not limited in this application.
[0065] The false detection target features corresponding to the same error category are divided to obtain multiple candidate error category sets, and the false detection target features corresponding to the same correct category are divided to obtain multiple candidate correct category sets.
[0066] For example, the false detection target features include m1, m2, m3, m4, and m5, among which the correct category of m1 is category T1, and the wrong category is category R2; the correct category of m2 is category T1, and the wrong category is category R1; the correct category of m3 is category T1, and the wrong category is category R1; the correct category of m4 is category T2, and the wrong category is category R2; the correct category of m5 is category T2, and the wrong category is category R2.
[0067] The candidate correct category set corresponding to the correct category T1 includes false detection target features m1, m2, and m3; the candidate correct category set corresponding to the correct category T2 includes false detection target features m4 and m5; the candidate error category set corresponding to the error category R1 includes false detection target features m2 and m3; the candidate error category set corresponding to the error category R2 includes false detection target features m1, m4, and m5.
[0068] Then, a set of candidate correct categories and a set of candidate wrong categories that match the input target features are determined.
[0069] Methods for determining a set of candidate correct categories corresponding to input target features include: For example, if the false detection similarity between the input target feature and at least one false detection target feature is greater than the false detection threshold, then the candidate correct category set corresponding to the false detection target feature whose false detection similarity is greater than the false detection threshold is obtained to obtain the matching correct category set. If the false detection similarity between the input target feature and the false detection target feature m1 is greater than the false detection threshold, and m1 corresponds to the correct category T1, then the candidate correct category set corresponding to the correct category T1 is used as the matching correct category set corresponding to the input target feature.
[0070] For another example, the mean corresponding to each falsely detected target feature in the candidate correct category set is calculated to obtain the average feature, the feature similarity between the input target feature and the average feature of each candidate correct category set is calculated, and the candidate correct category set with feature similarity greater than a threshold is taken as the matching correct category set.
[0071] The method for determining a set of candidate error categories corresponding to the input target features includes: For example, a set of candidate error categories whose error categories are consistent with the initial target category of the input target feature is obtained to obtain a set of matching error categories. For example, if the initial target category of the input target feature is R1, a set of candidate error categories corresponding to error category R1 is obtained as a set of matching error categories corresponding to the input target feature.
[0072] For another example, if the false detection similarity between the input target feature and at least one false detection target feature is greater than the false detection threshold, then the candidate error category set corresponding to the false detection target feature whose false detection similarity is greater than the false detection threshold is obtained to obtain the matching error category set. If the false detection similarity between the input target feature and the false detection target feature m1 is greater than the false detection threshold, and m1 corresponds to error category R2, then the candidate error category set corresponding to error category R2 is used as the matching error category set corresponding to the input target feature.
[0073] For example, the mean corresponding to each falsely detected target feature in the candidate error category set is calculated to obtain the average feature, the feature similarity between the input target feature and the average feature of each candidate error category set is calculated, and the candidate error category set with feature similarity greater than a threshold is taken as the matching error category set.
[0074] The method for determining the matching correct category set and the matching incorrect category set can be flexibly selected according to the actual application scenario, and this application does not limit this.
[0075] The similarity between the input target feature and the falsely detected target feature in the matching correct category set is calculated to obtain the correct set similarity; and the similarity between the input target feature and the falsely detected target feature in the matching wrong category set is calculated to obtain the wrong set similarity.
[0076] Specifically, the similarity between the input target feature and each falsely detected target feature in the matching correct category set is calculated, and then the multiple similarities obtained are averaged and the result is used as the correct set similarity; similarly, the similarity between the input target feature and each falsely detected target feature in the matching incorrect category set is calculated, and then the multiple similarities obtained are averaged and the result is used as the incorrect set similarity.
[0077] Based on the size relationship between the correct set similarity and the error set similarity, the correction strategy of the initial target category is determined, and the initial target category is corrected according to the correction strategy to obtain the category correction result.
[0078] For example, if the correct set similarity is greater than the error set similarity, and the initial target category is consistent with the correct category corresponding to the matching correct category set, the correction strategy is to retain the initial target category corresponding to the target object; if the correct set similarity is not greater than the error set similarity, the correction strategy is to discard the initial target category corresponding to the target object.
[0079] For example, if the correct set similarity is greater than the incorrect set similarity, but the initial target category is inconsistent with the correct category corresponding to the matching correct category set, the correction strategy is to discard the initial target category corresponding to the target object.
[0080] For example, if the correct set similarity is greater than the error set similarity, but the initial target category and the correct category corresponding to the matching correct category set are inconsistent, then the error category corresponding to each falsely detected target feature in the matching correct category set is obtained to obtain the error category set, and the number of error categories in the error category set that are consistent with the initial target category is counted. Combined with the number of error categories consistent with the initial target category and the correct set similarity, the probability that the input target feature and the falsely detected target feature in the matching correct category set belong to the same object is calculated, wherein the more the number of consistent error categories, the higher the correct set similarity, and the greater the probability of belonging to the same object. If the probability of belonging to the same object is greater than a preset threshold, the initial target category is modified to the correct category corresponding to the matching correct category set. In addition, the category confidence can be further modified to the correct set similarity.
[0081] Through the above embodiments, the misdetected target objects are effectively identified, thereby improving the accuracy of target recognition.
[0082] In some embodiments, in step S240, the initial target category is corrected based on the size of the missed detection similarity to obtain a category correction result, including: obtaining a missed detection threshold; if the missed detection similarity is greater than the missed detection threshold, the initial target category corresponding to the target object is modified according to the correct category preset by the missed detection target feature; if the missed detection similarity is not greater than the missed detection threshold, the initial target category corresponding to the target object is not modified.
[0083] If the missed detection similarity is greater than the missed detection threshold, it means that the target object is an object that needs to be detected but is not detected by the target recognition model. The initial target category corresponding to the target object is modified according to the correct category preset by the missed detection target feature.
[0084] Specifically, the correct category corresponding to the missed target feature is used as the corrected target category of the target object, and the missed detection similarity is used as the category confidence corresponding to the corrected target category to obtain a category correction result.
[0085] Through the above embodiments, missed target objects are effectively identified, thereby improving the accuracy of target recognition.
[0086] For example, see Figure 4 , Figure 4 A schematic diagram of target recognition is shown as an exemplary embodiment of the present application, such as Figure 4 As shown, target recognition is performed on the input image to be recognized to obtain the initial target category, category confidence, position and other information corresponding to the target object. Then, image features of the target object are extracted according to the corresponding position of the target object to obtain input target features. The input target features, initial target category and category confidence are input into the comparison module. After the comparison module rechecks and corrects the initial target category of the target object, the final target recognition result of the input image is obtained.
[0087] Specifically, see Figure 5 , Figure 5 This is a schematic diagram showing an exemplary embodiment of the present application showing a comparison module rechecking and correcting an initial target category, as shown in FIG. Figure 5 As shown, the category confidence corresponding to the initial target category is obtained, and it is determined whether the category confidence is greater than the confidence threshold. If the category confidence is greater than the confidence threshold, the target object is taken as a high-confidence target, and the similarity between the input target feature of the target object and the false detection target feature is calculated to obtain the false detection similarity, and it is determined whether the false detection similarity is greater than the false detection threshold. If so, the initial target category corresponding to the target object is discarded, if not, the initial target category corresponding to the target object is retained, that is, added to the re-inspection result set; if the category confidence is not greater than the confidence threshold, the target object is taken as a low-confidence target, and the similarity between the input target feature of the target object and the missed detection target feature is calculated to obtain the missed detection similarity, and it is determined whether the missed detection similarity is greater than the missed detection threshold. If so, the initial target category and category confidence corresponding to the target object are modified. Specifically, the initial target category corresponding to the target object is replaced with the correct category corresponding to the missed detection target feature, and the missed detection similarity is used as the category confidence. Then, the modified initial target category and category confidence corresponding to the target object are added to the re-inspection result set. If not, the initial target category corresponding to the target object is not modified, that is, it is directly added to the re-inspection result set.
[0088] Furthermore, the target recognition result is obtained based on the re-verification result set. The re-verification result set can be directly used as the target recognition result, or the results in the re-verification result set with category confidence lower than a preset threshold can be filtered and the filtered re-verification result set can be used as the target recognition result.
[0089] In some embodiments, the execution entity is connected to multiple recognition computing units; target recognition is performed on the input image to be recognized to obtain the initial target category corresponding to each target object and the category confidence corresponding to the initial target category, including: obtaining the computational load of each recognition computing unit; based on the computational load of each recognition computing unit, determining to select a target computing unit from multiple recognition computing units; sending the input image to be recognized to the target computing unit, so that the target computing unit performs target recognition on the input image, and obtains the initial target category corresponding to each target object and the category confidence corresponding to the initial target category.
[0090] See also Figure 6 , Figure 6 A schematic diagram of an identification calculation unit is shown as an exemplary embodiment of the present application. Figure 6 As shown, the execution body includes a host chip (Host Unit), the host chip is connected to a slave chip, and the slave chip (Slave Unit) is connected to multiple identification and calculation units. The identification and calculation unit can be an accelerator card device (Acc Unit), which is used to accelerate the relevant calculations of the neural network.
[0091] Specifically, the master chip segments the input image and obtains foreground blocks from the input image. Then, the foreground blocks are sent to the slave chip. The slave chip distributes the foreground blocks to different recognition and calculation units according to the principle of load balancing. The recognition and calculation units will execute the target recognition algorithm to obtain the final target recognition result. Finally, the slave chip transmits the target recognition result back to the master chip.
[0092] It should be noted that for the feature extraction process corresponding to the input target features, falsely detected target features, and missed target features, since the images have been labeled accordingly, there is no need to use the above master-slave packet cutting and distribution strategy. The feature extraction task can be directly distributed on the slave chip to the recognition calculation unit to extract the input target features, falsely detected target features, or missed target features.
[0093] In addition, additional slots are reserved on the board corresponding to the chip. When there is a greater demand for computing, the number of identification computing units can be increased through the reserved additional slots to improve computing power.
[0094] The target recognition method provided by the present application performs target recognition on an input image to be recognized, obtains an initial target category corresponding to each target object and a category confidence corresponding to the initial target category; obtains a confidence threshold, and compares the size relationship between the category confidence and the confidence threshold; and extracts image features corresponding to the target object in the input image to obtain input target features; if the category confidence is greater than the confidence threshold, calculates the similarity between the input target features and the falsely detected target features to obtain the falsely detected similarity, and corrects the initial target category based on the size of the falsely detected similarity; and / or, if the category confidence is not greater than the confidence threshold, calculates the similarity between the input target features and the missed detection target features to obtain the missed detection similarity, and corrects the initial target category based on the size of the missed detection similarity, so as to divide the target objects into objects that need to be falsely detected and re-inspected and objects that are missed and re-inspected according to the category confidence corresponding to the initial target category, thereby determining whether to use the falsely detected target features to correct the initial target category, or to use the missed detection target features to correct the initial target category, so as to reduce the probability of false detection or missed detection without retraining the model.
[0095] Figure 7 FIG. 1 is a block diagram of a target recognition device shown in an exemplary embodiment of the present application. Figure 7 As shown, the exemplary target recognition device 700 includes: an initial recognition module 710, a threshold comparison and feature extraction module 720, a false detection re-check module 730 and a missed detection re-check module 740. Specifically: The initial recognition module 710 is used to perform target recognition on the input image to be recognized, and obtain the initial target category corresponding to each target object and the category confidence corresponding to the initial target category; The threshold comparison and feature extraction module 720 is used to obtain a confidence threshold, compare the size relationship between the category confidence and the confidence threshold; and extract the image features corresponding to the target object in the input image to obtain the input target features; The false detection recheck module 730 is used to obtain the false detection target feature if the category confidence is greater than the confidence threshold, calculate the similarity between the input target feature and the false detection target feature to obtain the false detection similarity, and correct the initial target category based on the false detection similarity to obtain a category correction result; wherein the false detection target feature is obtained by extracting features of an image that does not contain a specified target but detects a specified target; The missed detection re-verification module 740 is used to obtain the missed detection target feature if the category confidence is not greater than the confidence threshold, calculate the similarity between the input target feature and the missed detection target feature, obtain the missed detection similarity, and correct the initial target category based on the size of the missed detection similarity to obtain a category correction result; wherein the missed detection target feature is obtained by extracting features of an image that contains a specified target but does not detect the specified target.
[0096] It should be noted that the target identification device provided in the above embodiment and the target identification method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In practical applications, the target identification device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0097] See also Figure 8 , Figure 8 800 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 800 includes a memory 801 and a processor 802, and the processor 802 is used to execute program instructions stored in the memory 801 to implement the steps in any of the above target recognition method embodiments. In a specific implementation scenario, the electronic device 800 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 800 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0098] Specifically, the processor 802 is used to control itself and the memory 801 to implement the steps in any of the above-mentioned target recognition method embodiments. The processor 802 can also be called a central processing unit (CPU). The processor 802 may be an integrated circuit chip with signal processing capabilities. The processor 802 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 802 can be implemented by an integrated circuit chip.
[0099] See also Fig. 9 , Fig. 9 The computer-readable storage medium 900 stores program instructions 910 that can be executed by a processor, and the program instructions 910 are used to implement the steps in any of the above target recognition method embodiments.
[0100] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0101] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0102] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0103] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
Claims
1. A target recognition method, characterized in that: The method comprises: Performing target recognition on the input image to be recognized, obtaining an initial target category corresponding to each target object and a category confidence corresponding to the initial target category; Obtaining a confidence threshold, comparing the size relationship between the category confidence and the confidence threshold; and extracting image features corresponding to the target object in the input image to obtain input target features; If the category confidence is greater than the confidence threshold, then obtaining the falsely detected target feature, calculating the similarity between the input target feature and the falsely detected target feature to obtain the falsely detected similarity, and correcting the initial target category based on the magnitude of the falsely detected similarity to obtain a category correction result; wherein the falsely detected target feature is obtained by extracting features from an image that does not contain a designated target but detects the designated target; and / or, If the category confidence is not greater than the confidence threshold, the missed target feature is obtained, the similarity between the input target feature and the missed target feature is calculated to obtain the missed detection similarity, and the initial target category is corrected based on the size of the missed detection similarity to obtain a category correction result; wherein, the missed target feature is obtained by extracting features of an image that contains a specified target but does not detect the specified target.
2. The method according to claim 1, characterized in that The correcting the initial target category based on the magnitude of the false detection similarity to obtain a category correction result includes: Get the false detection threshold; If the false detection similarity is greater than the false detection threshold, the initial target category corresponding to the target object is discarded; If the false detection similarity is not greater than the false detection threshold, the initial target category corresponding to the target object is retained.
3. The method according to claim 1, characterized in that: The correcting the initial target category based on the magnitude of the false detection similarity to obtain a category correction result includes: Obtaining the correct category and the error category corresponding to the false detection target features, dividing the false detection target features corresponding to the same error category to obtain multiple candidate error category sets, and dividing the false detection target features corresponding to the same correct category to obtain multiple candidate correct category sets; If the false detection similarity between the input target feature and at least one false detection target feature is greater than a false detection threshold, then obtaining a set of candidate correct categories corresponding to the false detection target features whose false detection similarity is greater than the false detection threshold, and obtaining a set of matching correct categories; and obtaining a set of candidate error categories whose error categories are consistent with the initial target categories of the input target feature, and obtaining a set of matching error categories; Calculating the similarity between the input target feature and the falsely detected target feature in the matching correct category set to obtain the correct set similarity; and calculating the similarity between the input target feature and the falsely detected target feature in the matching wrong category set to obtain the wrong set similarity; Determining a correction strategy for the initial target category based on a size relationship between the correct set similarity and the error set similarity; The initial target category is corrected according to the correction strategy to obtain a category correction result.
4. The method according to claim 3, characterized in that The determining of the correction strategy of the initial target category based on the size relationship between the correct set similarity and the error set similarity includes: If the correct set similarity is greater than the incorrect set similarity, and the initial target category is consistent with the correct category corresponding to the matching correct category set, then the correction strategy is to retain the initial target category corresponding to the target object; If the correct set similarity is not greater than the incorrect set similarity, the correction strategy is to discard the initial target category corresponding to the target object.
5. The method according to claim 1, characterized in that The correcting the initial target category based on the size of the missed detection similarity to obtain a category correction result includes: Get the missed detection threshold; If the missed detection similarity is greater than the missed detection threshold, modifying the initial target category corresponding to the target object according to the correct category preset by the missed detection target feature; If the missed detection similarity is not greater than the missed detection threshold, the initial target category corresponding to the target object is not modified.
6. The method according to claim 5, characterized in that If the missed detection similarity is greater than the missed detection threshold, modifying the initial target category corresponding to the target object according to the correct category preset by the missed detection target feature includes: The correct category corresponding to the missed target feature is used as the corrected target category of the target object, and the missed detection similarity is used as the category confidence corresponding to the corrected target category to obtain a category correction result.
7. The method according to claim 1, characterized in that The obtaining of the confidence threshold comprises: Obtaining the category confidence of the target category corresponding to the missed-detection target feature and / or the false-detection target feature; A confidence threshold is calculated based on the category confidence corresponding to the missed-detection target feature and / or the false-detection target feature.
8. The method according to claim 1, characterized in that Multiple recognition computing units are deployed; The performing target recognition on the input image to be recognized to obtain an initial target category corresponding to each target object and a category confidence corresponding to the initial target category includes: Obtaining the computational load of each recognition computation unit; Determine, based on the computational load of each of the identification computational units, to select a target computational unit from the plurality of identification computational units; The input image to be identified is sent to the target computing unit, so that the target computing unit performs target recognition on the input image to obtain an initial target category corresponding to each target object and a category confidence corresponding to the initial target category.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the processor is configured to execute program instructions stored in the memory to implement the steps in the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and the program instructions can be executed by a processor to implement the steps in the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
False detection image determination method and device, equipment and medium
CN111639653A
Detection method and device, detection equipment and storage medium
CN112884743A
Vehicle part detection method and device, terminal and storage medium
CN116468931A
Method and device for determining image category and confidence threshold
CN118038105A
Cited By
Human body false detection filtering method and system based on multi-dimensional comparison and medium
CN121904807A
Human false detection filtering method and system based on multi-dimensional comparison and medium
CN121904807B
