Methods, apparatus, electronic equipment, media and products for automatic annotation of time series data
Through the automatic labeling method of time series data, combined with the target detection model and the target tracking model, the detection frame is corrected and updated frame by frame, which solves the problem of inaccurate automatic labeling results in the existing technology and achieves more accurate and efficient object labeling.
Patent Information
- Application Number
- CN202210199005.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-01
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-03-01
AI Technical Summary
Existing automatic labeling methods cannot adjust and correct the object labeling results in time during the labeling process, resulting in inaccurate automated object labeling results.
Through the automatic annotation method of time series data, the combination of the target detection model and the target tracking model is used to correct and update the detection frame frame by frame, and the intersection ratio and threshold conditions are used to adjust and delete the detection frame to achieve real-time correction and optimization of the annotation results. .
It improves the accuracy of automated object labeling, reduces errors and repetitions in manual labeling, improves labeling efficiency, and enhances the generalization ability of the model.
Smart Images

Figure CN114882211B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data annotation technology, and in particular to methods, devices, electronic devices, media and products for automatic annotation of time series data. Background Art
[0002] At present, deep learning models often require a large amount of labeled data, and labelers need to do a lot of labeling work. Providing accurate automatic object labeling results can greatly reduce the workload of labelers.
[0003] However, the existing automatic labeling methods provide object labeling results based on the original data before labeling begins, without combining the real-time labeling information generated during the labeling process. The object labeling results cannot be adjusted and corrected in time during the actual labeling process, and the errors in the automatic labeling results cannot be corrected in real time, resulting in inaccurate automated object labeling results.
[0004] With respect to the above-mentioned related technologies, the inventors believe that the existing automatic labeling methods have the defect that the object labeling results cannot be adjusted and corrected in time during the actual labeling process, resulting in inaccurate automatic object labeling results. Summary of the invention
[0005] In order to provide more accurate automated object labeling results, the present application provides a method, device, electronic device, medium and product for automatic labeling of time series data.
[0006] In a first aspect, the present application provides a method for automatic labeling of time series data, which has the characteristic of providing more accurate automatic object labeling results.
[0007] This application is achieved through the following technical solutions:
[0008] A method for automatically labeling time series data includes the following steps:
[0009] After obtaining the frames to be annotated and arranging them in time sequence, they are input into a preset target detection model based on single-frame data to output detection boxes frame by frame as the first automatic annotation results of the corresponding frames;
[0010] Based on the first frame data in the frame to be annotated and the preset detection frame area value and position, correct the corresponding first automatic annotation result;
[0011] Based on the frames to be annotated arranged in time sequence, the correct first automatic annotation result is input into a preset target tracking model based on continuous frame data to predict all detection frames of the object in the frame data in subsequent frames as the second automatic annotation result of the corresponding frame;
[0012] The detection frame of each object in the second automatic labeling result is compared with the detection frame of the first automatic labeling result, and the first automatic labeling result of the corresponding frame is updated.
[0013] In a preferred example, the present application may be further configured as follows: the step of updating the first automatic annotation result of the corresponding frame includes:
[0014] For the detection frame of the second automatic labeling result, search the first automatic labeling result for the detection frame with the largest intersection-and-union ratio with it, and when the intersection-and-union ratio meets the condition, make the second automatic labeling result of the corresponding frame data replace the first automatic labeling result.
[0015] In a preferred example, the present application may be further configured as follows: the step of updating the first automatic annotation result of the corresponding frame includes:
[0016] For the detection box of the second automatic labeling result, a detection box with the largest intersection-over-union ratio is searched in the first automatic labeling result, and when the intersection-over-union ratio does not meet a condition, the detection box is added to the first automatic labeling result.
[0017] In a preferred example, the present application can be further configured to include the following steps:
[0018] Correcting the updated first automatic labeling result based on the next frame data in the frame to be labeled and the preset detection frame area value and position;
[0019] Then, the correct first automatic labeling result after correction is input into a preset target tracking model based on continuous frame data, and then a second automatic labeling result of the corresponding frame is obtained;
[0020] Determining whether the detection frame of each object in the second automatic labeling result matches the updated detection frame of the first automatic labeling result;
[0021] If they match, the second automatic labeling result of the corresponding frame data is used to iteratively update the first automatic labeling result until the correction of the last frame data of the frame to be labeled is completed.
[0022] In a preferred example, the present application can be further configured to include the following steps:
[0023] When the first automatic annotation result is returned to the annotation platform, it is input into a preset target detection model based on single-frame data to output the detection frame frame by frame and update the first automatic annotation result of the corresponding frame.
[0024] In a preferred example, the present application may be further configured as follows: the step of replacing the first automatic annotation result with the second automatic annotation result corresponding to the frame data comprises:
[0025] The detection box of the first automatic labeling result is removed from the original labeling result, and the detection box of the second automatic labeling result is added to the original labeling result.
[0026] In a preferred example, the present application can be further configured as follows: the step of automatically correcting the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position includes:
[0027] When the difference between the area value of the first automated labeling result and the preset detection frame area value is less than or equal to a first threshold, and the deviation between the position of the first automated labeling result and the preset detection frame position is less than or equal to a second threshold, and the recognition result in the detection frame is a target object, the detection frame is retained.
[0028] In a preferred example, the present application can be further configured as follows: the step of automatically correcting the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position includes:
[0029] When the difference between the area value of the first automated labeling result and the preset detection frame area value exceeds a first threshold, and the deviation between the position of the first automated labeling result and the preset detection frame position exceeds a second threshold, and the recognition result in the detection frame is a target object, the position and size of the detection frame are adjusted according to the preset detection frame area value and position.
[0030] In a preferred example, the present application can be further configured as follows: the step of automatically correcting the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position includes:
[0031] When the difference between the area value of the first automated labeling result and the preset detection frame area value exceeds a third threshold, and the deviation between the position of the first automated labeling result and the preset detection frame position exceeds a fourth threshold, or the recognition result in the detection frame is a non-target object, the detection frame is deleted.
[0032] In a preferred example, the present application can be further configured to include the following steps:
[0033] Based on the frames to be annotated arranged in time sequence, the correct first automatic annotation result of the first frame to be annotated is input into a preset target tracking model based on continuous frame data, and all detection frames of subsequent frames are predicted as actual outputs of the target tracking model;
[0034] Using the second automatic labeling result as the expected output of the target tracking model;
[0035] Compare the actual output with the expected output, and calculate the loss value of the target tracking model;
[0036] The loss value is fed back via the gradient to update the parameters of the target tracking model;
[0037] Iterative parameter update of the target tracking model.
[0038] In a second aspect, the present application provides a device for automatic labeling of time series data, which has the characteristic of providing more accurate automatic object labeling results.
[0039] This application is achieved through the following technical solutions:
[0040] A time series data automatic labeling device, comprising:
[0041] A single-frame annotation module is used to obtain the frames to be annotated and arrange them in time sequence, and then input them into a preset target detection model based on single-frame data to output detection boxes frame by frame as the first automatic annotation result of the corresponding frame;
[0042] A correction module, used for correcting the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position;
[0043] A continuous frame labeling module is used to input the correct first automatic labeling result into a preset target tracking model based on continuous frame data based on the frames to be labeled arranged in time sequence, and predict all detection frames of the object in the frame data in subsequent frames as the second automatic labeling result of the corresponding frame;
[0044] The optimization module is used to compare the detection frame of each object in the second automatic labeling result with the detection frame of the first automatic labeling result, and update the first automatic labeling result of the corresponding frame.
[0045] In a third aspect, the present application provides a computer device having the characteristic of providing more accurate automated object labeling results.
[0046] This application is achieved through the following technical solutions:
[0047] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for automatic annotation of time series data when executing the computer program.
[0048] In a fourth aspect, the present application provides a computer-readable storage medium having the characteristic of providing more accurate automated object labeling results.
[0049] This application is achieved through the following technical solutions:
[0050] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for automatic annotation of time series data are implemented.
[0051] In a fifth aspect, the present application provides a computer program product having the characteristic of providing more accurate automated object labeling results.
[0052] This application is achieved through the following technical solutions:
[0053] A computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for automatic annotation of time series data are implemented.
[0054] In summary, the present application includes at least one of the following beneficial technical effects:
[0055] 1. After obtaining the frames to be labeled and arranging them in time sequence, they are input into the preset target detection model based on single-frame data to output the detection frame frame by frame as the first automatic labeling result of the corresponding frame; based on the first frame data in the frame to be labeled and the preset detection frame area value and position, the corresponding first automatic labeling result is corrected until the corresponding first automatic labeling result meets the conditions, so as to increase the prior information of the time sequence relationship by checking the first automatic labeling result, so that the correct first automatic labeling result after correction can accurately mark most target objects, which is conducive to improving the automatic labeling effect and also conducive to improving the efficiency of subsequent manual labeling; based on the frames to be labeled arranged in time sequence, the correct first automatic labeling result after correction is input into the preset target tracking model based on continuous frame data, and all the detection frames of the subsequent frames are predicted as the second automatic labeling result of the corresponding frame, so as to increase the prior information of the time sequence relationship and smooth the fluctuation of the position and size of the detection frame based on the upper and lower frame data, so as to better mark the target objects. Annotate a more accurate detection frame; search for a detection frame with the largest intersection-and-union ratio with the second automatic annotation result from the detection frame of the first automatic annotation result of each frame of data; if it exists and the intersection-and-union ratio meets the conditions, replace the first automatic annotation result with the second automatic annotation result of the corresponding frame data, and the target tracking model supplements and updates the first automatic annotation result of the target detection model based on the single-frame data. The target detection model and the target tracking model divide the work between each other and work together to complete the annotation work of the frame to be annotated, so that a more accurate detection frame can be annotated; furthermore, a method for automatic annotation of time series data can timely adjust and correct the annotation results in the actual annotation process, so that the automatic object annotation results are more accurate, and provide an automatic annotation result that interacts with the annotation process to assist in the manual annotation process, thereby speeding up the efficiency of manual annotation; at the same time, the automatic annotation results of subsequent frames are corrected in time according to the corrected first automatic annotation results of the previous frame, which greatly reduces the recurrence of similar erroneous annotations and improves the annotation efficiency;
[0056] 2. Correcting and inputting the first automatic annotation result of the target tracking model based on continuous frame data always keeps the latest state to iterate the output result of the target tracking model, and provides the automatic annotation result that interacts with the annotation process, so that the automatic object annotation result is more accurate;
[0057] 3. When the first automated annotation result is returned to the annotation platform, it is input into a preset target detection model based on single-frame data to output the detection frame frame by frame, and the first automated annotation result of the corresponding frame is updated, so that the output result of the target detection model can interact with the entire annotation process in real time, providing an automated annotation result that interacts with the annotation process, making the automated object annotation result more accurate;
[0058] 4. Based on the frames to be annotated arranged in time sequence, the correct first automatic annotation result of the first frame to be annotated is input into the preset target tracking model based on continuous frame data, and all detection frames of subsequent frames are predicted as the actual output of the target tracking model; the second automatic annotation result is used as the expected output of the target tracking model; the actual output and the expected output are compared to calculate the loss value of the target tracking model; the loss value is passed back through the gradient to update the parameters of the target tracking model, and the target tracking model with updated parameters is iterated to optimize the target tracking model, improve the prediction ability of the target tracking model, and make the annotation result output by the target tracking model more accurate;
[0059] 5. If the intersection and union ratio of the first automated labeling result and the second automated labeling result is an empty set, the detection box corresponding to the second automated labeling result is added to the first automated labeling result to supplement and update the first automated labeling result, expand the recognition range of the target object, and enhance the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a flowchart of a method for automatic annotation of time series data according to one embodiment of the present application.
[0061] Figure 2 It is a flowchart of automatically correcting the first automatic annotation result corresponding to the automatic correction.
[0062] Figure 3 It is a flowchart of the updated target tracking model.
[0063] Figure 4 It is a structural block diagram of a time series data automatic annotation device according to one embodiment of the present application. DETAILED DESCRIPTION
[0064] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make modifications to the present embodiment without any creative contribution as needed, but such modifications are protected by the patent law as long as they are within the scope of the claims of the present application.
[0065] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0066] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can 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, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.
[0067] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.
[0068] Reference Figure 1 , an embodiment of the present application provides a method for automatic annotation of time series data, and the main steps of the method are described as follows.
[0069] S1: After obtaining the frames to be annotated and arranging them in time sequence, they are input into a preset target detection model based on single-frame data to output detection boxes frame by frame as the first automatic annotation result of the corresponding frame;
[0070] S2: based on the first frame data in the frame to be annotated and the preset detection frame area value and position, correct the corresponding first automatic annotation result;
[0071] S3: Based on the frames to be annotated arranged in time sequence, the correct first automatic annotation result is input into a preset target tracking model based on continuous frame data, and all detection frames of the object in the frame data in subsequent frames are predicted as the second automatic annotation result of the corresponding frame;
[0072] S4: Compare the detection frame of each object in the second automatic labeling result with the detection frame of the first automatic labeling result;
[0073] S51: for the detection frame of the second automatic labeling result, searching the detection frame with the largest intersection-over-union ratio in the first automatic labeling result, and when the intersection-over-union ratio satisfies a condition, replacing the first automatic labeling result with the second automatic labeling result of the corresponding frame data;
[0074] S6: When the annotator is annotating, the first automated annotation result is returned to the annotation platform to assist in the annotation; based on the next frame data in the frame to be annotated and the preset detection box area value and position, the updated first automated annotation result is corrected to obtain the second automated annotation result of the corresponding frame, and the first automated annotation result is iteratively updated until the correction of all frames to be annotated is completed.
[0075] Among them, based on the next frame data in the frame to be labeled and the preset detection box area value and position, correcting the updated first automatic labeling result, obtaining the second automatic labeling result of the corresponding frame, and iteratively updating the first automatic labeling result until the correction of all frames to be labeled is completed includes:
[0076] Correcting the updated first automatic labeling result based on the next frame data in the frame to be labeled and the preset detection frame area value and position;
[0077] Then, the correct first automatic labeling result after correction is input into a preset target tracking model based on continuous frame data, and then a second automatic labeling result of the corresponding frame is obtained;
[0078] Determine whether the detection frame of each object in the second automatic labeling result matches the updated detection frame of the first automatic labeling result;
[0079] If they match, the second automatic labeling result of the corresponding frame data is used to iteratively update the first automatic labeling result until the correction of the last frame data of the frame to be labeled is completed.
[0080] Further, S4: after searching for a detection frame with the largest intersection-over-union ratio in the first automatic labeling result for the detection frame of the second automatic labeling result, the following steps are further included:
[0081] S52: For a detection box in the second automatic labeling result, search for a detection box with the largest intersection-over-union ratio in the first automatic labeling result, and if the intersection-over-union ratio does not meet the condition, add the detection box to the first automatic labeling result.
[0082] Furthermore, when the first automatic annotation result is returned to the annotation platform, it is input into a preset target detection model based on single-frame data to output the detection box frame by frame and update the first automatic annotation result of the corresponding frame.
[0083] Reference Figure 2 , further, S2: based on the first frame data in the frame to be annotated and the preset detection frame area value and position, the step of automatically correcting the corresponding first automatic annotation result includes:
[0084] S21: when the difference between the area value of the first automatic annotation result and the preset area value of the detection frame is less than or equal to the first threshold, and the deviation between the position of the first automatic annotation result and the preset position of the detection frame is less than or equal to the second threshold, and the recognition result in the detection frame is the target object, the detection frame is retained;
[0085] S22: when the difference between the area value of the first automatic annotation result and the preset area value of the detection frame exceeds a first threshold, and the deviation between the position of the first automatic annotation result and the preset position of the detection frame exceeds a second threshold, and the recognition result in the detection frame is a target object, adjusting the position and size of the detection frame according to the preset area value and position of the detection frame;
[0086] S23: When the difference between the area value of the first automatic labeling result and the preset area value of the detection frame exceeds the third threshold, and the deviation between the position of the first automatic labeling result and the preset position of the detection frame exceeds the fourth threshold, or the recognition result in the detection frame is a non-target object, delete the detection frame.
[0087] Reference Figure 3 , further, S31: based on the frames to be annotated arranged in time sequence, a correct first automatic annotation result of the first frame to be annotated is input into a preset target tracking model based on continuous frame data, and all detection frames of subsequent frames are predicted as actual outputs of the target tracking model;
[0088] S32: Using the second automatic annotation result as the expected output of the target tracking model;
[0089] S33: Compare the actual output with the expected output and calculate the loss value of the target tracking model;
[0090] S34: The loss value is fed back via the gradient to update the parameters of the target tracking model;
[0091] S35: Iterative parameter update of target tracking model.
[0092] Specifically, the specific process steps of the above embodiments are described as follows.
[0093] The preset single-frame data-based target detection model is trained based on a deep learning model to automatically annotate single-frame data. In this embodiment, the deep learning model used by the target detection model can be any one of yolov4, RetinaNet or MaskRCNN.
[0094] Taking yolov4 as an example, first obtain the dataset of the required labeled categories, such as vehicle detection box, headlight detection box, pedestrian detection box and other labeled datasets, or define the labeled category dataset according to task requirements, and create a dataset folder in the same directory as the downloaded yolov4 folder, and then store the dataset of the required labeled category or the self-defined labeled category dataset in the dataset folder. At the same time, modify the configuration file, and perform model training and inference to build a target detection model for automatically labeling single frame data.
[0095] By inputting a single frame of data to be labeled, the target detection model can detect the position of the object to be labeled in the current frame to obtain the detection frame corresponding to the object to be labeled. The detection frame is the area formed by the horizontal straight lines where the upper and lower boundaries of the object to be labeled are located and the vertical straight lines where the left and right boundaries are located.
[0096] Then, after obtaining the frames to be annotated and arranging them in time sequence, they are input into the above-mentioned target detection model to output the detection boxes frame by frame as the first automatic annotation results of the corresponding frames.
[0097] Next, based on the first frame data in the frame to be annotated and the preset detection frame area value and position, the corresponding first automated annotation result is automatically corrected until the corresponding first automated annotation result meets the conditions. The preset detection frame area value and position are set based on the position and size of the target object, respectively. The preset detection frame area value is the area of the rectangular area formed by the horizontal straight line where the upper and lower boundaries of the target object are located and the vertical straight line where the left and right boundaries are located. The detection frame position is the location of the rectangular area. The preset detection frame area value is manually pre-set according to the uncorrected first automated result. Based on the preset detection frame area value and position, the corresponding first automated annotation result is automatically corrected until the corresponding first automated annotation result meets the preset detection frame area value and position conditions.
[0098] Specifically, when the difference between the area value of the first automated annotation result and the preset detection frame area value is less than or equal to the first threshold, and the deviation between the position of the first automated annotation result and the preset detection frame position is less than or equal to the second threshold, and the recognition result in the detection frame is a target object, the detection frame is retained; when the difference between the area value of the first automated annotation result and the preset detection frame area value exceeds the first threshold, and the deviation between the position of the first automated annotation result and the preset detection frame position exceeds the second threshold, and the recognition result in the detection frame is a target object, the position and size of the detection frame are adjusted according to the preset detection frame area value and position; when the difference between the area value of the first automated annotation result and the preset detection frame area value exceeds the third threshold, the third threshold is greater than the first threshold, and the deviation between the position of the first automated annotation result and the preset detection frame position exceeds the fourth threshold, the fourth threshold is greater than the second threshold, or the recognition result in the detection frame is a non-target object, the detection frame is deleted.
[0099] In this embodiment, the first threshold may be 0.5, the second threshold may be 0.08, the third threshold may be 1.5, and the fourth threshold may be 0.8.
[0100] By checking the first automated labeling result, the automatically corrected first automated labeling result can accurately mark most target objects. Therefore, when the automated labeling result is subsequently used to assist manual labeling, the efficiency of manual labeling can be greatly improved.
[0101] Of course, the first automated labeling result can also be corrected by manual labeling, which includes manually labeling the first automated labeling result, adjusting the detection frames with inaccurate sizes and positions, deleting multiple labeled detection frames, and supplementing the missed detection frames to obtain the final labeling result of the first automated labeling result.
[0102] Arrange the frames to be annotated in time sequence, obtain the first frame data and the corresponding first automatic annotation result, use the first frame data as the frame to be annotated, display its image or point cloud data on the annotation tool, and manually identify and annotate. At the same time, the corresponding first automatic annotation result, that is, the detection frame, will also be displayed by the annotation tool as auxiliary information to speed up the manual annotation. During the annotation process, the first automatic annotation result is modified according to the position and size of the target object. The modification operation includes retaining the detection frame that is accurately identified and fits the boundary of the target object; modifying the position and size of the detection frame that is accurately identified but slightly deviates from the boundary of the target object, until the modified detection frame accurately fits the boundary of the target object; deleting the detection frame that is not accurately identified or deviates too much from the boundary of the target object; to obtain the final annotation result. After the manual annotation is completed, the final annotation result is stored and returned as the first automatic annotation result of the corresponding frame.
[0103] If data annotation is performed based only on single-frame data, the temporal relationship cannot be utilized. For example, when detecting the same object in consecutive frames, the position and size of the detection box may fluctuate. Since the target detection model based on a single frame cannot obtain the detection box information of the upper and lower frames, it cannot optimize the fluctuations, which may easily lead to insufficient prior knowledge obtained by the target detection model. As a result, the performance ceiling of the target detection model is lower than that of the model that can utilize the upper and lower frame data.
[0104] Therefore, based on the frames to be annotated arranged in time sequence, the first automatic annotation results that meet the conditions are input into the preset target tracking model based on continuous frame data, and all detection frames of subsequent frames are predicted as the second automatic annotation results of the corresponding frames, so as to increase the prior information of the temporal relationship, which helps to improve the automatic annotation effect. In addition, the fluctuations of the position and size of the detection frame are smoothed based on the upper and lower frame data, so that more accurate detection frames can be annotated.
[0105] The preset target tracking model based on continuous frame data is trained based on a deep learning model to automatically annotate the continuous frame data. In this embodiment, the deep learning model used by the target tracking model can be either DeepSort or Trackor.
[0106] Taking DeepSort as an example, first obtain the training data set, which can be defined according to task requirements. Alternatively, you can use a publicly available data set such as the Market-1501 pedestrian rectangle data set, and divide the obtained data set into a training set and a test set. Set the absolute path and modify the configuration file, and then run the downloaded DeepSort model to train the target tracking model for automatically annotating continuous frame data.
[0107] For example, by inputting continuous frame data, such as D={d1, d2,…, dn} and the first automatic annotation result l1 of the first frame data d1 that meets the conditions, the target tracking model can automatically perform target detection on the second frame and subsequent input frame data D'={d2,…, dn}. When an object annotated in the first frame appears in a subsequent frame, the target tracking model can detect the new position and corresponding detection frame of the object in the subsequent frame, and return the detection frame L'={l2,…,ln} of all target objects annotated in the first frame in the subsequent frame.
[0108] If there are still frame data X'={xt+1,...xm} of the frames to be labeled that are arranged in time sequence, then the first automatic labeling result yt that meets the conditions of the latest frame data xt is obtained, based on the frame data to be labeled X', the continuous frame data to be labeled as the input of the target tracking model, that is, corresponding to D', with xt as the first frame data, that is, corresponding to d1, and yt as the first frame labeling information in the input of the target tracking model, that is, corresponding to l1. The target tracking model can automatically detect the frame data X' to be labeled, and return the detection boxes of all target objects yt in the xt frame data in the subsequent frames as the second automatic labeling results of the new target objects.
[0109] Because the detection box predicted by the target tracking model for an object in the next frame in the time series relationship is based on its detection box in the previous frame, based on the first automatic labeling result that meets the conditions, if there is a deviation in the position or size of the detection box automatically labeled by the target detection model, the target tracking model can automatically correct the labeling result of the next frame according to the first automatic labeling result that meets the conditions in the previous frame, thereby improving the automatic labeling effect.
[0110] In this embodiment, the first automatic annotation result of the first frame data that meets the conditions is input into a preset target tracking model based on continuous frame data, and the position change of the object in the verified data frame is predicted to obtain all the detection frames of the first frame data in the subsequent frames. If other frame data, such as the second frame data, are taken, then because the automatic annotation result of the first frame is not utilized, it is easy to cause the previously updated result of the second frame to be overwritten when updating the subsequent frames, resulting in the previous annotation of the second frame not taking effect, affecting the accuracy.
[0111] Next, a detection frame having the largest intersection-over-union ratio with the second automatic annotation result is searched from the first automatic annotation result of each frame of data, and it is determined whether the intersection-over-union ratio is greater than or equal to a preset threshold.
[0112] Specifically, based on the similarity between the first detection box of the first automatic labeling result and the second detection box of the second automatic labeling result, the area formed by the set of pixels in the detection box is measured, and the ratio of the intersection area and the union area of the two detection boxes is calculated to obtain the intersection-over-union ratio, usually referred to as IoU.
[0113] By searching the detection frame with the largest intersection-over-union ratio with the second automatic annotation result from the first automatic annotation result of each frame of data, and determining whether the intersection-over-union ratio corresponding to the detection frame is greater than or equal to a preset threshold. In this embodiment, the threshold can be set to 0.25.
[0114] When the intersection-and-union ratio is greater than or equal to the threshold, the second automated annotation result of the corresponding frame data replaces the first automated annotation result, that is, the detection box of the first automated annotation result is removed from the annotation result, and the detection box of the second automated annotation result is added to the annotation result to update the original automated annotation result of the corresponding frame data.
[0115] Furthermore, for a certain detection frame in the second automated labeling result, a detection frame with the largest intersection-over-union ratio with the second automated labeling result is searched from the first automated labeling result of each frame data, and when the intersection-over-union ratio corresponding to the detection frame does not reach a preset threshold, that is, it is less than the preset threshold, that is, the detection frame of the second automated labeling result does not exist in the first automated labeling result, and the detection frame of the second automated labeling result represents a new object, then the detection frame of the second automated labeling result is added to the first automated labeling result to update the original automated labeling result of the corresponding frame data, supplement and update the first automated labeling result, expand the recognition range of the target object, and enhance the generalization ability of the model.
[0116] Furthermore, when performing the labeling work, a first automatic labeling result is output to assist manual labeling.
[0117] Furthermore, based on the frames to be annotated arranged in time sequence, a correct first automatic annotation result of the first frame to be annotated is input into a preset target tracking model based on continuous frame data, and all detection frames of subsequent frames are predicted as actual outputs of the target tracking model;
[0118] Using the second automatic annotation result as the expected output of the target tracking model;
[0119] Compare the actual output with the expected output and calculate the loss value of the target tracking model;
[0120] The loss value is fed back via the gradient to update the parameters of the target tracking model;
[0121] Object tracking model with iterative parameter updates.
[0122] Specifically, all the first automatic labeling results {y0, y1, ..., ym} that meet the conditions and their corresponding frame data {x0, x1, ..., xm} arranged in time sequence are obtained, and any frame data xi and its corresponding first automatic labeling result yi are used as the first frame input of the target detection model, that is, corresponding to d1 and l1 respectively, and the subsequent frame data {xi, xi+1, ...xm} are used as the frame data to be labeled, that is, corresponding to D', and the second automatic labeling results {yi, yi+1..., ym} of the subsequent frames are used as the expected output of the target tracking model.
[0123] Then the actual output of the model, that is, the detection box L' of all target objects in the subsequent frames marked in the first frame returned by the target tracking model is compared with the above expected output to calculate the model loss value. In this embodiment, for discrete value models, such as target object categories, cross entropy is used as the loss value, and for continuous value models, such as the coordinates of the target object detection box, the root mean square error is used as the loss value, and the partial derivative of the loss value with respect to each model parameter is calculated. Then, the gradient descent method is used to update the model parameters, that is, the parameters of the target tracking model are updated via gradient backpropagation. During the optimization process, parameter values that are too large will be reduced, and parameter values that are too small will be increased, so that the loss value is as small as possible.
[0124] After the update is complete, save the new target tracking model for subsequent use to improve the prediction capability of the target tracking model.
[0125] Furthermore, a method for automatic labeling of time series data is based on a corrected first automatic labeling result, adds prior information of the time series relationship, and uses a target tracking model based on continuous frame data to predict the labeling result of the frame to be labeled, which is beneficial to the improvement of the automatic labeling effect; and the target tracking model is used to supplement and update the first automatic labeling result of the target detection model based on single frame data, and the target detection model and the target tracking model are divided into two parts to jointly complete the labeling work of the frame to be labeled, so as to timely adjust and correct the labeling result in the actual labeling process, so as to make the automatic object labeling result more accurate, and provide an automatic labeling result that interacts with the labeling process to assist in the manual labeling process, thereby speeding up the efficiency of manual labeling; at the same time, the automatic labeling result of the subsequent frame is corrected in time according to the corrected first automatic labeling result of the previous frame, which greatly reduces the recurrence of similar erroneous labeling and improves the labeling efficiency.
[0126] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0127] Reference Figure 4The embodiment of the present application further provides a time series data automatic labeling device, which corresponds one-to-one to a time series data automatic labeling method in the above embodiment. The time series data automatic labeling device includes:
[0128] A single-frame annotation module is used to obtain the frames to be annotated and arrange them in time sequence, and then input them into a preset target detection model based on single-frame data to output detection boxes frame by frame as the first automatic annotation result of the corresponding frame;
[0129] A correction module, used to correct the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position, until the correction of all the frames to be annotated is completed;
[0130] A continuous frame annotation module is used to input the correct first automatic annotation result into a preset target tracking model based on continuous frame data based on the frames to be annotated arranged in time sequence, and predict all detection frames of the object in the frame data in subsequent frames as the second automatic annotation result of the corresponding frame;
[0131] an optimization module, configured to compare the detection frame of each object in the second automated labeling result with the detection frame of the first automated labeling result;
[0132] The updating module is used to update the first automatic labeling result of the target detection model, so as to return the first automatic labeling result to the labeling platform to assist the labeling when the labeler labels.
[0133] Furthermore, the correction module includes:
[0134] A retaining unit, configured to retain the detection frame when a difference between an area value of the first automated annotation result and an area value of a preset detection frame is less than or equal to a first threshold, and a deviation between a position of the first automated annotation result and a position of the preset detection frame is less than or equal to a second threshold, and a recognition result in the detection frame is a target object;
[0135] an adjustment unit, configured to adjust the position and size of the detection frame according to the preset detection frame area value and position when the difference between the area value of the first automatic annotation result and the preset detection frame area value exceeds a first threshold, and the deviation between the position of the first automatic annotation result and the preset detection frame position exceeds a second threshold, and the recognition result in the detection frame is a target object;
[0136] A deleting unit is used to delete the detection frame when the difference between the area value of the first automatic labeling result and the preset detection frame area value exceeds a third threshold, and the deviation between the position of the first automatic labeling result and the preset detection frame position exceeds a fourth threshold, or the recognition result in the detection frame is a non-target object.
[0137] Furthermore, a time series data automatic labeling device also includes:
[0138] The iterative module is used to input the correct first automatic annotation result of the first frame to be annotated into a preset target tracking model based on continuous frame data based on the frames to be annotated arranged in time sequence, predict all detection frames of subsequent frames as the actual output of the target tracking model; use the second automatic annotation result as the expected output of the target tracking model; compare the actual output with the expected output, and calculate the loss value of the target tracking model; the loss value is fed back via the gradient to update the parameters of the target tracking model; iterate the target tracking model with updated parameters.
[0139] Furthermore, the update module also includes:
[0140] The expansion submodule is used to search for a detection frame with the largest intersection-and-union ratio with the second automated annotation result from the first automated annotation result of each frame of data for a certain detection frame in the second automated annotation result, and when the intersection-and-union ratio corresponding to the detection frame does not reach a preset threshold, then add the detection frame of the second automated annotation result to the first automated annotation result.
[0141] For the specific definition of a time series data automatic annotation device, please refer to the definition of a time series data automatic annotation method above, which will not be repeated here. Each module in the above-mentioned time series data automatic annotation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0142] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for automatic annotation of time series data is implemented.
[0143] In one embodiment, a computer-readable storage medium is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0144] S1: After obtaining the frames to be annotated and arranging them in time sequence, they are input into a preset target detection model based on single-frame data to output detection boxes frame by frame as the first automatic annotation result of the corresponding frame;
[0145] S2: based on the first frame data in the frame to be annotated and the preset detection frame area value and position, correct the corresponding first automatic annotation result;
[0146] S3: Based on the frames to be annotated arranged in time sequence, the correct first automatic annotation result is input into a preset target tracking model based on continuous frame data, and all detection frames of the object in the frame data in subsequent frames are predicted as the second automatic annotation result of the corresponding frame;
[0147] S4: Compare the detection box of each object in the second automatic labeling result with the detection box of the first automatic labeling result, and update the first automatic labeling result of the corresponding frame.
[0148] In one embodiment, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, a method for automatically labeling time series data is implemented.
[0149] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0150] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.
Claims
1. A method for automatic annotation of time series data, characterized in that: The following steps are involved: After obtaining the frames to be annotated and arranging them in time sequence, they are input into a preset target detection model based on single-frame data to output detection boxes frame by frame as the first automatic annotation results of the corresponding frames; Based on the first frame data in the frame to be annotated and the preset detection frame area value and position, correct the corresponding first automatic annotation result; Based on the frames to be annotated arranged in time sequence, the correct first automatic annotation result is input into a preset target tracking model based on continuous frame data to predict all detection frames of the object in the frame data in subsequent frames as the second automatic annotation result of the corresponding frame; Comparing the detection frame of each object in the second automatic labeling result with the detection frame of the first automatic labeling result, and updating the first automatic labeling result of the corresponding frame; The following steps are also included: Based on the frames to be annotated arranged in time sequence, the correct first automatic annotation result of the first frame to be annotated is input into a preset target tracking model based on continuous frame data, and all detection frames of subsequent frames are predicted as actual outputs of the target tracking model; Using the second automatic labeling result as the expected output of the target tracking model; Compare the actual output with the expected output, and calculate the loss value of the target tracking model; The loss value is fed back via the gradient to update the parameters of the target tracking model; Iterative parameter update of the target tracking model.
2. The method for automatic annotation of time series data according to claim 1, characterized in that: The following steps are also included: The step of updating the first automatic annotation result of the corresponding frame includes: For the detection frame of the second automatic labeling result, search the first automatic labeling result for the detection frame with the largest intersection-over-union ratio with it, and when the intersection-over-union ratio meets the condition, make the second automatic labeling result of the corresponding frame data replace the first automatic labeling result.
3. The method for automatic annotation of time series data according to claim 2, characterized in that: The following steps are also included: The step of updating the first automatic annotation result of the corresponding frame includes: For the detection box of the second automatic labeling result, a detection box with the largest intersection-over-union ratio is searched in the first automatic labeling result, and when the intersection-over-union ratio does not meet a condition, the detection box is added to the first automatic labeling result.
4. The method for automatic annotation of time series data according to any one of claims 1 to 3, characterized in that: The following steps are also included: Correcting the updated first automatic labeling result based on the next frame data in the frame to be labeled and the preset detection frame area value and position; Then, the correct first automatic labeling result after correction is input into a preset target tracking model based on continuous frame data, and then a second automatic labeling result of the corresponding frame is obtained; Determining whether the detection frame of each object in the second automatic labeling result matches the updated detection frame of the first automatic labeling result; If they match, the second automatic labeling result of the corresponding frame data is used to iteratively update the first automatic labeling result until the correction of the last frame data of the frame to be labeled is completed.
5. The method for automatic annotation of time series data according to claim 1, characterized in that: The following steps are also included: When the first automatic annotation result is returned to the annotation platform, it is input into a preset target detection model based on single-frame data to output the detection frame frame by frame and update the first automatic annotation result of the corresponding frame.
6. The method for automatic annotation of time series data according to claim 2, characterized in that: The step of replacing the first automatic annotation result with the second automatic annotation result corresponding to the frame data comprises: The detection box of the first automatic labeling result is removed from the original labeling result, and the detection box of the second automatic labeling result is added to the original labeling result.
7. The method for automatic annotation of time series data according to claim 1, characterized in that: The step of automatically correcting the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position includes: When the difference between the area value of the first automated labeling result and the preset detection frame area value is less than or equal to a first threshold, and the deviation between the position of the first automated labeling result and the preset detection frame position is less than or equal to a second threshold, and the recognition result in the detection frame is a target object, the detection frame is retained.
8. The method for automatic annotation of time series data according to claim 1, characterized in that: The step of automatically correcting the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position includes: When the difference between the area value of the first automated labeling result and the preset detection frame area value exceeds a first threshold, and the deviation between the position of the first automated labeling result and the preset detection frame position exceeds a second threshold, and the recognition result in the detection frame is a target object, the position and size of the detection frame are adjusted according to the preset detection frame area value and position.
9. The method for automatic annotation of time series data according to claim 1, characterized in that: The step of automatically correcting the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position includes: When the difference between the area value of the first automated labeling result and the preset detection frame area value exceeds a third threshold, and the deviation between the position of the first automated labeling result and the preset detection frame position exceeds a fourth threshold, or the recognition result in the detection frame is a non-target object, the detection frame is deleted.
10. A time series data automatic labeling device, characterized in that: include: A single-frame annotation module is used to obtain the frames to be annotated and arrange them in time sequence, and then input them into a preset target detection model based on single-frame data to output detection boxes frame by frame as the first automatic annotation result of the corresponding frame; A correction module, used for correcting the corresponding first automatic annotation result based on the first frame data in the frame to be annotated and the preset detection frame area value and position; A continuous frame labeling module is used to input the correct first automatic labeling result into a preset target tracking model based on continuous frame data based on the frames to be labeled arranged in time sequence, and predict all detection frames of the object in the frame data in subsequent frames as the second automatic labeling result of the corresponding frame; The optimization module is used to compare the detection frame of each object in the second automatic labeling result with the detection frame of the first automatic labeling result, and update the first automatic labeling result of the corresponding frame.
11. A computer device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 9 when being executed by a processor.
