Image data automatic desensitization method and system based on OCR image recognition
By using OCR image recognition technology and pixel coverage, the system automatically identifies and processes sensitive information in both fixed and non-fixed locations in coal mine images, solving the problems of low efficiency and poor accuracy in existing technologies and enabling secure and efficient sharing of coal mine image data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies struggle to efficiently process both fixed-location and non-fixed-location sensitive information in coal mine images simultaneously, resulting in low efficiency and poor accuracy in coal mine image data sharing, and posing a risk of sensitive information leakage.
By employing OCR image recognition technology combined with a sensitive word database, sensitive information in both fixed and non-fixed locations is automatically identified and desensitized through preprocessing, object detection, and pixel overlay methods, and secondary verification is performed to ensure accuracy.
It enables secure and efficient sharing of coal mine image data, improves the efficiency and accuracy of desensitization, adapts to complex underground environments, and ensures data security and compliance.
Smart Images

Figure CN121786885A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing and information security technology, specifically to an automatic desensitization method and system for image data based on OCR image recognition. Background Technology
[0002] In the digital development of the coal mining industry, image data, as an important information carrier, is widely used in scenarios such as safety production monitoring, project progress management, and equipment status monitoring. To achieve collaborative work, technical exchange, and data analysis, the sharing of coal mine image data across departments and units is becoming increasingly frequent.
[0003] However, coal mine image data often contains a large amount of sensitive information. If this information is leaked, it could pose a serious threat to the safe production of coal mines, the interests of enterprises, and even national security. Sensitive data in coal mine images can be mainly divided into two categories: one is sensitive information in fixed locations, usually fixed in the four corners of the image in the form of markings or labels, such as the shooting location, precise time, equipment number, and the name of a classified area in the mine; the other is sensitive information in non-fixed locations, which may appear in any area of the image, such as handwritten construction records, temporarily posted notices, and classified data in equipment operating parameters.
[0004] Currently, the desensitization of coal mine image data is mostly done manually, where staff examine each image individually to identify and mask sensitive information. This method is not only inefficient and unsuitable for processing large volumes of image data, but also overly reliant on human experience, making it prone to overlooking or mishandling sensitive information.
[0005] While some image desensitization techniques have been applied in other fields, existing technologies struggle to simultaneously meet the precise and efficient desensitization needs of both fixed-location and non-fixed-location sensitive information in coal mine images. For fixed-location sensitive information, there is a lack of convenient batch annotation and automated processing mechanisms; for non-fixed-location sensitive information, due to its high degree of location uncertainty and diverse forms, existing technologies cannot achieve comprehensive and accurate identification and desensitization. Therefore, there is an urgent need for a desensitization method capable of automatically identifying and processing both types of sensitive information in coal mine images to ensure the security and efficiency of coal mine image data sharing. Summary of the Invention
[0006] To address this, embodiments of the present invention provide an automatic desensitization method and system for image data based on OCR image recognition, in order to solve the technical problems of existing coal mine image data desensitization methods being inefficient and inaccurate, and unable to effectively process both fixed-location and non-fixed-location sensitive information simultaneously, thereby achieving secure and efficient sharing of coal mine image data.
[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0008] According to a first aspect of the present invention, an automatic desensitization method for image data based on OCR image recognition is provided, the method comprising:
[0009] S1. Collect sensitive words in the coal mining industry and establish a sensitive word database, and regularly update and maintain the sensitive word database;
[0010] S2. Pre-mark the sensitive information areas at fixed locations in the coal mine image, determine the bounding box range and store it as a template. For the image to be processed, locate the fixed sensitive information areas according to the template and use pixel coverage to desensitize them.
[0011] S3. Preprocess the image to improve image quality, then use an object detection model to identify the area where sensitive objects are located, use OCR to identify the text information in the area, match the identified text information with a sensitive word database, and if a sensitive word is matched, locate the text area and use pixel overlay to desensitize it.
[0012] S4. Scan the desensitized image again for sensitive information and perform a second verification. If there is still undesensitized sensitive information, repeat the corresponding desensitization steps in S2 or S3; otherwise, output the desensitized image.
[0013] Furthermore, the sensitive word database includes at least one of the following: classified names of mining areas, core parameters of key equipment, information of personnel involved in classified matters, precise coordinates, and classified time.
[0014] Furthermore, the fixed positions are the four corners of the image, and the bounding box is defined by the coordinates of the upper left corner and the lower right corner.
[0015] Furthermore, the image is preprocessed to improve image quality, including:
[0016] The Gaussian filtering algorithm is used to remove noise, the Hough transform algorithm is used for tilt correction, the text ratio is corrected through geometric transformation, and the color image is converted to grayscale.
[0017] Furthermore, the object detection model is a YOLOv8 model, trained to identify at least one object among people, vehicles, tunneling equipment, and coal mining equipment.
[0018] Furthermore, the sensitive information matching adopts a combination of exact matching and fuzzy matching.
[0019] Furthermore, when locating the text region, the bounding box recognized by OCR is enlarged by a certain threshold.
[0020] Furthermore, the pixel overlay desensitization uses color blocks similar to the background color of the image or a preset blur pattern.
[0021] Furthermore, the secondary verification uses the same technology as S2 and S3 to scan for sensitive information.
[0022] According to a second aspect of the present invention, an automatic image data desensitization system based on OCR image recognition is provided, the system comprising:
[0023] The sensitive word database creation module is used to collect sensitive words in the coal mining industry and create a sensitive word database, and to regularly update and maintain the sensitive word database;
[0024] The fixed-area sensitive information processing module is used to pre-mark sensitive information areas at fixed locations in coal mine images, determine the bounding box range and store it as a template. For the image to be processed, the fixed sensitive information areas are located according to the template and desensitized using pixel coverage.
[0025] The non-fixed region sensitive information processing module is used to preprocess images to improve image quality, then use an object detection model to identify the region where sensitive objects are located, use OCR to identify text information in the region, match the identified text information with a sensitive word library, and if a sensitive word is matched, locate the text region and use pixel overlay to desensitize it.
[0026] The secondary verification module is used to scan the de-identified image for sensitive information again. If there is still un-de-identified sensitive information, it returns to the corresponding sensitive information processing module; otherwise, it outputs the de-identified image.
[0027] The embodiments of the present invention have the following advantages:
[0028] This invention establishes a sensitive word database for the coal mining industry and automates the processing of sensitive information in fixed and non-fixed locations within images. For fixed areas, sensitive information is located and anonymized using pre-stored templates. For non-fixed areas, sensitive text is located using image preprocessing, object detection, and OCR recognition technologies, and then matched with the database for anonymization. Finally, a second verification process ensures no information is missed. This invention effectively improves the accuracy and efficiency of anonymizing coal mine image data, adapts to complex underground environments, and ensures the security and compliance of data during sharing. Attached Figure Description
[0029] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0030] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0031] Figure 1 A schematic diagram of the logical structure of an automatic image data desensitization system based on OCR image recognition provided in an embodiment of the present invention;
[0032] Figure 2 This is a flowchart illustrating an automatic desensitization method for image data based on OCR image recognition, provided in an embodiment of the present invention. Detailed Implementation
[0033] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] To address the issues of low efficiency and poor accuracy in existing methods for desensitizing coal mine image data, which cannot effectively handle both fixed-location and non-fixed-location sensitive information simultaneously, and to achieve secure and efficient sharing of coal mine image data.
[0035] refer to Figure 1 This invention discloses an automatic image data desensitization system based on OCR image recognition. The system includes: a sensitive word library establishment module 1; a fixed area sensitive information processing module 2; a non-fixed area sensitive information processing module 3; and a secondary verification module 4.
[0036] Corresponding to the aforementioned automatic image data desensitization system based on OCR image recognition, this invention also discloses an automatic image data desensitization method based on OCR image recognition. The following details an automatic image data desensitization method based on OCR image recognition disclosed in this invention, in conjunction with the aforementioned automatic image data desensitization system based on OCR image recognition.
[0037] refer to Figure 2 This invention discloses an automatic desensitization method for image data based on OCR image recognition. Since the location of the camera in the coal mine is basically fixed, the position of the sensitive information on the sign in the image is fixed, and the sensitive information in the fixed area is processed.
[0038] Other sensitive information may appear on staff uniforms and transport vehicles, using non-fixed area sensitive information processing.
[0039] Due to the complex underground environment, images may be unclear, with distorted or tilted text. Sensitive information in non-fixed areas requires data preprocessing.
[0040] S1. Collect sensitive words in the coal mining industry and establish a sensitive word database, and regularly update and maintain the sensitive word database.
[0041] Collect common sensitive terms in the coal mining industry, including but not limited to classified names of mining areas, core parameters of key equipment, information of personnel involved in classified matters, precise coordinates, and classified time periods, build a sensitive term database, and update and maintain it regularly according to actual needs.
[0042] S2. Pre-mark the sensitive information areas at fixed locations in the coal mine image, determine the bounding box range and store it as a template. For the image to be processed, locate the sensitive information areas according to the template and use pixel coverage to desensitize them.
[0043] Region labeling: Sensitive information regions fixed at the four corners of the coal mine image are pre-labeled, and the bounding box range of the sensitive information at each corner is determined. The bounding box is defined by the coordinates of the upper left corner (x1, y1) and the lower right corner (x2, y2), and these labeling information are stored as templates.
[0044] Batch identification and desensitization: For coal mine images to be processed, firstly, based on the stored template, the fixed sensitive information areas at the four corners of the image are located. Then, these areas are desensitized using pixel coverage, for example, by covering the area with color blocks similar to the image background color or a preset blur pattern to ensure that the sensitive information cannot be identified.
[0045] S3. Preprocess the image to improve image quality, then use an object detection model to identify the area where sensitive objects are located, use OCR to identify the text information in the area, match the identified text information with a sensitive word database, if a sensitive word is matched, locate the text area and use pixel overlay to desensitize it.
[0046] When processing sensitive information in non-fixed regions, the image is first preprocessed. Due to issues such as image blurriness, distorted fonts, and tilt, a Gaussian filter algorithm is first used to remove noise and reduce interference from environmental factors such as coal ash in the mine. Next, tilt correction is performed using the Hough transform algorithm to correct the tilt, ensuring the text lines are horizontal or vertical, conforming to the recognition model's expectation of text direction. Then, geometric transformation is used to restore the text's normal proportions and correct text on curved surfaces caused by the shooting angle. Finally, the color image is converted to grayscale to reduce redundant information in the color channels, lower the computational load, and highlight the text information.
[0047] Since sensitive information in underground working environments can appear on workers' uniforms and transport vehicles in addition to sensitive information in fixed areas, YOLOv8 can be used to train all objects that may contain sensitive information, such as people, vehicles, tunneling, and coal mining objects, to identify the object information in sensitive images and obtain the location of the objects.
[0048] OCR Fixed-Point Region Recognition: Using OCR image recognition technology, the region where the object is located is scanned, all text information in the image is identified, and the region where each text information is located is recorded, represented by bounding box coordinates (x3, y3) - (x4, y4).
[0049] Sensitive Information Matching: The text information recognized by OCR is compared with a preset sensitive word database to determine whether the text information contains sensitive words. The comparison process uses a combination of exact matching and fuzzy matching. Exact matching is used to identify completely identical sensitive words, while fuzzy matching is used to identify similar sensitive words due to differences in font, clarity, etc.
[0050] Location and Desensitization: After identifying text information containing sensitive words, to prevent any omissions in the identified text information, the bounding box of the location area is enlarged by a certain threshold, such as 20%, to accurately locate the area of the sensitive information in the image. Subsequently, the same pixel coverage method as for desensitization of fixed areas is used to desensitize this area.
[0051] S4. Scan the desensitized image again for sensitive information and perform a second verification. If there is still undesensitized sensitive information, repeat the corresponding desensitization steps in S2 or S3; otherwise, output the desensitized image.
[0052] The image after the above two desensitization steps is then subjected to a second verification. The image is scanned again using the aforementioned technology to confirm whether any un-desensitized sensitive information remains. If so, the corresponding desensitization steps are repeated; otherwise, the desensitized image is output, completing the entire desensitization process.
[0053] The embodiments of the present invention have the following advantages:
[0054] 1) Improved desensitization efficiency: This invention automates the desensitization of coal mine image data, eliminating the need for manual processing of each image individually, significantly reducing processing time and labor costs. For batches of coal mine image data, it can quickly complete the desensitization operation, meeting the timeliness requirements of large-scale data sharing.
[0055] 2) Improve the accuracy of desensitization: For sensitive information in fixed locations, pre-labeled templates are used for positioning, avoiding the subjectivity and error of manual identification and ensuring accurate desensitization of sensitive information in fixed areas; for sensitive information in non-fixed locations, OCR recognition technology and sensitive word database comparison are combined to comprehensively and accurately identify various types of sensitive information, reducing the risk of missing sensitive information.
[0056] 3) Enhanced adaptability: This method can process both fixed and non-fixed sensitive information in coal mine images simultaneously, and is applicable to various types of coal mine images, including monitoring screenshots, on-site photos, equipment recording images, etc., and has wide applicability.
[0057] 4) Ensuring data security: Through automated desensitization processing, the leakage of sensitive information in coal mine images is effectively prevented, providing security for cross-departmental and cross-unit sharing of coal mine image data. This helps to promote information exchange while safeguarding the legitimate rights and interests of coal mining enterprises and maintaining safe production order.
[0058] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.
Claims
1. An automatic desensitization method for image data based on OCR image recognition, characterized in that, The method includes: S1. Collect sensitive words in the coal mining industry and establish a sensitive word database, and regularly update and maintain the sensitive word database; S2. Pre-mark the sensitive information areas at fixed locations in the coal mine image, determine the bounding box range and store it as a template. For the image to be processed, locate the fixed sensitive information areas according to the template and use pixel coverage to desensitize them. S3. Preprocess the image to improve image quality, then use an object detection model to identify the area where sensitive objects are located, use OCR to identify the text information in the area, match the identified text information with a sensitive word database, and if a sensitive word is matched, locate the text area and use pixel overlay to desensitize it. S4. Scan the desensitized image again for sensitive information and perform a second verification. If there is still undesensitized sensitive information, repeat the corresponding desensitization steps in S2 or S3; otherwise, output the desensitized image.
2. The automatic image data desensitization method based on OCR image recognition as described in claim 1, characterized in that, The sensitive word database includes at least one of the following: classified names of mining areas, core parameters of key equipment, information of personnel involved in classified matters, precise coordinates, and classified time.
3. The automatic image data desensitization method based on OCR image recognition as described in claim 1, characterized in that, The fixed positions are the four corners of the image, and the bounding box is defined by the coordinates of the top left corner and the bottom right corner.
4. The automatic desensitization method for image data based on OCR image recognition as described in claim 1, characterized in that, Image preprocessing to improve image quality includes: The Gaussian filtering algorithm is used to remove noise, the Hough transform algorithm is used for tilt correction, the text ratio is corrected through geometric transformation, and the color image is converted to grayscale.
5. The automatic desensitization method for image data based on OCR image recognition as described in claim 1, characterized in that, The object detection model is a YOLOv8 model, trained to identify at least one object among people, vehicles, tunneling equipment, and coal mining equipment.
6. The automatic desensitization method for image data based on OCR image recognition as described in claim 1, characterized in that, The sensitive information matching adopts a combination of exact matching and fuzzy matching.
7. The automatic desensitization method for image data based on OCR image recognition as described in claim 1, characterized in that, When locating the text region, the bounding box recognized by OCR is magnified by a certain threshold.
8. The automatic desensitization method for image data based on OCR image recognition as described in claim 1, characterized in that, The pixel overlay desensitization uses color blocks similar to the background color of the image or a preset blur pattern.
9. The automatic desensitization method for image data based on OCR image recognition as described in claim 1, characterized in that, The secondary verification uses the same technique as S2 and S3 to scan for sensitive information.
10. An automatic image data desensitization system based on OCR image recognition, characterized in that, The system includes: The sensitive word database creation module is used to collect sensitive words in the coal mining industry and create a sensitive word database, and to regularly update and maintain the sensitive word database; The fixed-area sensitive information processing module is used to pre-mark sensitive information areas at fixed locations in coal mine images, determine the bounding box range and store it as a template. For the image to be processed, the fixed sensitive information areas are located according to the template and desensitized using pixel coverage. The non-fixed region sensitive information processing module is used to preprocess images to improve image quality, then use an object detection model to identify the region where sensitive objects are located, use OCR to identify text information in the region, match the identified text information with a sensitive word library, and if a sensitive word is matched, locate the text region and use pixel overlay to desensitize it. The secondary verification module is used to scan the de-identified image for sensitive information again. If there is still un-de-identified sensitive information, it returns to the corresponding sensitive information processing module; otherwise, it outputs the de-identified image.