Image sensitive information identification method, system, equipment and medium
Through the convolutional neural network deep model and threshold segmentation morphology operation, the sensitive information of the image is extracted, which solves the problems of low recognition efficiency and misjudgment in the existing technology, and achieves higher recognition accuracy and efficiency.
Patent Information
- Application Number
- CN202410714462.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-06
AI Technical Summary
In the existing technology, the efficiency of identifying sensitive information in images is low, and misjudgments and missed judgments are prone to occur. Especially in massive data environments, the effectiveness of deep learning models is directly proportional to the amount of data, and methods based on rules and features cannot cover it. All sensitive information.
The convolutional neural network deep model is used to match and train image information through preset candidate areas. It combines threshold segmentation and morphological operations to extract sensitive image information, reduce model calculation parameters and size, and improve recognition accuracy.
It improves the recognition rate and accuracy of sensitive image information, reduces the occurrence of misjudgments and missed judgments, and enhances the accuracy and recognition efficiency of the model.
Smart Images

Figure CN118608917A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a method, system, device and medium for recognizing image sensitive information. Background Art
[0002] With the promotion of the Internet, browsing websites to obtain information and knowledge has become the mainstream way for people to learn and relax. Internet images are produced and disseminated in large quantities on various websites because they are easy to read and obtain. However, there are also some problems. A large amount of sensitive information is widely disseminated on websites for various purposes, which seriously affects the health and safety of the network environment.
[0003] In the prior art, traditional network sensitive image recognition comes from manual detection, but manual detection is inefficient and costly. There are also rule-based methods and feature-based methods. Rule-based methods usually identify sensitive information by manually defining rules. Due to the complexity and diversity of rules, they cannot cover all sensitive information. Feature-based methods use predefined feature extraction operators, such as edge detection, color distribution, etc., but the performance of these features in different images may be different, resulting in the inability to accurately discover sensitive information. Image sensitive information recognition based on deep learning is to capture image features to achieve automatic detection and recognition of sensitive information. However, deep learning methods are affected by background information, character postures, etc. in the image. In addition, the effectiveness of deep learning models is proportional to the amount of available data. Large-scale massive data will also have the problem of collecting multiple encrypted data sets from multiple sources. This is also prone to the problem of inaccurate image sensitive information recognition and misjudgment and missed judgment. Summary of the invention
[0004] The embodiments of the present application provide a method, system, device and medium for identifying sensitive information in an image, which are used to solve the problem that the identification of sensitive information is not accurate enough and there are false positives and missed positives.
[0005] A first aspect of an embodiment of the present application provides a method for identifying image sensitive information, comprising:
[0006] Obtaining preprocessed image information;
[0007] Constructing a convolutional neural network deep model, and setting a preset candidate area matching the image information based on the convolutional neural network deep model, wherein the preset candidate area includes a first preset candidate area and a second preset candidate area;
[0008] Selecting training samples based on the image information, and inputting the training samples to train the convolutional neural network deep model;
[0009] The image to be recognized acquired in real time is recognized through the trained convolutional neural network to generate the recognition result;
[0010] After segmenting the image sensitive information in the recognition result through threshold segmentation and morphological operation, the target image sensitive information is extracted.
[0011] Furthermore, the selecting training samples based on the image information and inputting the training samples to train the convolutional neural network deep model includes:
[0012] The regions are divided based on the training samples, and the preset candidate regions are matched according to the divided regions, so that the convolutional neural network is trained based on the preset candidate regions using the training samples.
[0013] Furthermore, the generated recognition result includes first region image sensitivity information obtained by recognizing the first preset candidate region and second region image sensitivity information obtained by recognizing the second preset candidate region.
[0014] Furthermore, the obtaining of pre-processed image information includes:
[0015] The preprocessing includes color space conversion, size adjustment, denoising, contrast enhancement and edge detection.
[0016] Furthermore, the size adjustment includes:
[0017] Determine an initial size and a target size of the image information, construct an initial image based on the initial size, and construct a target image based on the target size;
[0018] Determining a mapping relationship between the initial image and the target image, and determining a region corresponding to the target image in the initial image according to the mapping relationship;
[0019] Calculate the weight of each pixel of the target image in the mapping area;
[0020] The pixel values of the target image are calculated according to the weights.
[0021] Furthermore, the expression for calculating the weight of each pixel of the target image in the mapping area is as follows:
[0022]
[0023] Where: A(x′, y′) is the area of the mapping region from the initial image (x, y) to the target image (x′, y′), A total is the total area of the entire mapping region.
[0024] Furthermore, the expression for calculating the pixel value of the target image according to the weight is as follows:
[0025]
[0026] Where: I(x,y) is the pixel value of the initial image at position (x,y), M is the mapping area, and w(x,y) is the weight.
[0027] A second aspect of an embodiment of the present application provides a system for identifying image sensitive information, including:
[0028] An image information acquisition unit, used to acquire preprocessed image information;
[0029] A convolutional neural network deep model construction unit, used to construct a convolutional neural network deep model, and to set a preset candidate area matching the image information based on the convolutional neural network deep model, wherein the preset candidate area includes a first preset candidate area and a second preset candidate area;
[0030] A training sample input unit, used to select training samples based on the image information, and input the training samples to train the convolutional neural network deep model;
[0031] A recognition result generating unit, used to recognize the image to be recognized acquired in real time through a trained convolutional neural network, and generate a recognition result;
[0032] The target image sensitive information extraction unit is used to extract the target image sensitive information after segmenting the image sensitive information in the recognition result through threshold segmentation and morphological operation.
[0033] A third aspect of an embodiment of the present application provides a computer device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein when the processor executes the computer-readable instructions, the steps of the method for identifying image sensitive information as described in any one of the above items are implemented.
[0034] A fourth aspect of an embodiment of the present application provides a readable storage medium, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the method for identifying image sensitive information as described in any one of the above items are implemented.
[0035] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0036] This application first obtains preprocessed image information, builds a convolutional neural network deep model, sets a preset candidate area that matches the preprocessed image information based on the convolutional neural network deep model, then selects training samples based on the image information, inputs the training samples to train the convolutional neural network deep model, then selects training samples based on the image information, inputs the training samples to train the convolutional neural network deep model, and then uses the trained model to recognize the image acquired in real time to generate a recognition result, and finally segments the sensitive image information in the recognition result through threshold segmentation and morphological operations to extract the sensitive information. Setting candidate areas during model training with image training samples, setting corresponding matching areas of the training sample images for feature extraction can reduce model calculation parameters and model size, improve model accuracy, and improve the recognition rate of image sensitive information. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of an embodiment of a method for identifying sensitive information of an image in the present invention;
[0038] Figure 2 It is a schematic flow chart of another embodiment of a method for identifying image sensitive information in the present invention;
[0039] Figure 3 It is a structural block diagram of an embodiment of a system for identifying image sensitive information in the present invention;
[0040] Figure 4 The present invention provides a structural block diagram of a computer device. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0042] In this embodiment, the image sensitive information recognition method is used to improve the recognition rate of image sensitive information. In this embodiment, the implementation method can be implemented in the system, can be implemented in the server, and can also be implemented in the terminal, and the specific details are not clearly limited.
[0043] Embodiment 1
[0044] See also Figure 1 An embodiment of a method for identifying sensitive information of an image according to the present invention comprises the following steps:
[0045] S11. Obtaining preprocessed image information;
[0046] In this embodiment, the image information acquired by the system is a combination of text and images, such as document images, bank card images, etc., where the document images include both text / digital information and photo information of a person, where the text / digital information mainly includes identity information, and sensitive information in the identity information may include name, ID number, and address; sensitive information in a face image may include eyes, nose, and mouth, or sensitive information in a full-body image of a person may include a face picture. For example, a bank card image includes a bank card number, branch name, and background picture, etc., which also contains sensitive information, which will not be elaborated here.
[0047] The channels for obtaining image information are not limited here. Big data collection can be used. The amount of image data collected is huge, the data format is diverse, and the relationship between data is complex. Therefore, after collecting image information, the image needs to be preprocessed, and the preprocessing includes color space conversion, resizing, denoising, contrast enhancement and boundary detection. Color space conversion is to convert the image from RGB color space to other spaces, such as gray space or HSV color space. Using color space conversion can reduce the amount of calculation and storage space in image processing. Resizing is to adjust the image size according to specific application scenarios and needs. Denoising is to remove noise in the image to improve the accuracy of subsequent processing algorithms. Low-pass filters such as median filters and Gaussian filters can be used to remove image noise. Contrast enhancement is to enhance the characteristics of the image by changing the contrast, brightness and color saturation of the image to make it more vivid and clear. Boundary detection is to detect boundary information in the image through various edge detection algorithms, such as Canny detector and Sobel detector, to segment the image and obtain more important features. In addition, there are methods such as rotation, translation, scaling, cropping and tilt correction. These methods can be selected according to application scenarios and needs.
[0048] S12. constructing a convolutional neural network deep model, and setting a preset candidate area matching the image information based on the convolutional neural network deep model, wherein the preset candidate area includes a first preset candidate area and a second preset candidate area;
[0049] The convolutional neural network deep model constructed in this embodiment adopts the G-GhostNet convolutional neural network, wherein preset candidate areas matching the image information are set when constructing the model, and the preset candidate areas include a first preset candidate area and a second preset candidate area, wherein the preset candidate area refers to an area set according to the distinction between images and texts, the first preset candidate area refers to an area in the image that contains digital / text sensitive information features, and the second preset candidate area refers to an area in the image that contains image sensitive information, such as an ID card image information, which contains identity information and a person's upper body photo. When the sample image is input, the corresponding identity information matches the first preset candidate area, and the person's upper body photo matches the second preset candidate area, and deployment training is performed at the same time.
[0050] S13. Select training samples based on image information, and input the training samples to train the convolutional neural network deep model;
[0051] In this embodiment, inputting training samples to train the convolutional neural network deep model includes:
[0052] The training samples are divided into regions, and the preset candidate regions are matched according to the divided regions, so that the convolutional neural network is trained based on the preset candidate regions using the training samples. Specifically, before the training samples are input into the model, the system automatically divides the sample images into regions, wherein the method of dividing the regions is consistent with the preset candidate regions set in the model. For example, when the sample image is an ID card image, the text / numbers are divided into the first region, and the upper body photo of a person is divided into the second region. The divided sample images are then input into the model to match the preset candidate regions.
[0053] S14. Recognize the image to be recognized acquired in real time through the trained convolutional neural network to generate a recognition result;
[0054] Obtain the image information to be identified, input the image into the trained convolutional neural network, and generate the recognition result. The recognition result includes the first region image feature vector obtained by identifying the first preset candidate region and the second region image feature vector obtained by identifying the second preset candidate region. For example, input the ID card image information to be identified, generate text / digital areas respectively, that is, the first region image sensitive information, including the name, the number of the date of birth in the ID card, etc. Generate the face image sensitive information, that is, the second region image sensitive information. Generally, the ID card includes a photo of the upper body of the person, and the sensitive information here includes a photo of the face.
[0055] S15. After segmenting the image sensitive information in the recognition result through threshold segmentation and morphological operation, the target image sensitive information is extracted.
[0056] In this embodiment, after the sensitive information of the image in the recognition result is segmented by threshold segmentation and morphological operation, the sensitive information of the target image is extracted. For example, the name of the text / number part and the important numbers in the ID card image can be extracted, or the image of the face part in the second area can be extracted.
[0057] Specifically, threshold segmentation is to select the segmentation threshold based on the grayscale features of the image, realize the binarization of the image, and convert the image into a black and white binary image. Morphological operations are algorithms such as dilation, corrosion, opening, and closing. The algorithms are used to filter, patch, connect, extract, and other processes after the image is binarized to further eliminate noise, locate the image target, segment sensitive information, and extract the contour of sensitive information. Sensitive information extraction is to detect the edge information in the image with the help of the Canny algorithm and other methods to extract the contour of sensitive data. After obtaining the contour, the sensitive data is framed by a rectangular frame, a circular frame, and the like. According to the results of segmentation and positioning, subsequent processing is performed, such as cutting, saving, encryption, and the like. In this process, it can also be determined whether all sensitive information has been identified. If not all of them have been identified, further image processing can be performed based on information such as the shape, product, and position relationship of the segmented contour to improve the robustness of detection and recognition.
[0058] In the above embodiments, different features are identified respectively by setting preset candidate areas during the model training process, which can greatly reduce the model training calculation process, improve the model accuracy and improve the recognition rate of sensitive information.
[0059] Embodiment 2
[0060] See also Figure 2 , the size adjustment in the preprocessing of the image information in the present invention includes the following steps:
[0061] S111. Determine the initial size and target size of the image information, construct an initial image based on the initial size, and construct a target image based on the target size;
[0062] S112. Determine a mapping relationship between the initial image and the target image, and determine a region corresponding to the target image in the initial image according to the mapping relationship;
[0063] S113. Calculate the weight of each pixel of the target image in the mapping area;
[0064] S114. Calculate pixel values of the target image according to the weights.
[0065] In this embodiment, the size adjustment is to scale the image. If the original size of the image is W×H (width × height) and it needs to be reduced to W′×H′, where W′ < W and H′ < H, then each new pixel needs to obtain information from a region of the original image. Determining the mapping relationship between the initial image and the target image is to determine the mapping relationship between the scaled image and the original image. For each new pixel position (x′, y′), find the corresponding region in the original image. Usually, this region is a rectangle, and its size is proportional to the size of the new pixel. Calculating the weight of each pixel in the target image in the mapping region is to calculate the contribution weight of each pixel (x, y) in the mapping region to the new pixel (x′, y′). The weight is usually based on their positions in the mapping region, and the following expression can be used to calculate the weight:
[0066]
[0067] In the formula: A(x′, y′) is the area of the mapping region from the initial image (x, y) to the target image (x′, y′), and A total is the total area of the entire mapping region.
[0068] Calculating the pixel value of the target image according to the weight is to calculate the value of the new pixel using the above weight. For a grayscale image, the grayscale value expression of the new pixel is as follows:
[0069]
[0070] In the formula: I(x, y) is the pixel value of the initial image at the position (x, y), M is the mapping region, and w(x, y) is the weight.
[0071] For a color image, each pixel has three color channels (usually RGB), and the above process needs to be performed independently for each channel.
[0072] The above embodiment estimates the new pixel value by improving the interpolation method, thereby scaling the image. When reducing the image, it reduces the aliasing effect and maintains the sharpness of the image edge, which is used to improve the accuracy of the training samples.
[0073] Embodiment 3
[0074] Please refer to Figure 3 , an embodiment of an image sensitive information recognition system in the present invention includes the following steps:
[0075] An image information acquisition unit 101, configured to acquire preprocessed image information;
[0076] A convolutional neural network deep model construction unit 102 is used to construct a convolutional neural network deep model, and to set a preset candidate area matching the image information based on the convolutional neural network deep model, wherein the preset candidate area includes a first preset candidate area and a second preset candidate area;
[0077] A training sample input unit 103 is used to select training samples based on image information and input the training samples to train a convolutional neural network deep model;
[0078] The recognition result generating unit 104 is used to recognize the image to be recognized acquired in real time through the trained convolutional neural network to generate a recognition result;
[0079] The target image sensitive information extraction unit 105 is used to extract the target image sensitive information after segmenting the image sensitive information in the recognition result through threshold segmentation and morphological operation.
[0080] For the specific definition of the identification system, please refer to the definition of the identification method above, which will not be repeated here. Each unit module in the above identification system can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above unit modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0081] Embodiment 4
[0082] See also Figure 4 The present invention provides a computer device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the above method are implemented.
[0083] Those of ordinary skill in the art will appreciate that the units of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition of each example has been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0084] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored. In addition, each functional unit in each embodiment of the present invention can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0085] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-0nlyMemory), random access memory (RAM, RandomAccessMemory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.
[0086] It can be understood that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. A method for identifying image sensitive information, characterized in that: include: Obtaining preprocessed image information; Constructing a convolutional neural network deep model, and setting a preset candidate area matching the image information based on the convolutional neural network deep model, wherein the preset candidate area includes a first preset candidate area and a second preset candidate area; Selecting training samples based on the image information, and inputting the training samples to train the convolutional neural network deep model; The image to be recognized acquired in real time is recognized through the trained convolutional neural network to generate the recognition result; After segmenting the image sensitive information in the recognition result through threshold segmentation and morphological operation, the target image sensitive information is extracted.
2. The method for identifying image sensitive information according to claim 1, characterized in that: The selecting training samples based on the image information and inputting the training samples to train the convolutional neural network deep model includes: The regions are divided based on the training samples, and the preset candidate regions are matched according to the divided regions, so that the convolutional neural network is trained based on the preset candidate regions using the training samples.
3. The method for identifying image sensitive information according to claim 2, characterized in that: The generated recognition result includes first region image sensitivity information obtained by recognizing the first preset candidate region and second region image sensitivity information obtained by recognizing the second preset candidate region.
4. The method for identifying image sensitive information according to claim 1, characterized in that: The obtaining of preprocessed image information comprises: The preprocessing includes color space conversion, size adjustment, denoising, contrast enhancement and edge detection.
5. The method for identifying image sensitive information according to claim 4, characterized in that: The size adjustment includes: Determine an initial size and a target size of the image information, construct an initial image based on the initial size, and construct a target image based on the target size; Determining a mapping relationship between the initial image and the target image, and determining a region corresponding to the target image in the initial image according to the mapping relationship; Calculate the weight of each pixel of the target image in the mapping area; The pixel values of the target image are calculated according to the weights.
6. The method for identifying image sensitive information according to claim 5, characterized in that: The expression for calculating the weight of each pixel of the target image in the mapping area is as follows: Where: A(x′, y′) is the area of the mapping region from the initial image (x, y) to the target image (x′, y′), A total is the total area of the entire mapping region.
7. The method for identifying image sensitive information according to claim 5, characterized in that: The expression for calculating the pixel value of the target image according to the weight is as follows: I(x′,y′)=∑ ( x ,y)∈M w(x,y)·I(x,y); Where: I(x,y) is the pixel value of the initial image at position (x,y), M is the mapping area, and w(x,y) is the weight.
8. A system for identifying image sensitive information, characterized in that: include: An image information acquisition unit, used to acquire preprocessed image information; A convolutional neural network deep model construction unit, used to construct a convolutional neural network deep model, and to set a preset candidate area matching the image information based on the convolutional neural network deep model, wherein the preset candidate area includes a first preset candidate area and a second preset candidate area; A training sample input unit, used to select training samples based on the image information, and input the training samples to train the convolutional neural network deep model; A recognition result generating unit, used to recognize the image to be recognized acquired in real time through a trained convolutional neural network, and generate a recognition result; The target image sensitive information extraction unit is used to extract the target image sensitive information after segmenting the image sensitive information in the recognition result through threshold segmentation and morphological operation.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the steps of the method for identifying image sensitive information as described in any one of claims 1 to 7 are implemented.
10. A readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the steps of the method for identifying image sensitive information as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
File digital image optimization sensitive information shielding system fused with image recognition
CN120182796A
