Timestamp character recognition method and device, electronic equipment and storage medium
By adopting active learning and non-uniform pixel data augmentation technology in timestamp text recognition, the problems of insufficient generalization performance of model and poor recognition performance in complex environments in the prior art are solved, and higher robustness and accuracy are achieved.
Patent Information
- Application Number
- CN202411533631.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art has insufficient generalization performance and poor recognition performance in complex environments in timestamp text recognition, resulting in reduced robustness and accuracy of the model.
Active learning technology is used to select samples that need to be marked through query strategies that combine expert knowledge and model uncertainty, and training data that is closer to the actual scenario is generated through non-uniform pixel data augmentation technology.
It improves the generalization performance of the timestamp text recognition model and the recognition performance in complex environments, and improves the robustness and accuracy of the model.
Smart Images

Figure CN119540965A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a timestamp text recognition method, device, electronic device and storage medium. Background Art
[0002] With the widespread application of video surveillance technology, automatically detecting and recognizing timestamp text in surveillance videos has become a key task. However, timestamp text is usually located in the corners of the video and is confused with the complex background color, which poses a great challenge to existing detection and recognition models. In particular, when the color of the timestamp text is similar to the background, the recognition accuracy of the existing model is significantly reduced.
[0003] At present, the YOLOX model is widely used in target detection tasks, and the CRNN model is used to handle text recognition tasks. However, there are still some technical difficulties when using these models for timestamped text detection and recognition. First, the cost of data annotation is high. Large-scale, high-quality annotated data is crucial to the performance of the model, but the annotation process is time-consuming and labor-intensive, and low-quality data may lead to a decrease in the robustness of the model. Active learning technology can reduce the amount of data and improve the learning efficiency of the model by selecting the most valuable samples for annotation. However, existing active learning methods usually rely on a single query criterion, such as uncertainty, ignoring the diversity and representativeness of samples in actual scenarios, resulting in insufficient generalization ability of the model.
[0004] Secondly, in complex environments, the confusion between timestamp text and background seriously affects the recognition effect of the CRNN model. The low contrast and blur of timestamp text and the lack of camera adjustment result in the limited processing ability of existing technologies for such scenarios. Existing text recognition technologies focus more on the recognition of handwritten and natural scene texts, and there is less research on the confusion between timestamp text and background in surveillance images, resulting in insufficient performance of the model in such scenarios. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a timestamp text recognition method, device, electronic device and storage medium to solve the problems of insufficient generalization performance of the timestamp text recognition model in the prior art, poor recognition performance in complex environments, resulting in reduced robustness and accuracy of the model.
[0006] According to a first aspect of an embodiment of the present application, a timestamp text recognition method is provided, comprising: obtaining an initial annotated data set, and training a target detection model using the initial annotated data set; using the trained target detection model to predict unlabeled image data to obtain prediction results; using a predetermined query strategy to select samples to be labeled from the unlabeled image data, wherein the query strategy is used to screen samples with high uncertainty by calculating information entropy based on expert knowledge and model uncertainty; labeling the samples to be labeled, and using the annotated data to update the initial annotated data set, using the updated initial annotated data set to update the target detection model, and using the updated target detection model to perform the timestamp text recognition task.
[0007] According to a second aspect of an embodiment of the present application, a timestamp text recognition device is provided, comprising: a training module, configured to obtain an initial annotated data set, and train a target detection model using the initial annotated data set; a prediction module, configured to use the trained target detection model to predict unlabeled image data and obtain prediction results; a query module, configured to select samples to be labeled from unlabeled image data using a predetermined query strategy, wherein the query strategy is used to screen samples with high uncertainty by calculating information entropy based on expert knowledge and model uncertainty; an update module, configured to label the samples to be labeled, and update the initial annotated data set using the annotated data, update the target detection model using the updated initial annotated data set, and perform the timestamp text recognition task using the updated target detection model.
[0008] According to a third aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the computer program.
[0009] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0010] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0011] By obtaining an initial annotated data set, using the initial annotated data set to train a target detection model; using the trained target detection model to predict unlabeled image data to obtain prediction results; using a predetermined query strategy to select samples to be labeled from unlabeled image data, wherein the query strategy is used to screen samples with high uncertainty by calculating information entropy based on expert knowledge and model uncertainty; labeling the samples to be labeled, and using the labeled data to update the initial annotated data set, using the updated initial annotated data set to update the target detection model, and using the updated target detection model to perform timestamped text recognition tasks. This application can improve the generalization performance of the timestamped text recognition model, improve the recognition performance of the model in complex environments, and improve the robustness and accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 It is a flowchart of a timestamp text recognition method provided in an embodiment of the present application;
[0014] Figure 2 is a flowchart of the active learning method provided in the embodiment of the present application;
[0015] Figure 3 It is a schematic diagram of a surveillance image sample with timestamp text and background confusion provided by an embodiment of the present application;
[0016] Figure 4 is a schematic diagram comparing the non-uniform pixel data enhancement effect provided in an embodiment of the present application;
[0017] Figure 5 is a schematic diagram of a sample of an offset image generated according to an embodiment of the present application;
[0018] Figure 6 It is a structural schematic diagram of a timestamp text recognition device provided in an embodiment of the present application;
[0019] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0021] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0022] In intelligent video analysis and surveillance, automatically detecting and recognizing timestamp text in videos has important application value. Timestamp text is usually used to record the generation time of the video, helping to trace and verify the occurrence time of events in surveillance videos. However, there are many challenges in accurately detecting and recognizing these timestamp texts, especially in the corners of the video, in scenes with complex backgrounds or low contrast. These factors seriously affect the accuracy and robustness of existing text detection and recognition models.
[0023] Current technologies attempt to handle the detection and recognition of timestamped text through deep learning models such as YOLOX and CRNN. The YOLOX model excels at object detection tasks, while the CRNN model is mainly used to process sequence data, such as text recognition. However, existing technical solutions still have some problems, especially in data quality, data acquisition efficiency, and the problem of text and background confusion in complex environments, which leads to insufficient performance of the model in practical applications.
[0024] Existing technical problem 1: High data annotation cost and unreasonable selection of effective samples
[0025] When using the YOLOX model for timestamp text detection, the quality and quantity of data are critical to the performance of the model. Deep learning models usually require a large amount of labeled training data to improve accuracy and robustness. However, labeling large-scale data is very time-consuming and resource-intensive. More importantly, not all data contributes equally to model training. Low-quality data can even have a negative impact on model training and weaken the robustness of the model.
[0026] To address this problem, active learning technology has been introduced into the data selection process. The core idea of active learning is to select the most valuable samples from unlabeled data for labeling in order to improve learning efficiency and reduce the workload of labeling. Existing active learning query strategies usually rely on a single criterion (such as model uncertainty), that is, samples that the model considers uncertain will be preferentially labeled. However, this single-criterion query strategy may cause the model to ignore representative samples in actual scenarios, thereby affecting the model's generalization ability and actual application performance.
[0027] Existing technical problem 2: low accuracy of timestamped text recognition under complex backgrounds
[0028] In the text recognition task, CRNN models are widely used for the recognition of sequence text. However, the particularity and complex background of timestamp text bring new challenges to the existing technology. Timestamp text often appears in the corners of surveillance videos and is similar in color to the background, especially at night or in low lighting conditions. The camera usually does not automatically adjust the image according to the readability of the text, which results in a low contrast between the timestamp text and the background, and serious confusion between the text and the background.
[0029] Existing text recognition technologies focus more on handwritten text recognition and scene text recognition, but less research has been done on the confusion between timestamp text and background. Since the visual characteristics of timestamp text are not as prominent as those of text in ordinary scenes, coupled with background interference, the recognition accuracy of existing technologies has dropped significantly when dealing with such complex environments.
[0030] To solve this problem, it is necessary to generate training data that is closer to the actual confusion scene. This can be achieved through non-uniform pixel data enhancement technology, simulating the confusion effect between the timestamp text and the background. Combined with specific image interpolation methods, such as linear interpolation in the vertical direction and quartic polynomial interpolation in the horizontal direction, it can ensure that the enhanced image is visually closer to the real surveillance image, thereby improving the model's ability to handle text and background confusion in complex scenes.
[0031] Therefore, in summary, the prior art mainly has the following technical problems:
[0032] 1. Low data labeling efficiency: It is costly to obtain large-scale high-quality labeled data, and low-quality data may reduce the performance of the model. Existing active learning strategies usually rely on a single standard and may ignore representative samples, resulting in insufficient model generalization performance.
[0033] 2. Timestamp text and background confusion: In actual monitoring scenarios, timestamp text is often similar to the background color, causing confusion between the text and the background. Existing technologies are insufficient in recognition capabilities in such complex scenarios, and more realistic data enhancement technology and interpolation methods are needed to optimize the recognition performance of the model.
[0034] In view of the problems existing in the above-mentioned prior art, the present application proposes a timestamp text recognition method. The technical solution of the present application mainly aims at the problem of model performance degradation in the process of timestamp text detection and recognition, especially in complex backgrounds and limited annotated data, and proposes a comprehensive solution based on active learning and non-uniform pixel data enhancement. First of all, when using the YOLOX model for timestamp text detection, a major problem faced is the high cost of data annotation, and not all data contribute equally to model training. To this end, the present application introduces active learning technology to reduce the amount of data annotation and improve learning efficiency by optimizing the sample selection process. Specifically, the core of active learning lies in the selection of query strategies. Unlike traditional strategies that rely only on a single uncertainty criterion, the present application proposes a query strategy that combines expert knowledge and model uncertainty. By combining the knowledge rules of domain experts, such as the number of categories, the number of detection boxes, the flatness of the detection box, the inconsistency of detection and recognition results, etc., it is ensured that the selected samples not only have a high labeling value, but also reflect the diversity and representativeness in real scenes. In addition, the query strategy based on model uncertainty selects samples with high model prediction uncertainty for annotation by calculating the information entropy of the samples, thereby effectively improving the generalization ability of the model.
[0035] Secondly, in order to solve the confusion problem between timestamp text and background, the present application proposes non-uniform pixel data enhancement technology. Timestamp text is usually embedded in the corner of the video, and the color may be similar to the background. The camera will not adjust the contrast of the image, so the CRNN model has poor performance in recognizing these low-contrast texts. In order to simulate the confusion between timestamp text and background in such complex scenes, the present application generates training samples through non-uniform pixel data enhancement technology. This technology simulates the effect of non-uniform noise by adding different offsets to each pixel in the image, and ensures the smooth transition of the image through linear interpolation in the vertical direction and quartic polynomial interpolation in the horizontal direction, thereby generating image data closer to the actual application scenario. This enhanced training data not only improves the model's ability to recognize timestamp text, but also significantly improves the model's robustness in dealing with complex backgrounds. In summary, the technical solution of the present application effectively combines active learning with data enhancement technology to solve the problems of low data annotation efficiency, insufficient model generalization ability, and recognition accuracy in complex backgrounds in timestamp text detection and recognition.
[0036] The contents of the technical solution of the present application are described in detail below with reference to the accompanying drawings and specific embodiments.
[0037] Figure 1 FIG. 1 is a flow chart of a timestamp text recognition method provided in an embodiment of the present application. Figure 1As shown, the timestamp text recognition method may specifically include:
[0038] S101, obtaining an initial annotated data set, and using the initial annotated data set to train a target detection model;
[0039] S102, using the trained object detection model to predict the unlabeled image data and obtain a prediction result;
[0040] S103, selecting samples to be labeled from the unlabeled image data using a predetermined query strategy, wherein the query strategy is used to screen samples with high uncertainty by calculating information entropy based on expert knowledge and model uncertainty;
[0041] S104, labeling the samples to be labeled, and using the labeled data to update the initial labeled data set, using the updated initial labeled data set to update the target detection model, and using the updated target detection model to perform the timestamp text recognition task.
[0042] In some embodiments, the present application discloses a timestamp text detection method based on active learning, which aims to solve the problem of high cost and low efficiency of large-scale data annotation in the prior art. Through this method, the workload of data annotation can be effectively reduced, while improving the learning efficiency and performance of the timestamp text detection model. Figure 2 is a flow chart of the active learning method provided in the embodiment of the present application. Figure 2 As shown, the active learning method may specifically include:
[0043] First, a small annotated dataset is selected for initial training. This dataset contains surveillance image samples for timestamp text detection, and the area where the timestamp text is located is annotated in the image. By inputting this initial annotated dataset into the YOLOX object detection model for training, an initial version of the model is generated. This model is used to detect timestamp text in images and output detection boxes.
[0044] After the initial model training is completed, select a certain amount of unlabeled surveillance image data and use the trained YOLOX model to predict these unlabeled data. The model will automatically generate detection boxes for timestamp text and output confidence scores and category information for each detection box.
[0045] In order to improve the efficiency of labeling, this application adopts an active learning query strategy to screen samples in unlabeled data. Specifically, this embodiment combines expert knowledge and uncertainty strategy for sample selection. The expert knowledge part includes category number rules, detection box number rules, detection box flatness rules, etc. Through these rules, samples with higher labeling value can be screened out. For example, if the number of categories in the test results of a certain sample is less than two categories (that is, any one of the date, time, and week is missing), the sample will be given priority for labeling. In addition, samples with higher uncertainty are selected by calculating the information entropy of the sample. Samples with high information entropy indicate that the model has greater uncertainty in its prediction results, so the sample also has a higher labeling value.
[0046] The samples that need to be labeled that are filtered out by the query strategy are manually labeled to determine the specific location and category of the timestamp text. After the labeling is completed, these newly labeled samples are added to the initial labeled data set to form an extended training data set. Next, the YOLOX model is retrained using this extended training data set to update the model's detection capabilities.
[0047] The above steps of unlabeled data prediction, query strategy sample selection, sample labeling and model update will be repeatedly executed to gradually improve the detection performance of the model. After each model update, the detection performance of the model is evaluated on the test set. If the performance of the model on the test set reaches the preset standard (such as the detection accuracy or recall rate reaches the target value), the active learning process stops.
[0048] Through the above steps, the active learning method of this embodiment effectively reduces the amount of data to be labeled, reduces the labeling cost, and significantly improves the learning efficiency and detection accuracy of the model by optimizing sample selection.
[0049] In some embodiments, selecting samples to be labeled from unlabeled image data using a predetermined query strategy includes:
[0050] Determine the target data category and judge the annotation value of the sample based on the number of categories so as to detect the predetermined key categories;
[0051] Evaluate the number of detection boxes. When the number of detection boxes for a certain type of data exceeds the expected range, mark the corresponding samples as samples that need to be labeled.
[0052] Determine the alignment of the detection frame and use the position consistency of the detection frame in the horizontal and vertical directions to evaluate the accuracy of the sample. When the detection frame is not aligned, mark the sample;
[0053] The test results are checked for compliance with the preset format. When the test results are inconsistent with the specified character length or format, the sample is identified as a sample that requires further annotation.
[0054] Specifically, the core of active learning is to select query strategies. Traditional strategies usually rely only on a single criterion, such as uncertainty, which may cause the model to ignore representative samples in real scenarios. To solve this problem, this application proposes a query strategy that combines expert knowledge and uncertainty, innovatively integrating the expert's understanding of the data and the uncertainty of the model in processing unknown data, optimizing sample selection, and ensuring its diversity and representativeness. The joint query strategy based on expert knowledge and uncertainty includes two parts: expert knowledge-based and uncertainty-based. Next, these two parts will be explained in detail.
[0055] An embodiment of the present application also discloses a timestamp text recognition method for selecting samples to be labeled based on a predetermined query strategy. The method aims to optimize the sample selection process by combining expert knowledge and model uncertainty, thereby improving the labeling efficiency and the detection accuracy of the model.
[0056] When processing unlabeled image data, first determine the target data category of the timestamp text. Timestamp text usually contains three types of key information: date, day of the week, and time. Based on the category number rule, the model needs to detect at least two categories, date and time, to consider the sample as a valid sample. If the number of categories in the detection result of a sample is less than two (that is, less than the two categories of date and time), the sample has a higher labeling value and is selected for labeling first. Through this rule, it is ensured that each sample contains the most critical information, improving the efficiency and quality of sample labeling.
[0057] Furthermore, based on the rule for the number of detection boxes, the rationality of the number of detection boxes is further evaluated. In surveillance images, each type of timestamp data (date, week, time) usually appears only once. Therefore, if two or more detection boxes appear in a certain type of data, it indicates that the model may mistakenly detect non-timestamp text as a target, or detect the same target multiple times. Such samples indicate that the model has a large uncertainty about the scene and has a high annotation value. Therefore, these samples are marked as samples for further review and are manually annotated in subsequent steps.
[0058] Furthermore, the alignment of the detection boxes in the sample in the image is evaluated in combination with the unevenness rule of the detection box. The timestamp text in the surveillance image is usually located on the same horizontal line of the image and has a consistent height. Therefore, it is expected that the center point of the detection box remains consistent in the horizontal direction and the height of the detection box is the same. If there is a significant difference in the height of the detection box in the detection result of a certain sample, or the vertical position of the center point deviates too much, it is considered that the detection box fails to accurately locate the target timestamp text. Such uneven detection box samples are marked as having annotation value and submitted for manual annotation to improve the accuracy of the model in future detections.
[0059] Furthermore, in the last step, the format and character length of the detection results are strictly checked based on the inconsistency rules of detection and recognition. Date, week and time information have clear format requirements respectively. Specifically, the date information should be 10 characters in length and follow the format of "YYYY-MM-DD" or "YYYY / MM / DD"; the week information should be 3 characters, such as "Monday"; the time information should be 8 characters in length and strictly follow the "HH:MM" format. If the detection result of the model does not match the preset format or length, it may be due to inaccurate positioning of the detection frame, resulting in the timestamp text failing to fully cover or exceeding the detection frame. Therefore, all samples whose detection results are inconsistent with the expected format or character length will be marked as samples that require further annotation and subsequent manual annotation.
[0060] Through the above-mentioned query strategy based on expert knowledge, this embodiment can effectively screen out samples with annotation value, ensure the high quality of the annotation data set, and reduce unnecessary annotation workload, thereby improving the learning efficiency and accuracy of the overall model.
[0061] In some embodiments, determining the alignment of the detection frame, using the position consistency of the detection frame in the horizontal direction and the vertical direction to evaluate the accuracy of the sample, and marking the sample when the detection frame is not aligned, includes:
[0062] Obtain the detection frame position information of the date, day of the week and time, evaluate the horizontal alignment of each detection frame, and mark the sample when the horizontal position deviation between the detection frames exceeds the preset horizontal position deviation threshold;
[0063] The height consistency of each detection frame in the vertical direction is evaluated, and when the height position deviation of the detection frame exceeds the preset height position deviation threshold, the sample is marked.
[0064] Specifically, an embodiment of the present application also provides a method for judging the accuracy of timestamp text recognition samples based on the alignment of the detection frame, which aims to ensure the accuracy of the timestamp text detection results by evaluating the alignment of the detection frame in the monitoring image in the horizontal and vertical directions, and mark the samples if the alignment requirements are not met for subsequent manual labeling.
[0065] First, when performing timestamp text detection on surveillance images, the target detection model (such as the YOLOX model) is first used to obtain the detection box position information of the three types of data in the image: date, day of the week, and time. This information includes the coordinate position and size of each detection box in the image.
[0066] Furthermore, since the date, day of the week and time in the surveillance image are usually on the same horizontal line, the alignment of the detection frame in the horizontal direction is an important criterion for evaluating the detection accuracy. Specifically, based on the coordinates of the center point of the detection frame, the position deviation of adjacent detection frames in the horizontal direction is calculated. When the horizontal position deviation between the detection frames exceeds the preset threshold (that is, the detection frames are not on the same horizontal line), it is considered that the sample has obvious detection errors. At this time, the sample is marked as a sample that needs further annotation and submitted to manual annotation personnel for review and correction.
[0067] Furthermore, in addition to the alignment in the horizontal direction, the height consistency of the detection frame in the vertical direction is also a key criterion for detection accuracy. Under normal circumstances, the detection frames of the date, week, and time should have similar heights. Therefore, this embodiment evaluates the height of each detection frame and calculates the height difference in the vertical direction. If the height deviation of the detection frame exceeds the preset threshold, it indicates that the detection frame fails to accurately cover the timestamp text area and may be too large or too small. Therefore, samples that exceed the preset height deviation range will be marked as samples that require further annotation.
[0068] Furthermore, when the deviation of the detection box in the horizontal or vertical direction exceeds the preset threshold, the sample is marked as an "uneven sample". This mark indicates that the model fails to correctly detect the actual position and size of the timestamp text, which may lead to timestamp text recognition errors. For these uneven samples, manual annotation will be performed in the subsequent process to ensure the accuracy and completeness of the training data.
[0069] Through the method of the above-mentioned embodiment, the accuracy of the timestamp text detection model in complex scenarios can be significantly improved, and by timely discovering samples with uneven detection box positions, it is ensured that the generated annotation data has high quality and consistency, providing high-quality data support for the iterative training of subsequent models.
[0070] In some embodiments, selecting samples to be labeled from unlabeled image data using a predetermined query strategy includes:
[0071] Calculate the minimum amount of information of each type of detection box in each unlabeled sample, and estimate the information entropy of the sample based on the minimum amount of information; compare the information entropy of the sample with the preset information entropy threshold. When the information entropy of the sample exceeds the preset information entropy threshold, mark the sample as a sample to be labeled, and analyze and label the screened samples.
[0072] Specifically, this embodiment also provides a method for selecting samples to be labeled based on an uncertainty query strategy, which uses the information entropy calculation of the samples to screen out unlabeled image samples with high model prediction uncertainty for labeling, thereby improving the performance of the timestamp text detection model.
[0073] First, when processing unlabeled image data, use the trained object detection model (such as the YOLOX model) to predict the detection boxes of various timestamp texts (including date, day of the week, and time) in the image. For each detection box in each unlabeled sample, calculate its minimum information content. The minimum information content is used to measure the model's confidence in the detection box. The lower the confidence, the greater the information content, indicating that the model has a higher prediction uncertainty for the detection box. By obtaining the minimum information content of each category of detection boxes, the prediction uncertainty of the sample as a whole can be further quantified.
[0074] Furthermore, after obtaining the minimum amount of information for each detection box, the overall information entropy of each unlabeled sample is calculated based on this information. Information entropy is an indicator to measure the uncertainty of sample prediction. The higher the information entropy, the more uncertain the model's prediction of the sample. Therefore, for each sample, the minimum amount of information of each category of the detection box is weighted averaged to estimate the overall information entropy of the sample.
[0075] Furthermore, in this embodiment, the preset information entropy threshold is 0.9. When the overall information entropy of a sample exceeds this threshold, it indicates that the prediction uncertainty of the sample is large, and the model may produce an erroneous detection result when processing the sample. Such high information entropy samples are considered to have a higher marking value because they represent edge or complex samples that the model cannot accurately predict.
[0076] Furthermore, for samples whose information entropy exceeds a preset threshold, they are marked as samples that need further annotation. This marking process can filter out these high-uncertainty samples from the unlabeled data set and give priority to manual annotators for detailed annotation. The annotation of these samples can not only enhance the diversity of training data, but also help the model better cope with timestamp text detection tasks in complex scenarios.
[0077] Furthermore, the marked samples to be labeled are further analyzed and labeled, including the specific location, category (date, week or time) and related information of the timestamp text. After the labeling is completed, these labeled samples are added to the training data set and the object detection model is retrained to further improve the model's prediction ability and generalization performance.
[0078] Through the above method of this embodiment, the uncertainty query strategy is used to effectively screen out high information entropy samples, which can significantly reduce the workload of annotation and improve the model's learning ability for difficult-to-predict samples. This method shows excellent performance in the active learning framework, especially in dealing with timestamp text detection tasks.
[0079] In some embodiments, selecting samples to be labeled from unlabeled image data using a predetermined query strategy includes:
[0080] The results of the samples to be labeled obtained by querying based on expert knowledge are fused with the results of the samples to be labeled obtained by querying based on model uncertainty to obtain the final samples to be labeled.
[0081] Specifically, this embodiment also provides a timestamp text detection sample selection method based on multi-strategy fusion, which selects high-value samples to be labeled from unlabeled image data by combining expert knowledge query strategy and model uncertainty query strategy, thereby improving labeling efficiency and model performance.
[0082] First, the unlabeled image data is preliminarily screened using a query strategy based on expert knowledge. The expert knowledge strategy includes the following rules:
[0083] Category number rule: Samples that contain at least two categories, date and time, are considered to be worthy of labeling. If any of these categories is missing in the test result, the sample needs to be labeled.
[0084] Detection box number rule: If the number of detection boxes for a certain type of data (such as date or time) exceeds the expected number (usually 1), the sample may have misdetection or re-detection problems and needs further labeling.
[0085] Frame alignment rule: If the frames for date, day of week, and time are obviously not aligned horizontally or vertically, the sample needs further annotation.
[0086] Format and length consistency check: If the detected timestamp text information does not meet the preset format and length requirements (such as the date is in the "YYYY-MM-DD" format and the time is in the "HH:MM" format), the sample is marked as a sample that needs to be labeled.
[0087] Through the above expert knowledge rules, a group of samples that may have detection errors and need to be labeled are preliminarily screened out.
[0088] Next, we use the uncertainty-based query strategy to further screen samples. The specific steps are:
[0089] The minimum amount of information of each type of detection box in each unlabeled sample is calculated, and the overall information entropy of each sample is estimated based on this.
[0090] The information entropy of the sample is compared with a preset threshold (such as 0.9). When the information entropy of the sample exceeds the threshold, the sample is marked as a sample that needs to be labeled, indicating that the model's prediction of the sample has great uncertainty.
[0091] The uncertainty query strategy can filter out samples that are more difficult for the model to predict. The labeling of these samples helps improve the model's generalization ability for complex scenarios.
[0092] Furthermore, after the above two strategies have respectively screened out the samples to be labeled, the results are fused. The fusion process includes the following steps:
[0093] The sample results that need to be labeled obtained based on expert knowledge query are merged with the sample results obtained based on uncertainty query to remove duplicate samples.
[0094] For samples that pass both strategies, we prioritize marking them as high-priority samples and prioritize manual labeling. These samples have both abnormal features defined by expert rules and high model uncertainty, so labeling these samples is significantly helpful for model improvement.
[0095] For samples that are filtered out by only one strategy, they are still marked as samples that need to be labeled, but their labeling priority is relatively low.
[0096] Furthermore, the final samples to be labeled that are selected by the fusion strategy are submitted to manual labelers for detailed analysis and labeling. The manual labeling process includes confirming the specific location, category, and format information of the timestamp text, and ensuring the accuracy of the detection box. After the labeling is completed, these samples are added to the labeling dataset for further optimization of the target detection model.
[0097] Through the multi-strategy fusion method of this embodiment, it is possible to more comprehensively and effectively screen out samples that need to be labeled. Combining expert knowledge with model uncertainty not only ensures that samples with significant errors are labeled, but also labels complex samples that the model cannot accurately predict, thereby improving labeling efficiency and model detection performance.
[0098] In some embodiments, after updating the target detection model using the updated initial annotated dataset, the method further includes:
[0099] Generating offset data for image enhancement, wherein the offset data is generated based on a random number and applied to each pixel of the image;
[0100] The image is smoothly transitioned in the vertical and horizontal directions by using linear interpolation in the vertical direction and quartic polynomial interpolation in the horizontal direction.
[0101] Applying the generated offset data to the original image and generating an offset image using a non-uniform pixel data enhancement technique;
[0102] The generated offset image is superimposed with the original timestamp text image to generate an enhanced training dataset;
[0103] The target detection model is trained using the enhanced training data set to obtain a trained target detection model.
[0104] Specifically, the confusion between the timestamp text and the background in surveillance images may occur due to a variety of reasons, such as image blur, low contrast, or uneven illumination, which together constitute a special form of non-uniform noise. Figure 3 Schematic diagram of a surveillance image sample with timestamp text and background confusion provided by an embodiment of the present application. Figure 3 As shown, in order to improve the performance of the recognition model in the case of timestamp text and background confusion, this application uses non-uniform pixel data enhancement technology. By adding different offsets to each pixel point, the characteristics of non-uniform noise are simulated, aiming to make the generated data set closer to the actual application scenario, thereby optimizing the performance of the recognition model.
[0105] In practical applications, this embodiment also provides a method for generating a training data set using non-uniform pixel data enhancement technology, which optimizes the performance of the target detection model and the text recognition model in complex environments by simulating the confusion between the timestamp text and the background in the surveillance image.
[0106] First, offset data is generated to simulate the confusion between the timestamp text and the background in the surveillance image due to low contrast, uneven lighting, or blur. The offset data is generated based on the image width, height, and random numbers and applied to each pixel of the image. The offset of each pixel is different in order to simulate the distribution characteristics of non-uniform noise in the image and make the generated data closer to the actual application scenario.
[0107] Furthermore, in the generated offset data, in order to ensure the visual naturalness of the image after enhancement, two interpolation methods are used to smoothly transition the image:
[0108] Vertical linear interpolation: Linear interpolation is performed in the vertical direction of the image to ensure that the transition of pixels in the vertical direction is smooth, which can effectively avoid drastic pixel changes in the vertical direction.
[0109] Quartic polynomial interpolation in the horizontal direction: In the horizontal direction, the pixel values of the image are fitted using quartic polynomial interpolation to ensure smoothness in the horizontal direction. Quartic polynomial interpolation can generate smooth transition curves in a wider range, which is particularly suitable for monitoring horizontal timestamp text in images.
[0110] Furthermore, based on the above interpolation process, the generated offset data is applied to the original surveillance image to generate an offset image that has been enhanced with non-uniform pixel data. At this time, the offset of each pixel point presents a continuous and gradual change trend, avoiding abrupt pixel jumps in the image and ensuring the visual smoothness and naturalness of the image. This change simulates the complex confusion between the timestamp text and the background in the actual surveillance scene, making the enhanced image closer to the real surveillance scene.
[0111] Furthermore, the generated offset image is superimposed with the original timestamp text image to create a training dataset that has been processed with non-uniform pixel data enhancement. In this way, the timestamp text that is clearly visible in the original image is confused with the background after enhancement. This process effectively simulates the situation in a real surveillance environment where the timestamp text is difficult to recognize due to reduced contrast or noise interference.
[0112] Furthermore, after generating the enhanced training dataset, the dataset is used to retrain the target detection model (such as YOLOX) and the text recognition model (such as CRNN). With these enhanced data, the model's performance in timestamped text recognition in complex backgrounds has been significantly improved. The model can better recognize timestamped text that is severely confused with the background in the original surveillance image, improving its robustness and accuracy in actual surveillance scenarios.
[0113] The non-uniform pixel data enhancement technology of this embodiment can effectively simulate the complex confusion scene of timestamp text and background, and through the training of enhanced data sets, the model can cope with more complex detection tasks. Figure 4 It is a schematic diagram comparing the non-uniform pixel data enhancement effect provided in the embodiments of the present application.
[0114] Figure 4 The comparison graph shown shows that it is more difficult to distinguish the timestamp text in the enhanced image than in the unenhanced image, thereby effectively improving the generalization ability of the model in actual complex scenes.
[0115] In some embodiments, generating an offset image using a non-uniform pixel data enhancement technique includes:
[0116] Generate a set of random numbers based on the width, height and random coefficient of the image;
[0117] Generate multiple control points for each row of the image according to random numbers, where the control points include left and right boundary points and key positions in the middle of the image;
[0118] Using the quartic polynomial interpolation algorithm, a smooth offset curve is fitted based on the control points to make the image transition continuously in the horizontal direction;
[0119] Determine the vertical coordinate value of the control point, and use the linear interpolation method to calculate the vertical coordinate of the control point row by row based on the proportional relationship of the image height so as to form a continuous and uniform change in the vertical direction;
[0120] The pixels of the image are adjusted according to the vertical coordinates of the control points to generate an offset image, in which the offsets of the pixels are in a continuous and gradual changing trend.
[0121] Specifically, this embodiment also describes a method for generating an offset image based on non-uniform pixel data enhancement technology, which mainly simulates the non-uniform noise of the image when the timestamp text and the background are confused through random number generation, control point setting and interpolation calculation, and realizes a continuous and smooth transition of the image, so as to improve the robustness of the timestamp text recognition model in complex backgrounds.
[0122] First, a set of random numbers (such as point1 to point10) are generated based on the width and height of the image and a set of random coefficients. These random numbers are used to control the pixel offset and provide sufficient diversity to simulate the non-uniform noise in the surveillance image. These random numbers are the basic data used to generate the control points for each row of the image, ensuring that the offset of each pixel is different.
[0123] Furthermore, for each row of the image, five control points are created based on the generated random numbers, including the left and right boundary points of the image and the key position in the middle. The horizontal coordinates of the control points are determined by:
[0124] x1 and x5 correspond to the left and right boundaries of the image respectively;
[0125] x3 is the midpoint position calculated by fitting the straight line;
[0126] x2 and x4 are located at the midpoints between x1 and x3 and between x3 and x5 respectively.
[0127] This control point setting logic ensures a smooth transition of the image in the horizontal direction, and the distribution of the control points is diverse.
[0128] Furthermore, the horizontal coordinates of the control points are used to fit the five control points in each row of the image based on the quartic polynomial interpolation algorithm to generate a smooth offset curve. Quartic polynomial interpolation has high accuracy and can generate natural curves in a large range, ensuring that there are no abrupt pixel jumps in the horizontal direction of the image. This smooth transition is crucial for simulating the effect of confusing the timestamp text with the background.
[0129] Furthermore, when determining the vertical coordinates of the control points, linear interpolation is used for calculation. Taking control point x1 as an example, assume that its vertical coordinates y0 and y1 correspond to point3 to point7 respectively. Based on the image height and the difference between x1 and x0, the scale factor is calculated. The vertical coordinates of the control points are then calculated row by row by multiplying the scale factor by the difference in row numbers.
[0130] Since the scale factor is fixed, the vertical coordinates of the control points show a continuous and uniform change trend as the row number changes. This continuous vertical change ensures that the image forms a smooth gradient in the vertical direction, further improving the authenticity of the simulated non-uniform noise.
[0131] Furthermore, based on the above interpolation calculation results, the offset of each pixel point of the image is adjusted to generate a final offset image. Figure 5 is a schematic diagram of a sample of the offset image generated by the embodiment of the present application. Figure 5 As shown in the figure, the offset of each pixel in the offset image shows a continuous and gradual change trend, thus avoiding abrupt pixel jumps in the image and ensuring the overall smoothness of the image. The generated offset image can effectively simulate the confusion between the timestamp text and the background in the surveillance image caused by factors such as uneven lighting and image blur.
[0132] For example, in one example, first, a set of random numbers (point1 to point10) are calculated based on a set of random coefficients, image width and height and other parameters. The generation of these random numbers is intended to provide basic data for smooth transition while ensuring the diversity of the generated random numbers. Then, using this set of random numbers, 5 control points are generated for each row of the image. Quartic interpolation is performed based on these 5 control points to fit a quartic curve to ensure smooth transition in the horizontal direction. The generation logic of the 5 control points in each row is as follows: First, five horizontal key positions (x1, x2, x3, x4, x5) are determined. These positions correspond to the horizontal coordinates of the control points, where x1 and x5 represent the left and right endpoints of the image boundary, respectively, x3 is calculated by fitting a straight line, and x2 and x4 are the midpoints between x1 to x3 and x3 to x5, respectively. The next step is to determine the vertical coordinates of the control points, which is achieved by linear interpolation.
[0133] Take the generation of vertical coordinates corresponding to control point x1 as an example. The y0 and y1 corresponding to control point x1 are point3 to point7 respectively. The scale factor is calculated based on the difference between x1 and x0 (image height - 1). The value of Then the scale factor is multiplied by the difference between x and x0, which is the row number. Since the scale factor is fixed, the vertical coordinate values of the control points will change continuously and evenly as the row number increases. This means that the vertical coordinate values of the same control point between adjacent rows will have only slight differences, resulting in a smooth gradient in the vertical direction.
[0134] Through the method of the above-mentioned embodiment, the offset image generated by this embodiment can be used for training the timestamp text detection model, improving the recognition ability of the model under complex backgrounds, so that it can better cope with the timestamp text recognition problem under low contrast and noise interference in actual application scenarios.
[0135] According to the technical solution provided by the present application, the technical solution of the present application has at least the following advantages:
[0136] (1) Using non-uniform pixel data enhancement technology to improve the performance of the recognition model when dealing with timestamp text and background confusion
[0137] In view of the fact that the confusion between timestamp text and background can be regarded as a special kind of non-uniform noise, the present application adopts non-uniform pixel data enhancement technology. This technology assigns a random offset to each pixel to simulate this noise effect. Considering that in real surveillance images, there is a certain smoothness between pixels-that is, the offset of any pixel is similar to that of its surrounding pixels, without mutation. The present application adopts a specific interpolation strategy to maintain this characteristic. Specifically, through quartic interpolation in the horizontal direction and linear interpolation in the vertical direction, the smoothness in the horizontal and vertical directions is ensured respectively. This method effectively makes the generated images for timestamp text recognition closer to the real scene, thereby significantly improving the recognition performance of the CRNN model when dealing with confusion between timestamp text and complex background.
[0138] (2) Adopting a joint query strategy based on expert knowledge and uncertainty
[0139] In order to reduce the data annotation cost of timestamp text detection, this application uses active learning technology to select the most valuable samples for detection and annotation. The key to active learning is to determine the query strategy, which aims to identify which samples are the most informative and challenging for the detection model so that they can be labeled first. Traditional active learning query strategies often rely on a single criterion, such as uncertainty, to select samples, which may cause the model to favor certain types of data and ignore other samples that are more representative and practical in actual application scenarios. To solve this problem, this application proposes a joint query strategy that combines domain expert knowledge (category number rules, detection box number rules, detection and recognition inconsistency, detection box unevenness) and uncertainty. This strategy combines the intuitive understanding of data by domain experts and the uncertainty measurement of the model when processing unknown data, optimizes the sample selection process, and ensures the diversity and representativeness of the samples.
[0140] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0141] Figure 6 Schematic diagram of the structure of the timestamp text recognition device provided by the embodiment of the present application. Figure 6 As shown, the timestamp text recognition device includes:
[0142] The training module 601 is configured to obtain an initial annotated data set and train a target detection model using the initial annotated data set;
[0143] The prediction module 602 is configured to use the trained object detection model to predict the unlabeled image data and obtain a prediction result;
[0144] The query module 603 is configured to select samples to be labeled from the unlabeled image data using a predetermined query strategy, wherein the query strategy is used to select samples with high uncertainty by calculating information entropy based on expert knowledge and model uncertainty;
[0145] The updating module 604 is configured to label the samples to be labeled, and use the labeled data to update the initial labeled data set, use the updated initial labeled data set to update the target detection model, and use the updated target detection model to perform the timestamp text recognition task.
[0146] In some embodiments, Figure 6The query module 603 determines the target data category and judges the annotation value of the sample based on the number of categories so as to detect the predetermined key categories; evaluates the number of detection frames, and when the number of detection frames for a certain type of data exceeds the expected range, marks the corresponding sample as a sample to be labeled; determines the alignment of the detection frame, and uses the position consistency of the detection frame in the horizontal and vertical directions to evaluate the accuracy of the sample. When the detection frame is not aligned, the sample is marked; checks the compliance of the detection result with the preset format. When the detection result is inconsistent with the specified character length or format, the sample is identified as a sample that needs further annotation.
[0147] In some embodiments, Figure 6 The query module 603 obtains the detection frame position information of the date, day of the week and time, evaluates the alignment of each detection frame in the horizontal direction, and marks the sample when the horizontal position deviation between the detection frames exceeds the preset horizontal position deviation threshold; evaluates the height consistency of each detection frame in the vertical direction, and marks the sample when the height position deviation of the detection frame exceeds the preset height position deviation threshold.
[0148] In some embodiments, Figure 6 The query module 603 calculates the minimum amount of information of each type of detection box in each unlabeled sample, and estimates the information entropy of the sample based on the minimum amount of information; compares the information entropy of the sample with a preset information entropy threshold, and when the information entropy of the sample exceeds the preset information entropy threshold, marks the sample as a sample to be labeled, and analyzes and labels the screened samples.
[0149] In some embodiments, Figure 6 The query module 603 merges the results of the samples to be labeled obtained by querying based on the expert knowledge with the results of the samples to be labeled obtained by querying based on the model uncertainty to obtain the final samples to be labeled.
[0150] In some embodiments, Figure 6 After updating the target detection model using the updated initial annotation data set, the generation module 605 generates offset data for image enhancement, wherein the offset data is generated based on random numbers and applied to each pixel of the image; the image is smoothly transitioned in the vertical and horizontal directions using linear interpolation in the vertical direction and quartic polynomial interpolation in the horizontal direction; the generated offset data is applied to the original image, and an offset image is generated using non-uniform pixel data enhancement technology; the generated offset image is superimposed with the original timestamp text image to generate an enhanced training data set; the target detection model is trained using the enhanced training data set to obtain a trained target detection model.
[0151] In some embodiments, Figure 6The generation module 605 generates a set of random numbers based on the width, height and random coefficient of the image; generates multiple control points for each row of the image according to the random numbers, wherein the control points include the left and right boundary points of the image and the key position in the middle; uses a quartic polynomial interpolation algorithm to fit a smooth offset curve based on the control points so that the image can transition continuously in the horizontal direction; determines the vertical coordinate value of the control point, and uses a linear interpolation method to calculate the vertical coordinate of the control point row by row based on the proportional relationship of the image height so as to form a continuous and uniform change in the vertical direction; adjusts the pixels of the image according to the vertical coordinate of the control point to generate an offset image, in which the offset of the pixel point in the offset image is a continuous and gradual change trend.
[0152] Figure 7 Schematic diagram of the structure of the electronic device 7 provided in the embodiment of the present application. Figure 7 As shown, the electronic device 7 of this embodiment includes: a processor 701, a memory 702, and a computer program 703 stored in the memory 702 and executable on the processor 701. When the processor 701 executes the computer program 703, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 701 executes the computer program 703, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0153] Exemplarily, the computer program 703 may be divided into one or more modules / units, which are stored in the memory 702 and executed by the processor 701 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 703 in the electronic device 7.
[0154] The electronic device 7 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 7 may include, but is not limited to, a processor 701 and a memory 702. Those skilled in the art will appreciate that Figure 7 It is only an example of the electronic device 7 and does not constitute a limitation of the electronic device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0155] The processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0156] The memory 702 may be an internal storage unit of the electronic device 7, for example, a hard disk or memory of the electronic device 7. The memory 702 may also be an external storage device of the electronic device 7, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7. Further, the memory 702 may also include both an internal storage unit of the electronic device 7 and an external storage device. The memory 702 is used to store computer programs and other programs and data required by the electronic device. The memory 702 may also be used to temporarily store data that has been output or is to be output.
[0157] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0158] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0159] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments applied for herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0160] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0161] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0162] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0163] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0164] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A timestamp text recognition method, characterized in that: include: Obtaining an initial annotated data set, and using the initial annotated data set to train a target detection model; Use the trained target detection model to predict the unlabeled image data and obtain the prediction results; Selecting samples to be labeled from the unlabeled image data using a predetermined query strategy, wherein the query strategy is used to screen samples with high uncertainty by calculating information entropy based on expert knowledge and model uncertainty; The samples to be labeled are labeled, and the labeled data is used to update the initial labeled data set, the updated initial labeled data set is used to update the target detection model, and the updated target detection model is used to perform the timestamped text recognition task.
2. The method according to claim 1, characterized in that: The selecting samples to be labeled from the unlabeled image data using a predetermined query strategy includes: Determine the target data category and judge the annotation value of the sample based on the number of categories so as to detect the predetermined key categories; Evaluate the number of detection boxes. When the number of detection boxes for a certain type of data exceeds the expected range, mark the corresponding samples as samples that need to be labeled. Determine the alignment of the detection frame and use the position consistency of the detection frame in the horizontal and vertical directions to evaluate the accuracy of the sample. When the detection frame is not aligned, mark the sample; The test result is checked for compliance with the preset format. When the test result is inconsistent with the specified character length or format, the sample is identified as a sample that requires further annotation.
3. The method according to claim 2, characterized in that The method of determining the alignment of the detection frame and evaluating the accuracy of the sample by using the position consistency of the detection frame in the horizontal and vertical directions, and marking the sample when the detection frame is not aligned, includes: Obtaining the detection frame position information of the date, day of the week and time, evaluating the horizontal alignment of each detection frame, and marking the sample when the horizontal position deviation between the detection frames exceeds a preset horizontal position deviation threshold; The height consistency of each detection frame in the vertical direction is evaluated, and when the height position deviation of the detection frame exceeds a preset height position deviation threshold, the sample is marked.
4. The method according to claim 1, characterized in that The selecting samples to be labeled from the unlabeled image data using a predetermined query strategy includes: Calculate the minimum amount of information of each type of detection box in each unlabeled sample, and estimate the information entropy of the sample based on the minimum amount of information; compare the information entropy of the sample with a preset information entropy threshold. When the information entropy of the sample exceeds the preset information entropy threshold, mark the sample as a sample to be labeled, and analyze and label the screened samples.
5. The method according to claim 3 or 4, characterized in that: The selecting samples to be labeled from the unlabeled image data using a predetermined query strategy includes: The results of the samples to be labeled obtained by querying based on expert knowledge are fused with the results of the samples to be labeled obtained by querying based on model uncertainty to obtain the final samples to be labeled.
6. The method according to claim 1, characterized in that After the target detection model is updated using the updated initial annotated data set, the method further includes: Generating offset data for image enhancement, wherein the offset data is generated based on a random number and applied to each pixel of the image; The image is smoothly transitioned in the vertical and horizontal directions by using linear interpolation in the vertical direction and quartic polynomial interpolation in the horizontal direction. Applying the generated offset data to the original image and generating an offset image using a non-uniform pixel data enhancement technique; The generated offset image is superimposed with the original timestamp text image to generate an enhanced training dataset; The target detection model is trained using the enhanced training data set to obtain a trained target detection model.
7. The method according to claim 6, characterized in that The method of generating an offset image by using a non-uniform pixel data enhancement technique includes: Generate a set of random numbers based on the width, height and random coefficient of the image; Generating a plurality of control points for each row of the image according to the random number, wherein the control points include left and right boundary points and a key position in the middle of the image; Using a quartic polynomial interpolation algorithm, a smooth offset curve is fitted based on the control points, so that the image transitions continuously in the horizontal direction; Determine the vertical coordinate value of the control point, and calculate the vertical coordinate of the control point row by row based on the proportional relationship of the image height by using a linear interpolation method, so as to form a continuous and uniform change in the vertical direction; The pixels of the image are adjusted according to the vertical coordinates of the control points to generate the offset image, in which the offsets of the pixels are in a continuous and gradual change trend.
8. A time-stamped text recognition device, characterized in that: include: A training module is configured to obtain an initial annotated data set and train an object detection model using the initial annotated data set; A prediction module is configured to use the trained object detection model to predict the unlabeled image data and obtain a prediction result; A query module is configured to select samples to be labeled from the unlabeled image data using a predetermined query strategy, wherein the query strategy is used to screen samples with high uncertainty by calculating information entropy based on expert knowledge and model uncertainty; The updating module is configured to annotate the samples to be annotated, and use the annotated data to update the initial annotated data set, use the updated initial annotated data set to update the target detection model, and use the updated target detection model to perform the timestamped text recognition task.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.