Picture OCR (Optical Character Recognition) character screening and classifying method based on downstream task driving
By introducing downstream task-driven dynamic adaptation mechanism and multi-dimensional information fusion in OCR technology, the problem of accuracy and correlation of text screening in complex backgrounds is solved, high-precision text screening and classification are achieved, and the accuracy of analysis is improved. and emergency response efficiency.
Patent Information
- Application Number
- CN202411003456.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2025-01-03
AI Technical Summary
Existing OCR technology is difficult to provide high accuracy and correlation text screening results in complex contexts, and lacks dynamic adaptability and multi-dimensional information fusion, resulting in low accuracy and correlation of identification results and cannot meet specific application needs.
Using the image OCR text filtering and classification method based on downstream task, through text detection, object detection and task adapter modules, combined with historical data and context information, the screening standards are dynamically adjusted, and multi-dimensional information fusion is carried out to analyze downstream task requirements in real time, and optimize the Filtering rules for text size, color and background information.
It realizes high-precision text screening in complex contexts, improves the accuracy and reliability of analysis, significantly improves emergency processing efficiency and accuracy, and can dynamically adjust the screening standards according to different task scenarios, providing the most relevant and accurate text Filter results.
Smart Images

Figure CN119251843A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and optical character recognition (OCR), and in particular to a method for screening and classifying text in an image OCR driven by downstream tasks. Background Art
[0002] In the existing technology, image OCR (Optical Character Recognition) text recognition technology has been widely used in various image processing tasks. However, traditional OCR technology usually only focuses on extracting text information from images, and is not specifically optimized for different downstream tasks. This results in low accuracy and relevance of recognition results when processing complex scenes, which cannot meet the needs of specific applications.
[0003] For example, in sensitive information classification tasks, existing OCR systems cannot effectively distinguish text with a banner or background, resulting in inaccurate text fragments, affecting the accuracy of analysis. Traditional screening methods mainly rely on simple text size and color screening rules, but these rules are often insufficient when faced with complex and changing background information, and it is difficult to filter out irrelevant or noise information.
[0004] In order to solve these problems, the text is usually filtered and classified by combining context information and machine learning algorithms. However, these methods still have certain limitations: 1. Insufficient contextual information: Traditional methods are unable to fully utilize the background information in the image, such as buildings, road signs, and commodities, resulting in insufficient relevance of the selected text fragments.
[0005] 2. Lack of dynamic adaptability: Existing technologies lack the ability to dynamically adjust screening criteria based on downstream task requirements, resulting in the inability to provide the most relevant and accurate text screening results when faced with different task scenarios.
[0006] 3. Limited screening accuracy: Due to insufficient fusion of multi-dimensional information, traditional methods find it difficult to accurately identify and screen out the most relevant text fragments in complex backgrounds, affecting the high-quality data input for subsequent task analysis.
[0007] Therefore, how to introduce a dynamic adaptation mechanism based on downstream task drive and high-precision screening of multi-dimensional information fusion into the OCR system has become a technical problem to be solved by the present invention. Summary of the invention
[0008] The technical problem solved by the present invention is to provide an image OCR text screening and classification method based on downstream task drive in response to the defects existing in the above-mentioned prior art, so as to solve the problem of improving the accuracy and relevance of text screening in complex backgrounds proposed in the above-mentioned background technology.
[0009] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows: A method for image OCR text screening and classification based on downstream task drive includes the following steps: Step 1: perform text detection on the input image, obtain the position of the text in the image, and record it as a position set Pos, where each position record includes the coordinates of the four corner points of the text segment; Step 2: Crop the image into multiple small images according to the text position, perform text recognition, and obtain the text content of each position; Step 3, determine the size and color of each text segment, and record them as Size and Color respectively, where Size is the height of the text segment and Color is the color label of the text segment; Step 4: Detect objects in the image and identify background objects in the image, including but not limited to buildings, road signs, commodities, banners, and clothing; Step 5, comparing the text position with the background target position, calculating the intersection area ratio between each text segment and the background target, and determining the type of background target corresponding to each text segment; Step 6: Further select the text segments that have been filtered above according to the specific downstream tasks: In the sensitive information classification task, select a banner background or text with a larger size and a non-black color; In the territorial judgment task, text information related to the geographic location was selected and filtered in combination with background information, such as road signs and buildings; In the emergency information processing task, select text information related to the emergency situation and filter it in combination with background information, such as banners; The text fragments that have undergone task-specific screening are input into the classification model of the downstream task for processing and analysis.
[0010] As a further solution of the present invention, in step 6, in the sensitive information classification task, text selection is performed in the following manner: Introducing the task adapter module to analyze downstream task requirements in real time and automatically adjust the screening criteria for text size and color; By collecting and analyzing past processing records and context information, relevant patterns and rules are extracted, and the screening criteria are dynamically adjusted based on these patterns. Specific operations include: Combined with the results of historical data feedback, extract the text corresponding to the background target type and text segment features that are more relevant to the task; Based on the analysis results, the background information filtering rules are updated in real time to select text with a banner background or a larger size and a non-black color; In the territorial judgment task, text selection is performed in the following ways: Analyze downstream task requirements in real time through the task adapter module, and dynamically adjust the text information screening criteria related to geographic location; Combine contextual information, such as historical data and task-specific parameters, to optimize the filtering rules for landmarks and building background information. Specific operations include: Extracting text information and background target features related to geographic location from historical data; Use machine learning models to analyze contextual information, identify and extract characteristic patterns related to geographic location; dynamically adjust the screening criteria for road signs and building background information based on the analysis results to improve the accuracy of territorial judgment; In the emergency information processing task, text selection is performed in the following ways: Using the task adapter module, the downstream task requirements are analyzed in real time, and the text information screening criteria related to emergency situations are automatically adjusted; Based on the feedback results of historical data, dynamically optimize the screening rules of text background target types and text fragment features for emergency information processing tasks to improve the efficiency and accuracy of emergency information processing; The background information screening rules are updated in real time according to the analysis results to select the background as a banner or corresponding text to participate in the emergency information processing task.
[0011] As a further solution of the present invention, in step 3, further comprising: A deep learning algorithm is used to classify the color of text fragments, a threshold is used to classify the size of text fragments, and a classification model is generated to improve screening efficiency and accuracy.
[0012] As a further solution of the present invention, in step 4, a convolutional neural network is used for target detection, and background targets are identified by fine-tuning the pre-trained model.
[0013] As a further solution of the present invention, in step 5, further comprising: The intersection area ratio between each text segment and multiple background targets is calculated, and the background target with the largest intersection area is selected as the background target type of the text segment.
[0014] As a further solution of the present invention, introducing the task adapter module comprises the following steps: According to the downstream task requirements, the screening standard parameter library is updated in real time, and the screening standards are dynamically adjusted according to the feedback results.
[0015] As a further solution of the present invention, in the sensitive information classification task, the text selection is further optimized by: Combined with contextual semantic analysis, text fragments with similar semantics are clustered, and text fragments related to the task are given priority.
[0016] As a further solution of the present invention, in the territorial judgment task, the text selection is further optimized by the following methods: By utilizing geographic information system (GIS) data and combining it with road signs and building background information, the screening criteria can be dynamically adjusted to improve the accuracy of territorial judgment.
[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. It can analyze the specific needs of downstream tasks in real time and dynamically adjust the screening criteria of text size, color and background information. This task-driven dynamic adaptability enables the system to quickly adjust to different task scenarios and provide the most relevant and accurate text screening results.
[0018] 2. Downstream task refinement: Through the task adapter module, the system can implement refined text screening strategies for specific tasks such as sensitive classification, territorial judgment, and emergency information processing. For example, in the sensitive information classification task, the system will give priority to text fragments with banner backgrounds or large text sizes and non-black colors. This refined screening significantly improves the accuracy and reliability of the analysis.
[0019] 3. High-precision screening brought by multi-dimensional information fusion: The present invention can effectively filter out irrelevant or noise information by combining the size, color and background information of the text for multi-dimensional screening. Compared with the single-dimensional screening method, multi-dimensional information fusion significantly improves the accuracy and effectiveness of data screening. The system can accurately identify and filter out the most relevant text fragments in a complex background, ensuring high-quality data input for subsequent task analysis, such as using intelligent optimization and feedback loop mechanisms: 4. Significantly improve the efficiency and accuracy of emergency response: In the emergency information processing task, the system can quickly filter out text information related to the emergency, and combine it with the banner background information for efficient processing. Compared with traditional methods, the system's response speed and accuracy in handling emergencies are greatly improved, ensuring timely decision-making and response.
[0020] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 This is a flowchart of OCR information screening of images classified as sensitive information in Example 3 of the present invention. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] See also Figure 1 In an embodiment of the present invention, a method for OCR text screening and classification based on downstream task drive is characterized by comprising the following steps: Step 1: perform text detection on the input image, obtain the position of the text in the image, and record it as a position set Pos, where each position record includes the coordinates of the four corner points of the text segment; Step 2: Crop the image into multiple small images according to the text position, perform text recognition, and obtain the text content of each position; Step 3, determine the size and color of each text segment, and record them as Size and Color respectively, where Size is the height of the text segment and Color is the color label of the text segment; Step 4: Detect objects in the image and identify background objects in the image, including but not limited to buildings, road signs, commodities, banners, and clothing; Step 5, comparing the text position with the background target position, calculating the intersection area ratio between each text segment and the background target, and determining the type of background target corresponding to each text segment; Step 6: Further select the text segments that have been filtered above according to the specific downstream tasks: In the sensitive information classification task, select a banner background or text with a larger size and a non-black color; In the territorial judgment task, text information related to the geographic location was selected and filtered in combination with background information, such as road signs and buildings; In the emergency information processing task, select text information related to the emergency situation and filter it in combination with background information, such as banners; The text fragments that have undergone task-specific screening are input into the classification model of the downstream task for processing and analysis.
[0025] In step 6, in the sensitive information classification task, text selection is performed in the following way: Introducing the task adapter module to analyze downstream task requirements in real time and automatically adjust the screening criteria for text size and color; By collecting and analyzing past processing records and context information, relevant patterns and rules are extracted, and the screening criteria are dynamically adjusted based on these patterns. Specific operations include: Combined with the results of historical data feedback, extract the text corresponding to the background target type and text segment features that are more relevant to the task; Based on the analysis results, the background information filtering rules are updated in real time to select text with a banner background or a larger size and a non-black color; In the territorial judgment task, text selection is performed in the following ways: Analyze downstream task requirements in real time through the task adapter module, and dynamically adjust the text information screening criteria related to geographic location; Combine contextual information, such as historical data and task-specific parameters, to optimize the filtering rules for landmarks and building background information. Specific operations include: Extracting text information and background target features related to geographic location from historical data; Use machine learning models to analyze contextual information, identify and extract characteristic patterns related to geographic location; dynamically adjust the screening criteria for road signs and building background information based on the analysis results to improve the accuracy of territorial judgment; In the emergency information processing task, text selection is performed in the following ways: Using the task adapter module, the downstream task requirements are analyzed in real time, and the text information screening criteria related to emergency situations are automatically adjusted; Based on the feedback results of historical data, dynamically optimize the screening rules of text background target types and text fragment features for emergency information processing tasks to improve the efficiency and accuracy of emergency information processing; The background information screening rules are updated in real time according to the analysis results to select the background as a banner or corresponding text to participate in the emergency information processing task.
[0026] As a further solution of the present invention, in step 3, further comprising: A deep learning algorithm is used to classify the color of text fragments, a threshold is used to classify the size of text fragments, and a classification model is generated to improve screening efficiency and accuracy.
[0027] As a further solution of the present invention, in step 4, a convolutional neural network is used for target detection, and background targets are identified by fine-tuning the pre-trained model.
[0028] As a further solution of the present invention, in step 5, further comprising: The intersection area ratio between each text segment and multiple background targets is calculated, and the background target with the largest intersection area is selected as the background target type of the text segment.
[0029] As a further solution of the present invention, introducing the task adapter module comprises the following steps: According to the downstream task requirements, the screening standard parameter library is updated in real time, and the screening standards are dynamically adjusted according to the feedback results.
[0030] As a further solution of the present invention, in the sensitive information classification task, the text selection is further optimized by: Combined with contextual semantic analysis, text fragments with similar semantics are clustered, and text fragments related to the task are given priority.
[0031] As a further solution of the present invention, in the territorial judgment task, the text selection is further optimized by the following methods: By utilizing geographic information system (GIS) data and combining it with road signs and building background information, the screening criteria can be dynamically adjusted to improve the accuracy of territorial judgment.
[0032] As a further solution of the present invention, it further comprises: In step 6, a feedback loop mechanism is introduced to continuously optimize the screening criteria based on the output results of the classification model to improve the overall performance of the classification model.
[0033] Embodiment 1: This embodiment demonstrates the specific application of a downstream task-driven image OCR text screening and classification method in the sensitive information classification task.
[0034] Traditional OCR systems can only extract text information simply, and it is difficult to accurately filter out relevant key words. This method solves this problem through the following steps: First, the system receives the cover data of the short video. It performs text detection on the input image and uses OCR technology to obtain the position of the text in the image and record it as a position set Pos. Each position record includes the coordinates of the four corner points of the text segment.
[0035] Next, the image is cropped into multiple small images according to the text position, and text recognition is performed on these small images to obtain the text content at each position. At the same time, the size and color of each text segment are determined and recorded as Size and Color respectively, where Size is the height of the text segment and Color is the color label of the text segment.
[0036] The system further performs target detection on the image and uses a convolutional neural network to identify background targets in the image, including buildings, road signs, commodities, banners, etc. The text position is compared with the background target position, and the intersection area ratio of each text segment and the background target is calculated to determine the type of background target corresponding to each text segment. If a text segment intersects with multiple background targets, the background target with the largest intersection area is selected as the background target type of the text segment.
[0037] In the sensitive information classification task, the system analyzes the downstream task requirements in real time through the task adapter module, automatically adjusts the text size and color screening criteria, and selects text fragments with banner backgrounds or large sizes and non-black colors. For example, when the system recognizes an image containing multiple banners, the task adapter module will prioritize filtering out large non-black text on banners or on the background, which usually contains important information.
[0038] To improve the accuracy of screening, the system combines contextual information and historical data to optimize the screening rules for background information. After each task is executed, the system introduces a feedback loop mechanism to adjust the screening criteria in real time based on the output results of the classification model, ensuring that the system can efficiently screen out the most relevant sensitive text information in the process of constantly changing cover images.
[0039] The main function of the feedback loop mechanism is to continuously optimize the screening criteria to improve the overall performance of the classification model. The specific implementation method is as follows: 1. Task adapter module.
[0040] The task adapter module monitors the output results of the classification model in real time and dynamically adjusts the screening standard parameter library based on these results. The specific steps are as follows: Data collection: The output results processed by the classification model will be recorded and analyzed to generate feedback data.
[0041] Criteria adjustment: Based on the feedback data, the adapter module updates the screening criteria. For example, if a certain type of background information (such as banners) has a higher importance in the task, the adapter module will increase the screening weight of this type of background information.
[0042] 2. Optimize screening rules.
[0043] Combining context information and historical data, the system optimizes the filtering rules. The specific implementation is as follows: Contextual analysis: The system combines the contextual information of the current task (such as other text and background information in the image) and historical data (such as performance in previous tasks) to optimize the screening rules for the current task.
[0044] Dynamic adjustment: Based on real-time feedback, the system will fine-tune the screening criteria. For example, in the sensitive information classification task, if it is found that text fragments with large fonts and non-black colors are more important, the system will increase the screening priority of these text fragments.
[0045] 3. Continuous learning and improvement.
[0046] The feedback loop mechanism continuously improves the screening criteria through continuous learning. The specific process is as follows: Model training: The system collects the output results and feedback data of the classification model, and conducts continuous learning and model retraining to improve the accuracy of the model.
[0047] Standard optimization: After each task is executed, the system adjusts the screening criteria based on feedback data to make it more in line with the current task requirements, ensuring that the screening criteria are always in the optimal state.
[0048] Through the above feedback loop mechanism, the screening criteria can be continuously optimized according to the output results of the classification model, ensuring that the system can always efficiently screen out the most relevant text information in a constantly changing environment. This mechanism not only improves the accuracy and efficiency of text screening, but also dynamically adapts to different task requirements, significantly improving the performance and reliability of the overall system.
[0049] Embodiment 2: In this embodiment, we demonstrate the specific application of a downstream task-driven image OCR text screening and classification method in the sensitive information classification task to ensure that the system can accurately screen out key text information and improve the accuracy of subsequent analysis.
[0050] Traditional OCR systems can only extract text information, but cannot effectively filter out relevant key words. This method solves this problem by following the steps below: First, the system receives the cover data of the short video. It performs text detection on the input image and uses OCR technology to obtain the position of the text in the image, which is recorded as a position set Pos=[pos_i]_(i=1)^N, where each position record includes the coordinates of the four corner points of the text segment (x0_i, y0_i, x1_i, y1_i, x2_i, y2_i, x3_i, y3_i).
[0051] Next, the image is cropped into multiple small images according to the text position, and text recognition is performed on these small images to obtain the text content at each position. Then, the size and color of each text segment are determined and recorded as Size and Color respectively. Size is the height of the text segment, and Color is the color label of the text segment.
[0052] The system further performs target detection on the image and uses a convolutional neural network to identify background targets in the image, including buildings, road signs, commodities, banners, etc. The text position is compared with the background target position, the intersection area ratio of each text segment and the background target is calculated, and the type of background target corresponding to each text segment is determined. If a text segment intersects with multiple background targets, the background target with the largest intersection area is selected as the background target type of the text segment.
[0053] In the sensitive information classification task, the system analyzes the downstream task requirements in real time through the task adapter module, automatically adjusts the text size and color screening criteria, and selects text fragments with banner backgrounds or large sizes and non-black colors. For example, when the system recognizes an image containing multiple banners, the task adapter module will prioritize filtering out large non-black text on banners or on the background, which usually contains important information.
[0054] To improve the accuracy of screening, the system combines contextual information and historical data to optimize the screening rules for background information. After each task is executed, the system introduces a feedback loop mechanism to adjust the screening criteria in real time based on the output results of the classification model, ensuring that the system can efficiently screen out the most relevant sensitive text information in the ever-changing video cover.
[0055] In specific applications, we first perform text detection to obtain the text position Pos; then perform text cropping and recognition to obtain the text content Content; then determine the text size Size and color Color, and identify background targets through target detection; finally, combine the task adapter module to filter out text fragments that meet the task requirements. These text fragments are first sent to the sensitive information classification model for analysis.
[0056] This example demonstrates the specific application of this method in sensitive information classification tasks. This method not only improves the accuracy and efficiency of text screening, but also dynamically adapts to different task requirements, achieves high-precision text screening in complex backgrounds, and significantly improves the reliability and timeliness of monitoring.
[0057] Embodiment 3: This embodiment mainly discusses the information screening of image OCR based on the classification of sensitive information for subsequent applications. The screening criteria will be based on different subsequent tasks, but in the image OCR stage, we mainly consider the following information: First, determine the text size, color and other information. Second, determine the background of the text, such as buildings, road signs, commodities, banners, clothing, etc.; In order to achieve the purpose of the above invention, the specific process of the implementation steps of the present invention is as follows: Step 1: Image OCR For an input image, first perform text detection and record the text position in the image as in For text snippets The horizontal and vertical coordinates of the four points in clockwise order from the upper left corner to the lower left corner, Indicates that the image is Then, the image is cut into small pictures according to the text position, and the picture list is: , perform text recognition on it, and get the text content of the picture as ,in Indicates location The corresponding text.
[0058] Note that the text detection model and text recognition model mentioned in the above steps can be any model in the OCR field.
[0059] Step 2: Determine the text size and color, and decide the text information to be output in this step based on subsequent analysis tasks.
[0060] Generally speaking, we believe that the text in the image that is larger and non-black is more important for sensitive information classification tasks. The results obtained by feeding these texts into the sensitive information classification model will be better than the results obtained by feeding the entire data.
[0061] First, based on the text position detected in the first step, the text size of each text segment is obtained (the text size is measured by height), that is: in For text snippets The corresponding text size.
[0062] Next, we classify the text color of the cropped image list into two categories: black font images and non-black font images. To do this, we need to train a picture text color classification model. The backbone of the model can be a simple crnn. First, collect texts of various colors and mark them as black font images or non-black font images. Send the marked images to the text color classification model For the trained model, we can get a label of whether the font is black for an input text image. Then, for the image list It can be fed into the color classification model to get the following results: in, Indicates The value of the text fragment, which can be black or non-black.
[0063] Finally, determine the subscript of the text segment to be retained in this step. Specifically, consider the text size and color separately: First is the text size, find the minimum value in the text segment ; Then filter out the text subscripts whose text size is twice the minimum value Finally, determine which text to keep. If it is empty, it means that the text size in the picture is basically the same, and there is no size distinction. In this step, we retain all text subscripts, namely: Otherwise keep The corresponding subscript is: Next, consider text color, similar to text size. Filter out text that has a non-black color: Similarly, if When it is an empty set, it means that the colors in the picture are all black and there is no distinction. Then we retain all the text subscripts in this step, namely: , otherwise keep The corresponding subscript is: Step 3: Image target detection.
[0064] The specific objects that need to be detected in the image are actually determined based on the specific business involved in the subsequent analysis model. For the classification of sensitive information, here we choose the categories: buildings, road signs, goods, banners, clothing, and others (this category is not marked in the detection model, that is, the positions not marked with the previous labels are all other categories).
[0065] After defining the target to be detected, we only need to train a corresponding target detection model Specifically, first collect data for annotation and obtain batch training data sets. For example, the locations of buildings and banners are marked: Next, use the labeled data to train an object detection model , the model can choose any target detection model, such as classic target detection models such as yolo.
[0066] Finally, send an image to the trained object detection model above , get the type and position of all targets in each picture, the formula is as follows: in, Indicates the number of targets marked on the image. Indicates Types of targets, Indicates The position of a target, which is composed of the upper left corner coordinates and the lower right corner coordinates.
[0067] Step 4: Determine the background corresponding to each type of text to determine the output text subscript.
[0068] 1) Compare the background position with the text position to obtain the background type corresponding to each text segment.
[0069] Specifically, first, for each text segment , calculate the ratio of the intersection area with each background to the area of the text itself in turn to get the proportion vector of the text on each background: in Representation text object The intersection area, Representation text area.
[0070] Next, those whose intersection area is greater than a certain threshold The candidate objects are screened out: That is, the candidate targets are those whose characters have most of their area within the target.
[0071] Finally, determine the background target type of this type of text. If it is empty, it means that the text has no corresponding background. The corresponding target background categories are: Otherwise, the target with the smallest candidate target area is selected as its type in the candidate set, that is, 2) Determine the text subscript for output.
[0072] For sensitive information classification scenarios, among these buildings, road signs, commodities, banners, clothing, and other categories, we believe that banners and other categories are more important for sensitive information classification, while buildings, road signs, commodities, and clothing information are not important. Therefore, we only filter those background categories that are banners or other two types of text output: Similarly, if When it is an empty value, it means that all the words are of similar importance, so the words we filter in this step are the entire set, that is: ,otherwise .
[0073] Step 5: Determine the text that needs to be output in the end.
[0074] Take the union of the results from step 2 and step 4 to get the final output text. The formula is as follows: The above formula indicates that we will eventually take the union of the texts filtered out by font size, color, and text background as our final text output and send it to the sensitive information classification model for subsequent analysis.
[0075] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.
Claims
1. A method for OCR text screening and classification based on downstream task drive, characterized by: The following steps are involved: Step 1: perform text detection on the input image, obtain the position of the text in the image, and record it as a position set Pos, where each position record includes the coordinates of the four corner points of the text segment; Step 2: Crop the image into multiple small images according to the text position, perform text recognition, and obtain the text content of each position; Step 3, determine the size and color of each text segment, and record them as Size and Color respectively, where Size is the height of the text segment and Color is the color label of the text segment; Step 4: Detect objects in the image and identify background objects in the image, including but not limited to buildings, road signs, commodities, banners, and clothing; Step 5, comparing the text position with the background target position, calculating the intersection area ratio between each text segment and the background target, and determining the type of background target corresponding to each text segment; Step 6: Further select the text segments that have been filtered above according to the specific downstream tasks: In the sensitive information classification task, select a banner background or text with a larger size and a non-black color; In the territorial judgment task, text information related to the geographic location was selected and filtered in combination with background information, such as road signs and buildings; In the emergency information processing task, select text information related to the emergency situation and filter it in combination with background information, such as banners; The text fragments that have undergone task-specific screening are input into the classification model of the downstream task for processing and analysis.
2. According to the downstream task-driven image OCR text screening and classification method of claim 1, it is characterized in that: In step 6, in the sensitive information classification task, text selection is performed in the following way: Introducing the task adapter module to analyze downstream task requirements in real time and automatically adjust the screening criteria for text size and color; By collecting and analyzing past processing records and context information, relevant patterns and rules are extracted, and the screening criteria are dynamically adjusted based on these patterns. Specific operations include: Combined with the results of historical data feedback, extract the text corresponding to the background target type and text segment features that are more relevant to the task; Based on the analysis results, the background information filtering rules are updated in real time to select text with a banner background or a larger size and a non-black color; In the territorial judgment task, text selection is performed in the following ways: Analyze downstream task requirements in real time through the task adapter module, and dynamically adjust the text information screening criteria related to geographic location; Combine contextual information, such as historical data and task-specific parameters, to optimize the filtering rules for landmarks and building background information. Specific operations include: Extracting text information and background target features related to geographic location from historical data; Use machine learning models to analyze contextual information, identify and extract characteristic patterns related to geographic location; dynamically adjust the screening criteria for road signs and building background information based on the analysis results to improve the accuracy of territorial judgment; In the emergency information processing task, text selection is performed in the following ways: Using the task adapter module, the downstream task requirements are analyzed in real time, and the text information screening criteria related to emergency situations are automatically adjusted; Based on the feedback results of historical data, dynamically optimize the screening rules of text background target types and text fragment features for emergency information processing tasks to improve the efficiency and accuracy of emergency information processing; The background information screening rules are updated in real time according to the analysis results to select the background as a banner or corresponding text to participate in the emergency information processing task.
3. The method for OCR text screening and classification based on downstream task drive according to claim 1, characterized in that: In step 3, further comprising: A deep learning algorithm is used to classify the color of text fragments, a threshold is used to classify the size of text fragments, and a classification model is generated to improve screening efficiency and accuracy.
4. The method for OCR text screening and classification based on downstream task drive according to claim 1, characterized in that: In step 4, a convolutional neural network is used for object detection and background objects are recognized by fine-tuning the pre-trained model.
5. The method for OCR text screening and classification based on downstream task drive according to claim 1, characterized in that: In step 5, further comprising: The intersection area ratio between each text segment and multiple background targets is calculated, and the background target with the largest intersection area is selected as the background target type of the text segment.
6. The method for OCR text screening and classification based on downstream task drive according to claim 2, characterized in that: Introducing a task adapter module involves the following steps: According to the downstream task requirements, the screening standard parameter library is updated in real time, and the screening standards are dynamically adjusted according to the feedback results.
7. The method for OCR text screening and classification based on downstream task drive according to claim 2, characterized in that: In the sensitive information classification task, the text selection is further optimized by: Combined with contextual semantic analysis, text fragments with similar semantics are clustered, and text fragments related to the task are given priority.
8. The method for OCR text screening and classification based on downstream task drive according to claim 2, characterized in that: In the territorial judgment task, the text selection is further optimized in the following ways: By utilizing geographic information system (GIS) data and combining it with road signs and building background information, the screening criteria can be dynamically adjusted to improve the accuracy of territorial judgment.
Citation Information
Patent Citations
Picture character positioning method and device, medium and computer device
CN109858475A
Network picture sensitive character automatic detection method
CN111460247A
Machine learning-based universal OCR training data generation system and method
CN112418224A
Icon character information processing method
CN117011853A
Automated generation of banner images
US11172271B1
