A privacy protection method based on medical images
Through the target area encryption method based on chaos theory, personal information in medical images is protected, which solves the problem of privacy leakage in medical image data sharing, achieves privacy protection with high security and anti-attack performance, and is suitable for complex network environments. medical data sharing.
Patent Information
- Application Number
- CN202111214455.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-10-19
AI Technical Summary
Medical images can easily leak patients' personal privacy information during the data sharing process. Existing technologies are difficult to effectively protect privacy, especially in complex network environments, resulting in serious challenges to data security.
The target area encryption method based on chaos theory is used to segment, extract, encrypt and embed the target text area in the medical image to ensure that only those with the decryption key can access personal information. The Logistic Chaos Equation is used to generate key parameters. and pixel value scrambling encryption.
It achieves data sharing while protecting user privacy, has high attack resistance, is suitable for complex network environments, and provides protection solutions for different permissions to ensure the security and privacy of medical data.
Smart Images

Figure CN113889232B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image privacy, and in particular to a privacy protection method based on medical images. Background Art
[0002] With the increasing demand for medical image diagnosis and the surge in the number and types of imaging equipment, digital management, storage, transmission and display of patient medical records have greatly improved the efficiency of medical image management, reduced diagnostic costs, and facilitated medical image communication and remote consultation. However, at the same time, whether the patient's personal privacy contained in medical images will be leaked also faces serious challenges.
[0003] In recent years, medical data, as one of the special high-value basic data, is growing at an exponential rate. According to IDC (Internet Data Center, referred to as IDC) research, medical data will reach 35ZB in 2020, among which medical imaging data will grow the fastest. While medical data sharing brings huge value and convenience, it also makes medical data leakage and ransomware incidents occur frequently, which makes the security of medical data closely related to people's livelihood face unprecedented challenges. The privacy and security protection of medical data is imperative.
[0004] When medical images and other data are shared, personal privacy information will be exposed. Therefore, in order to protect the personal information in medical images, a medical image privacy protection method based on chaos theory is proposed. It can be used for privacy protection when sharing medical image information in a complex network environment, and protects user privacy while sharing data. It is a method based on chaotic sequence scrambling the target text area. When sharing medical images, it does not affect the use of data, but also protects personal information. Only people with decryption keys can see the personal information in a specific target area. The target area encryption protection algorithm based on chaos theory has good anti-attack performance and can cope with various online attacks. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a privacy protection method based on medical images. First, the target text area in the medical image is extracted, which is the key area for privacy protection. Then, the information protection of the medical image is completed through a series of operations and transformations, preparing for the subsequent medical image data sharing.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A privacy protection method based on medical images includes the following steps:
[0008] S1. Segment and extract the target text area:
[0009] S1.1. Read the original image and perform preprocessing; the preprocessing includes grayscale conversion, first denoising, image gradient extraction, second denoising, binarization, and image morphological processing of the original image in sequence;
[0010] S1.2. Delineate the target text area contour, and extract the target text area image according to the target text area contour;
[0011] S2. Encrypt the target text area image;
[0012] S3. Embed the encrypted target text area image into the corresponding position of the original image to obtain the encrypted overall image.
[0013] To optimize the above technical solutions, the specific measures taken also include:
[0014] Furthermore, the specific contents of extracting the image gradient in step S1.1 include:
[0015] The horizontal axis of the original image to the right is the x-axis, and the vertical axis of the original image downward is the y-axis. The convolution kernel of the Sobel operator is used. Perform convolution and operation with each pixel in the image to obtain the grayscale derivative f of each pixel in the x-axis direction x , through the convolution kernel of the Sobel operator Perform convolution and operation with each pixel in the image to obtain the grayscale derivative f of each pixel in the y-axis direction y , and according to f x Obtain the grayscale gradient value grad of each pixel in the x-axis direction x According to f y Obtain the grayscale gradient value grad of each pixel in the y-axis direction y ;in,
[0016]
[0017]
[0018]
[0019]
[0020] In the formula, f(i+1,j-1), f(i-1,j-1), f(i+1,j), f(i-1,j), f(i+1,j+1), f(i-1,j+1), f(i,j+1), and f(i,j-1) represent the grayscale values of the surrounding nodes of the 3*3 matrix with (i,j) as the center point; the grayscale value of the pixel at the center point (i,j) of the 3*3 matrix is f(i,j).
[0021] Furthermore, the grayscale gradient value in the x-axis direction of each pixel point is subtracted from the grayscale gradient value in the y-axis direction to obtain an image after the image gradient is extracted.
[0022] Furthermore, the image morphological processing in step S1.1 specifically adopts morphological corrosion processing and morphological dilation processing.
[0023] Furthermore, the specific contents of delineating the target text area outline in step S1.2 include:
[0024] Taking the top left corner of the original image as the origin, the horizontal axis to the right of the origin as the x-axis, and the vertical axis downward from the origin as the y-axis, the outer contour coordinates of the white areas in the original image after preprocessing are extracted, and the area size of each white area is calculated and sorted by number;
[0025] According to the order of numbers, calculate the circumscribed rectangle of each white area according to the coordinates of the outer contour of the white area;
[0026] Four circumscribed rectangles with vertex coordinates of (0,0), (W-1,0), (W-1,H-1), and (0,H-1) are selected, and the area formed by the four circumscribed rectangles is the target text area, and the four circumscribed rectangle borders are the outlines of the target text area; W represents the width of the original image, and H represents the height of the original image.
[0027] Furthermore, the specific contents of encrypting the target text area image in step S2 include:
[0028] S2.1. Determine the key parameter value: Use three Logistic chaos equations x k+1 =μ k x k (1-x k ) to determine the key parameters key1-key7;
[0029] In the formula, x k represents the initial value of the chaos equation, μ k represents the branch parameter of the chaos equation, x k+1 Indicates the next calculated value of the chaos equation; k = 1, 2, 3, when k = 1, that is, x 1+1=μ1x1(1-x1) represents the first chaotic equation. When k=2, that is, x 2+1 =μ2x2(1-x2) represents the second chaotic equation. When k=3, that is, x 3+1 =μ3x3(1-x3) represents the third chaotic equation;
[0030] key1-key3 represent the initial values x of the three chaotic equations respectively k , x k The value range is (0,1); key4-key6 represent the branch parameters μ of the three chaotic equations respectively. k , μ k The value range is (3.5699,4]; key7 indicates the number of encryption times;
[0031] S2.2. Read the target text area image extracted in step S1.2, determine the size of the target text area image according to the width and height of the target text area image, and create an empty matrix A of the same size as the target text area image; and read the pixel points c1(i, j) at each position in the target text area image one by one;
[0032] S2.3. Each time a pixel point at a position in the target text area image is read, the three chaotic equations are simultaneously iterated once to generate three iteration results x k , x k Multiply by the maximum grayscale value 255 and convert it to an integer r k ;
[0033] Where k = 1, 2, 3; when k = 1, the first chaotic equation produces an iterative result x1, and the converted integer is r1; when k = 2, the second chaotic equation produces an iterative result x2, and the converted integer is r2; when k = 3, the third chaotic equation produces an iterative result x3, and the converted integer is r3;
[0034] S2.4. Combine the pixel c1(i,j) at each position of the target text area image read in step S2.2 with the three corresponding integers r generated in step S2.3 k Calculate and obtain the encrypted new pixel value c′1(i,j);
[0035]
[0036] In the formula, mod means remainder operation;
[0037] S2.5. Loop through steps S2.3-S2.4, and load the encrypted pixel value c′1(i, j) obtained each time into the blank matrix A created in step S2.2 according to the read position, to obtain the encrypted target text area image;
[0038] Steps S2.1-S2.5 are repeated to complete the encryption of all target text area images in the original image.
[0039] Furthermore, an incorrect key parameter value is selected to perform an attack test on the image encrypted in step 3 to detect the security of the encrypted image.
[0040] The beneficial effects of the present invention are:
[0041] 1. Based on the existing technology, the present application proposes: (1) denoising, edge characterization and binarization of the original image, and proposes an algorithm to optimize the contour of the target area to complete the segmentation and extraction of the target text area; (2) in order to achieve the protection of the target area, chaos theory is used to complete the encryption processing of the area, and then it is embedded back into the original image, thereby realizing the protection of the personal information of the medical image and facilitating the subsequent data sharing.
[0042] 2. This design can be used in a complex network environment. It is a protection method adopted to achieve medical data sharing without leaking user privacy. It not only protects the target area, but also provides different protections for people with different permissions, thus achieving the sharing of medical data. The whole scheme is simple, highly secure, and anti-attack, making it easy to be accepted by everyone. In practical applications, it can be applied to the privacy protection of medical images in online diagnosis and treatment systems, laying the foundation for remote diagnosis and treatment and data sharing. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of the segmentation and extraction algorithm of the target text area of the present invention.
[0044] Figure 2 It is a schematic diagram of the target text area encryption algorithm flow based on chaos theory of the present invention.
[0045] Figure 3a-3c Schematic diagram of the process of denoising the original image according to the present invention; Figure 3a It is a schematic diagram of the original image of the present invention; Figure 3b It is a schematic diagram of the Gaussian filter template; Figure 3b This is a schematic diagram of the original image after Gaussian denoising.
[0046] Figure 4a-4c Schematic diagram of the gradient calculation process and results of the present invention; Figure 4a It is a schematic diagram of the edge contour in the x direction after the gradient operation; Figure 4b It is a schematic diagram of the edge contour in the y direction after the gradient operation; Figure 4c This is a schematic diagram of the final image edge contour after gradient operation.
[0047] Figure 5 It is a schematic diagram of the result of binarization processing of an image of the present invention.
[0048] Figure 6 It is a schematic diagram of the result of the image being processed by expansion and corrosion according to the present invention.
[0049] Figure 7a-7b is a schematic diagram of target text area segmentation and extraction; Figure 7a It is a schematic diagram of the distribution of the target text area in the original image; Figure 7b are multiple target text area images after segmentation.
[0050] Figure 8 It is a schematic diagram comparing the target text area images and the results of post-encryption processing of the present invention.
[0051] Fig. 9 It is a schematic diagram of the result after the encrypted target text area image is embedded into the original image in the present invention.
[0052] Fig.10 It is a schematic diagram comparing an image of a target text area image after correct decryption and an image after incorrect decryption according to the present invention. DETAILED DESCRIPTION
[0053] The present invention will now be described in further detail with reference to the accompanying drawings.
[0054] This application adopts the following technical solutions:
[0055] Step 1: Segment and extract the target text area. First, perform Gaussian denoising on the original image, then extract the image X and Y gradients to depict the edge, then continue to remove noise and binarize. At this time, in order to optimize the contour of the target text area, continue to perform image morphological processing of expansion and corrosion to obtain a highly connected area, calculate the minimum circumscribed rectangle of its area contour, and define the contour range according to the coordinates, thus completing the extraction of the target text area.
[0056] Step 2: Perform chaotic encryption on the target text area. Based on the chaotic system theory, determine the key parameter list, and then use three Logistics chaotic equations for synchronous iteration, synchronously calculate their chaotic sequences, and perform image scrambling encryption based on pixel value position transformation on the segmented target area.
[0057] Step 3: Embed the scrambled target area back into the original medical image to complete the encryption protection of personal privacy information.
[0058] Step 4: In order to prevent various attacks, several anti-attack experiments were conducted here. First, histogram analysis, information entropy analysis, and adjacent pixel correlation analysis were performed on the target text area before and after encryption. In addition, noise attack and blocking attack were performed on the encrypted target area. Simulation experiments and related analysis show that the algorithm has good anti-attack performance and well protects personal privacy information in medical images.
[0059] Among them, in step 1, segmenting and extracting the target text area is the first step in protecting personal privacy in medical images, because a complete medical image not only displays the image of the patient's examination part, but also displays the relevant text information of the image, such as the patient's name, gender, age, examination time, equipment parameters, etc. These text areas containing the patient's personal information are the target areas to be protected.
[0060] Among them, in step 2, the target text area is chaotically encrypted, the purpose of which is to protect the personal information in the text area, prevent the information from being abused, and thus protect personal privacy. The key to privacy protection here is to rely on a good chaotic encryption algorithm to scramble and encrypt the target area.
[0061] In step 3, the encrypted target area is embedded in the original medical image to complete the security protection of personal privacy information. In this way, only those who have the decryption key can decrypt the target area in the image, see the specific personal information, and obtain all the data. This method not only realizes the privacy protection of medical data, but also can be used to realize data sharing with different permissions.
[0062] Among them, in step 4, in order to verify the effectiveness and anti-attack ability of the proposed method, various anti-attack experiments were carried out. Through various data analysis and simulation tests, the security performance of this medical privacy protection algorithm was verified, and then the effectiveness of the algorithm was explained.
[0063] The following is a detailed description of a preferred embodiment in conjunction with the accompanying drawings:
[0064] 1. Segmentation and detection algorithm of target text area
[0065] Figure 1 The figure shows the segmentation and detection algorithm of the target text area. The algorithm first performs Gaussian denoising on the original image, then extracts the image X and Y direction gradients respectively to depict the edge, and then continues to remove noise and binarize. At this time, in order to optimize the contour of the target text area, the image morphological processing of expansion and corrosion is performed to obtain a region with high connectivity, and the minimum circumscribed rectangle of its region contour is calculated. The contour range is delineated according to the coordinates, and the segmentation and extraction of the target text area is completed.
[0066] The specific implementation process of segmentation and detection of the target text area is as follows:
[0067] (1) After reading the original image, it is necessary to convert it into grayscale, that is, convert the three channels of the image, R, G, and B, into a single-channel grayscale image. The original image, the Gaussian filter template, and the result after Gaussian denoising are shown below. Figure 3a-3c shown.
[0068] In Gaussian denoising, the two-dimensional Gaussian filter function used is shown in formula (1):
[0069]
[0070] Among them, G(x,y) is the gray value of the selected pixel point (x,y); (x,y) is the pixel point coordinates in the two-dimensional plane; x and y are the distances from the pixel point (x,y) to the center point; σ is the standard deviation. If the template size is (2k+1)×(2k+1), G(x,y) is discretized, and the element value at the position (i,j) in the Gaussian kernel is the weight coefficient. The calculation formula is shown in (2):
[0071]
[0072] Where k is the Gaussian kernel radius. The Gaussian denoising result is as follows Figure 3c shown.
[0073] (2) Extracting image gradient and binarization: The edge of an image is the location where the grayscale of the image changes. Therefore, the edge location can be determined by calculating the maximum value of the grayscale derivative. Suppose the grayscale of point P(x,y) in the image is f(x,y), then the grayscale derivative of point P is formula (3):
[0074]
[0075] Since the tangent direction of the edge may be in the x direction, the y direction, or neither the x direction nor the y direction, the edge is often detected by calculating the derivative of the direction in which the grayscale changes fastest. The grayscale gradient value is calculated as: In the image, the minimum value in the x and y directions is 1 pixel, so Δx and Δy are often 1 in the derivation process. The function of the above formula 3 is to obtain the grayscale derivative of the image point, and calculate the grayscale gradient value by calculating the grayscale derivative to determine the edge position. It belongs to the theoretical basis part. This application uses the Soble operator to calculate the gradient value.
[0076] The Sobel operator is a commonly used derivative-based edge detection algorithm that is used to calculate the grayscale approximation of the image brightness function. Based on the grayscale gradient value algorithm, the Sobel operator takes into account the different effects of pixels at different distances on edge determination. The derivatives calculated for close pixels are given higher weights, and the derivatives calculated for distant pixels are given lower weights. In the image, the grayscale derivatives in the x and y directions are calculated using formulas (4) and (5):
[0077]
[0078]
[0079] In the algorithm implementation process, the 3×3 template is used as the kernel to perform convolution and operation with each pixel in the image, and then a suitable threshold is selected to extract the edge. The two convolution kernels of the Sobel algorithm are formula (6):
[0080]
[0081] The gradient in the x and y directions is calculated using the Sobel operator. Figure 4a , 4b As shown, the gradient in the y direction is then subtracted from the x direction. Through this subtraction, the image area with high horizontal gradient and low vertical gradient is left. The result shows that a clearer edge contour is finally depicted, as shown in Figure 4c shown.
[0082] Then use low-pass filtering to smooth the high-frequency noise of the image and replace it with the mean of the surrounding pixels, thereby smoothing and replacing the area with large intensity changes. And perform binarization on the resulting blurred image, that is, divide the image value into two values at a certain boundary, such as Figure 5 shown.
[0083] (3) Image morphological processing: The above results still contain many areas of no interest, and we hope to make the text area smoother and more coherent. Therefore, we need to expand the above area appropriately by performing morphological erosion and dilation respectively.
[0084] The expansion process is defined as:
[0085] B is a convolution template or convolution kernel. The image A (original image) is convolved by template B, each pixel in the image is scanned, and the binary image elements are "or" operated with the template elements. If both are 0, the target pixel is 0, otherwise it is 1. In this way, the maximum value of the regional pixel can be obtained, so that the edge of the image is enlarged and the expansion process is completed.
[0086] The corrosion treatment is defined as:
[0087] Use template B to perform convolution calculation on image A (original image) to obtain the minimum value of the pixel points in the coverage area of B, and use this minimum value to replace the reference point pixel point. The result after performing morphological erosion and dilation processing is as follows Figure 6 shown.
[0088] (4) Divide the contour to achieve segmentation and extraction of the target area
[0089] Use the cv2.findContours() function in OpenCV to extract the outer contour coordinates of all white areas under the black background in the above processing results, and sort and number all white areas by calculating the area size of each area; then traverse the above areas according to the number, calculate the minimum enclosing rectangle of the extracted contour coordinates of each area, and only focus on the four vertices of the minimum enclosing rectangle to draw the detection frame of the area detection in the future. Since the text area of medical images is often located in the four corners of the picture, the target area is locked on the four vertices of the picture. In order to dynamically locate the corner area of the picture according to the change of the picture size, in the actual process we can read the width (W) and height (H) of multiple original pictures, and filter the vertex coordinates of the minimum enclosing rectangle obtained in the above traversal process to determine whether it contains the four points (0, 0), (W-1, 0), (W-1, H-1), and (0, H-1). In this way, the target text area in pictures of different sizes can be dynamically filtered out, and the target extraction results are as follows: Figure 7a As shown in the gray box area in the figure above, the detected area is segmented to obtain the target text area. The segmented area is as follows Figure 7b shown.
[0090] 2. Encryption algorithm for target text area
[0091] For the four text regions in the medical images obtained above, it can be clearly seen that each region contains different information and has a very different area, so it is suitable for Logistic chaotic system to perform encryption based on pixel value transformation. The specific encryption process is as follows: Figure 2 As shown, the execution steps are as follows:
[0092] Step 1: Determine the value of the encryption key parameter list. Here we use three Logistic chaos equations x k+1 =μx k (1-x k) performs synchronous iteration and synchronously calculates its chaotic sequence, where k = 1, 2, 3. The encryption key parameter key contains 7 values, where key1~key3 represent the initial values of the three chaotic equations, and their value range is (0, 1); key4~key6 represent the three chaotic equation branch parameters, and their value range is (3.5699, 4]; key7 represents the number of encryption times. The list of key parameters determined in the embodiment here is as described in Table 1, and this embodiment only needs one encryption, so key7=1. After the key parameters are determined, the pixel value transformation encryption can be performed.
[0093] Table 1 Encryption key parameter list value
[0094]
[0095] Step 2: Read the width (W) and height (H) of the target text area image to obtain the size of the target text area image, and create an empty matrix A of the same size as the target text area image for standby use based on the values of W and H. The width (W) and height (H) of the target text area image are read in a nested loop, and the pixel points c1 (i, j) at each position in the image can be read one by one according to the size of the target text area image, and then encryption operations are performed on them.
[0096] Step 3: Rounding of chaotic sequence values. Each time the above loop is executed, the three equations will simultaneously undergo a chaotic iteration, generating three iteration results x k , due to the chaos value x k It is in the interval (0,1), so it can be regarded as a coefficient, multiplied by the maximum grayscale value 255 and converted to an integer r k , k=1,2,3. In fact, the value calculated by each equation is converted from the interval (0.1) to the integer value of the interval (0,255). For example, if the original value is 0.3, it becomes: 0.3*255=76.5 after processing; rounded to 76, a conversion method, that is, to attach the variables in the chaos equation to the gray value of the image.
[0097] Step 4: For integer r k Perform the operation of adding first and then XOR, that is, Then, it is added to the corresponding pixel value c1(i, j) read, and the remainder is taken, as shown in formula (7), to obtain the encrypted new pixel value c1′(i, j).
[0098] Step 5: Repeat the above steps, and load the encrypted pixel value c1′(i,j) obtained each time into the blank matrix A created in the second step according to the read position, and the encrypted image can be obtained.
[0099] Repeat the above five steps and complete them one by one Figure 7a The image encryption of the four regions is as follows: Figure 8 shown.
[0100] The encrypted target text region images are embedded back into the original medical image to obtain the encrypted results of the medical image text region. Fig. 9 shown.
[0101] 3. Sensitivity Analysis and Anti-Attack Verification
[0102] In order to resist differential attacks, the encrypted image must be very sensitive to the key when decrypted. Key sensitivity means that when decrypting an encrypted image, even if a slightly different wrong key is used, the plaintext image cannot be correctly decrypted. Fig.10 The results of decryption with two keys are shown. Taking one of the text areas as an example, let key1=0.341 in the wrong key list and check its decryption result. Fig.10 As shown, one of the values in the wrong key list differs from the corresponding value in the correct key list by only 0.002, but the decryption result hardly shows any information of the original image, and the decryption fails. This also reflects that the encryption method has high security and personal privacy is effectively protected.
[0103] It should be noted that the terms such as "upper", "lower", "left", "right", "front", "back", etc. cited in the invention are only for the convenience of description and are not used to limit the scope of implementation of the present invention. Changes or adjustments in their relative relationships should be regarded as the scope of implementation of the present invention without substantially changing the technical content.
[0104] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A privacy protection method based on medical images, It is characterized in that The following steps are involved: S1. Segment and extract the target text area: S1.
1. Read the original image and perform preprocessing; the preprocessing includes grayscale conversion, first denoising, image gradient extraction, second denoising, binarization, and image morphological processing of the original image in sequence; S1.
2. Delineate the target text area contour, and extract the target text area image according to the target text area contour; S2. Encrypt the target text area image; the specific contents include: S2.
1. Determine the key parameter value: Use three Logistic chaos equations x k+1 =μ k x k (1-x k ) to determine the key parameters key1-key7; In the formula, x k represents the initial value of the chaos equation, μ k represents the branch parameter of the chaos equation, x k+1 Indicates the next calculated value of the chaos equation; k = 1, 2, 3, when k = 1, that is, x 1+1 =μ 1 x 1 (1-x 1 ) represents the first chaotic equation. When k = 2, that is, x 2+1 =μ 2 x 2 (1-x 2 ) represents the second chaotic equation. When k = 3, that is, x 3+1 =μ 3 x 3 (1-x 3 ) represents the third chaos equation; key1-key3 represent the initial values x of the three chaotic equations respectively k , x k The value range is (0,1); key4-key6 represent the branch parameters μ of the three chaotic equations respectively. k , μ k The value range is (3.5699,4]; key7 indicates the number of encryption times; S2.
2. Read the target text area image extracted in step S1.2, determine the size of the target text area image according to the width and height of the target text area image, and create an empty matrix A of the same size as the target text area image; and read the pixel points c at each position in the target text area image one by one. 1 (i,j); S2.
3. Each time a pixel point at a position in the target text area image is read, the three chaotic equations are simultaneously iterated once to generate three iteration results x k , x k Multiply by the maximum grayscale value 255 and convert it to an integer r k ; Where k = 1, 2, 3; when k = 1, the first chaotic equation produces the iterative result x 1 , the converted integer is r 1 ; When k = 2, the second chaotic equation produces the iterative result x 2 , the converted integer is r 2 ; When k = 3, the third chaotic equation produces the iterative result x 3 , the converted integer is r 3 ; S2.
4. The pixel point c at each position of the target text area image read in step S2.2 1 (i, j) combined with the three integers r generated in step S2.3 k Calculate and obtain the encrypted new pixel value c′ 1 (i,j); In the formula, mod means remainder operation; S2.
5. Repeat steps S2.3-S2.4, and obtain the encrypted pixel value c′ each time. 1 (i, j) is loaded into the blank matrix A created in step S2.2 according to the read position, and the encrypted target text area image can be obtained; Repeat steps S2.1-S2.5 to complete the encryption of all target text area images in the original image; S3. Embed the encrypted target text area image into the corresponding position of the original image to obtain the encrypted overall image.
2. According to the privacy protection method based on medical images as described in claim 1, It is characterized in that The specific contents of extracting the image gradient in step S1.1 include: The horizontal axis of the original image to the right is the x-axis, and the vertical axis of the original image downward is the y-axis. The convolution kernel of the Sobel operator is used. Perform convolution and operation with each pixel in the image to obtain the grayscale derivative f of each pixel in the x-axis direction x , through the convolution kernel of the Sobel operator Perform convolution and operation with each pixel in the image to obtain the grayscale derivative f of each pixel in the y-axis direction y , and according to f x Obtain the grayscale gradient value grad of each pixel in the x-axis direction x According to f y Obtain the grayscale gradient value grad of each pixel in the y-axis direction y ;in, In the formula, f(i+1,j-1), f(i-1,j-1), f(i+1,j), f(i-1,j), f(i+1,j+1), f(i-1,j+1), f(i,j+1), and f(i,j-1) represent the grayscale values of the surrounding nodes of the 3*3 matrix with (i,j) as the center point; the grayscale value of the pixel at the center point (i,j) of the 3*3 matrix is f(i,j).
3. According to the privacy protection method based on medical images as described in claim 2, It is characterized in that The grayscale gradient value in the x-axis direction of each pixel point is subtracted from the grayscale gradient value in the y-axis direction to obtain the image after the image gradient is extracted.
4. According to the privacy protection method based on medical images as described in claim 1, It is characterized in that The image morphological processing described in step S1.1 specifically adopts morphological corrosion processing and morphological dilation processing.
5. According to the privacy protection method based on medical images as described in claim 1, It is characterized in that The specific contents of delineating the target text area outline in step S1.2 include: Taking the top left corner of the original image as the origin, the horizontal axis to the right of the origin as the x-axis, and the vertical axis downward from the origin as the y-axis, the outer contour coordinates of the white areas in the original image after preprocessing are extracted, and the area size of each white area is calculated and sorted by number; According to the order of numbers, calculate the circumscribed rectangle of each white area according to the coordinates of the outer contour of the white area; Four circumscribed rectangles with vertex coordinates of (0,0), (W-1,0), (W-1,H-1), and (0,H-1) are selected, and the area formed by the four circumscribed rectangles is the target text area, and the four circumscribed rectangle borders are the outlines of the target text area; W represents the width of the original image, and H represents the height of the original image.
6. A privacy protection method based on medical imaging according to claim 1, It is characterized in that Select an incorrect key parameter value to perform an attack test on the image encrypted in step 3 to detect the security of the encrypted image.
Citation Information
Cited By
Medical image multi-dimensional dynamic privacy protection method and device and storage medium
CN122245649A
Medical image multi-dimensional dynamic privacy protection method, device and storage medium
CN122245649B
