Image processing method and device, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202211656735.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-12-22
AI Technical Summary
[0004]本申请实施例的目的是提供一种图像处理方法、装置、电子设备及可读存储介质,以解决现有技术中图像数据的脱敏,存在处理效率低的问题
[0017]本申请实施例中,在对图像进行脱敏处理前,先获取图像对应的应用场景下的历史敏感数据,然后基于该历史敏感数据,判断图像中是否包括敏感信息,最后再对由此确定的敏感信息进行脱敏处理,这样,可以省去人为识别脱敏内容的操作,提高脱敏处理的效率,同时还可以提高数据脱敏的准确性。
Smart Images

Figure CN116108464B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, specifically relating to an image processing method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] With the advent of the big data era, the enormous economic value hidden in big data has been discovered and brought to light, but it has also brought thorny problems in the protection of privacy data and sensitive information. Once this sensitive information is leaked or damaged, it may cause serious harm to users. Therefore, de-identification technology has emerged.
[0003] In existing technologies, the implementation process of image data desensitization is relatively complex and difficult to meet user needs. Specifically, the definition of sensitive information varies in different business scenarios, requiring manual identification of the content to be desensitized in each frame of the image, resulting in low processing efficiency and high cost. Summary of the Invention
[0004] The purpose of this application is to provide an image processing method, apparatus, electronic device, and readable storage medium to solve the problem of low processing efficiency in the desensitization of image data in the prior art.
[0005] In a first aspect, embodiments of this application provide an image processing method, including:
[0006] Get the first image;
[0007] Obtain target sensitive data features corresponding to the target application scenario; wherein, the target application scenario is the application scenario corresponding to the first image;
[0008] Identify the sensitive image region in the first image that matches the target sensitive data features;
[0009] The image in the sensitive image region is desensitized to obtain a second image.
[0010] Secondly, embodiments of this application provide an image processing apparatus, comprising:
[0011] The first acquisition module is used to acquire the first image;
[0012] The second acquisition module is used to acquire target sensitive data features corresponding to the target application scenario; wherein, the target application scenario is the application scenario corresponding to the first image;
[0013] The determining module is used to determine the sensitive image region in the first image that matches the target sensitive data features;
[0014] The desensitization module is used to desensitize the image in the sensitive image area to obtain a second image.
[0015] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps in the image processing method as described in the first aspect.
[0016] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the image processing method as described in the first aspect.
[0017] In this embodiment of the application, before the image is desensitized, historical sensitive data of the application scenario corresponding to the image is obtained. Then, based on the historical sensitive data, it is determined whether the image contains sensitive information. Finally, the sensitive information determined in this way is desensitized. In this way, the operation of manually identifying the desensitized content can be eliminated, the efficiency of the desensitization process can be improved, and the accuracy of data desensitization can also be improved. Attached Figure Description
[0018] Figure 1 A schematic flowchart of the image processing method provided in the embodiments of this application;
[0019] Figure 2 This is a schematic diagram of the desensitization process of the desensitization model provided in the embodiments of this application;
[0020] Figure 3 A schematic diagram illustrating sensitive region matching provided in an embodiment of this application;
[0021] Figure 4 This is a schematic block diagram of an image processing apparatus provided in an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0023] It should be understood that the phrase "one embodiment" or "an embodiment" in the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0024] In the various embodiments of this application, it should be understood that the sequence number of the steps does not imply an absolute order of execution. The execution order of each step should be determined by its function and internal logic. Therefore, the sequence number of each step should not constitute an absolute limitation on the implementation process of the embodiments of this application.
[0025] The image processing method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0026] This application provides an image processing method applied to an electronic device.
[0027] like Figure 1 As shown, the image processing method may include:
[0028] Step 101: Obtain the first image.
[0029] The first image mentioned here is the image to be desensitized.
[0030] Step 102: Obtain the target sensitive data features corresponding to the target application scenario.
[0031] The target application scenario is the application scenario corresponding to the first image.
[0032] Since different application scenarios have different definitions of sensitive information, in this embodiment of the application, before performing desensitization processing on the image to be desensitized, the application scenario of the image to be desensitized can be determined first, and then based on the determined application scenario, sensitive data in that application scenario can be obtained, and then the sensitive information of the image can be detected based on this.
[0033] Optionally, in this embodiment, a scenario database can be pre-built to store sensitive data under different application scenarios. Different tag indexes can also be set for different application scenarios so that sensitive data under the same scenario can be found through the corresponding tag index. The sensitive data in the scenario database can be obtained by statistically analyzing historically occurring sensitive data.
[0034] Step 103: Determine the sensitive image region in the first image that matches the target sensitive data features.
[0035] Among them, the sensitive image region is the image region whose image content matches the target sensitive data features.
[0036] After obtaining the target sensitive data features in the target application scenario, the first image is matched with the target sensitive data features to determine whether the image to be desensitized contains sensitive data in the application scenario.
[0037] Step 104: Desensitize the image in the sensitive image area to obtain the second image.
[0038] Once it is determined that the first image contains sensitive data related to the target application scenario, the image in the sensitive image area can be desensitized to obtain the desensitized second image.
[0039] In this embodiment, before desensitizing the image, historical sensitive data of the application scenario corresponding to the image is first obtained. Then, based on this historical sensitive data, it is determined whether the image contains sensitive information. Finally, the sensitive information determined in this way is desensitized. This eliminates the need for manual identification of the desensitized content and improves the efficiency of the desensitization process.
[0040] As an optional embodiment, target-sensitive data features may include: target-sensitive text and target-sensitive graphics. Target-sensitive graphics, as described herein, refer to graphics other than text.
[0041] Optionally, step 102: obtaining target sensitive data features corresponding to the target application scenario may include:
[0042] Obtain a first sensitive data matching template that includes target sensitive text features and a second sensitive data matching template that includes target sensitive graphic features.
[0043] The first and second sensitive matching templates are pre-built, and the construction process is as follows:
[0044] First, obtain the historical sensitive dataset from the image dataset in the target application scenario; then, perform Fourier transform on the historical sensitive dataset to obtain the target sensitive text features and target sensitive graphic features; then, construct a first sensitive data matching template based on the target sensitive text features, and construct a second sensitive data matching template based on the target sensitive image features.
[0045] As an optional embodiment, step 103: determining the sensitive image region in the first image that matches the target sensitive data features may include:
[0046] Step A1: Binarize the first image to obtain a grayscale image of the first image.
[0047] Binarizing an image can simplify the original complex image, reduce the amount of data, and highlight the outline of the sensitive image of interest, making it easier to identify sensitive information in the future.
[0048] Step A2: Divide the grayscale image into multiple initial image regions.
[0049] Step A3: Obtain the shallow image features of each initial image region to obtain the shallow feature image of the grayscale image.
[0050] In this embodiment of the application, after obtaining the grayscale image of the first image, the grayscale image can be input into a pre-constructed desensitization model for desensitization processing to obtain the desensitized second image. For example, Figure 2 As shown, the desensitization model described in this application embodiment includes: a first convolutional layer, a sensitive region pooling layer, a second convolutional layer, and a fully connected layer.
[0051] After the grayscale image is input into the pre-built desensitization model, the model first divides the grayscale image into feature regions. Specifically, the first convolutional layer divides the grayscale image into multiple initial image regions and extracts the shallow features of each initial image region to obtain a shallow feature image, such as... Figure 2 As shown. The shallow features of an image may include, but are not limited to: image location, size, grayscale values, and textual information within the image.
[0052] The shallow features of the acquired image can be used to form the feature values of each initial image region. In this way, when identifying sensitive information, the identification of sensitive information of the entire image can be transformed into the identification of sensitive feature values of each initial image region, which helps to improve the identification efficiency. Furthermore, when the initial image region is divided into sufficiently fine areas, the range of the identified sensitive region is also sufficiently accurate.
[0053] Step A4: Perform sliding matching of the first sensitive data matching template on the shallow feature image to determine the first type of sensitive image region.
[0054] Among them, the first type of sensitive image region is the initial image region that matches the image content with the target sensitive text features.
[0055] Step A5: Perform sliding matching of the second sensitive data matching template on the shallow feature image to determine the second type of sensitive image region.
[0056] The second type of sensitive image region is the initial image region where the image content matches the target sensitive graphic features.
[0057] The second type of sensitive image region and the second type of sensitive image region together constitute the aforementioned sensitive image region.
[0058] After obtaining the shallow feature image, the shallow feature image, along with pre-constructed first and second sensitive data matching templates, can be input into the sensitive region pooling layer of the desensitization model for processing and sensitive region matching, such as... Figure 2 As shown.
[0059] like Figure 3 As shown, during sensitive region matching, the sensitive data matching template 301 can be slidably matched on the shallow feature image 302. The shallow feature image 302 consists of multiple initial image regions 3021. The smallest dashed grid cell in the figure represents an initial image region.
[0060] Specifically, a first sensitive data matching template can be used for sliding matching on a shallow feature image to calculate the similarity of sensitive text between each initial image region in the shallow feature image and the first sensitive data matching template. When the similarity of sensitive text exceeds a set threshold t1, the current initial image region is determined as a first-type sensitive image region. By traversing all initial image regions, the first-type sensitive region bounding image can be obtained. Then, a second sensitive data matching template can be used for sliding matching on the shallow feature image to calculate the similarity of sensitive graphics between each initial image region in the shallow feature image and the second sensitive data matching template. When the similarity of sensitive graphics exceeds a set threshold t2, the current initial image region is determined as a second-type sensitive image region. By traversing all initial regions, the second-type sensitive region bounding image can be obtained. Finally, the first-type sensitive region bounding image and the second-type sensitive region bounding image are integrated to obtain the sensitive region bounding image.
[0061] The similarity of sensitive text and the similarity of sensitive images can be expressed as follows:
[0062]
[0063] Where P(T,S) represents the degree of similarity of sensitive text or sensitive images, T(x,y) is the sensitive data matching template, S(x,y) is the initial image region, and x∈[m,m+k] and y∈[n,n+l] are the horizontal and vertical coordinates of the initial image region, respectively.
[0064] As an optional embodiment, if the sensitive image region includes a first type of sensitive image region that matches the features of the target sensitive text, step 104: desensitizing the image in the sensitive image region to obtain a second image may include:
[0065] The process involves: acquiring sensitive text from the first type of sensitive image region; encoding the sensitive text to obtain desensitized text; and replacing the sensitive text with the desensitized text to obtain the second image.
[0066] Continuing with the aforementioned desensitization model as an example, the text desensitization scheme will be described.
[0067] The second convolutional layer of the desensitization model filters the image containing sensitive regions, identifying both sensitive and non-sensitive areas. For the first category of sensitive image regions within the sensitive regions, text extraction is performed to obtain and encode sensitive fields. These desensitized fields are then used to replace the sensitive fields in the first category of sensitive image regions, resulting in the first category of desensitized regions.
[0068] Where the sensitive image region includes a second type of sensitive image region that matches the target sensitive graphic features, step 104: desensitizing the image in the sensitive image region to obtain a second image may include:
[0069] Based on the Discrete Fourier Transform, the second type of sensitive image region is desensitized to obtain the second type of preliminary desensitized image region; based on the Arnold Transform, the second type of preliminary sensitive image region is desensitized to obtain the second image.
[0070] Continuing with the aforementioned desensitization model as an example, the graphic desensitization scheme will be described.
[0071] When performing desensitization processing on a second type of sensitive image region within a sensitive region, firstly, for any second type of sensitive image region of size M*N... Where x∈[0,M-1], y∈[0,N-1], according to the Discrete Fourier Transform, for A compression transformation is performed to obtain the second type of preliminary desensitized image region. The compression transformation is expressed as follows:
[0072]
[0073] Where u is the x-coordinate of any pixel in the second type of sensitive image region, v is the y-coordinate of any pixel in the second type of sensitive image region, and i is the identifier of each second type of sensitive image region.
[0074] Subsequently, the second type of initially desensitized image region is desensitized a second time according to the Arnold transform to obtain the second type of desensitized image region.
[0075] The Arnold transform can be expressed as:
[0076]
[0077] Where a and b are the parameters of the Arnold transform coefficient matrix.
[0078] In the fully connected layer of the desensitization model, the sensitive regions of the image are replaced with the first type of desensitized image region and the second type of desensitized image region according to the corresponding pixel coordinates and sensitive region type, thus obtaining the desensitized image.
[0079] In this embodiment, different types of sensitive information in the image can be identified separately, and different desensitization methods can be used for different types of sensitive information, which helps to improve the efficiency and accuracy of data desensitization.
[0080] As an optional embodiment, after step 104: desensitizing the image in the sensitive image region to obtain the second image, the image processing method may further include:
[0081] Step B1: Input the second image into the desensitization test model to identify sensitive image regions in the second image.
[0082] In this embodiment, after desensitizing the first image to obtain the second image, the second image can be input into the desensitization detection model to identify sensitive image regions and determine whether the second image still contains sensitive data. The desensitization detection model and the desensitization model share weights and parameters, meaning the two models have identical components, which reduces training time.
[0083] Step B2: Based on the output of the desensitization test model, score the desensitization effect of the second image.
[0084] In this embodiment of the application, the desensitization effect of the second image can be scored based on the output results of the desensitization test model.
[0085] Optionally, the desensitization effect of the second image can be scored according to a pre-constructed desensitization scoring function. The desensitization scoring function can be:
[0086]
[0087] Among them, D score The score is represented by SUM, which represents the second image, and λ represents the desensitization scoring factor. This represents the first type of sensitive image region. This represents the second type of sensitive image region, where x and y represent pixel coordinates, and w1 i This represents the preset weight value of the i-th type I sensitive image region. Let represent the preset weight value of the j-th second-class sensitive image region, K represent the total number of first-class sensitive image regions, and L represent the total number of second-class sensitive image regions.
[0088] Step B3: If the score is less than the preset value, perform desensitization processing on the sensitive image areas in the second image.
[0089] Step B4: If the score is greater than the preset value, output the second image as the final desensitized image.
[0090] After obtaining the scoring results, the scoring results are compared with the preset values to determine whether the desensitization effect of the second image meets the business requirements of the current scenario.
[0091] If the score is lower than the preset value, it indicates that the second image still contains a significant amount of sensitive information, and the desensitization effect has not yet met the business requirements of the current scenario. Therefore, further desensitization processing of the second image is required. The desensitized second image is then scored until its score exceeds the preset value.
[0092] If the score is greater than the preset value, it means that the desensitization effect of the second image has met the business requirements of the current scenario, and the second image will be determined as the final desensitized image.
[0093] It should be noted that, for cases where the score equals the preset value, either the sensitive image region in the second image can be desensitized, or the second image can be output as the final desensitized image. The specific steps can be set according to actual needs.
[0094] The preset values mentioned here can be set according to actual needs. For example, if the full score is 100, the preset values can be set to 60, 70, 80, etc.
[0095] In this embodiment of the application, by testing the desensitization effect of the desensitized image, it can be determined whether there is any incomplete desensitization of the desensitized image, that is, whether there is still a lot of residual sensitive information in the desensitized image. In this way, if the test result is that the desensitization is incomplete, the desensitized image can continue to be desensitized, thereby improving the security of data desensitization.
[0096] As an optional embodiment, in order to enable different users to have different viewing permissions for images, this application embodiment can also perform different levels of encryption processing on the desensitized second image. Users can use different decryption passwords to decrypt the image to different degrees, thereby obtaining different image content. The specific implementation method is as follows.
[0097] After step 104: desensitizing the image in the sensitive image region to obtain the second image, the image processing method may further include:
[0098] Step C1: Encrypt the non-desensitized areas in the second image according to the first encryption algorithm to obtain the first encrypted image.
[0099] In this embodiment, the non-de-sensitized area of the second image can be encrypted using a first encryption algorithm to obtain an encrypted non-de-sensitized area. The encrypted non-de-sensitized area is then combined with the de-sensitized area of the second image to obtain a first-level encrypted image, and a first-level key is generated. The first-level encrypted image is the first encrypted image, and the first-level key is used to decrypt the first-level encrypted image.
[0100] Optionally, the first encryption algorithm may be a permutation encryption algorithm.
[0101] Step C2: Encrypt the desensitized area in the first encrypted image according to the second encryption algorithm to obtain the second encrypted image.
[0102] In this embodiment, the desensitized area of the second image can be encrypted using a second encryption algorithm to obtain an encrypted non-desensitized area. The encrypted non-desensitized area and the encrypted desensitized area are then combined to obtain a second-level encrypted image, and a second-level key is generated. The second-level encrypted image is the second encrypted image itself, and the second-level key is used to decrypt the second-level encrypted image.
[0103] Alternatively, the second encryption algorithm may be a chaotic encryption algorithm.
[0104] Step C3: Replace the image in the first image region of the second encrypted image with the image in the second image region to obtain the third image.
[0105] Wherein, if the first image region is the encrypted and desensitized region of the second encrypted image, the second image region is the encrypted and non-desensitized region of the second encrypted image; and if the first image region is the encrypted and non-desensitized region of the second encrypted image, the second image region is the encrypted and desensitized region of the second encrypted image.
[0106] In this embodiment, the encrypted and desensitized areas can be encoded according to their position [x, y], size [L, W], and sensitive information type [sensitive text, sensitive image] to generate a first type of encrypted and desensitized area code [sensitive text 1, x1, y1, L1, W1] and a second type of encrypted and desensitized area code [sensitive image 2, x2, y2, L2, W2]. Then, the two types of encrypted and desensitized area codes are randomly selected for replacement encryption. For example, based on the second type of encrypted and desensitized area code, the corresponding second type of encrypted and desensitized area is selected to replace any first type of encrypted and desensitized area; or based on the first type of encrypted and desensitized area code, the corresponding first type of encrypted and desensitized area is selected to replace any second type of encrypted and desensitized area, resulting in the final encrypted and desensitized area. The final encrypted image is the third image, and the third-level key is used to decrypt the final encrypted image.
[0107] During decryption and viewing, users can be granted different levels of viewing permissions based on their work scope. Users retrieve different levels of encryption keys from the key storage device according to their permission level, allowing for varying degrees of image decryption. For example, highest-level personnel requiring complete original image information can obtain all keys based on their permission level to decrypt the first-level encrypted image, obtaining a desensitized image including both the complete desensitized and undesensitized areas. This desensitized image can then be inversely transformed to obtain the original image. Users with the lowest permissions can only obtain the third-level key to decrypt the final encrypted image, ensuring smooth browsing of the undesensitized areas while preventing the leakage of desensitized information.
[0108] In this embodiment of the application, encrypted images with different encryption levels can be generated based on different encryption keys, thereby satisfying the different levels of viewing of image content by users with different permissions.
[0109] Finally, it should be noted that the image processing method provided in this application is applicable to the processing of a single frame image as well as the processing of continuous time-series images. Continuous time-series images may include, but are not limited to, video images, moving images, and presentation documents (such as PPT files).
[0110] The above is a description of the image processing method provided in the embodiments of this application.
[0111] In summary, in this embodiment, before desensitizing the image, historical sensitive data of the application scenario corresponding to the image is first obtained. Then, based on this historical sensitive data, it is determined whether the image contains sensitive information. Finally, the identified sensitive information is desensitized. This eliminates the need for manual identification of the desensitized content, improving the efficiency of the desensitization process. Furthermore, this embodiment can identify different types of sensitive information in the image and apply different desensitization methods to each type, which helps improve the efficiency and accuracy of data desensitization. Further, this embodiment can also verify the desensitization effect of the desensitized image to determine if there are any incomplete desensitizations. If incomplete desensitization occurs, the desensitized image is further desensitized, thereby improving the security of data desensitization. Finally, this embodiment can generate encrypted images with different encryption levels based on different encryption keys, thereby satisfying the different levels of viewing of image content by users with different permissions.
[0112] The image processing method provided by the embodiments of this application has been described above. The image processing apparatus provided by the embodiments of this application will be described below with reference to the accompanying drawings.
[0113] like Figure 4 As shown in the figure, this application embodiment also provides an image processing apparatus applied to an electronic device.
[0114] The image processing device may include:
[0115] The first acquisition module 401 is used to acquire the first image.
[0116] The second acquisition module 402 is used to acquire target sensitive data features corresponding to the target application scenario.
[0117] The target application scenario is the application scenario corresponding to the first image.
[0118] The determination module 403 is used to determine the sensitive image region in the first image that matches the target sensitive data features.
[0119] The desensitization module 404 is used to desensitize the image in the sensitive image area to obtain a second image.
[0120] Optionally, the target-sensitive data features may include: target-sensitive text features and target-sensitive graphic features.
[0121] The second acquisition module 402 may include:
[0122] The first acquisition unit is used to acquire a first sensitive data matching template including the target sensitive text features and a second sensitive data matching template including the target sensitive graphic features.
[0123] Optionally, the device may further include:
[0124] The second acquisition module is used to acquire historical sensitive datasets in the target application scenario.
[0125] The third acquisition module is used to acquire the target sensitive text features and the target sensitive graphic features from the historical sensitive dataset.
[0126] The first template construction module is used to construct the first sensitive data matching template based on the target sensitive text features.
[0127] The second template construction module is used to construct the second sensitive data matching template based on the target sensitive graphic features.
[0128] Optionally, the determining module 403 may include:
[0129] An image processing unit is used to perform binarization processing on the first image to obtain a grayscale image of the first image.
[0130] An image segmentation unit is used to segment the grayscale image into multiple initial image regions.
[0131] The second acquisition unit is used to acquire shallow image features of each of the initial image regions to obtain a shallow feature image of the grayscale image.
[0132] The first determining unit is used to perform sliding matching of the first sensitive data matching template on the shallow feature image to determine the first type of sensitive image region.
[0133] The first type of sensitive image region is an initial image region that matches the target sensitive text features.
[0134] The second determining unit is used to perform sliding matching of the second sensitive data matching template on the shallow feature image to determine the second type of sensitive image region.
[0135] The second type of sensitive image region is an initial image region that matches the target sensitive graphic features.
[0136] Optionally, if the sensitive image region includes a first type of sensitive image region that matches the target sensitive text features, the desensitization module 404 may include:
[0137] The third acquisition unit is used to acquire sensitive text in the first type of sensitive image region.
[0138] The encoding unit is used to encode the sensitive text to obtain desensitized text.
[0139] The desensitization unit is used to replace the sensitive text with the desensitized text to obtain the second image.
[0140] Optionally, if the sensitive image region includes a second type of sensitive image region that matches the target sensitive graphic features, the desensitization module 404 may include:
[0141] The first image transformation unit is used to perform desensitization processing on the second type of sensitive image region based on discrete Fourier transform to obtain the second type of preliminary desensitized image region.
[0142] The second image transformation unit is used to perform desensitization processing on the second type of preliminary sensitive image region based on Arnold transform to obtain the second image.
[0143] Optionally, the device may further include:
[0144] The desensitization detection module is used to input the second image into the desensitization test model and identify sensitive image regions in the second image.
[0145] The scoring module is used to score the desensitization effect of the second image based on the output of the desensitization test model.
[0146] The second desensitization module is used to desensitize sensitive image regions in the second image when the score is less than a preset value.
[0147] The image output module is used to output the second image as the final desensitized image when the score is greater than a preset value.
[0148] Optionally, the device may further include:
[0149] The first encryption module is used to encrypt the non-desensitized areas in the second image according to the first encryption algorithm to obtain the first encrypted image.
[0150] The second encryption module is used to encrypt the desensitized area in the first encrypted image according to the second encryption algorithm to obtain the second encrypted image.
[0151] The third encryption module is used to replace the image in the first image region of the second encrypted image with the image in the second image region to obtain the third image.
[0152] Wherein, if the first image region is the encrypted and desensitized region of the second encrypted image, the second image region is the encrypted and non-desensitized region of the second encrypted image; if the first image region is the encrypted and non-desensitized region of the second encrypted image, the second image region is the encrypted and desensitized region of the second encrypted image.
[0153] The image processing apparatus provided in this application embodiment can achieve... Figure 1 The various processes implemented by the image processing device in the method embodiment shown will not be described again here to avoid repetition.
[0154] In this embodiment, before desensitizing the image, historical sensitive data of the application scenario corresponding to the image is first obtained. Then, based on this historical sensitive data, it is determined whether the image contains sensitive information. Finally, the sensitive information determined in this way is desensitized. This eliminates the need for manual identification of the desensitized content and improves the efficiency of the desensitization process.
[0155] This application also provides an electronic device, including a processor and a memory. The memory stores a program or instructions that can run on the processor. When the program or instructions are executed by the processor, they implement the various steps of the above-described image processing method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0156] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described image processing method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0157] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM, RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An image processing method, characterized in that, include: Get the first image; Obtain target sensitive data features corresponding to the target application scenario; wherein, the target application scenario is the application scenario corresponding to the first image; Identify the sensitive image region in the first image that matches the target sensitive data features; The image in the sensitive image region is desensitized to obtain a second image; The target-sensitive data features include: target-sensitive text features and target-sensitive graphic features; The acquisition of target sensitive data features corresponding to the target application scenario includes: Obtain a first sensitive data matching template that includes the target sensitive text features and a second sensitive data matching template that includes the target sensitive graphic features; The step of determining the sensitive image region in the first image that matches the target sensitive data features includes: The first image is binarized to obtain a grayscale image of the first image; After obtaining the grayscale image of the first image, the grayscale image is input into a pre-constructed desensitization model for desensitization processing to obtain the desensitized second image. The desensitization model includes: a first convolutional layer, a sensitive region pooling layer, a second convolutional layer, and a fully connected layer. Specifically, after the grayscale image is input into the pre-constructed desensitization model, the desensitization model divides the grayscale image into multiple initial image regions through a first convolutional layer, and extracts shallow image features from each initial image region to obtain a shallow feature image; The first sensitive data matching template is slidably matched on the shallow feature image to determine the first type of sensitive image region; wherein, the first type of sensitive image region is the initial image region that matches the image content with the target sensitive text feature; The second sensitive data matching template is slidably matched on the shallow feature image to determine the second type of sensitive image region; wherein, the second type of sensitive image region is the initial image region whose image content matches the target sensitive graphic feature; After desensitizing the image in the sensitive image region to obtain the second image, the method further includes: The non-desensitized areas in the second image are encrypted using the first encryption algorithm to obtain the first encrypted image, and a first-level key is generated. The desensitized area in the first encrypted image is encrypted using the second encryption algorithm to obtain the second encrypted image, and a second-level key is generated. The image in the first image region of the second encrypted image is replaced with the image in the second image region to obtain the third image, and a third-level key is generated; Wherein, if the first image region is the encrypted and desensitized region of the second encrypted image, the second image region is the encrypted and non-desensitized region of the second encrypted image; if the first image region is the encrypted and non-desensitized region of the second encrypted image, the second image region is the encrypted and desensitized region of the second encrypted image. The first-level key is used to decrypt the first encrypted image; The second-level key is used to decrypt the second encrypted image; The third-level key is used to decrypt the third encrypted image; different levels of viewing permissions are granted to users according to the scope of business operations, and the key is used to obtain different levels of keys according to the viewing permissions.
2. The image processing method according to claim 1, characterized in that, Before obtaining the first sensitive data matching template including the target sensitive text features and the second sensitive data matching template including the target sensitive graphic features, the method further includes: Obtain the historical sensitive dataset under the target application scenario; From the historical sensitive dataset, obtain the target sensitive text features and the target sensitive graphic features; Based on the target sensitive text features, construct the first sensitive data matching template; Based on the target sensitive graphic features, a second sensitive data matching template is constructed.
3. The image processing method according to claim 1, characterized in that, When the sensitive image region includes a first type of sensitive image region that matches the target sensitive text features, the step of desensitizing the image in the sensitive image region to obtain a second image includes: Extract sensitive text from the first type of sensitive image region; The sensitive characters are encoded to obtain desensitized characters; The sensitive text is replaced with the desensitized text to obtain the second image.
4. The image processing method according to claim 1, characterized in that, When the sensitive image region includes a second type of sensitive image region that matches the target sensitive graphic features, the step of desensitizing the image in the sensitive image region to obtain the second image includes: Based on the discrete Fourier transform, the second type of sensitive image region is desensitized to obtain the second type of preliminary desensitized image region; Based on the Arnold transform, the second type of preliminary sensitive image region is desensitized to obtain the second image.
5. The image processing method according to claim 1, characterized in that, After desensitizing the image in the sensitive image region to obtain the second image, the method further includes: The second image is input into the desensitization test model to identify sensitive image regions in the second image; Based on the output of the desensitization test model, the desensitization effect of the second image is scored; If the score is less than a preset value, the sensitive image regions in the second image are desensitized. If the score is greater than the preset value, the second image will be output as the final desensitized image.
6. An image processing apparatus, characterized in that, include: The first acquisition module is used to acquire the first image; The second acquisition module is used to acquire target sensitive data features corresponding to the target application scenario; wherein, the target application scenario is the application scenario corresponding to the first image; The determining module is used to determine the sensitive image region in the first image that matches the target sensitive data features; The desensitization module is used to desensitize the image in the sensitive image area to obtain a second image; The device further includes: The first encryption module is used to encrypt the non-desensitized areas in the second image according to the first encryption algorithm to obtain the first encrypted image and generate the first-level key; The second encryption module is used to encrypt the desensitized area in the first encrypted image according to the second encryption algorithm to obtain the second encrypted image and generate a second-level key; The third encryption module is used to replace the image in the first image region of the second encrypted image with the image in the second image region to obtain the third image and generate the third-level key; Wherein, if the first image region is the encrypted and desensitized region of the second encrypted image, the second image region is the encrypted and non-desensitized region of the second encrypted image; if the first image region is the encrypted and non-desensitized region of the second encrypted image, the second image region is the encrypted and desensitized region of the second encrypted image. The first-level key is used to decrypt the first encrypted image; The second-level key is used to decrypt the second encrypted image; The third-level key is used to decrypt the third encrypted image; different levels of viewing permissions are granted to users according to the scope of business operations, and the key is used to obtain different levels of keys according to the viewing permissions; The target-sensitive data features include: target-sensitive text features and target-sensitive graphic features; The second acquisition module includes: The first acquisition unit is used to acquire a first sensitive data matching template including the target sensitive text features and a second sensitive data matching template including the target sensitive graphic features; The determining module includes: An image processing unit is used to perform binarization processing on the first image to obtain a grayscale image of the first image; After obtaining the grayscale image of the first image, the grayscale image is input into a pre-constructed desensitization model for desensitization processing to obtain the desensitized second image. The desensitization model includes: a first convolutional layer, a sensitive region pooling layer, a second convolutional layer, and a fully connected layer. An image segmentation unit is used to divide the grayscale image into multiple initial image regions after the grayscale image is input into the pre-constructed desensitization model, wherein the desensitization model divides the grayscale image into multiple initial image regions through a first convolutional layer; The second acquisition unit is used to extract shallow image features within each of the initial image regions to obtain a shallow feature image; The first determining unit is used to perform sliding matching of the first sensitive data matching template on the shallow feature image to determine a first type of sensitive image region; wherein, the first type of sensitive image region is an initial image region that matches the image content with the target sensitive text features; The second determining unit is used to perform sliding matching of the second sensitive data matching template on the shallow feature image to determine the second type of sensitive image region; wherein, the second type of sensitive image region is the initial image region that matches the image content with the target sensitive graphic feature.
7. The image processing apparatus according to claim 6, characterized in that, The device further includes: The second acquisition module is used to acquire historical sensitive datasets under the target application scenario; The third acquisition module is used to acquire the target sensitive text features and the target sensitive graphic features from the historical sensitive dataset; The first template construction module is used to construct the first sensitive data matching template based on the target sensitive text features; The second template construction module is used to construct the second sensitive data matching template based on the target sensitive graphic features.
8. The image processing apparatus according to claim 6, characterized in that, When the sensitive image region includes a first type of sensitive image region that matches the target sensitive text features, the desensitization module includes: The third acquisition unit is used to acquire sensitive text in the first type of sensitive image region; The encoding unit is used to encode the sensitive characters to obtain desensitized characters; The desensitization unit is used to replace the sensitive text with the desensitized text to obtain the second image.
9. The image processing apparatus according to claim 6, characterized in that, When the sensitive image region includes a second type of sensitive image region that matches the target sensitive graphic features, the desensitization module includes: The first image transformation unit is used to perform desensitization processing on the second type of sensitive image region based on discrete Fourier transform to obtain the second type of preliminary desensitized image region. The second image transformation unit is used to perform desensitization processing on the second type of preliminary sensitive image region based on Arnold transform to obtain the second image.
10. The image processing apparatus according to claim 6, characterized in that, The device further includes: The desensitization detection module is used to input the second image into the desensitization test model and identify sensitive image regions in the second image; The scoring module is used to score the desensitization effect of the second image based on the output of the desensitization test model. The second desensitization module is used to desensitize the sensitive image regions in the second image when the score is less than a preset value. The image output module is used to output the second image as the final desensitized image when the score is greater than a preset value.
11. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the image processing method as described in any one of claims 1 to 5.
12. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the image processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method, device and equipment
CN114238910A
Multi-entity image privacy protection method, device and equipment
CN115033902A