Method and system for desensitizing picture with personal sensitive information
Through the combination of SIFT algorithm and image generation model, automatic identification and desensitization of sensitive information in pictures is achieved, the limitations of the existing technology in terms of automation and practicality are solved, the scope of application and efficiency of image processing is improved, and the application of image processing is reduced. The risk of personal information leakage.
Patent Information
- Application Number
- CN202411493925.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The prior art has limitations in the degree of manual constituency and automation, and its usefulness is limited for scenes that do not connect to the public network or lack a large amount of scene sensitive information position labeling data, making it difficult to effectively identify and replace personal sensitive information in pictures.
The SIFT algorithm is used to split the images to be processed into image blocks of the same size, extract multi-dimensional vectors, and create a comparison picture group containing name, mobile phone number, and ID number information. By calculating the differences between multi-dimensional vectors, identifying the location of sensitive information, and combining image generation The model is masked and completed to achieve automated desensitization.
Without relying on public networks or large amounts of labeled data, the degree of automation and scope of application of image processing is improved, the risk of user personal information leakage is reduced, and the efficiency and accuracy of image desensitization is improved.
Smart Images

Figure CN119272334A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and system for desensitizing pictures containing personal sensitive information. Background Art
[0002] As one of the core means to prevent the leakage of sensitive information, desensitization technology is crucial to preventing serious consequences such as identity theft, fraud, harassment, and effectively safeguarding personal privacy rights. In actual business scenarios, especially when it comes to image information, such as personal sensitive information on documents such as ID cards, driver's licenses, passports, and identity recognition features such as faces and license plates, all need to be protected through image desensitization. This usually includes blurring, blocking or replacing sensitive areas to effectively prevent unauthorized personnel from identifying and using this information. In the current market, the identification and replacement of sensitive information in images mainly adopts manual delineation combined with image completion technologies such as generative adversarial networks (GANs) and deep diffusion probability models (DDPMs). These technologies automatically identify and replace manually delineated sensitive areas through trained sensitive information location recognition models such as CNN-based target detection models. However, this method has limitations in the degree of automation of manual delineation, and its practicality is limited for scenarios that are not connected to the public network or lack a large amount of scene sensitive information location annotation data. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention provides a method for desensitizing a picture with personal sensitive information, wherein the personal sensitive information includes name information, mobile phone number information and ID card number information, comprising the following steps: S1, split the image to be processed into multiple image blocks of the same size, where there are overlapping areas between adjacent image blocks, extract each image block into a multi-dimensional vector using the SIFT algorithm, and form a vector set of the image to be processed that contains the multi-dimensional vectors corresponding to each image block; S2, prepare three comparison picture groups, wherein each different sample picture contained in the first picture group only contains name information, each different sample picture contained in the second picture group only contains mobile phone number information, and each different sample picture contained in the third picture group only contains ID card number information, use SIFT algorithm to extract each sample picture in the first picture group, the second picture group and the third picture group as a corresponding multidimensional vector, and merge all the multidimensional vectors of the three comparison picture groups into a comparison picture vector data set; S3, calculating the difference between each multidimensional vector in the to-be-processed picture vector set and the comparison picture vector data set, if there is at least one image block corresponding to a multidimensional vector close to each multidimensional vector of a comparison picture group, then the image block is used as a desensitized position area containing a sensitive information type corresponding to the close comparison picture group; S4, after masking the obtained desensitized position area and using the image generation model to complete the masked area, the final desensitized image is obtained.
[0004] Preferably, the step S2 comprises: S21, using the SIFT algorithm to extract each sample image into a corresponding 128-dimensional multidimensional vector, performing product quantization processing on each 128-dimensional multidimensional vector y in the image vector data set, and dividing the multidimensional vector y into 16 sub-vectors, each of which has a length of 8, as follows: ; in is one of the 128-dimensional vectors y. is a subvector of vector y.
[0005] S22, perform 16 k-means clustering on the 16 sub-vectors, and store 50 centroids in each cluster.
[0006] Preferably, step S3 comprises: S31, using the following approximate formula to calculate the approximate distance between the 128-dimensional multidimensional vector x of each image block in the image vector set to be processed and the multidimensional vector y in the image vector data set:
[0007] Among them, x is a vector in the image vector set to be processed, and y is a vector in the image vector data set. is a subvector of vector y, for Mapped to the centroid of its corresponding k-means algorithm, is a subvector of vector x.
[0008] S32, calculate the approximate distance between all multidimensional vectors x in the image vector set to be processed and all multidimensional vectors y in the image vector data set, obtain a set number of candidate vector groups arranged in front of the approximate distance, the candidate vector group includes a multidimensional vector x and a multidimensional vector y, and determine whether the multidimensional vector x in the candidate vector group belongs to a certain type of sensitive information.
[0009] Preferably, step S32 includes: classifying sets according to different comparison picture groups from which the multidimensional vector y in the candidate vector group comes, and respectively calculating the approximate distance average values in each classified candidate vector group set; if the approximate distance average value exceeds a set threshold, it is considered that the image to be processed contains the sensitive information type corresponding to the candidate vector group set that exceeds the set threshold.
[0010] Preferably, step S32 also includes: if the approximate distance average value exceeds a set threshold, obtaining a multidimensional vector x in each candidate vector group corresponding to the set of candidate vector groups exceeding the set threshold, and using the image block area corresponding to the multidimensional vector x as a position area containing the sensitive information type corresponding to the classified candidate vector group.
[0011] Preferably, the step S4 includes: first marking the acquired desensitized position area position as masked, and then using the DDPM model to complete the image: the specific DDPM completion formula is as follows: ; in is the image area sampled from the unmasked part of the image to be processed, are the default parameters of the DDPM model, is the original image area after being masked, is the image area sampled by the DDPM model, is the image sample after the last round of sampling, It is the image sample after this round of sampling; and The input of the trained neural network is , the parameters are ; is the identity matrix, For the special product here to represent the mask, first from Start, and then loop the above formula until the set number of times is reached. , splicing is sampled from the model , complete the picture.
[0012] The present invention also discloses a system for desensitizing a picture with personal sensitive information, wherein the personal sensitive information includes name information, mobile phone number information and ID card number information, and comprises an image splitting module, a sample generating module, a difference comparing module and a desensitizing completing module, wherein the image splitting module is used to split the picture to be processed into a plurality of image blocks of the same size, wherein there is an overlapping area between adjacent image blocks, and each image block is extracted into a multidimensional vector by using a SIFT algorithm to form a vector set of the picture to be processed containing the multidimensional vectors corresponding to each image block; the sample generating module is used to prepare three comparison picture groups, wherein each different sample picture contained in the first picture group only contains name information, each different sample picture contained in the second picture group only contains mobile phone number information, and each different sample picture contained in the third picture group only contains mobile phone number information. Each different sample image contained in the film group only contains the identity card number information. The SIFT algorithm is used to extract each sample image in the first image group, the second image group and the third image group as a corresponding multidimensional vector, and all the multidimensional vectors of the three comparison image groups are merged into a comparison image vector data set; a difference comparison module is used to calculate the difference between each multidimensional vector in the image vector set to be processed and the comparison image vector data set. If there is at least one image block corresponding to a multidimensional vector close to each multidimensional vector of a comparison image group, the image block is used as a desensitized position area containing the sensitive information type corresponding to the close comparison image group; a desensitization completion module is used to mask the obtained desensitized position area and use the image generation model to complete the masked area to obtain the final desensitized image.
[0013] Preferably, the sample generation module includes a vector module and a clustering module, wherein the vector module is used to extract each sample image into a corresponding 128-dimensional multidimensional vector using the SIFT algorithm, perform product quantization processing on each 128-dimensional multidimensional vector y in the image vector data set, and divide the multidimensional vector y into 16 sub-vectors, each of which has a length of 8, as follows: ,in is one of the 128-dimensional vectors y. is a sub-vector of vector y; the clustering module is used to perform 16 k-means clustering on the 16 sub-vectors, and each cluster stores 50 centroids.
[0014] The present invention also discloses a device for desensitizing pictures with personal sensitive information, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the aforementioned methods when executing the computer program.
[0015] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the aforementioned methods are implemented.
[0016] The method and system for desensitizing pictures with personal sensitive information disclosed in the present invention utilize the traditional graphic feature extraction SIFT algorithm combined with an image generation model to realize automatic calibration and desensitization of sensitive information in pictures. The picture to be processed containing sensitive information is split into image blocks of the same size and with overlapping areas, and each image block is extracted into a multidimensional vector using the SIFT algorithm to form a vector set of pictures to be processed. Three comparison picture groups containing only name information, mobile phone number information, and ID card number information are respectively prepared, and the pictures therein are extracted into corresponding multidimensional vectors using the SIFT algorithm and merged into a comparison picture vector data set. Then, the differences between the multidimensional vectors in the image vector set to be processed and the comparison image vector data set are calculated. If there is a multidimensional vector corresponding to at least one image block that is close to the multidimensional vectors of a comparison image group, the image block is used as a desensitized position area containing the sensitive information type corresponding to the close comparison image group; finally, the desensitized position area is masked and the masked area is completed using an image generation model to obtain the final desensitized image, so that enterprises or organizations can obtain images that avoid sensitive information in scenarios that are not connected to the public network or lack a large amount of scene sensitive information location annotation data, thereby improving the scope of application and processing speed of image processing and reducing the risk of user personal information leakage.
[0017] 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
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 A schematic diagram of the steps of a method for desensitizing a picture containing personal sensitive information disclosed in an embodiment of the present invention.
[0019] Figure 2 This is a picture to be processed containing sensitive information disclosed in an embodiment of the present invention.
[0020] Figure 3 The image does not contain sensitive information after being processed according to an embodiment of the present invention.
[0021] Figure 4 A schematic diagram of splitting a to-be-processed image into different image blocks disclosed in an embodiment of the present invention.
[0022] Figure 5 This is a schematic diagram of specific steps of step S2 disclosed in one embodiment of the present invention.
[0023] Figure 6 This is a schematic diagram of specific steps of step S3 disclosed in one embodiment of the present invention.
[0024] Figure 7 This is a schematic diagram of specific steps of step S32 disclosed in one embodiment of the present invention.
[0025] Figure 8 A schematic diagram of the structure of a system for desensitizing images containing personal sensitive information disclosed in another embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment 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.
[0027] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0028] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.
[0029] Unless otherwise defined, the technical or scientific terms used herein shall have the common meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the patent application specification and claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "a" do not indicate a quantity limitation, but indicate the existence of at least one.
[0030] As one of the core means to prevent the leakage of sensitive information, desensitization technology is crucial to preventing serious consequences such as identity theft, fraud, harassment, and effectively safeguarding personal privacy rights. In actual business scenarios, especially when it comes to image information, such as personal sensitive information on documents such as ID cards, driver's licenses, passports, and identity recognition features such as faces and license plates, all need to be protected through image desensitization. This usually includes blurring, blocking or replacing sensitive areas to effectively prevent unauthorized personnel from identifying and using this information. In the current market, the identification and replacement of sensitive information in images mainly adopts manual delineation combined with image completion technologies such as generative adversarial networks (GANs) and deep diffusion probability models (DDPMs). These technologies automatically identify and replace manually delineated sensitive areas through trained sensitive information location recognition models such as CNN-based target detection models. However, this method has limitations in the degree of automation of manual delineation, and its practicality is limited for scenarios that are not connected to the public network or lack a large amount of scene sensitive information location annotation data.
[0031] Therefore, in this embodiment, a method for desensitizing a picture with personal sensitive information is disclosed, wherein the personal sensitive information includes name information, mobile phone number information and ID card number information, as shown in the attached Figure 1 As shown, the following steps are included.
[0032] Step S1, split the image to be processed into multiple image blocks of the same size, where there are overlapping areas between adjacent image blocks, and extract each image block into a multidimensional vector using the SIFT algorithm to form a vector set of the image to be processed that contains the multidimensional vectors corresponding to each image block.
[0033] Specifically, attached Figure 2 For example, a picture P to be processed contains sensitive information (name, ID number, mobile phone number). Our goal is to erase the sensitive information in the picture P to be processed without leaving any traces of erasure. This is actually an image completion task in the field of computer vision CV, which aims to complete the image after processing. Figure 3The picture shown is restored to a state that is as natural as possible and does not contain sensitive information. Therefore, this embodiment adopts the traditional SIFT method to solve the current sensitive information replacement method's reliance on open source models or online services. The scale-invariant feature transform (SIFT) method is a computer vision algorithm used to detect and describe local features in an image. These features are invariant to image scaling, rotation, and even affine transformations, and can find and extract key points, i.e., feature points, of an image in different scale spaces. Specifically, as shown in the attached Figure 4 As shown, firstly, the image P to be processed is split into image blocks of the same size and overlapped with each other using boxes of the same size, and then the SIFT algorithm is used to extract features from each image block and generate a corresponding 128-dimensional vector. Figure 2 As shown, the image to be processed containing sensitive information is divided into 100 blocks, where this number is a hyperparameter. The specific value may vary in different scenarios. In practice, the number of blocks will be determined based on the effect, and finally a vector set of 100 128-dimensional vectors of the image to be processed is generated.
[0034] Step S2, prepare three comparison picture groups, wherein each different sample picture contained in the first picture group only contains name information, each different sample picture contained in the second picture group only contains mobile phone number information, and each different sample picture contained in the third picture group only contains ID card number information, and use the SIFT algorithm to extract each sample picture in the first picture group, the second picture group and the third picture group as a corresponding multidimensional vector, and merge all the multidimensional vectors of the three comparison picture groups into a comparison picture vector data set.
[0035] Specifically, three different types of picture data are designed: a preset number of pictures containing only names, a preset number of pictures containing only mobile phone numbers, and a preset number of pictures containing only ID card numbers. Since the difficulty and speed of generating these data are much lower than the circle frame of the position in the target detection, multiple picture data can be quickly produced. In this embodiment, 1000 pictures are designed. Subsequently, each picture is refined into a 128-dimensional vector using the SIFT algorithm. These 3000 128-dimensional vectors constitute the picture vector data set D.
[0036] Step S3, calculate the difference between each multidimensional vector in the image vector set to be processed and the comparison image vector data set. If there is a multidimensional vector corresponding to at least one image block that is close to each multidimensional vector of a comparison image group, then the image block is used as a desensitized position area containing the sensitive information type corresponding to the close comparison image group.
[0037] Specifically, after generating the to-be-processed picture vector set and the custom picture vector data set D corresponding to the to-be-processed picture, the image blocks in the to-be-processed picture are classified by calculating the difference between each vector in the to-be-processed picture vector set and each vector in the picture vector data set D, and the sensitive information therein is identified. For example, if the vectors corresponding to several blocks in the to-be-processed picture are closest to the 1,000 vectors containing names in the picture vector data set, it is considered that the positions in these blocks are the positions corresponding to the sensitive information of the name, and the civil servant needs to be desensitized. Similarly, the position of sensitive information such as the ID card number or mobile phone number in the to-be-processed picture can also be found in this way.
[0038] Among them, since the image to be processed needs to be compared with the vectors in the image vector data set 100*3000 times, and it involves 128-dimensional calculations, in order to improve the comparison speed, this embodiment adopts the famous PQ product quantization technology, which is an efficient vector quantization method, mainly used to process high-order data compression and acceleration, divide the data vector into multiple sub-vectors, and quantize these sub-vectors respectively, so as to achieve the purpose of reducing memory usage and improving search speed. In this embodiment, the step S2 is as shown in the attached figure. Figure 5 As shown, the specific contents also include the following.
[0039] Step S21, using the SIFT algorithm to extract each sample image into a corresponding 128-dimensional multidimensional vector, performing product quantization processing on each 128-dimensional multidimensional vector y in the image vector data set, and dividing the multidimensional vector y into 16 sub-vectors, each of which has a length of 8, as follows: ; in is one of the 128-dimensional vectors y. is a subvector of vector y.
[0040] Step S22, performing 16 k-means clustering on the 16 sub-vectors, and storing 50 centroids in each cluster.
[0041] Specifically, each 128-dimensional vector y in the image vector dataset D is subjected to product quantization processing, each vector y is divided into 16 sub-vectors of length 8, and the 16 sub-vectors are subjected to 16 k-means clustering, wherein the segmentation of vector y and the number of centroids stored in each cluster are determined according to the effect in the actual processing process. Since the number of centroids is less than the length of the original vector, the data storage requirements will be greatly reduced.
[0042] After clustering, the step S3 is as follows: Figure 6 As shown, it also includes the following contents.
[0043] Step S31, using the following approximate formula to calculate the approximate distance between the 128-dimensional multidimensional vector x of each image block in the image vector set to be processed and the multidimensional vector y in the image vector data set: ; Among them, x is a vector in the image vector set to be processed, and y is a vector in the image vector data set. is a subvector of vector y, for Mapped to the centroid of its corresponding k-means algorithm, is a subvector of vector x.
[0044] Step S32, calculate the approximate distance between all multidimensional vectors x in the image vector set to be processed and all multidimensional vectors y in the image vector data set, obtain a set number of candidate vector groups arranged in front of the approximate distance, the candidate vector group includes a multidimensional vector x and a multidimensional vector y, and determine whether the multidimensional vector x in the candidate vector group belongs to a certain type of sensitive information.
[0045] Specifically, the approximate distance between each multidimensional vector x of the image vector set to be processed and all the multidimensional vectors y in the image vector data set is calculated using an approximate formula, and the multidimensional vectors y with the top approximate distances to each multidimensional vector x are obtained to form a candidate vector group to decide whether the image block corresponding to the multidimensional vector x contains a certain type of sensitive information. In this embodiment, the 100 candidate vector groups with the largest approximate distances are selected as the most approximate vectors for decision making, as shown in the attached figure. Figure 7 The specific contents shown include the following.
[0046] Step S321, classify the candidate vector groups according to the different comparison picture groups from which the multidimensional vector y in the candidate vector group comes, and calculate the average value of the approximate distance in each classification candidate vector group set: ; Among them, x is a vector in the image vector set to be processed, and y is a vector in the image vector data set. , , They respectively represent the set of multidimensional vectors y of name, ID number, and mobile phone number that contain the corresponding sensitive information in the candidate vector group corresponding to x. , , Respectively represent sets , , The number of elements in , , , Respectively , , The average value of the approximate distances in the candidate vector group composed of each multidimensional vector y and x.
[0047] For example, when among the 100 candidate vector groups corresponding to a multidimensional vector x, the multidimensional vectors y in 60 candidate vector groups correspond to sensitive name information, the multidimensional vectors y in 30 candidate vector groups correspond to sensitive ID card number information, and the multidimensional vectors y in 10 candidate vector groups correspond to sensitive mobile phone number information, , , They respectively represent a set of 60 multidimensional vectors y corresponding to sensitive name information, a set of 30 multidimensional vectors y corresponding to sensitive ID card number information, and a set of 10 multidimensional vectors y corresponding to sensitive mobile phone number information.
[0048] Step S322, determine whether the average value of the approximate distance exceeds the set threshold. If the average value of the approximate distance exceeds the set threshold, it is considered that the image to be processed contains the sensitive information type corresponding to the set of candidate vector groups that exceeds the set threshold, obtain the multidimensional vector x in each candidate vector group corresponding to the set of candidate vector groups that exceeds the set threshold, and use the image block area corresponding to the multidimensional vector x as the position area containing the sensitive information type corresponding to the classified candidate vector group.
[0049] Specifically, for example, when the threshold is set to 0.4, if >0.4, then it is considered that The image block corresponding to the corresponding multidimensional vector x is the location area containing sensitive name information, which needs to be desensitized.
[0050] Step S4, masking the obtained desensitization position area and using the image generation model to complete the masked area to obtain the final desensitization image.
[0051] Specifically, after finding the specific desensitization location area, the found desensitization location area is masked, and the DDPM model is used to complete the image to obtain the final desensitized image, which includes: First, mark the obtained desensitized position area as masked, and then use the DDPM model to complete the image: The specific DDPM completion formula is as follows: ; in is the image area sampled from the unmasked part of the image to be processed, are the default parameters of the DDPM model, is the original image area after being masked, is the image area sampled by the DDPM model, is the image sample after the last round of sampling, It is the image sample after this round of sampling; and The input of the trained neural network is , the parameters are ; is the identity matrix, For the special product here to represent the mask, first from Start, and then loop the above formula until the set number of times is reached. , splicing is sampled from the model , complete the picture.
[0052] The method and system for desensitizing images containing personal sensitive information disclosed in this embodiment utilize the traditional graphic feature extraction SIFT algorithm combined with an image generation model to achieve automatic calibration and desensitization of sensitive information in images. The image to be processed containing sensitive information is split into image blocks of the same size and with overlapping areas, and each image block is extracted into a multidimensional vector using the SIFT algorithm to form a vector set of images to be processed. Three comparison image groups containing only name information, mobile phone number information, and ID card number information are respectively prepared, and the images therein are extracted into corresponding multidimensional vectors using the SIFT algorithm and merged into a comparison image vector data set. Then, the differences between the multidimensional vectors in the image vector set to be processed and the comparison image vector data set are calculated. If there is a multidimensional vector corresponding to at least one image block that is close to the multidimensional vectors of a comparison image group, the image block is used as a desensitized position area containing the sensitive information type corresponding to the close comparison image group; finally, the desensitized position area is masked and the masked area is completed using an image generation model to obtain the final desensitized image, so that enterprises or organizations can obtain images that avoid sensitive information in scenarios that are not connected to the public network or lack a large amount of scene sensitive information location annotation data, thereby improving the scope of application and processing speed of image processing and reducing the risk of user personal information leakage.
[0053] In another embodiment, as shown in the attached Figure 8As shown, a system for desensitizing images with personal sensitive information is also disclosed, wherein the personal sensitive information includes name information, mobile phone number information and ID card number information, including an image splitting module 1, a sample generating module 2, a difference comparison module 3 and a desensitization completion module 4. The image splitting module 1 is used to split the image to be processed into a plurality of image blocks of the same size, wherein there is an overlapping area between adjacent image blocks, and each image block is extracted as a multidimensional vector using the SIFT algorithm to form a vector set of the image to be processed containing the multidimensional vectors corresponding to each image block. The sample generating module 2 is used to prepare three comparison image groups, wherein each different sample image contained in the first image group contains only name information, each different sample image contained in the second image group contains only mobile phone number information, and each different sample image contained in the third image group contains only ID card number information, and each sample image in the first image group, the second image group and the third image group is extracted as a corresponding multidimensional vector using the SIFT algorithm, and all multidimensional vectors of the three comparison image groups are merged into a comparison image vector data set. The difference comparison module 3 is used to calculate the difference between each multidimensional vector in the image vector set to be processed and the comparison image vector data set. If there is a multidimensional vector corresponding to at least one image block that is close to each multidimensional vector of a comparison image group, the image block is used as a desensitized position area containing the sensitive information type corresponding to the close comparison image group. The desensitization completion module 4 is used to mask the obtained desensitized position area and use the image generation model to complete the masked area to obtain the final desensitized image.
[0054] In this embodiment, the sample generation module includes a vector module and a clustering module, wherein the vector module is used to extract each sample image into a corresponding 128-dimensional multidimensional vector using the SIFT algorithm, perform product quantization processing on each 128-dimensional multidimensional vector y in the image vector data set, and divide the multidimensional vector y into 16 sub-vectors, each of which has a length of 8, as follows: ,in is one of the 128-dimensional vectors y. is a sub-vector of vector y; the clustering module is used to perform 16 k-means clustering on the 16 sub-vectors, and each cluster stores 50 centroids.
[0055] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. Similar parts between the various embodiments can be referred to each other. For the system for desensitizing pictures with personal sensitive information disclosed in the embodiment, since it corresponds to the method for desensitizing pictures with personal sensitive information disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the aforementioned method part.
[0056] In other embodiments, a device for desensitizing pictures with personal sensitive information is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the various steps of the method for desensitizing pictures with personal sensitive information as described in the above embodiments when executing the computer program. The server may include, but is not limited to, a processor and a memory. It will be understood by those skilled in the art that the schematic diagram is merely an example of a server and does not constitute a limitation on the server, and may include more or fewer components than shown in the figure, or a combination of certain components, or different components.
[0057] If the device for desensitizing pictures with personal sensitive information is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments for desensitizing pictures with personal sensitive information can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0058] In conclusion, the above is only a preferred embodiment of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the patent of the present invention.
Claims
1. A method for desensitizing a picture containing personal sensitive information, wherein the personal sensitive information includes name information, mobile phone number information and ID card number information, characterized in that: The steps include: S1, split the image to be processed into multiple image blocks of the same size, where there are overlapping areas between adjacent image blocks, extract each image block into a multi-dimensional vector using the SIFT algorithm, and form a vector set of the image to be processed that contains the multi-dimensional vectors corresponding to each image block; S2, prepare three comparison picture groups, wherein each different sample picture contained in the first picture group only contains name information, each different sample picture contained in the second picture group only contains mobile phone number information, and each different sample picture contained in the third picture group only contains ID card number information, use SIFT algorithm to extract each sample picture in the first picture group, the second picture group and the third picture group as a corresponding multidimensional vector, and merge all the multidimensional vectors of the three comparison picture groups into a comparison picture vector data set; S3, calculating the difference between each multidimensional vector in the to-be-processed picture vector set and the comparison picture vector data set, if there is at least one image block corresponding to a multidimensional vector close to each multidimensional vector of a comparison picture group, then the image block is used as a desensitized position area containing a sensitive information type corresponding to the close comparison picture group; S4, after masking the obtained desensitized position area and using the image generation model to complete the masked area, the final desensitized image is obtained.
2. According to the method for desensitizing a picture with personal sensitive information according to claim 1, the step S2 comprises: S21, using the SIFT algorithm to extract each sample image into a corresponding 128-dimensional multidimensional vector, performing product quantization processing on each 128-dimensional multidimensional vector y in the image vector data set, and dividing the multidimensional vector y into 16 sub-vectors, each of which has a length of 8, as follows: in is one of the 128-dimensional vectors y. is a subvector of vector y; S22, perform 16 k-means clustering on the 16 sub-vectors, and store 50 centroids in each cluster.
3. According to the method for desensitizing a picture with personal sensitive information according to claim 2, the step S3 comprises: S31, using the following approximate formula to calculate the approximate distance between the 128-dimensional multidimensional vector x of each image block in the image vector set to be processed and the multidimensional vector y in the image vector data set: ; Among them, x is a vector in the image vector set to be processed, and y is a vector in the image vector data set. is a subvector of vector y, for Mapped to the centroid of its corresponding k-means algorithm, is a subvector of vector x; S32, calculate the approximate distance between all multidimensional vectors x in the image vector set to be processed and all multidimensional vectors y in the image vector data set, obtain a set number of candidate vector groups arranged in front of the approximate distance, the candidate vector group includes a multidimensional vector x and a multidimensional vector y, and determine whether the multidimensional vector x in the candidate vector group belongs to a certain type of sensitive information.
4. According to the method for desensitizing a picture with personal sensitive information according to claim 3, the step S32 comprises: According to the different comparison picture groups from which the multidimensional vector y in the candidate vector group comes, a classification set is performed, and the approximate distance average value in each classification candidate vector group set is calculated respectively. If the approximate distance average value exceeds a set threshold, it is considered that the image to be processed contains the sensitive information type corresponding to the candidate vector group set that exceeds the set threshold.
5. According to the method for desensitizing a picture with personal sensitive information according to claim 4, the step S32 further comprises: If the average value of the approximate distance exceeds the set threshold, the multidimensional vector x in each candidate vector group corresponding to the set of candidate vector groups exceeding the set threshold is obtained, and the image block area corresponding to the multidimensional vector x is used as the position area containing the sensitive information type corresponding to the classified candidate vector group.
6. According to the method for desensitizing a picture with personal sensitive information according to claim 5, the step S4 comprises: First, mark the obtained desensitized position area as masked, and then use the DDPM model to complete the image: The specific DDPM completion formula is as follows: ; in is the image area sampled from the unmasked part of the image to be processed, are the default parameters of the DDPM model, is the original image area after being masked, is the image area sampled by the DDPM model, is the image sample after the last round of sampling, It is the image sample after this round of sampling; and The input of the trained neural network is , the parameters are ; is the identity matrix, For the special product here to represent the mask, first from Start, and then loop the above formula until the set number of times is reached. , splicing is sampled from the model , complete the picture.
7. A system for desensitizing images containing personal sensitive information, wherein the personal sensitive information includes name information, mobile phone number information, and ID card number information, characterized in that: include: An image splitting module is used to split the image to be processed into multiple image blocks of the same size, where there are overlapping areas between adjacent image blocks, and extract each image block into a multi-dimensional vector using the SIFT algorithm to form a vector set of the image to be processed that contains the multi-dimensional vectors corresponding to each image block; A sample generation module is used to prepare three comparison picture groups, wherein each different sample picture contained in the first picture group only contains name information, each different sample picture contained in the second picture group only contains mobile phone number information, and each different sample picture contained in the third picture group only contains ID card number information, and each sample picture in the first picture group, the second picture group and the third picture group is extracted into a corresponding multi-dimensional vector using the SIFT algorithm, and all the multi-dimensional vectors of the three comparison picture groups are merged into a comparison picture vector data set; A difference comparison module is used to calculate the difference between each multidimensional vector in the to-be-processed picture vector set and the comparison picture vector data set. If there is a multidimensional vector corresponding to at least one image block that is close to each multidimensional vector of a comparison picture group, the image block is used as a desensitized position area containing a sensitive information type corresponding to the close comparison picture group; The desensitization completion module is used to mask the obtained desensitized position area and use the image generation model to complete the masked area to obtain the final desensitized image.
8. According to the system for desensitizing images with personal sensitive information as claimed in claim 7, the sample generation module comprises: The vector module is used to extract each sample image into a corresponding 128-dimensional multidimensional vector using the SIFT algorithm, perform product quantization processing on each 128-dimensional multidimensional vector y in the image vector data set, and divide the multidimensional vector y into 16 sub-vectors, each of which has a length of 8, as follows: in is one of the 128-dimensional vectors y. is a subvector of vector y; The clustering module is used to perform 16 k-means clustering on the 16 sub-vectors, and each cluster stores 50 centroids.
9. A device for desensitizing a picture containing personal sensitive information, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Sensitive image search method and device
CN103294813A
Information processing method, device, and computer storage medium
CN109284684A
Sensitive data-based desensitization method and system
CN110188571A
Picture retrieval method and device, computer equipment and storage medium
CN112100412A
Desensitization and restoration method and system for webpage screenshots
CN113806806A