Image desensitization method, device, electronic device and storage medium
By selecting a suitable algorithm unit according to the target area type in image processing, determining the target area using the first algorithm unit composed of object detection and segmentation algorithms, and selecting an appropriate algorithm in the second algorithm pool for desensitization, the problem of poor image desensitization effect in the prior art is solved, and a more efficient image desensitization effect is achieved.
Patent Information
- Application Number
- CN202210686345.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-06-16
AI Technical Summary
In the prior art, the image desensitization method is single, resulting in poor desensitization effect, especially when facing massive image data.
During the image processing process, different algorithm units are selected according to the target area type of the image to be desensitized, and the target area is determined using the first algorithm unit composed of the object detection algorithm and the segmentation algorithm, and affine deformation, motion blur, turn-on operation, expansion or mosaic algorithm are selected in the second algorithm pool to desensitize the target area.
The precise segmentation and desensitization of the target area is achieved, the effect of image desensitization is improved, and the poor effect caused by the single desensitization method in the prior art is solved.
Smart Images

Figure CN115049540B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image desensitization method, device, electronic device and computer-readable storage medium. Background Art
[0002] During image recognition, the image needs to be preprocessed. Image preprocessing is to separate each text image and hand it over to the recognition module for recognition. It is the processing performed on the input image before feature extraction, segmentation and matching in image analysis.
[0003] The primary goal of image preprocessing is to eliminate irrelevant information from an image, recover useful real-world information, enhance the detectability of relevant information, and minimize data simplification, thereby improving the reliability of feature extraction, image segmentation, matching, and recognition. Image desensitization is a crucial step in image preprocessing, removing sensitive information from an image. Existing technologies typically use a single desensitization method for image processing, which is ineffective when dealing with massive amounts of image data. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide an image desensitization method, device, electronic device and computer-readable storage medium, which can select different preprocessing methods for preprocessing based on different images to be desensitized, thereby improving the preprocessing effect.
[0005] In a first aspect, an embodiment of the present application provides an image desensitization method, the method comprising:
[0006] receiving an image to be desensitized;
[0007] Receive the type of the target area to be acquired;
[0008] Determining a first algorithm unit in a first algorithm pool according to the type of the target area to be acquired;
[0009] Inputting the image to be desensitized into the first algorithm unit, so that the first algorithm unit obtains the target area according to the image to be desensitized;
[0010] determining a second algorithm unit in the second algorithm pool;
[0011] Inputting the target area into the second algorithm unit so that the second algorithm unit desensitizes the target area to obtain a desensitized target area;
[0012] The desensitized target area is embedded in the image to be desensitized to obtain a desensitized image.
[0013] In the above implementation process, an image to be desensitized and the type of the target area to be obtained are received, a first algorithm unit is determined in a first algorithm pool according to the type of the target area to be obtained, the target area is determined in the image to be desensitized using the first algorithm unit, a second algorithm unit is determined in a second algorithm pool, and the target area is desensitized using the second algorithm unit to obtain a desensitized image. By selecting a suitable algorithm unit to process the image to be desensitized based on the type of the target area to be obtained, the target area can be accurately segmented and desensitized, thereby solving the technical problem of poor desensitization effect caused by the single desensitization method in the prior art.
[0014] Furthermore, the first algorithm unit is configured with a target detection algorithm;
[0015] The step of inputting the image to be desensitized into the first algorithm unit so that the first algorithm unit obtains the target area according to the image to be desensitized includes:
[0016] The target area is determined in the image to be desensitized using the target detection algorithm.
[0017] In the above implementation process, the first algorithm unit is configured with a target detection algorithm, and the first algorithm unit can quickly determine the target area in the image to be desensitized by using the target detection algorithm.
[0018] Furthermore, the target detection algorithm includes: a convolutional neural network and a regression algorithm;
[0019] The step of determining the target area in the image to be desensitized by using the target detection algorithm includes:
[0020] Processing the image to be desensitized using a convolutional neural network to obtain spatial features;
[0021] The spatial features are processed using a regression algorithm to obtain the target area.
[0022] In the above implementation process, the embodiment of the present application provides a target detection algorithm, which is composed of a convolutional neural network and a regression algorithm. The convolutional neural network in the target detection algorithm is used to extract features of the image to be desensitized, and the spatial features of the image to be desensitized can be obtained. The spatial features are further processed by the regression algorithm to obtain the target area. Based on the above implementation, the target area in the image to be desensitized can be quickly determined.
[0023] Furthermore, the target detection algorithm includes: a Transformer model and a regression algorithm;
[0024] The step of determining the target area in the image to be desensitized by using the target detection algorithm includes:
[0025] Inputting the image to be desensitized into the Transformer model to obtain spatial features;
[0026] The spatial features are processed using a regression algorithm to obtain the target area.
[0027] In the above implementation process, the image to be desensitized is input into the Transformer model for encoding to obtain a spatial feature matrix, and finally the spatial features are processed based on the regression algorithm to obtain the target area. The Transformer model can further process the obtained spatial features to make the boundary of the target area clearer.
[0028] Furthermore, the first algorithm unit is configured with a segmentation algorithm;
[0029] The step of inputting the image to be desensitized into the first algorithm unit so that the first algorithm unit obtains the target area according to the image to be desensitized includes:
[0030] The image to be desensitized is processed using the segmentation algorithm to obtain the target area.
[0031] In the above implementation process, the first algorithm unit is configured with a segmentation algorithm, and the first algorithm unit uses the segmentation algorithm to process the image to be desensitized to obtain the target area.
[0032] Furthermore, the segmentation algorithm includes: an encoding network and a decoding network;
[0033] The step of processing the image to be desensitized using the segmentation algorithm to obtain the target area includes:
[0034] The image to be desensitized is sequentially input into the encoding network and the decoding network to obtain the target area.
[0035] In the above implementation process, the embodiment of the present application provides the composition and implementation method of a segmentation algorithm. The segmentation algorithm includes an encoding network and a decoding network. The first algorithm unit sequentially inputs the image to be desensitized into the encoding network and the decoding network to quickly obtain the target area. Encoding feature information can effectively retain useful features and ignore useless features.
[0036] Furthermore, the second algorithm unit is configured with: one or more of affine deformation, motion blur, opening operation, dilation, and mosaic algorithm;
[0037] The step of inputting the target area into the second algorithm unit so that the second algorithm unit desensitizes the target area to obtain the desensitized target area includes:
[0038] The target area is desensitized using one or more of affine deformation, motion blur, opening operation, expansion, and mosaic algorithms to obtain a desensitized target area.
[0039] In the above implementation process, the second algorithm unit is configured with multiple algorithms, and the second algorithm unit uses one or more algorithms among the multiple algorithms to desensitize the target area.
[0040] In a second aspect, an embodiment of the present application provides a desensitization device, comprising:
[0041] An image receiving module, used for receiving images to be desensitized;
[0042] A type receiving module, used for receiving the type of the target area to be acquired;
[0043] A first algorithm determination module is configured to determine a first algorithm unit in a first algorithm pool according to the type of the target area to be acquired;
[0044] a target region determination module, configured to input the image to be desensitized into the first algorithm unit, so that the first algorithm unit obtains a target region based on the image to be desensitized;
[0045] A second algorithm determination module, configured to determine a second algorithm unit in a second algorithm pool;
[0046] a desensitization module, configured to input the target area into the second algorithm unit, so that the second algorithm unit desensitizes the target area to obtain a desensitized target area;
[0047] The embedding module is used to embed the desensitized target area into the image to be desensitized to obtain the desensitized image.
[0048] In the above implementation process, an image to be desensitized and the type of the target area to be obtained are received, a first algorithm unit is determined in a first algorithm pool according to the type of the target area to be obtained, the target area is determined in the image to be desensitized using the first algorithm unit, a second algorithm unit is determined in a second algorithm pool, and the target area is desensitized using the second algorithm unit to obtain a desensitized image. By selecting a suitable algorithm unit to process the image to be desensitized based on the type of the target area to be obtained, the target area can be accurately segmented and desensitized, thereby solving the technical problem of poor desensitization effect caused by the single image desensitization method in the prior art.
[0049] In a third aspect, an embodiment of the present application provides an electronic device, 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 the method described in any one of the first aspects when executing the computer program.
[0050] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the method as described in any one of the first aspects.
[0051] Other features and advantages disclosed in the present application will be described in the following description, or some features and advantages can be inferred or determined without doubt from the description, or can be learned by implementing the above-mentioned technology disclosed in the present application.
[0052] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 A schematic diagram of the process of the image desensitization method provided in an embodiment of the present application;
[0055] Figure 2 A schematic diagram of the structure of an image desensitization device provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0058] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.
[0059] Example 1
[0060] See also Figure 1 The embodiment of the present application provides an image desensitization method, which is applied to an image desensitization system. The image desensitization system includes: a first algorithm pool and a second algorithm pool. The method includes:
[0061] S1: Receive the image to be desensitized;
[0062] S2: Receive the type of the target area to be acquired;
[0063] In the above embodiment, the types of the target area to be acquired include: a maximum rectangular outer contour and a pixel-level outer contour.
[0064] The target area can be the name, address, etc. on the certificate.
[0065] S3: determining a first algorithm unit in the first algorithm pool according to the type of the target area to be acquired;
[0066] S4: inputting the image to be desensitized into the first algorithm unit, so that the first algorithm unit obtains the target area according to the image to be desensitized;
[0067] S5: Determine a second algorithm unit in the second algorithm pool;
[0068] S6: inputting the target area into the second algorithm unit so that the second algorithm unit desensitizes the target area to obtain a desensitized target area;
[0069] S7: Embed the desensitized target area into the image to be desensitized to obtain the desensitized image.
[0070] In the above implementation process, the image desensitization system is configured with a first algorithm pool and a second algorithm pool, and a plurality of algorithm units are configured in the first algorithm pool and the second algorithm pool. Different from the prior art, the image to be desensitized and the type of the target area to be obtained are received, and the first algorithm unit is determined in the first algorithm pool according to the type of the target area to be obtained. The target area in the image to be desensitized is determined by the first algorithm unit, and the second algorithm unit is determined in the second algorithm pool. The target area is desensitized using the second algorithm unit to obtain a desensitized image. By selecting a suitable algorithm unit to process the image to be desensitized according to the type of the target area to be obtained, the target area can be accurately segmented and desensitized, thereby solving the technical problem of poor desensitization effect caused by the single desensitization method in the prior art.
[0071] The first algorithm pool is provided with a plurality of algorithm units, each of which is provided with different algorithms. In one possible implementation, the first algorithm unit is configured with a target detection algorithm;
[0072] The step of inputting the image to be desensitized into the first algorithm unit so that the first algorithm unit obtains the target area according to the image to be desensitized includes:
[0073] The target area is determined in the image to be desensitized using the target detection algorithm.
[0074] In the above implementation process, the first algorithm unit is configured with a target detection algorithm, and the first algorithm unit can quickly determine the target area in the image to be desensitized by using the target detection algorithm.
[0075] In one possible implementation, the target detection algorithm includes: a convolutional neural network and a regression algorithm;
[0076] The steps of using the target detection algorithm to determine the target area in the image to be desensitized include:
[0077] Use convolutional neural network to process the desensitized image to obtain spatial features;
[0078] The spatial features are processed using regression algorithms to obtain the target area.
[0079] In the above embodiment, the regression algorithm may adopt anchor-based regression, such as SSD, YOLO, Faster-RCNN, etc.; or may adopt anchor-free regression, such as FCOS, CornerNet, etc.
[0080] In the above implementation process, the embodiment of the present application provides a target detection algorithm, which is composed of a convolutional neural network and a regression algorithm. The convolutional neural network in the target detection algorithm is used to extract features of the image to be desensitized, and the spatial features of the image to be desensitized can be obtained. The spatial features are further processed by the regression algorithm to obtain the target area. Based on the above implementation, the target area in the image to be desensitized can be quickly determined.
[0081] For example, taking a video screen as an example, the calculation formula of the convolutional neural network is as follows:
[0082]
[0083] Among them, t is the serial number of the video screen, u is the number of rows of the weight matrix, v is the number of columns of the weight matrix, k is the dimension of the weight matrix corresponding to the convolution kernel, i is the row number of the pixel matrix, and j is the column number of the pixel matrix. is the image feature corresponding to the pixel image of the t-th frame; is the element in row u and column v of the weight matrix corresponding to the convolution kernel of the t-th frame pixel image. It is the element in the i+uth row and j+vth column in the pixel matrix corresponding to the tth frame of the video.
[0084] Preferably, after extracting the spatial features, the first algorithm unit also generates a spatial embedding tensor based on the spatial features, generates a position code based on the spatial embedding tensor, superimposes the position code and the spatial embedding tensor and inputs the time series model Self-Attenditon for encoding, and uses the code output by the model as a new spatial feature.
[0085] In one possible implementation, the target detection algorithm includes: a Transformer model and a regression algorithm;
[0086] The steps of using the target detection algorithm to determine the target area in the image to be desensitized include:
[0087] Input the image to be desensitized into the Transformer model to obtain spatial features;
[0088] The spatial features are processed using regression algorithms to obtain the target area.
[0089] In the above implementation process, the image to be desensitized is input into the Transformer model for encoding to obtain a spatial feature matrix, and finally the spatial features are processed based on the regression algorithm to obtain the target area. The Transformer model can further process the obtained spatial features to make the boundary of the target area clearer.
[0090] The Transformer model uses a multi-attention-based mechanism to form multiple subspaces and enhance the model's encoding capabilities. The Transformer model's operational mechanism is as follows:
[0091] Generate a spatial embedding tensor based on the image to be desensitized;
[0092] The spatial embedding tensor is divided into h parts and combined with the weight W i Multiply together to form a multi-head computing tensor Q i , K i 、V i .
[0093]
[0094] The above calculation tensor is input into the feedforward neural network and softmax for normalization, and the attention tensor head is calculated. i ;
[0095] The h attention tensors are stacked to form the encoded output image feature tensor.
[0096] In one possible embodiment, the first algorithm unit among the plurality of algorithm units is configured with a segmentation algorithm. The step of inputting the image to be desensitized into the first algorithm unit so that the first algorithm unit obtains the target area based on the image to be desensitized includes:
[0097] The desensitized image is processed using a segmentation algorithm to obtain the target area.
[0098] In the above implementation process, the first algorithm unit is configured with a segmentation algorithm, and the first algorithm unit uses the segmentation algorithm to process the image to be desensitized to obtain the target area.
[0099] Furthermore, the segmentation algorithm includes: an encoding network and a decoding network;
[0100] In the above embodiment, the encoding network and the decoding network can use an upsampling network or a TRansformer. The upsampling network is generally composed of a deconvolution (transposed convolution) neural network or a convolution neural network + an upsampling algorithm (nearest neighbor interpolation, bilinear interpolation, unpooling, etc.).
[0101] The steps of using the segmentation algorithm to process the desensitized image and obtain the target area include:
[0102] The image to be desensitized is input into the encoding network and the decoding network in sequence to obtain the target area.
[0103] In the above implementation process, the embodiment of the present application provides the composition and implementation method of a segmentation algorithm. The segmentation algorithm includes an encoding network and a decoding network. The first algorithm unit sequentially inputs the image to be desensitized into the encoding network and the decoding network to quickly obtain the target area. Encoding feature information can effectively retain useful features and ignore useless features.
[0104] Based on the above embodiment, when the type of the target area to be obtained is the maximum rectangular outer contour, the first algorithm unit configured with the target detection algorithm is selected to process the desensitized image; when the type of the target area to be obtained is the pixel-level outer contour, the first algorithm unit configured with the segmentation algorithm is selected to process the desensitized image.
[0105] The purpose of setting up the second algorithm pool is to add noise to the target area and interfere with the characteristic information of the target area. To prevent the cracking algorithm from eliminating the added noise information, in S5, a second algorithm unit is randomly determined in the second algorithm pool. It is understandable that multiple second algorithm units are set in the second algorithm pool. The first algorithm unit and the second algorithm unit in the embodiment of the present application are only for distinguishing descriptions and should not be understood as indicating or implying relative importance.
[0106] Furthermore, the second algorithm unit is configured with: one or more of affine deformation, motion blur, opening operation, dilation, and mosaic algorithm;
[0107] The step of inputting the target area into the second algorithm unit so that the second algorithm unit desensitizes the target area to obtain the desensitized target area includes:
[0108] The target area is desensitized by using one or more of affine deformation, motion blur, opening operation, expansion, and mosaic algorithm to obtain a desensitized target area.
[0109] Furthermore, the embodiments of the present application describe the above-mentioned algorithms.
[0110] Affine deformation: Use a 2*3 matrix to distort, translate, and rotate the target area. Let the original image coordinates be X, A be the distortion or rotation matrix, and B be the translation matrix. Then the transfer matrix is M = [AB], and the transformed coordinates are T. The detailed calculation formula is as follows:
[0111]
[0112]
[0113]
[0114] Motion blur: Let psf be the point spread function, L be the blur radius, β be the motion slope, x and y be the pixel coordinates. The point spread function is calculated as follows:
[0115]
[0116] For an image y(x) that reflects uniform motion, the motion afterimage is superimposed and mapped to each pixel, and the image after motion blur is:
[0117]
[0118]
[0119] Where * represents convolution, r = L / 2.
[0120] Opening operation: Erosion. The result of using S to erode X is the set of X that remains in X after S translates x. Its role in mathematical morphology operations is to eliminate object boundary points.
[0121]
[0122] Dilation is the dual operation of erosion. Its function in mathematical morphology is to expand the boundary points of the object. The calculation formula is as follows:
[0123]
[0124] Opening operation: The opening operation is an operation that first erodes and then expands. The calculation formula is as follows:
[0125]
[0126] Mosaic: Mosaic is an image convolution calculation, that is, within the range of the convolution kernel, the mean of the pixels within the range is taken, and the mean is assigned to each pixel of the convolution kernel. As the convolution kernel moves, the mean is repeatedly taken and assigned, and finally the area that needs to be mosaicked is covered.
[0127] Example 2
[0128] See also Figure 2 The embodiment of the present application provides a desensitization device, which is applied to an image desensitization system. The image desensitization system includes: a first algorithm pool and a second algorithm pool; the device includes:
[0129] Image receiving module 1, used for receiving the image to be desensitized;
[0130] Type receiving module 2, used to receive the type of the target area to be acquired;
[0131] A first algorithm determination module 3, configured to determine a first algorithm unit in a first algorithm pool according to the type of the target area to be acquired;
[0132] The target region determination module 4 is configured to input the image to be desensitized into the first algorithm unit so that the first algorithm unit obtains the target region based on the image to be desensitized;
[0133] A second algorithm determination module 5, configured to determine a second algorithm unit in a second algorithm pool;
[0134] The desensitization module 6 is used to input the target area into the second algorithm unit so that the second algorithm unit desensitizes the target area to obtain the desensitized target area;
[0135] The embedding module 7 is used to embed the desensitized target area into the image to be desensitized to obtain the desensitized image.
[0136] In the above implementation process, the image desensitization system is configured with a first algorithm pool and a second algorithm pool, and a plurality of algorithm units are configured in the first algorithm pool and the second algorithm pool. Different from the prior art, the image to be desensitized and the type of the target area are received, and the first algorithm unit is determined in the first algorithm pool according to the type of the target area. The target area is determined in the image to be desensitized using the first algorithm unit, and the second algorithm unit is determined in the second algorithm pool. The target area is desensitized using the second algorithm unit to obtain a desensitized image. By selecting a suitable algorithm unit to process the image to be desensitized according to the type of the target area, the target area can be accurately segmented and desensitized, thereby solving the technical problem of poor desensitization effect caused by the single desensitization method in the prior art.
[0137] In one possible implementation, the first algorithm unit is configured with a target detection algorithm;
[0138] The target region determination module 4 is further configured to determine the target region in the image to be desensitized using a target detection algorithm.
[0139] In one possible implementation, the target detection algorithm includes: a convolutional neural network and a regression algorithm; the target area determination module 4 is also used to use the convolutional neural network to process the desensitized image to obtain spatial features; and use the regression algorithm to process the spatial features to obtain the target area.
[0140] In a possible implementation, the target region determination module 4 is further configured to input the image to be desensitized into a Transformer model to obtain spatial features; and process the spatial features using a regression algorithm to obtain a target region.
[0141] In a possible implementation, the first algorithm unit is configured with a segmentation algorithm; the target region determination module 4 is further configured to process the image to be desensitized using the segmentation algorithm to obtain the target region.
[0142] In a possible implementation, the segmentation algorithm includes: an encoding network and a decoding network; the target region determination module 4 is further configured to sequentially input the image to be desensitized into the encoding network and the decoding network to obtain the target region.
[0143] In one possible embodiment, the second algorithm unit is configured with: one or more of affine deformation, motion blur, opening operation, expansion, and mosaic algorithms; the desensitization module 6 is also used to include: using one or more of affine deformation, motion blur, opening operation, expansion, and mosaic algorithms to desensitize the target area to obtain a desensitized target area.
[0144] This application also provides an electronic device, see Figure 3 , Figure 3 This is a block diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 31, a communication interface 32, a memory 33, and at least one communication bus 34. The communication bus 34 is used to enable direct communication between these components. The communication interface 32 of the electronic device in this embodiment of the present application is used to communicate signaling or data with other node devices. The processor 31 may be an integrated circuit chip with signal processing capabilities.
[0145] The processor 31 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor, or the processor 31 can also be any conventional processor.
[0146] The memory 33 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory 33 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 31, the electronic device may perform the steps involved in the above method embodiment.
[0147] Optionally, the electronic device may further include a storage controller and an input / output unit.
[0148] The memory 33, storage controller, processor 31, peripheral interfaces, and input / output units are electrically connected to each other, directly or indirectly, to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses 34. The processor 31 is used to execute executable modules stored in the memory 33, such as software function modules or computer programs included in the electronic device.
[0149] The input and output unit is used to provide users with the ability to create tasks and to create optional start time periods or preset execution times for the tasks to enable interaction between the user and the server. The input and output unit can be, but is not limited to, a mouse and keyboard.
[0150] I understand. Figure 3 The structure shown is only for illustration, and the electronic device may also include Figure 3 More or fewer components than shown, or with Figure 3 Different configurations shown. Figure 3Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0151] An embodiment of the present application further provides a computer-readable storage medium having instructions stored thereon. When the instructions are run on a computer, the computer program is executed by a processor to implement the method described in the method embodiment. To avoid repetition, details are not given here.
[0152] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0153] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0154] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0155] The foregoing is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined or explained in subsequent figures.
[0156] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
[0157] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
Claims
1. An image desensitization method, characterized in that: The method comprises: receiving an image to be desensitized; receiving a type of a target area to be acquired, wherein the type of the target area to be acquired includes: a maximum rectangular outer contour and a pixel-level outer contour; Determining a first algorithm unit in a first algorithm pool according to the type of the target area to be acquired, wherein the first algorithm pool includes a plurality of algorithm units, and the plurality of algorithm units are provided with different algorithms; Inputting the image to be desensitized into the first algorithm unit, so that the first algorithm unit obtains the target area according to the image to be desensitized; determining a second algorithm unit in the second algorithm pool; Inputting the target area into the second algorithm unit so that the second algorithm unit desensitizes the target area to obtain a desensitized target area; The desensitized target area is embedded in the image to be desensitized to obtain a desensitized image.
2. The image desensitization method according to claim 1, characterized in that: The first algorithm unit is configured with a target detection algorithm; The step of inputting the image to be desensitized into the first algorithm unit so that the first algorithm unit obtains the target area according to the image to be desensitized includes: The target area is determined in the image to be desensitized using the target detection algorithm.
3. The image desensitization method according to claim 2, characterized in that: The target detection algorithm includes: convolutional neural network and regression algorithm; The step of determining the target area in the image to be desensitized by using the target detection algorithm includes: Processing the image to be desensitized using a convolutional neural network to obtain spatial features; The spatial features are processed using a regression algorithm to obtain the target area.
4. The image desensitization method according to claim 2, characterized in that: The target detection algorithm includes: Transformer model and regression algorithm; The step of determining the target area in the image to be desensitized by using the target detection algorithm includes: Inputting the image to be desensitized into the Transformer model to obtain spatial features; The spatial features are processed using a regression algorithm to obtain the target area.
5. The image desensitization method according to claim 1, characterized in that: The first algorithm unit is configured with a segmentation algorithm; The step of inputting the image to be desensitized into the first algorithm unit so that the first algorithm unit obtains the target area according to the image to be desensitized includes: The image to be desensitized is processed using the segmentation algorithm to obtain the target area.
6. The image desensitization method according to claim 5, characterized in that: The segmentation algorithm includes: an encoding network and a decoding network; The step of processing the image to be desensitized using the segmentation algorithm to obtain the target area includes: The image to be desensitized is sequentially input into the encoding network and the decoding network to obtain the target area.
7. The image desensitization method according to claim 6, characterized in that: The second algorithm unit is configured with: one or more of affine deformation, motion blur, opening operation, expansion, and mosaic algorithm; The step of inputting the target area into the second algorithm unit so that the second algorithm unit desensitizes the target area to obtain the desensitized target area includes: The target area is desensitized using one or more of affine deformation, motion blur, opening operation, expansion, and mosaic algorithms to obtain a desensitized target area.
8. An image desensitization device, characterized in that: The device comprises: An image receiving module, used for receiving images to be desensitized; A type receiving module, configured to receive the type of the target area to be acquired, wherein the type of the target area to be acquired includes: a maximum rectangular outer contour and a pixel-level outer contour; A first algorithm determination module is configured to determine a first algorithm unit in a first algorithm pool according to the type of the target area to be acquired, wherein the first algorithm pool includes a plurality of algorithm units, and the plurality of algorithm units are provided with different algorithms; a target region determination module, configured to input the image to be desensitized into the first algorithm unit, so that the first algorithm unit obtains a target region based on the image to be desensitized; A second algorithm determination module, configured to determine a second algorithm unit in a second algorithm pool; a desensitization module, configured to input the target area into the second algorithm unit, so that the second algorithm unit desensitizes the target area to obtain a desensitized target area; The embedding module is used to embed the desensitized target area into the image to be desensitized to obtain the desensitized image.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the image desensitization method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the steps of the image desensitization method according to any one of claims 1 to 7.
Citation Information
Patent Citations
System for automatically desensitizing medical records and application
CN111199050A
Dynamic desensitization method and device based on machine learning
CN111428273A
Image desensitization method and device and electronic equipment
CN112528318A