A method, device and electronic device for target recognition
Through online training and updating of target recognition models, the problem of insufficient intelligence in target recognition of artificial intelligence systems in the existing technology is solved, high-accuracy automatic target recognition is achieved, and false alarm rates and manual workload are reduced.
Patent Information
- Application Number
- CN202010910389.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-02
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-09-02
AI Technical Summary
Existing artificial intelligence systems are not highly intelligent when identifying targets and require manual operations, resulting in limited accuracy of recognition results. Especially under abnormal circumstances, targets cannot be automatically identified, affecting efficiency.
By using the initial recognition results and set label strategies to train and update the target recognition model online, a new target recognition model is generated, reducing manual intervention and improving recognition accuracy.
Target recognition can be achieved without manual operation, improving the accuracy of recognition results, reducing the false alarm rate of perimeter prevention, reducing manual workload, and improving model update efficiency.
Smart Images

Figure CN112101156B
Abstract
Description
Technical Field
[0001] This specification relates to the field of artificial intelligence, and in particular to a method, device and electronic device for target recognition. Background Art
[0002] With the continuous progress of society, the application scope of artificial intelligence systems is becoming wider and wider. The current artificial intelligence system is not intelligent enough and is still in a semi-automatic state. In many scenarios, manual operation is still required. For example, when an abnormal situation (moving targets, etc.) is found, the target cannot be automatically identified and manual operation is required to identify the target.
[0003] However, since manual operations have a lag, using manual operations with a lag in artificial intelligence systems will affect the accuracy of the final artificial intelligence results. Summary of the invention
[0004] The present application provides a method, device and electronic device for target recognition to improve the accuracy of target recognition results.
[0005] Specifically, the present application is implemented through the following technical solutions:
[0006] According to a first aspect of the present application, a target recognition method is provided, which is applied to an electronic device, and the method includes:
[0007] Determine the identification label corresponding to each target object according to the obtained initial identification result of each target object and the configured set label identification strategy; the initial identification result of the target object is obtained by inputting the target image corresponding to the target object into the trained first target identification model, and the identification label corresponding to the target object is associated with the initial identification result of the target object;
[0008] Re-training the model based on the first target recognition model is performed according to the target images corresponding to each target object and the identification labels corresponding to each target object to obtain a second target recognition model. When the second target recognition model passes the set performance test, the first target recognition model that has been designated for target recognition is updated to the second target recognition model, so that target recognition is performed through the updated second target recognition model.
[0009] According to a second aspect of the present application, a target recognition device is provided, which is applied to an electronic device, and includes:
[0010] An initial recognition unit is used to determine the recognition label corresponding to each target object according to the obtained initial recognition result of each target object and the configured set label recognition strategy; the initial recognition result of the target object is obtained by inputting the target image corresponding to the target object into the trained first target recognition model, and the recognition label corresponding to the target object is associated with the initial recognition result of the target object;
[0011] A model updating unit is used to retrain the model based on the first target recognition model according to the target images corresponding to each target object and the identification labels corresponding to each target object to obtain a second target recognition model, and when the second target recognition model passes a set performance test, update the first target recognition model that has been designated for target recognition to the second target recognition model, so as to perform target recognition through the updated second target recognition model.
[0012] According to a third aspect of the present application, an electronic device is provided, including:
[0013] processor;
[0014] a memory for storing processor-executable instructions;
[0015] The processor implements the method described in the first aspect by running the executable instructions.
[0016] In the present application, the electronic device uses an initial first target recognition model to perform target recognition on the target object in the real-time video stream to obtain an initial recognition result, and then determines the recognition label corresponding to each target object based on the initial recognition result and the configured set label recognition strategy. Subsequently, the electronic device can retrain on the basis of the first target recognition model to obtain a second target recognition model based on the target image corresponding to each target object and the recognition label corresponding to each target object. If the second recognition model passes the set performance test, the first recognition model is updated to the second recognition model to perform target recognition on the target object in the real-time video stream through the updated second target recognition model.
[0017] It can be seen from the embodiments of the present application that in this embodiment, the target recognition model is not fixed. The target recognition result identified by the target recognition model is used to iterate and update the target recognition model multiple times through an online training method. Compared with the existing target recognition model that does not change once trained, the intelligence of the target recognition model is greatly improved, and target recognition can be achieved without manual operation, thereby improving the accuracy of target recognition.
[0018] Furthermore, in this embodiment, when iteratively updating the target recognition model, there is no need to manually label the target. Instead, the target recognition results identified by the target recognition model are used for online iterative updating, which reduces manual workload and improves the updating efficiency of the target recognition model.
[0019] Furthermore, when applied to the perimeter protection scenario, the present embodiment performs target recognition by continuously optimizing the target recognition model, thereby avoiding false alarms of non-targets and the like, and reducing the false alarm rate of perimeter protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0021] Figure 1 It is a flow chart of a target recognition method shown in an exemplary embodiment of the present application.
[0022] Figure 2 It is a flowchart of another target recognition method shown in an exemplary embodiment of the present application.
[0023] Figure 3 It is a structural schematic diagram of a target recognition device shown in an exemplary embodiment of the present application.
[0024] Figure 4 It is a block diagram of a target recognition device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0025] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.
[0026] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0027] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0028] In some applications, when image recognition is required, a common method is to use a target recognition model to perform target recognition. However, as described in the background technology, many current target recognition models are not intelligent enough and often require manual intervention. For example, when an abnormal situation (moving target, etc.) is detected, the current target recognition model cannot further distinguish the moving target, for example, it cannot identify whether the target is a person or an animal, and manual operation is required. However, manual operation has hysteresis, which affects the recognition efficiency.
[0029] To solve the above defects, the present application embodiment proposes a different target recognition method, specifically Figure 1 See Figure 1 , Figure 1 1 is a flow chart of a target recognition method shown in an exemplary embodiment, and the method is applied to an electronic device. In one example, the electronic device may be a front-end device. Optionally, the front-end device here may be an image acquisition device, such as a camera, a sensor, etc. In another example, the electronic device may also be a back-end device. Optionally, the back-end device here may be an image processing device, such as a DVR, an NVR, a management server, etc.
[0030] like Figure 1 As shown, the process may include the following steps:
[0031] Step S101: The electronic device determines the identification label corresponding to each target object based on the obtained initial identification results of each target object and the configured set label identification strategy; the identification result of the target object is obtained by inputting the target image corresponding to the target object into the trained first target recognition model, and the identification label corresponding to the target object is associated with the initial identification result of the target object.
[0032] In one example, the trained first target recognition model is designated for target recognition. In a specific implementation, as an embodiment, the first target recognition model can be stored in a storage medium corresponding to the electronic device. As another embodiment, the first target recognition model can also be stored in other devices independent of the electronic device, such as a cloud device.
[0033] In this embodiment, after the electronic device obtains the target image corresponding to the target object, if the first target recognition model is stored in the storage medium corresponding to the electronic device, the electronic device can directly input the target image corresponding to each target object into the trained first target recognition model, and obtain the initial recognition result of each target object. If the first target recognition model can also be stored on other devices independent of the electronic device, such as cloud devices, the electronic device can send the target image corresponding to each target object to other devices storing the first target recognition model, so that the other devices can input the target image corresponding to each target object into the first target recognition model, and return the initial recognition result of each target object to the electronic device. That is, the electronic device obtains the initial recognition result of each target object.
[0034] It should be noted that there are many ways to implement how the electronic device obtains the target image corresponding to the target object. For example, when the electronic device detects the real-time video stream, it can detect the moving target object and obtain the target image of the target object when the target object triggers the preset rule, for example, obtaining the image of the target object when the rule is triggered. Of course, the target image of the target object to be identified can also be obtained by other methods, which are not limited here.
[0035] In this embodiment, after obtaining the target image of the target object, the electronic device can use the first target recognition model to perform target recognition on it. The first target recognition model can be a preset trained model or a model trained and updated using the method of the present application.
[0036] Optionally, the initial recognition result of each target object depends on the model type of the first target recognition model. For example, if the first target recognition model is a classification model, the initial recognition result of each target object is the category of each target object. Taking the application in the highway scenario as an example, the first target recognition model is a classification model, which can output the following five categories of results: "people", "vehicles", "animals", "false alarm targets" and "unknown targets". Based on this, the initial recognition result of each target object is one of the five categories of results.
[0037] The tag identification strategy is used to determine the target identification result of the target object. During configuration, it can be configured according to actual needs. The configured tag identification strategy will be described below. As for how to determine the identification tag corresponding to each target object based on the initial identification results of each target object obtained and the configured tag identification strategy, it is also described below through multiple embodiments.
[0038] In order to optimize the first target recognition model, the electronic device can also use the target image of the above-mentioned identified target object as sample data, and automatically generate an identification label for the sample data based on the initial recognition result and the target recognition result determined by the set identification label strategy, so as to optimize the first target recognition model according to the sample data and the corresponding identification label.
[0039] In one embodiment, in order to improve the efficiency of data search, the electronic device can jointly store various types of information of the target object. Among them, the various types of information of the target object include the identification tag of the target object, the initial identification result of the target object, and other information of the target object (such as the target image of the target object, etc.). For example, after determining the target identification result of the target object, the target identification result can be jointly stored with other information of the target object. Then, after determining the identification tag of the target object, the target object is also jointly stored with the previously determined target identification result, etc.
[0040] For example, the electronic device can store the above-mentioned information in a table, such as storing the target recognition result of the target object, the identification tag of the target object and other information of the target object in the same table item. Among them, information such as the target image can be stored in the form of links, etc., which is not limited here.
[0041] In another embodiment, the electronic device may also associate various types of information of the target object through the identifier of the target object. For example, after determining the initial recognition result of the target object, the corresponding relationship between the initial recognition result of the target object and the identifier may be determined; after determining the identification tag of the target object, the corresponding relationship between the identification tag of the target object and the identifier may be determined. Furthermore, various types of information of the same target object may be searched according to the identifier of the target object.
[0042] Of course, this is just an example explanation. In actual applications, other methods can be used to determine the association relationship between various types of information of the target object, which will not be repeated here.
[0043] In an optional embodiment, the output result of the first target recognition model also includes a confidence level corresponding to the initial recognition result, and the electronic device can determine the identification label of the target object based on the confidence level. For example, if the confidence level is higher than a preset threshold (e.g., 70%), the initial recognition result is considered accurate, and the electronic device can directly use the initial recognition result as the identification label of the target object; if the confidence level is not higher than the preset threshold, the initial recognition result is considered inaccurate, and the electronic device can determine the identification label of the target object based on the initial recognition result and the configured set label recognition strategy.
[0044] In another optional embodiment, the electronic device may determine the identification tag of each target object according to the initial identification result and the configured set tag identification strategy without considering the confidence level.
[0045] When determining the identification tag of each target object based on the initial identification result and the configured set tag identification strategy, the electronic device can determine the target identification result corresponding to each target object using the configured set tag identification strategy; when the initial identification result corresponding to the target object matches the target identification result, the initial identification result or the target identification result corresponding to the target object is determined as the identification tag corresponding to the target object; otherwise, the target identification result corresponding to the target object is determined as the identification tag corresponding to the target object.
[0046] It should be noted that the electronic device can choose an appropriate time to determine the identification tag of the target object. For example, the electronic device can directly determine the identification tag of the target object after obtaining the initial identification result of the target object; or the electronic device can also save the initial identification results of multiple target objects, and then determine the identification tag of each target object in the multiple target comparisons at a certain time interval or when the saved initial identification results reach a certain number.
[0047] Step S102: The electronic device re-trains the model based on the first target recognition model according to the target images corresponding to each target object and the identification tags corresponding to each target object to obtain a second target recognition model, and when the second target recognition model passes the set performance test, updates the first target recognition model that has been designated for target recognition to the second target recognition model, so as to perform target recognition through the updated second target recognition model.
[0048] For ease of description, the model training in step 102 may be referred to as online model training.
[0049] Compared with the existing target recognition model that completely relies on a large amount of manual calibration training, it can be seen from step 102 that this embodiment can reduce the workload of manual calibration and save model training costs by online training the model of the identification labels corresponding to each target object determined based on the initial recognition results of each target object obtained and the configured set label recognition strategy.
[0050] In one example, the electronic device may save the acquired target image of the target object and the identification label of the target object determined in step S101, and use the target image and the identification label as sample data for model training.
[0051] In another example, the electronic device can also divide the target objects into two categories according to a preset ratio. For one category, the target image and identification label of the target object are used as sample data for model training; for the other category, the target image and identification label of the target object are used as test data to perform performance testing on the trained target recognition model.
[0052] After determining the sample data for model training, if the preset trigger conditions are met, the electronic device can re-train the model based on the first target recognition model according to the target images corresponding to each target object and the identification tags corresponding to each target object to obtain a second target recognition model.
[0053] In one example, the trigger condition may be whether the total amount of identification tags obtained within a specified historical time period is greater than or equal to a threshold, wherein the specified historical time period refers to a period of specified duration that has existed up to the current time point. The electronic device may detect the number of identification tags obtained within a period of specified duration up to the current time point, and if the number is greater than or equal to the set tag quantity threshold, model training is performed. For example, assuming that the current time point is 20200701, if the specified duration is 1 month, the electronic device may detect the number of identification tags obtained within the time period from 20200601 to 20200701, and compare the number of identification tags with the set threshold.
[0054] The number of obtained identification tags may be the number of newly added identification tags in the historical time period. In implementation, the electronic device may delete the identification tags after the model training is completed, and the identification tags subsequently saved are newly added data; or the electronic device may number each identification tag in sequence and record the number segment of the identification tags used in the last model training, and the subsequent electronic device may determine the number of newly added identification tags based on the number.
[0055] In another example, the trigger condition may also be a preset time interval, such as performing model training and updating at a preset period (eg, 10 days, 30 days, etc.).
[0056] Of course, other methods can also be used in this application to trigger model training, such as manual triggering by a user, etc., which are not specifically limited here.
[0057] It is understandable that the first target recognition model in this embodiment is the model currently specified by the electronic device for target recognition, for example, it can be a model preset when the electronic device leaves the factory, or it can be a model updated based on the method of this application. The electronic device can use the method in this application multiple times to optimize the model. For example, the electronic device can periodically detect the number of identification tags, and if the number of newly added identification tags meets the preset conditions, it can be updated through Figure 1 Alternatively, the electronic device may also periodically receive user instructions, and upon receiving user instructions, Figure 1 Thus, the present application can use more sample data to train the model, optimize the model, and improve the accuracy of target recognition.
[0058] The model training method can refer to relevant technologies and will not be repeated here.
[0059] In one embodiment, the set performance test may be to detect the recognition accuracy of the second target recognition model and determine whether the recognition accuracy of the second target recognition model meets a preset condition.
[0060] When performing an accuracy test, a preset test set may be used for testing, the test set including multiple pairs of test data, each pair of test data including a test image and an identification label corresponding to the test image. The test data may be determined when the sample data and the test data are determined in proportion after the electronic device saves the target object, the target image in the test data is used as the test image, and the identification label in the test data is used as the identification label corresponding to the test image. Alternatively, the test data may also be a test image pre-collected through a network or monitoring device, and each test image corresponds to an identification label manually annotated.
[0061] Specifically, the accuracy test may include the following steps:
[0062] First, each test image is input into the second object recognition model, and the recognition result of the test image is determined based on the output of the second object recognition model. The test result is compared with the recognition label corresponding to the test image, and if the two are consistent, it means that the test result is accurate.
[0063] Then, the number of accurate test results is obtained, and the ratio of the number of accurate test results to the total number of test results is used as the target recognition accuracy rate of the second target recognition model. If the target recognition accuracy rate is greater than the preset threshold, it is determined that the test result of the second recognition model meets the preset conditions; if the target recognition accuracy rate is not greater than the preset threshold, it is determined that the test result of the second recognition model does not meet the preset conditions.
[0064] In another embodiment, the performance test may also include resource consumption when the model is running. For example, when the electronic device is tested using the test set, the electronic device may detect the performance usage of the electronic device's memory, CPU, etc., and determine whether the performance usage is less than a preset performance threshold.
[0065] Of course, the performance test of the second target recognition model may also include tests in other dimensions, such as work efficiency, etc. This specification is only an exemplary description and does not make specific limitations.
[0066] After completing the performance test on the second object recognition model, the electronic device can determine whether the first object recognition model needs to be updated according to the result of the performance test.
[0067] If the second target recognition model passes the set performance test, the first target recognition model that has been designated for target recognition is updated to the second target recognition model, and subsequently, the electronic device can use the updated second target recognition model for target recognition.
[0068] If the second target recognition model fails the set performance test, the first target recognition model will not be updated, and the original first target recognition model will still be used for target recognition.
[0069] So far, it is completed Figure 1 The process shown. From the above description, it can be seen that the electronic device uses the initial first target recognition model to perform target recognition on the target object in the real-time video stream to obtain an initial recognition result, and then determines the recognition label corresponding to each target object based on the initial recognition result and the configured set label recognition strategy. Subsequently, the electronic device can retrain on the basis of the first target recognition model to obtain a second target recognition model based on the target image corresponding to each target object and the recognition label corresponding to each target object. If the second recognition model passes the set performance test, the first recognition model is updated to the second recognition model to perform target recognition on the target object in the real-time video stream through the updated second target recognition model.
[0070] It can be seen from the embodiments of the present application that in this embodiment, the target recognition model is not fixed. The target recognition result identified by the target recognition model is used to iterate and update the target recognition model multiple times through an online training method. Compared with the existing target recognition model that does not change once trained, the intelligence of the target recognition model is greatly improved, and target recognition can be achieved without manual operation, thereby improving the accuracy of target recognition.
[0071] Furthermore, in this embodiment, when iteratively updating the target recognition model, there is no need to manually label the target. Instead, the target recognition results identified by the target recognition model are used for online iterative updating, which reduces manual workload and improves the updating efficiency of the target recognition model.
[0072] Furthermore, in the perimeter defense scenario, the present embodiment performs target recognition by continuously optimizing the target recognition model, thereby avoiding false alarms of non-targets and the like, and reducing the false alarm rate of perimeter defense.
[0073] The following is an example of how to determine the identification tag corresponding to each target object based on the obtained initial identification results of each target object and the configured set tag identification strategy in the above step 101:
[0074] See also Figure 2 , Figure 2 The flowchart of step 101 provided in the embodiment of the present application is implemented.
[0075] Step 201, for each target object, using the configured set tag recognition strategy to determine the target recognition result corresponding to the target object;
[0076] As described above, the configured set tag recognition strategy is used to determine the target recognition result of the target object. Based on this, this step 201 can determine the target recognition result corresponding to the target object according to the configured set tag recognition strategy. The following will describe the use of the configured set tag recognition strategy to determine the target recognition result corresponding to the target object through an embodiment.
[0077] Step 202, when the initial recognition result corresponding to the target object matches the target recognition result, the initial recognition result or the target recognition result corresponding to the target object is determined as the recognition tag corresponding to the target object; otherwise, the target recognition result corresponding to the target object is determined as the recognition tag corresponding to the target object.
[0078] The target recognition result of the target object determined in step 201 may be compared with the initial recognition result of the target object obtained according to the first target recognition model. If the target recognition result matches the initial recognition result, the target recognition result is determined as the recognition label of the target object.
[0079] Optionally, if the target recognition result does not match the initial recognition result, other strategies may be used to determine whether the target object's recognition tag is the target object. For example, the target object's recognition tag may be determined as an "unknown target."
[0080] Among them, there are many methods for comparing the target recognition result and the initial recognition result. For example, it can be to determine whether the target recognition result is consistent with the initial recognition result. If they are consistent, it is considered that the target recognition result and the initial recognition result match; if they are inconsistent, it is considered that the target recognition result and the initial recognition result do not match.
[0081] So far, completed Figure 2 The process shown.
[0082] Below, this specification introduces a method for an electronic device to determine a target recognition result corresponding to the target object using a configured set tag recognition strategy through a specific embodiment. Of course, the electronic device can also use other methods to determine the target recognition result, which is only an exemplary description and not a limitation.
[0083] Embodiment 1:
[0084] In the present embodiment 1, the configured set tag identification strategy refers to determining the target identification result corresponding to the target object by means of the tracking result of the target object.
[0085] Based on this, in this embodiment, the above steps use the configured set tag recognition strategy to determine the target recognition result corresponding to the target object, including:
[0086] Step a1, obtaining a tracking result of the tracked target object; the tracking result includes motion information of the target object.
[0087] In this embodiment, the tracking result is a result obtained by tracking the target object in the video stream collected within a specified time period, which may include motion information of the target object, such as motion speed.
[0088] Step a2: determining a target recognition result corresponding to the target object according to the motion information of the target object in the tracking result.
[0089] As an embodiment, this embodiment can pre-configure different motion information for different target objects. Taking the motion information as motion speed as an example, the electronic device can pre-configure different motion speeds for different types of objects.
[0090] category Movement speed people 4km / h~10km / h vehicle 30km / h~100km / h Leaves 0km~5km / h
[0091] Table 1
[0092] Based on this, in this step 102, the target recognition result corresponding to the target object can be determined based on the movement speed of the target object in the tracking result and the movement information of the target object determined in Table 1. As an embodiment, this step 102 can compare the movement speed of the target object in the tracking result with the movement speed in Table 1. If the movement speed of the target object in the tracking result matches the movement speed range indicated by the table item corresponding to the target object in Table 1, it is determined that the initial recognition result of the target object is accurate, and the recognition result corresponding to the specified recognition result condition is determined to be the target recognition result corresponding to the target object; if the movement speed of the target object in the tracking result does not match the movement speed range indicated by the table item corresponding to the target object in Table 1, it can be determined that the initial recognition result of the target object is accurate, and the target recognition result is generated by other preset methods.
[0093] For example, suppose the initial recognition result of the target object is a vehicle:
[0094] If the target object's moving speed is 60km / h, according to Table 1, when the category is vehicle, the corresponding moving speed is 30-100km / h. At this time, it can be considered that the moving speed of the target object 60km / h matches the moving speed corresponding to the category of vehicle in Table 1. At this time, the target recognition result of the target object can be directly determined as a vehicle.
[0095] Assuming that the target object's moving speed is 10km / h, according to Table 1, when the category is vehicle, the corresponding moving speed is 30-100km / h. At this time, it can be considered that the moving speed of the target object 10km / h does not match the moving speed corresponding to the category of vehicle in Table 1. At this time, it can be determined that the initial recognition result of the target object is inaccurate, and the target recognition result is generated according to the preset method. Here, there are many methods for generating the target recognition result, such as querying the category matching the moving speed in Table 1, and the target recognition result of the target object is a person; or, the target recognition result of the target object can be directly determined as "unknown target".
[0096] Another example: Assume that the initial recognition result of the target object is a person:
[0097] If the target object's moving speed is 6km / h, according to Table 1, when the category is human, the corresponding moving speed is 4km / h to 10km / h. At this time, it can be considered that the moving speed of the target object 6km / h matches the moving speed corresponding to the category in Table 1 when it is human. At this time, the target recognition result of the target object can be directly determined to be human.
[0098] If the target object's moving speed is 60km / h, according to Table 1, when the category is human, the corresponding moving speed is 4km / h to 10km / h. At this time, it can be considered that the moving speed of the target object 60km / h does not match the moving speed corresponding to the category of human in Table 1. At this time, it can be determined that the initial recognition result of the target object is inaccurate, and the target recognition result is generated according to the preset method. Here, there are many methods for generating the target recognition result, such as querying the category matching the moving speed in Table 1, and the target recognition result of the target object is a vehicle; or, the target recognition result of the target object can be directly determined as "unknown target".
[0099] This completes the description of Embodiment 1.
[0100] Embodiment 2:
[0101] In the second embodiment, the configured set tag recognition strategy refers to determining the target recognition result corresponding to the target object with the help of the recognition results of other specified models.
[0102] Based on this, in this embodiment, the above steps use the configured set tag recognition strategy to determine the target recognition result corresponding to the target object, including:
[0103] Step b1, using at least one designated model that has been trained to identify the target object to obtain at least one reference identification result.
[0104] In this embodiment, the at least one designated model that has been trained can be pre-stored on a device storage medium by the electronic device, or can be obtained by the electronic device through a network according to actual needs. The electronic device can input a target image of the target object into at least one designated model, and determine a reference recognition result corresponding to the designated model according to the output result of each designated model.
[0105] Step b2: determining one of all the reference recognition results obtained as the target recognition result corresponding to the target object, wherein the one of the reference recognition results has the largest proportion among all the reference recognition results obtained.
[0106] In this embodiment, the target recognition result may be determined based on at least one reference recognition result corresponding to at least one specified model obtained in step b1.
[0107] In one example, the reference recognition result with the largest proportion among the reference recognition results can be used as the target recognition result. For example, if 5 specified models are used and reference recognition results of each specified model are obtained respectively, among the 5 reference recognition results, 1 indicates that the target object is a person and 4 indicate that the target object is a vehicle, then the reference recognition result with the largest proportion can be determined as indicating that the target object is a vehicle, and then the target recognition result of the target object is determined to be a vehicle.
[0108] In another example, the target recognition result can also be determined based on the comparison result of the reference recognition result of the target object and the initial recognition result. For example, the number of reference recognition results that are consistent with the target recognition result is determined, and then the proportion of the consistent number in the reference target recognition result is calculated. If the proportion is greater than a preset ratio threshold, the target recognition result of the target object is determined to be the first recognition result. If the proportion is not greater than the preset ratio threshold, other methods can be used to determine the target recognition result, such as taking the reference recognition result that occupies the largest proportion in the reference recognition result as the target recognition result.
[0109] For example, if the first target recognition result indicates that the target object is a person, among the five reference target recognition results obtained using five specified models, one indicates that the target object is a person, three indicate that the target object is a vehicle, and one indicates that the target object is a false alarm, then it can be determined that among the reference recognition results, there is a total of one that is consistent with the first recognition result, accounting for 20%. If the preset ratio threshold is 80%, the ratio is not greater than the preset ratio threshold. The electronic device can use other methods to determine the target recognition result, such as taking the "vehicle" that occupies the largest proportion in the reference recognition result as the target recognition result.
[0110] This completes the description of Embodiment 2.
[0111] Embodiment 3:
[0112] In this embodiment 3, the configured set tag recognition strategy is to determine the target recognition result corresponding to the target object by clustering method.
[0113] Based on this, in this embodiment, the above steps use the configured set tag recognition strategy to determine the target recognition result corresponding to the target object, including:
[0114] Step c1, clustering each target object according to a set clustering method.
[0115] In this embodiment, there may be multiple ways to cluster the target objects, for example, after converting the target image of the target object into an image vector, the target objects are clustered according to the image vector.
[0116] It should be noted that there are many methods for converting a target image into an image vector. For example, algorithms such as graph2vec and Node2vec can be used to embed the target image into a graph to obtain an image vector corresponding to the target image.
[0117] There are many methods for clustering image vectors, such as K-means algorithm, GMM (Gaussian Mixture Model) algorithm, etc.
[0118] Of course, the present application may also use other methods to cluster the target objects, which will not be described here.
[0119] Based on the preset clustering method, multiple target objects can be divided into multiple classes, and each class includes at least one target object. For example, assuming that there are 1000 target objects to be processed, the image vectors of the 1000 target objects can be used to divide the target objects into 5 categories, and each category includes at least one target object.
[0120] Step c2: for the first target object in each class, determine the designated label of the second target object in the class as the target recognition result of the first target object.
[0121] In this embodiment, the first target object is an object that is not assigned any designated label; the second target object is an object that is assigned a designated label, and different second target objects in the same class are assigned the same designated label.
[0122] In this embodiment, for each category formed by clustering, a number of second target objects can be screened out and displayed to the user through a visual interface, thereby obtaining a designated label determined by the user for the second target object.
[0123] In one example, the second target object may be the target object that is closest to the cluster center. In implementation, the electronic device determines the cluster center of each class based on the clustering result, then calculates the distance between each target object in the class and the cluster center, and then uses the target object with the smallest distance value as the second target object. After determining a second target object in each class, the second target object may be displayed through a visual interface of the electronic device so that the user can determine a designated label for the second target object, and then the electronic device may use the designated label as the target recognition result of the first target object in the class.
[0124] Of course, for the second target object, the designated label of the second target object can be directly used as the target recognition result.
[0125] For example, if K-means clustering algorithm is used to divide 1,000 target objects into 5 categories, the following steps are included:
[0126] First, 5 target objects are randomly selected from the 1000 target objects as the center points; then, for each of the other 995 target objects except the center point, the distance (such as Euclidean distance, cosine distance, etc.) between the target object and the 5 center points is calculated respectively, the center point with the smallest distance value is determined, and the target object is divided into the set to which the center point with the smallest distance belongs; then, for the 5 sets formed after the division, the center point of each set is recalculated, for example, the average value of each target object in the set can be used as the center point; the above steps are repeated until the determined center point meets the set conditions (for example, the distance between the newly determined center point and the last determined center point is less than the preset threshold), and the clustering is terminated.
[0127] According to the above steps, 1000 target objects can be divided into 5 categories, and the center point determined by the last clustering is used as the cluster center of each category. It can be understood that the center point here can be the calculated average value and does not represent any target object.
[0128] For the five divided categories, the distance between each target object in the category and the cluster center can be calculated again, and the target object with the closest distance to the cluster center can be determined as the second target object, and five second target objects can be obtained. Then, the five second target objects can be displayed to the user, and the designated labels determined by the user for them can be obtained, and the designated labels can be used as the target recognition results of each first target object in the category. For example, if the designated label determined by the user for the second target object in the first category is a vehicle, the target recognition result of the first target object in the first category can be determined as a vehicle.
[0129] It is understandable that when implementing the above clustering algorithm, the image vector of the target object can be used to implement specific calculations, and the obtained center point can also be expressed as a vector, which will not be repeated here.
[0130] In another example, the second target object may be a plurality of target objects randomly selected from each category. For each category after division, the electronic device may randomly select a number of target objects from the category as the second target object, and obtain a designated label determined by the user for the second target object. Generally, when the clustering result is accurate, the designated label of the second target object in each category is usually the same. Then, for each category, the designated label of the second target object in the category may be used as the target identification of the first target object. Still taking the above 1000 target objects as an example, after the 1000 target objects are divided into 5 categories, a number of target objects may be randomly obtained from each category as the second target object, and then the designated label determined by the user for the second target object is obtained, and the designated label is used as the target identification result of the first target object in the category.
[0131] Of course, if the clustering result error is large, the designated labels of the second target objects selected in the same class may be different. Based on this, the electronic device can use other methods to determine the target recognition result; or the electronic device can also reselect the second target object and re-determine the designated label. Or this embodiment can also use other methods to handle the situation where the designated labels of the second target objects in the same class are different. This is only an exemplary description and is not limited.
[0132] So far, the description of Example 3 is completed. It can be understood that although this embodiment still requires the user to specify the designated label of the second target object, the number of the second target objects is much smaller than the number of target objects for which the target recognition results are to be determined. Therefore, this embodiment can determine the recognition results of a large number of target objects based on a small number of designated labels by the user. Compared with manually labeling each target object, this embodiment reduces the manual workload and improves work efficiency.
[0133] Embodiment 4:
[0134] In this embodiment 4, the configured set label recognition strategy is to determine the target recognition result corresponding to the target object according to the similarity between images.
[0135] Based on this, in this embodiment, the above steps use the configured set tag recognition strategy to determine the target recognition result corresponding to the target object, including:
[0136] Step d1, dividing all target objects into a first category of target objects and a second category of target objects; the first category of target objects includes at least one first target object, which is an object that is not assigned any designated label; the second category of target objects includes at least one second target object, which is an object that is assigned a designated label. At least two different second target objects in the second category of target objects are assigned different designated labels, and / or at least two different second target objects in the second category of target objects are assigned the same designated label.
[0137] In this embodiment, the target objects are divided into two categories according to whether they are assigned a specified label. Objects that are not assigned any specified label are classified into the first category of target objects, which includes at least one first target object; and object pairs that are assigned a specified label are classified into the second category of target objects, which includes at least one second target object.
[0138] In one embodiment, the designated label of the second target object may be determined by the user. For example, a certain number or a certain proportion of target objects may be randomly selected and displayed to the user through a visual interface of the electronic device, and the designated labels of the target objects by the user may be obtained.
[0139] Optionally, the second category of target objects may include at least multiple different second target objects, among which the multiple second target objects may include second target objects assigned different designated labels, or may also include second target objects assigned the same designated label, or may include both second target objects assigned different labels and second target objects assigned the same designated label.
[0140] Step d2, for the first target object, determine the similarity between the first target object and each second target object in the second category of target objects, select a designated label assigned to one of the second target objects based on the similarity between the first target object and each second target object in the second category of target objects, and determine the selected designated label as the target recognition result of the first target object.
[0141] In this embodiment, for each first target object, the similarity between the first target object and each second target object in the second category of target objects may be determined.
[0142] As an embodiment, the target image of the target object may be converted into an image vector, and then the similarity between the target objects may be determined according to the distance between the image vectors, and the similarity is positively correlated with the distance.
[0143] It should be noted that the method of converting the target image into an image vector is the same as that in the above embodiment 3, and will not be repeated here. There are many ways to determine the distance between image vectors, for example, the Euclidean distance, Manhattan distance, etc. between image vectors can be calculated, which is not limited here.
[0144] For example, if the second target object includes G1, G2, and G3, for the first target object P1, the similarity S11 between P1 and G1, the similarity S12 between P1 and G2, and the similarity S13 between P1 and G3 can be determined respectively according to the distance between the image vectors.
[0145] In this embodiment, based on the determined similarity between the first target object and each second target object, a second target object is selected according to the similarity, and the designated tag of the selected second target object is determined as the target recognition result of the first target object. Optionally, when selecting the second target object, the second target object with the highest similarity can be selected; or it can be randomly selected from the second target objects whose similarity exceeds a preset similarity threshold, etc.
[0146] In this embodiment, according to the determined second target object, the designated tag corresponding to the second target object is determined as the target recognition result of the first target object.
[0147] Still taking the first target object P1 as an example, a second target object can be selected in a preset manner, such as selecting the second target object G1, and the designated tag of G1 can be determined as the target recognition result of P1. For example, if the designated tag of G1 is a vehicle, the target recognition result of P1 can be determined as a vehicle.
[0148] This completes the description of Embodiment 4.
[0149] It can be understood that the above four embodiments are feasible implementation methods for determining target recognition results shown in this specification as examples. In actual use, they can be expanded based on the above embodiments, or multiple of the above embodiments can be combined, which will not be repeated here.
[0150] The following description takes an electronic device as a management server and uses the embodiment of the present application in a perimeter protection application as an example.
[0151] In perimeter protection applications, for the acquired video stream, the target object in the video stream is first detected and tracked. If the target object triggers the preset rules, the target image of the moving target is extracted from the video stream, and the moving target is identified based on the target image.
[0152] For example, users can set up perimeter defense for the "emergency lane" on the highway. First, the real-time video stream can be detected, and the target object can be extracted from the single-frame image of the video stream. The target object includes static or dynamic targets, such as vehicles, people, road signs, etc., which are framed from the image. Then, the extracted target objects are tracked in the subsequent image frames of the above single-frame image, and the moving target objects are screened out; then, during the tracking process, it is detected whether the moving target object triggers the preset rules, such as determining whether the target object crosses the boundary of the above "emergency lane". If the target object triggers the preset rules, the target image containing the target object is extracted.
[0153] Based on the target image of the target object extracted above, the method of the present application can be used to perform target recognition. Taking the target object as target object A as an example, the following steps can be included:
[0154] First, the electronic device first inputs the target image of the target object A into the first target recognition model, and obtains an initial recognition result of the target object as a vehicle.
[0155] Then, the electronic device determines the target recognition result of the target object A according to a preset tag recognition strategy, and can determine that the target recognition result is a vehicle.
[0156] Next, the electronic device may compare the target recognition result and the initial recognition result of the target object A. If both the target recognition result and the initial recognition result are vehicles, it may be determined that the two match, and the identification tag of the target object A is determined to be a vehicle.
[0157] Repeat the above steps until the electronic device determines that the total amount of newly identified identification tags in the current cycle is greater than the threshold. Then, based on the first target recognition model, the target images and identification tags of these target objects can be used to re-train the model to obtain a second target recognition model.
[0158] Then, a preset performance test method is used, for example, to test the recognition accuracy of the second target recognition model. If the preset conditions are met, the first target recognition model is updated to the second target recognition model.
[0159] Subsequently, the electronic device may use the second target recognition model to perform target recognition on the target object in the real-time video stream.
[0160] At this point, the process of using the method of the present application in an electronic device for perimeter protection applications is completed.
[0161] Corresponding to the above-mentioned embodiments of the target recognition method, this specification also provides embodiments of a target recognition device.
[0162] The target recognition device embodiments of this specification can be applied to electronic devices. The device embodiments can be implemented by software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the electronic device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 3 The figure is a hardware structure diagram of the electronic device where the target recognition device of this specification is located, except Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in which the device in the embodiment is located may also include other hardware according to the actual function of the electronic device, which will not be described in detail.
[0163] Figure 4 It is a block diagram of a target recognition device shown in an exemplary embodiment of the present application.
[0164] Please refer to Figure 4 The target recognition device 400 can be applied in the aforementioned Figure 3 The electronic equipment shown includes:
[0165] An initial recognition unit is used to determine the recognition label corresponding to each target object according to the obtained initial recognition result of each target object and the configured set label recognition strategy; the initial recognition result of the target object is obtained by inputting the target image corresponding to the target object into the trained first target recognition model, and the recognition label corresponding to the target object is associated with the initial recognition result of the target object;
[0166] A model updating unit is used to retrain the model based on the first target recognition model according to the target images corresponding to each target object and the identification labels corresponding to each target object to obtain a second target recognition model, and when the second target recognition model passes a set performance test, update the first target recognition model that has been designated for target recognition to the second target recognition model, so as to perform target recognition through the updated second target recognition model.
[0167] Optionally, determining the identification tag corresponding to each target object according to the obtained initial identification result of each target object and the configured set tag identification strategy includes:
[0168] For each target object, the target recognition result corresponding to the target object is determined using the configured set tag recognition strategy;
[0169] When the initial recognition result corresponding to the target object matches the target recognition result, the initial recognition result or the target recognition result corresponding to the target object is determined as the recognition tag corresponding to the target object; otherwise, the target recognition result corresponding to the target object is determined as the recognition tag corresponding to the target object.
[0170] Optionally, the determining a target recognition result corresponding to the target object by using a configured set tag recognition strategy includes:
[0171] Obtaining a tracking result of the tracked target object; the tracking result includes motion information of the target object;
[0172] The target recognition result corresponding to the target object is determined according to the motion information of the target object in the tracking result.
[0173] Optionally, the determining a target recognition result corresponding to the target object by using a configured set tag recognition strategy includes:
[0174] Using at least one designated model that has been trained to identify the target object, and obtaining at least one reference identification result;
[0175] One of all the reference recognition results obtained is determined as the target recognition result corresponding to the target object, wherein the one of the reference recognition results has the largest proportion among all the reference recognition results obtained.
[0176] Optionally, the determining a target recognition result corresponding to the target object by using a configured set tag recognition strategy includes:
[0177] Cluster each target object according to the set clustering method. For the first target object in each class, the designated label of the second target object in the class is determined as the target recognition result of the first target object; the first target object is an object that is not assigned any designated label; the second target object is an object that is assigned a designated label, and different second target objects in the same class are assigned the same designated label.
[0178] Optionally, the determining a target recognition result corresponding to the target object by using a configured set tag recognition strategy includes:
[0179] All target objects are divided into a first category of target objects and a second category of target objects; the first category of target objects includes at least one first target object, which is an object that is not assigned any specified label; the second category of target objects includes at least one second target object, which is an object that is assigned a specified label; at least two different second target objects in the second category of target objects are assigned different specified labels, and / or at least two different second target objects in the second category of target objects are assigned the same specified label;
[0180] For the first target object, determine the similarity between the first target object and each second target object in the second category of target objects, select a designated label assigned to one of the second target objects based on the similarity between the first target object and each second target object in the second category of target objects, and determine the selected designated label as the target recognition result of the first target object.
[0181] Optionally, the initial recognition unit, before being used to re-train the model based on the first target recognition model according to the target image corresponding to each target object and the recognition label corresponding to each target object, is further used to:
[0182] Check whether the total amount of identification labels obtained within the specified historical time period is greater than or equal to the set label quantity threshold. If so, continue to re-train the model based on the first target recognition model according to the target images corresponding to each target object and the identification labels corresponding to each target object; the specified historical time period refers to: a time period ending at the current time point and having a specified duration.
[0183] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0184] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.
[0185] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0186] Corresponding to the embodiment of the aforementioned target recognition method, this specification also provides an electronic device, which includes: a processor and a memory for storing machine executable instructions. The processor and the memory are usually connected to each other via an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
[0187] In this embodiment, by reading and executing the machine executable instructions corresponding to the target recognition logic stored in the memory, the processor is prompted to:
[0188] Determine the identification label corresponding to each target object according to the obtained initial identification result of each target object and the configured set label identification strategy; the initial identification result of the target object is obtained by inputting the target image corresponding to the target object into the trained first target identification model, and the identification label corresponding to the target object is associated with the initial identification result of the target object;
[0189] Re-training the model based on the first target recognition model is performed according to the target images corresponding to each target object and the identification labels corresponding to each target object to obtain a second target recognition model. When the second target recognition model passes the set performance test, the first target recognition model that has been designated for target recognition is updated to the second target recognition model, so that target recognition is performed through the updated second target recognition model.
[0190] Optionally, determining the identification tag corresponding to each target object according to the obtained initial identification result of each target object and the configured set tag identification strategy includes:
[0191] For each target object, the target recognition result corresponding to the target object is determined using the configured set tag recognition strategy;
[0192] When the initial recognition result corresponding to the target object matches the target recognition result, the initial recognition result or the target recognition result corresponding to the target object is determined as the recognition tag corresponding to the target object; otherwise, the target recognition result corresponding to the target object is determined as the recognition tag corresponding to the target object.
[0193] Optionally, the determining a target recognition result corresponding to the target object by using a configured set tag recognition strategy includes:
[0194] Obtaining a tracking result of the tracked target object; the tracking result includes motion information of the target object;
[0195] The target recognition result corresponding to the target object is determined according to the motion information of the target object in the tracking result.
[0196] Optionally, the determining a target recognition result corresponding to the target object by using a configured set tag recognition strategy includes:
[0197] Using at least one designated model that has been trained to identify the target object, and obtaining at least one reference identification result;
[0198] One of all the reference recognition results obtained is determined as the target recognition result corresponding to the target object, wherein the one of the reference recognition results has the largest proportion among all the reference recognition results obtained.
[0199] Optionally, the determining a target recognition result corresponding to the target object by using a configured set tag recognition strategy includes:
[0200] Cluster each target object according to the set clustering method. For the first target object in each class, the designated label of the second target object in the class is determined as the target recognition result of the first target object; the first target object is an object that is not assigned any designated label; the second target object is an object that is assigned a designated label, and different second target objects in the same class are assigned the same designated label.
[0201] Optionally, the determining a target recognition result corresponding to the target object by using a configured set tag recognition strategy includes:
[0202] All target objects are divided into a first category of target objects and a second category of target objects; the first category of target objects includes at least one first target object, which is an object that is not assigned any specified label; the second category of target objects includes at least one second target object, which is an object that is assigned a specified label; at least two different second target objects in the second category of target objects are assigned different specified labels, and / or at least two different second target objects in the second category of target objects are assigned the same specified label;
[0203] For the first target object, determine the similarity between the first target object and each second target object in the second category of target objects, select a designated label assigned to one of the second target objects based on the similarity between the first target object and each second target object in the second category of target objects, and determine the selected designated label as the target recognition result of the first target object.
[0204] Optionally, before re-training the model based on the first target recognition model according to the target images corresponding to the target objects and the identification labels corresponding to the target objects, the method further includes:
[0205] Check whether the total amount of identification labels obtained within the specified historical time period is greater than or equal to the set label quantity threshold. If so, continue to re-train the model based on the first target recognition model according to the target images corresponding to each target object and the identification labels corresponding to each target object; the specified historical time period refers to: a time period ending at the current time point and having a specified duration.
[0206] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0207] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A target recognition method, characterized in that: The method is applied to electronic equipment in a perimeter protection scenario, and the method includes: If the confidence level corresponding to the initial recognition result of each target object obtained is higher than a preset threshold, the initial recognition result is used as the recognition label corresponding to each target object; If the confidence level corresponding to the initial recognition result of each target object obtained is not higher than a preset threshold, then for each target object, a tracking result of the tracked target object is obtained, the tracking result includes the movement speed of the target object, and the target recognition result corresponding to the target object is determined according to the movement speed of the target object in the tracking result; wherein, determining the target recognition result corresponding to the target object according to the movement speed of the target object in the tracking result includes: pre-configuring different movement speed ranges for different types of objects, comparing the movement speed of the target object in the tracking result with the movement speed ranges configured for the different objects, if the movement speed of the target object in the tracking result matches the movement speed range corresponding to the target object, then determining that the initial recognition result of the target object is accurate, and determining that the initial recognition result is the target recognition result corresponding to the target object, if the movement speed of the target object in the tracking result does not match the movement speed range corresponding to the target object, then determining that the initial recognition result of the target object is inaccurate, and using other preset methods to generate a target recognition result; When the initial recognition result corresponding to the target object matches the target recognition result, the initial recognition result or the target recognition result corresponding to the target object is determined as the recognition label corresponding to the target object; otherwise, the target recognition result corresponding to the target object is determined as the recognition label corresponding to the target object; the initial recognition result of the target object and the confidence corresponding to the initial recognition result of the target object are obtained by inputting the target image corresponding to the target object into the trained first target recognition model, and the recognition label corresponding to the target object is associated with the initial recognition result of the target object; Re-training the model based on the first target recognition model is performed according to the target images corresponding to each target object and the identification labels corresponding to each target object to obtain a second target recognition model. When the second target recognition model passes the set performance test, the first target recognition model that has been designated for target recognition is updated to the second target recognition model, so that target recognition is performed through the updated second target recognition model.
2. The method according to claim 1, characterized in that: Before re-training the model based on the first target recognition model according to the target images corresponding to the target objects and the identification labels corresponding to the target objects, the method further includes: Check whether the total amount of identification labels obtained within the specified historical time period is greater than or equal to the set label quantity threshold. If so, continue to re-train the model based on the first target recognition model according to the target images corresponding to each target object and the identification labels corresponding to each target object; the specified historical time period refers to: a time period ending at the current time point and having a specified duration.
3. A target recognition device, characterized in that: The device is applied to electronic equipment in perimeter protection scenarios, and includes: An initial recognition unit, configured to use the initial recognition result obtained for each target object as an identification label corresponding to each target object if the confidence level corresponding to the initial recognition result obtained for each target object is higher than a preset threshold; If the confidence level corresponding to the initial recognition result of each target object obtained is not higher than a preset threshold, then for each target object, a tracking result of the tracked target object is obtained, the tracking result includes the movement speed of the target object, and the target recognition result corresponding to the target object is determined according to the movement speed of the target object in the tracking result; wherein, determining the target recognition result corresponding to the target object according to the movement speed of the target object in the tracking result includes: pre-configuring different movement speed ranges for different types of objects, comparing the movement speed of the target object in the tracking result with the movement speed ranges configured for the different objects, if the movement speed of the target object in the tracking result matches the movement speed range corresponding to the target object, then determining that the initial recognition result of the target object is accurate, and determining that the initial recognition result is the target recognition result corresponding to the target object, if the movement speed of the target object in the tracking result does not match the movement speed range corresponding to the target object, then determining that the initial recognition result of the target object is inaccurate, and using other preset methods to generate a target recognition result; When the initial recognition result corresponding to the target object matches the target recognition result, the initial recognition result or the target recognition result corresponding to the target object is determined as the recognition label corresponding to the target object; otherwise, the target recognition result corresponding to the target object is determined as the recognition label corresponding to the target object; the initial recognition result of the target object and the confidence corresponding to the initial recognition result of the target object are obtained by inputting the target image corresponding to the target object into the trained first target recognition model, and the recognition label corresponding to the target object is associated with the initial recognition result of the target object; A model updating unit is used to retrain the model based on the first target recognition model according to the target images corresponding to each target object and the identification labels corresponding to each target object to obtain a second target recognition model, and when the second target recognition model passes a set performance test, update the first target recognition model that has been designated for target recognition to the second target recognition model, so as to perform target recognition through the updated second target recognition model.
4. The device according to claim 3, characterized in that The initial recognition unit, before being used to re-train the model based on the first target recognition model according to the target image corresponding to each target object and the recognition label corresponding to each target object, is further used to: Check whether the total amount of identification labels obtained within the specified historical time period is greater than or equal to the set label quantity threshold. If so, continue to re-train the model based on the first target recognition model according to the target images corresponding to each target object and the identification labels corresponding to each target object; the specified historical time period refers to: a time period ending at the current time point and having a specified duration.
5. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to claim 1 or 2 by running the executable instructions.
