An image desensitization replacement method, device, equipment and medium

By performing sensitive target detection and semantic reconstruction on images, a replacement region consistent with the environmental context features and non-sensitive attribute features of the target region is generated. This solves the problem of image feature distribution being destroyed in existing technologies and enables effective desensitization without changing image details and structure.

CN122199334APending Publication Date: 2026-06-12HANGZHOU HAOLINK INTELLIGENT TECHNOLOGY CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU HAOLINK INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-03-04
Publication Date
2026-06-12

Smart Images

  • Figure CN122199334A_ABST
    Figure CN122199334A_ABST
Patent Text Reader

Abstract

The application discloses an image desensitization replacement method, device, equipment and medium. The method comprises the following steps: obtaining a to-be-processed image; performing sensitive target detection on the to-be-processed image to obtain at least one target region containing sensitive information; extracting the environmental context features of the target region and the non-sensitive attribute features of the target region; performing semantic reconstruction on the target region based on the environmental context features and the non-sensitive attribute features to generate a replacement region; the replacement region is consistent with the environmental context features and the non-sensitive attribute features of the target region; and replacing the target region with the replacement region to obtain a desensitized image. The embodiment of the application can realize desensitization operation on the to-be-processed image without changing the details and structural information of the to-be-processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image desensitization and replacement method, apparatus, device, and medium. Background Technology

[0002] With the widespread use of video surveillance, mobile terminals, and drones, image data is being acquired and used extensively in scenarios such as security patrols, engineering management, data analysis, and model training. In smart construction and smart construction site scenarios, a large number of real-time monitoring images of construction sites are used for training algorithm models, such as personnel detection, equipment identification, and hazardous behavior recognition. However, construction site images generally contain the following sensitive information: personnel identity information (such as facial and body features), sensitive corporate markings (such as company logos, uniform markings, and safety helmet numbers), and sensitive text information (such as warning signs on walls, equipment nameplates, QR codes, and vehicle license plates). Directly using image data containing such sensitive information can easily lead to privacy leaks and compliance risks. Therefore, how to identify and de-identify sensitive information in images without affecting the overall usability of the images has become a crucial fundamental issue in the flow and application of image data.

[0003] Currently, in existing technologies, the processing of sensitive information in images usually adopts a unified desensitization strategy, such as directly applying mosaic, blurring, occlusion strips, or pixelation to the detected target area.

[0004] However, existing techniques can disrupt the distribution of image features, making the anonymized data unusable for secondary training of machine learning models. Summary of the Invention

[0005] This invention provides an image desensitization and replacement method, apparatus, device, and medium. The embodiments of this invention can perform desensitization operations on the image to be processed without changing the details and structural information of the image to be processed.

[0006] In a first aspect, embodiments of the present invention provide an image desensitization and replacement method, the method comprising:

[0007] Obtain the image to be processed;

[0008] Perform sensitive target detection on the image to be processed to obtain at least one target region containing sensitive information;

[0009] Extract the environmental context features and non-sensitive attribute features of the target region;

[0010] Based on environmental context features and non-sensitive attribute features, the target region is semantically reconstructed to generate a replacement region; the replacement region has the same environmental context features and non-sensitive attribute features as the target region.

[0011] Replace the target area with the replacement area to obtain the desensitized image.

[0012] Secondly, embodiments of the present invention also provide an image desensitization and replacement device, the device comprising:

[0013] The image acquisition module is used to acquire the image to be processed.

[0014] The sensitive target detection module is used to detect sensitive targets in the image to be processed, and obtain at least one target region containing sensitive information.

[0015] The feature extraction module is used to extract the environmental context features and non-sensitive attribute features of the target region.

[0016] The replacement region generation module is used to semantically reconstruct the target region based on environmental context features and non-sensitive attribute features to generate a replacement region; the replacement region has the same environmental context features and non-sensitive attribute features as the target region.

[0017] The desensitized image generation module is used to replace the target area with the replacement area to obtain the desensitized image.

[0018] Thirdly, embodiments of the present invention also provide an image desensitization and replacement device, the image desensitization and replacement device comprising:

[0019] At least one processor; and

[0020] A memory that is communicatively connected to at least one processor; wherein,

[0021] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the image desensitization and replacement method according to any embodiment of the present invention.

[0022] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions that are used to cause a processor to execute and implement the image desensitization and replacement method of any embodiment of the present invention.

[0023] The technical solution of this invention, by acquiring the image to be processed, can provide a unified data input basis for subsequent sensitive information identification and replacement processing. By performing sensitive target detection on the image to be processed, at least one target region containing sensitive information is obtained, which can realize the automatic location of sensitive information in the image, thereby reducing the workload of manual screening and improving the accuracy of sensitive information identification. By extracting the environmental context features and non-sensitive attribute features of the target region, the external environmental information of the target region can be obtained while distinguishing between sensitive semantic content and non-sensitive structural attributes, thereby providing necessary constraints for the subsequent generation process. Semantic reconstruction of the target region generates a replacement region consistent with the environmental context features and non-sensitive attribute features of the target region. This can maintain visual distribution consistency and structural continuity while removing sensitive information. By replacing the target region with the replacement region, a desensitized image is obtained. Sensitive information can be removed while preserving the overall visual effect of the original image, thereby improving the usability and security of the desensitized image. This solves the technical problem that existing technologies can significantly damage and change the details and structural information of image data, resulting in a large difference between the desensitized image data and the original image. Thus, the desensitization operation can be performed on the image to be processed without changing the details and structural information of the image to be processed, thus preserving the data value.

[0024] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 A flowchart of an image desensitization and replacement method provided in an embodiment of the present invention;

[0027] Figure 2 A flowchart of an image desensitization and replacement method provided in an embodiment of the present invention;

[0028] Figure 3 This is a schematic diagram of the structure of an image desensitization and replacement device provided in an embodiment of the present invention;

[0029] Figure 4 This is a schematic diagram of the structure of an image desensitization and replacement device provided in an embodiment of the present invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] The acquisition, storage, and application of images to be processed in the technical solutions of this invention comply with relevant laws and regulations and do not violate public order and good morals.

[0033] Figure 1 This is a flowchart illustrating an image desensitization and replacement method provided in an embodiment of the present invention. This embodiment is applicable to situations where sensitive information exists in image data collected at a construction site, and the sensitive areas corresponding to the sensitive information in the image data are desensitized. This method can be executed by an image desensitization and replacement device, which can be implemented in hardware and / or software.

[0034] See Figure 1 The image desensitization and replacement method shown includes:

[0035] S101. Obtain the image to be processed.

[0036] The image to be processed can refer to the original image data that needs to be de-identified. The image to be processed contains sensitive information and requires de-identification processing. For example, the image to be processed could be a photograph of a construction site, which contains personnel, equipment, and the background environment, and the sensitive content within it needs to be replaced.

[0037] S102. Perform sensitive target detection on the image to be processed to obtain at least one target region containing sensitive information.

[0038] Sensitive target detection refers to the process of automatically identifying and locating sensitive regions within an image to be processed. Specifically, multiple targets in the image to be processed can be obtained through target detection, and these targets can include both sensitive and non-sensitive targets. Then, sensitivity type detection is performed on each target to identify sensitive targets as target regions containing sensitive information.

[0039] Sensitive information refers to content in the image to be processed that is not intended to be directly displayed, stored, disseminated, or used for training. Sensitive information can manifest as specific regions or content forms within an image, and may include: faces, license plates, employee ID numbers, phone numbers, and company logos. For example, the facial features of a person in a construction site photo are considered sensitive information and need to be replaced to avoid identifying their specific identity.

[0040] The target region refers to a region in the image that has been located by target detection. The target region is a local spatial definition of the image to be processed, used to limit subsequent recognition and replacement operations to a local area and avoid indiscriminate processing of the entire image.

[0041] S103. Extract the environmental context features and non-sensitive attribute features of the target region.

[0042] Contextual features refer to the feature information used to characterize the external visual environment state of the target region in the image to be processed. These contextual features can include: background tone information, illumination intensity information, noise distribution information, texture structure information, object occlusion relationship information, and spatial structure information. As an important constraint for semantic reconstruction, contextual features ensure that the replacement region maintains visual consistency with the original image environment, thereby avoiding phenomena such as tone mismatch, illumination conflict, or abrupt edge changes, and improving the naturalness and usability of the desensitized image.

[0043] Non-sensitive attribute features refer to feature information in the target area that does not contain sensitive information but can reflect the general appearance, structure, or morphological attributes of the target. For example, when the target area is a person, non-sensitive attribute features may include: action posture information, key body points, head orientation, body outline shape, and clothing appearance structure; when the target area is a company trademark or graphic logo, non-sensitive attribute features may include: outer wireframe shape, graphic outline structure, basic geometric proportions, color scheme, and graphic layout structure; when the target area is text content, non-sensitive attribute features may include: font type, font size, typesetting method, line spacing, character spacing, and text orientation. The role of non-sensitive attribute features is to ensure that the replacement area after semantic reconstruction maintains consistency with the original target in morphological structure, thereby avoiding structural breaks or visual anomalies caused by completely deleting semantic information.

[0044] S104. Based on environmental context features and non-sensitive attribute features, semantic reconstruction is performed on the target region to generate a replacement region; the replacement region is consistent with the environmental context features and non-sensitive attribute features of the target region.

[0045] Semantic reconstruction refers to the process of regenerating the sensitive semantic content of a target region under the constraints of environmental context features and non-sensitive attribute features, in order to obtain a replacement region that is consistent with the original environment distribution and does not contain sensitive information. For example, in a face desensitization and replacement scenario, a conditional generative adversarial network model can be used to generate a new non-realistic facial image based on the person's pose and lighting conditions, thereby achieving face replacement and ensuring that the generated result is consistent with the original in terms of tone, lighting, and texture distribution. Figure 1 In another embodiment, a diffusion model can be used to reconstruct the target region. The diffusion model generates image content through a progressive denoising method, incorporating environmental context features as constraints during the generation process to ensure that the generated result maintains a consistent statistical distribution with the original image. In yet another embodiment, to ensure edge continuity between the replacement region and its surrounding areas, a Poisson image fusion algorithm can be used for edge smoothing. This algorithm solves the image gradient field consistency problem, making the replacement region continuous with the original image in gradient space, thereby eliminating stitching boundary traces.

[0046] The replacement region refers to a regenerated image region used to replace the content of the target region. The replacement region has a position and size that match the target region (at least mapped to the same coordinate range). The content of the replacement region differs from the original target region, but visually it should be able to be embedded into the original image as replacement content. The replacement region may contain pixel data and boundary transition information. For example, when the sensitivity type is a person, the replacement region can be a new facial region image; when the sensitivity type is text, the replacement region can be a new text block or texture block image; when the sensitivity type is a pattern, the replacement region can be a new pattern region image.

[0047] S105. Replace the target area with the replacement area to obtain the desensitized image.

[0048] In this context, a desensitized image refers to an output image where sensitive information has been visually replaced after the image to be processed has been replaced. For example, if the image to be processed is an image of a construction site scene, and the clearly identifiable faces in the image are replaced with new facial areas, the output image still retains the integrity of the construction site scene, but the original personnel cannot be directly identified. This output image is a desensitized image.

[0049] As can be seen, in this embodiment, acquiring the image to be processed provides a unified data input basis for subsequent sensitive information identification and replacement processing. By performing sensitive target detection on the image to be processed, at least one target region containing sensitive information is obtained, which enables automatic localization of sensitive information in the image, thereby reducing the workload of manual screening and improving the accuracy of sensitive information identification. By extracting the environmental context features and non-sensitive attribute features of the target region, the external environmental information of the target region can be obtained while distinguishing between sensitive semantic content and non-sensitive structural attributes, thus providing necessary constraints for the subsequent generation process. Semantic reconstruction of the target region generates a replacement region consistent with the environmental context features and non-sensitive attribute features of the target region. This can maintain visual distribution consistency and structural continuity while removing sensitive information. By replacing the target region with the replacement region, a desensitized image is obtained. Sensitive information can be removed while preserving the overall visual effect of the original image, thereby improving the usability and security of the desensitized image. This solves the technical problem that existing technologies can significantly damage and change the details and structural information of image data, resulting in a large difference between the desensitized image data and the original image. Thus, the desensitization operation can be performed on the image to be processed without changing the details and structural information of the image to be processed, thus preserving the data value.

[0050] In an optional embodiment, Figure 2The flowchart of an image desensitization and replacement method provided in this embodiment of the invention refines the process of "semantically reconstructing the target region based on environmental context features and non-sensitive attribute features to generate a replacement region with non-sensitive attribute features" into "generating semantic constraints based on environmental context features and non-sensitive attribute features; semantically reconstructing the target region based on semantic constraints to generate a replacement region", thereby improving the image desensitization and replacement operation.

[0051] It should be noted that for parts not described in detail in the embodiments of the present invention, please refer to the descriptions in other embodiments.

[0052] See Figure 2 The image desensitization and replacement method shown includes:

[0053] S201. Obtain the image to be processed.

[0054] S202. Perform sensitive target detection on the image to be processed to obtain at least one target region containing sensitive information.

[0055] S203. Extract the environmental context features and non-sensitive attribute features of the target region.

[0056] S204. Generate semantic constraints based on environmental context features and non-sensitive attribute features.

[0057] Semantic constraints refer to a set of semantic and visual rules that must be met when semantically reconstructing a target region. These constraints can include environmental consistency constraints, structure preservation constraints, category constraints, and statistical distribution constraints. For example, constraints might stipulate that the color tone of the generated region should match the surrounding background, the outline shape should maintain its original geometric proportions, the semantic category should belong to a non-sensitive category, and the pixel distribution should fall within the statistical distribution range of the original image. For instance, when desensitizing and replacing license plates, the generated region can be constrained to maintain a rectangular structure, retain the original font style and color scheme, and be replaced with non-real number content, thus achieving both structural consistency and information desensitization.

[0058] S205. Based on semantic constraints, perform semantic reconstruction on the target region to generate a replacement region.

[0059] S206. Replace the target area with the replacement area to obtain the desensitized image.

[0060] As can be seen, in this embodiment, by generating semantic constraints based on environmental context features and non-sensitive attribute features, environmental information and structural attribute information can be transformed into explicit generation restriction rules, thereby providing an executable control basis for the semantic reconstruction process. By incorporating environmental context features and non-sensitive attribute features into semantic constraints, visual distribution consistency and structural morphology consistency can be considered simultaneously during the generation process, thereby reducing the possibility that the generation result deviates from the original scene features.

[0061] In some embodiments, extracting environmental context features and non-sensitive attribute features of the target region includes:

[0062] Spatially expand the target area to obtain the expanded area of ​​the target area;

[0063] Extract the environmental context features of the extended region and the target region;

[0064] The environmental context features of the extended region and the environmental context features of the target region are determined as the environmental context features of the target region;

[0065] Based on the target area, determine the sensitivity type of the target area;

[0066] Based on the sensitive type, extract the non-sensitive attribute features of the target region.

[0067] The extended region refers to an image region formed by extending a certain spatial range outward from the target region. This region includes the target region itself and its surrounding adjacent environment. The extended region has a defined geometric structure, typically expanding outward from the boundary of the target region according to a preset ratio to form a larger rectangular or polygonal region. In this invention, the extended region is used to enhance the integrity of environmental information sampling, providing reliable environmental constraint data for subsequent semantic reconstruction.

[0068] As can be seen, in this embodiment, by spatially expanding the target region to obtain an expanded region, the adjacent environmental information around the target can be introduced when extracting features, thereby improving the completeness of environmental feature acquisition. By extracting the environmental context features of the expanded region and the environmental context features of the target region, information inside the local region and surrounding background information can be obtained simultaneously, thereby enhancing the comprehensiveness of environmental feature description. By determining the environmental context features of the expanded region and the environmental context features of the target region as the environmental context features of the target region, environmental information can be comprehensively integrated, thereby improving the accuracy of environmental consistency during subsequent semantic reconstruction. By determining the sensitivity type of the target region based on the target region, different types of sensitive objects can be distinguished and processed, thereby providing a targeted basis for subsequent feature extraction.

[0069] In some embodiments, sensitive target detection is performed on the image to be processed to obtain at least one target region containing sensitive information, including:

[0070] Perform target detection on the image to be processed to obtain at least one initial target region;

[0071] For each initial target region, perform sensitive type detection on the initial target region, and determine the sensitive type detection result of the initial target region. The sensitive type detection result includes: sensitive type and non-sensitive type;

[0072] Delete each initial target region that is not sensitive in the sensitive type detection result to obtain at least one target region containing sensitive information.

[0073] The initial target region refers to the candidate object region identified in the image to be processed by the object detection algorithm. This initial target region has not yet undergone sensitive type screening. In this invention, the initial target region serves as the first layer of the hierarchical detection mechanism, providing a candidate set for subsequent sensitive target screening.

[0074] As can be seen, in this embodiment, by performing target detection on the image to be processed, at least one initial target region is obtained, which can pre-screen candidate objects in the image, thereby providing a processing basis for subsequent sensitivity type determination; by performing sensitivity type detection on each initial target region, sensitive objects and non-sensitive objects can be distinguished at the candidate object level, thereby improving the targeting of sensitive target identification; by determining that the sensitivity type detection results of the initial target region include sensitive and non-sensitive types, different categories of objects can be classified and identified, thereby providing a clear basis for subsequent screening steps; by deleting each initial target region whose sensitivity type detection result is non-sensitive, object regions that do not require desensitization processing can be excluded, thereby reducing the scope of subsequent processing and improving the efficiency of desensitization processing.

[0075] In some embodiments, replacing the target region with a replacement region to obtain a desensitized image further includes:

[0076] Based on the image to be processed and the desensitized image, a similarity detection is performed on the image to be processed and the desensitized image to obtain the similarity detection results;

[0077] When the similarity detection result is similar, it is determined that the desensitization of the image to be processed by replacing the image with the desensitized image was successful.

[0078] When the similarity detection result is not similar, it is determined that the desensitization replacement of the image to be processed by the desensitized image has failed.

[0079] Similarity detection refers to the process of comparing the image to be processed with the desensitized image to determine whether the two have a predetermined degree of similarity.

[0080] As can be seen, in this embodiment, by replacing each target region in the image to be processed with a replacement region and obtaining a desensitized image before performing similarity detection, the overall consistency of the image after replacement can be verified, thus providing a basis for subsequent verification of the replacement effect. By performing similarity detection on the image to be processed and the desensitized image and obtaining similarity detection results, a quantitative judgment result on the degree of difference between the images before and after replacement can be formed, which can be used for subsequent replacement status determination. By determining that the desensitized image has successfully replaced the image to be processed when the similarity detection result is similar, a success judgment can be given when the replaced image still maintains an overall similarity with the original image, thereby improving the objectivity of the replacement result judgment. By determining that the desensitized image has failed to replace the image to be processed when the similarity detection result is dissimilar, a failure judgment can be given when the replacement causes an excessively large overall difference in the image, thereby facilitating the identification of possible abnormalities in the replacement process.

[0081] In some embodiments, based on the image to be processed and the desensitized image, similarity detection is performed on the image to be processed and the desensitized image to obtain similarity detection results, including:

[0082] Obtain the first feature vector of the image to be processed, and the second feature vector of the desensitized image;

[0083] The similarity between the first feature vector and the second feature vector is calculated based on the first feature vector and the second feature vector.

[0084] The similarity is compared with a preset deviation threshold;

[0085] When the similarity is less than the deviation threshold, the similarity detection result is determined to be dissimilar.

[0086] When the similarity is greater than or equal to the deviation threshold, the similarity detection result is determined to be similar.

[0087] The first feature vector can refer to a set of values ​​used to characterize the overall features of the image to be processed.

[0088] The second feature vector can refer to a set of values ​​used to characterize the overall features of the desensitized image. The second feature vector has the same dimension as the first feature vector and resides in the same feature representation space to ensure comparability. The second and first feature vectors are used together for similarity calculation, providing a quantitative basis for similarity detection results.

[0089] The deviation threshold can be a preset limit value used to determine whether something is similar or dissimilar. For example, if the deviation threshold is set to 0.80, it is judged as dissimilar when the similarity is 0.78 and as similar when the similarity is 0.85.

[0090] As can be seen, in this embodiment, by obtaining the first feature vector of the image to be processed and the second feature vector of the desensitized image, the image to be processed and the desensitized image can be converted into feature representations that can be compared, so as to uniformly measure the overall features of the two; by calculating the similarity between the two based on the first feature vector and the second feature vector, the degree of similarity between the image to be processed and the desensitized image can be quantitatively characterized, thereby providing a numerical basis for similarity judgment; by comparing the similarity with a preset deviation threshold, the quantified similarity result can be mapped to a threshold comparison result that can be used for judgment, so as to form a clear standard for similarity or dissimilarity judgment; by determining the similarity detection result as dissimilarity when the similarity is less than the deviation threshold, a dissimilarity conclusion can be output when the similarity is lower than a preset lower limit, thereby identifying the situation where the overall difference between the replaced image and the image to be processed is too large; by determining the similarity detection result as similar when the similarity is greater than or equal to the deviation threshold, a similarity conclusion can be output when the similarity meets the preset requirements, thereby reflecting the situation where the replaced image and the image to be processed are generally consistent.

[0091] In some embodiments, after replacing the target region with the replacement region to obtain the desensitized image, the method further includes:

[0092] Obtain the location information of the replacement region in the desensitized image;

[0093] Based on the location information, the structured annotation data associated with the image to be processed is corrected synchronously.

[0094] Structured annotation data refers to a dataset stored in a predefined data structure to describe the location and semantic category information of target objects in an image. During image processing and model training, image data and annotation data must remain consistent. If the annotation information is not updated synchronously after the content of the target region is replaced, a semantic mismatch will occur between the image and the label, affecting the accuracy of subsequent model training. Therefore, in this invention, after generating the desensitized image, the original structured annotation data is synchronously corrected based on the location information of the replaced region to ensure that the category information in the annotation data is consistent with the content of the desensitized image. This feature plays a role in maintaining data consistency and supporting the construction of training data in this invention.

[0095] As can be seen, in this embodiment, by replacing the target area with the replacement area and then performing subsequent steps after obtaining the desensitized image, the consistency of information at the data level can be further guaranteed on the basis of completing the image content update; by obtaining the location information of the replacement area in the desensitized image, the spatial range involved in the desensitization process can be clearly defined, thereby providing a positioning basis for the corresponding correction of the subsequent annotation data; by synchronously correcting the structured annotation data associated with the image to be processed according to the location information, the changes in image content can be kept consistent with the annotation information, thereby reducing the semantic mismatch between image data and annotation data.

[0096] Figure 3 This invention provides a schematic diagram of an image desensitization and replacement device. This invention is applicable to situations where sensitive information exists in image data collected at a construction site, and the sensitive areas corresponding to the sensitive information in the image data are desensitized. The device can perform an image desensitization and replacement method, and can be implemented in hardware and / or software.

[0097] See Figure 3 The image desensitization and replacement device shown includes: an image acquisition module 301, a sensitive target detection module 302, a feature extraction module 303, a replacement region generation module 304, and a desensitized image generation module 305, wherein...

[0098] Image acquisition module 301 is used to acquire the image to be processed;

[0099] Sensitive target detection module 302 is used to perform sensitive target detection on the image to be processed, and obtain at least one target region containing sensitive information;

[0100] Feature extraction module 303 is used to extract environmental context features and non-sensitive attribute features of the target region;

[0101] The replacement region generation module 304 is used to perform semantic reconstruction on the target region based on environmental context features and non-sensitive attribute features to generate a replacement region; the replacement region is consistent with the environmental context features and non-sensitive attribute features of the target region.

[0102] The desensitized image generation module 305 is used to replace the target area with the replacement area to obtain a desensitized image.

[0103] The technical solution of this invention, by acquiring the image to be processed, can provide a unified data input basis for subsequent sensitive information identification and replacement processing. By performing sensitive target detection on the image to be processed, at least one target region containing sensitive information is obtained, which can realize the automatic location of sensitive information in the image, thereby reducing the workload of manual screening and improving the accuracy of sensitive information identification. By extracting the environmental context features and non-sensitive attribute features of the target region, the external environmental information of the target region can be obtained while distinguishing between sensitive semantic content and non-sensitive structural attributes, thereby providing necessary constraints for the subsequent generation process. Semantic reconstruction of the target region generates a replacement region consistent with the environmental context features and non-sensitive attribute features of the target region. This can maintain visual distribution consistency and structural continuity while removing sensitive information. By replacing the target region with the replacement region, a desensitized image is obtained. Sensitive information can be removed while preserving the overall visual effect of the original image, thereby improving the usability and security of the desensitized image. This solves the technical problem that existing technologies can significantly damage and change the details and structural information of image data, resulting in a large difference between the desensitized image data and the original image. Thus, the desensitization operation can be performed on the image to be processed without changing the details and structural information of the image to be processed, thus preserving the data value.

[0104] In some embodiments, in terms of semantically reconstructing the target region based on environmental context features and non-sensitive attribute features to generate a replacement region, the replacement region generation module 304 is specifically used for:

[0105] Generate semantic constraints based on environmental context features and non-sensitive attribute features;

[0106] Based on semantic constraints, the target region is semantically reconstructed to generate a replacement region.

[0107] In some embodiments, the feature extraction module 303 is specifically used for: extracting environmental context features and non-sensitive attribute features of the target region.

[0108] Spatially expand the target area to obtain the expanded area of ​​the target area;

[0109] Extract the environmental context features of the extended region and the target region;

[0110] The environmental context features of the extended region and the environmental context features of the target region are determined as the environmental context features of the target region;

[0111] Based on the target area, determine the sensitivity type of the target area;

[0112] Based on the sensitive type, extract the non-sensitive attribute features of the target region.

[0113] In some embodiments, in performing sensitive target detection on the image to be processed to obtain at least one target region containing sensitive information, the feature extraction module 303 is specifically used for:

[0114] Perform object detection on the image to be processed to obtain at least one initial target region;

[0115] For each initial target region, perform sensitive type detection on the initial target region, and determine the sensitive type detection result of the initial target region. The sensitive type detection result includes: sensitive type and non-sensitive type;

[0116] Delete each initial target region that is not sensitive in the sensitive type detection result to obtain at least one target region containing sensitive information.

[0117] In some embodiments, the image desensitization and replacement apparatus further includes:

[0118] The similarity detection module is used to perform similarity detection on the image to be processed and the desensitized image, and obtain similarity detection results.

[0119] The similarity operation module is used to determine that the desensitization of the image to be processed has been successful when the similarity detection result is similar.

[0120] The dissimilarity operation module is used to determine that the desensitization replacement of the image to be processed has failed when the similarity detection result is dissimilarity.

[0121] In some embodiments, in performing similarity detection on the image to be processed and the desensitized image based on the image to be processed and the desensitized image to obtain similarity detection results, the similarity detection module is specifically used for:

[0122] Obtain the first feature vector of the image to be processed, and the second feature vector of the desensitized image;

[0123] The similarity between the first feature vector and the second feature vector is calculated based on the first feature vector and the second feature vector.

[0124] The similarity is compared with a preset deviation threshold;

[0125] When the similarity is less than the deviation threshold, the similarity detection result is determined to be dissimilar.

[0126] When the similarity is greater than or equal to the deviation threshold, the similarity detection result is determined to be similar.

[0127] In some embodiments, the image desensitization and replacement apparatus further includes:

[0128] The location acquisition module is used to acquire the location information of the replacement region in the desensitized image;

[0129] The data correction module is used to synchronously correct the structured annotation data associated with the image to be processed based on the location information.

[0130] The image desensitization and replacement device provided in the embodiments of the present invention can execute the image desensitization and replacement method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the image desensitization and replacement method.

[0131] Figure 4 This is a schematic diagram of the structure of an image desensitization and replacement device provided in an embodiment of the present invention.

[0132] like Figure 4 As shown, the image desensitization and replacement device 400 includes at least one processor 401 and a memory, such as a read-only memory (ROM) 402 or a random access memory (RAM) 403, communicatively connected to the at least one processor 401. The memory stores computer programs executable by the at least one processor. The processor 401 can perform various appropriate actions and processes based on the computer program stored in the ROM 402 or loaded into the RAM 403 from the storage unit 408. The RAM 403 can also store various programs and data required for the operation of the image desensitization and replacement device 400. The processor 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 408 is also connected to the bus 404.

[0133] Multiple components in the image desensitization and replacement device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, optical disk, etc.; and a communication unit 409, such as a network card, modem, wireless transceiver, etc. The communication unit 409 allows the image desensitization and replacement device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0134] Processor 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 401 performs the various methods and processes described above, such as image desensitization and replacement methods.

[0135] In some embodiments, the image desensitization and replacement method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the image desensitization and replacement device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by processor 401, one or more steps of the image desensitization and replacement method described above may be performed. Alternatively, in other embodiments, processor 401 may be configured to perform the image desensitization and replacement method by any other suitable means (e.g., by means of firmware).

[0136] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0137] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0138] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0139] To provide user interaction, the systems and techniques described herein can be implemented on an operational detection device. This image desensitization and replacement device includes: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the image desensitization and replacement device. Other types of devices can also be used to provide user interaction; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0140] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0141] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.

[0142] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0143] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An image desensitization and replacement method, characterized in that, The method includes: Obtain the image to be processed; Sensitive target detection is performed on the image to be processed to obtain at least one target region containing sensitive information; Extract the environmental context features and non-sensitive attribute features of the target region; Based on the environmental context features and the non-sensitive attribute features, the target region is semantically reconstructed to generate a replacement region; the replacement region is consistent with the environmental context features and non-sensitive attribute features of the target region. The target region is replaced by the replacement region to obtain a desensitized image.

2. The method according to claim 1, characterized in that, The step of semantically reconstructing the target region based on the environmental context features and the non-sensitive attribute features to generate a replacement region includes: Based on the environmental context features and the non-sensitive attribute features, semantic constraints are generated; Based on the semantic constraints, the target region is semantically reconstructed to generate a replacement region.

3. The method according to claim 1, characterized in that, The extraction of the environmental context features and non-sensitive attribute features of the target region includes: The target region is spatially expanded to obtain the expanded region of the target region; Extract the environmental context features of the extended region and the environmental context features of the target region; The environmental context features of the extended region and the environmental context features of the target region are determined as the environmental context features of the target region; Based on the target region, determine the sensitivity type of the target region; Based on the aforementioned sensitivity type, non-sensitive attribute features of the target region are extracted.

4. The method according to claim 3, characterized in that, The step of performing sensitive target detection on the image to be processed to obtain at least one target region containing sensitive information includes: Target detection is performed on the image to be processed to obtain at least one initial target region; For each of the initial target regions, a sensitive type detection is performed on the initial target region to determine the sensitive type detection result of the initial target region. The sensitive type detection result includes: sensitive type and non-sensitive type. The initial target regions that are detected as non-sensitive by the sensitive type are deleted to obtain at least one target region containing sensitive information.

5. The method according to claim 1, characterized in that, After replacing the target region with the replacement region to obtain the desensitized image, the method further includes: Based on the image to be processed and the desensitized image, a similarity detection is performed on the image to be processed and the desensitized image to obtain a similarity detection result; When the similarity detection result is similar, it is determined that the desensitized image has successfully replaced the image to be processed. When the similarity detection result is dissimilar, it is determined that the desensitization replacement of the image to be processed by the desensitized image has failed.

6. The method according to claim 5, characterized in that, The step of performing similarity detection on the image to be processed and the desensitized image to obtain similarity detection results includes: Obtain the first feature vector of the image to be processed and the second feature vector of the desensitized image; The similarity between the first feature vector and the second feature vector is calculated based on the first feature vector and the second feature vector. The similarity is compared with a preset deviation threshold; When the similarity is less than the deviation threshold, the similarity detection result is determined to be dissimilar. When the similarity is greater than or equal to the deviation threshold, the similarity detection result is determined to be similar.

7. The method according to claim 1, characterized in that, After replacing the target region with the replacement region to obtain the desensitized image, the method further includes: Obtain the location information of the replacement region in the desensitized image; Based on the location information, the structured annotation data associated with the image to be processed is simultaneously corrected.

8. An image desensitization and replacement device, characterized in that, include: The image acquisition module is used to acquire the image to be processed. A sensitive target detection module is used to detect sensitive targets in the image to be processed, and obtain at least one target region containing sensitive information; The feature extraction module is used to extract the environmental context features of the target region and the non-sensitive attribute features of the target region; The replacement region generation module is used to perform semantic reconstruction on the target region based on the environmental context features and the non-sensitive attribute features to generate a replacement region; The replacement region is consistent with the environmental context features and non-sensitive attribute features of the target region; The desensitized image generation module is used to replace the target region with the replacement region to obtain a desensitized image.

9. An image desensitization and replacement device, characterized in that, The image desensitization and replacement device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the image desensitization and replacement method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the image desensitization and replacement method according to any one of claims 1-7.