Hierarchical authorization medical image double-layer encryption method combined with image segmentation

By combining deep learning models and chaotic encryption technology, a two-layer encryption system with hierarchical authorization is implemented for the lesion area, which solves the problems of insufficient protection of the lesion area and inflexible user access control in the existing technology, and achieves precise protection and flexible access control for the lesion area.

CN122205012BActive Publication Date: 2026-08-25HUAQIAO UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610653349.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-13
Publication Date
2026-08-25
Estimated Expiration
2046-05-13

AI Technical Summary

Technical Problem

Existing medical image encryption methods fail to effectively distinguish between lesion areas and non-lesion areas, making it difficult to reflect the high sensitivity and high protection requirements of lesion areas. Furthermore, they lack differentiated access control for different users, making it difficult to meet the security and flexibility requirements of medical images during storage, transmission, and sharing.

Method used

By combining a deep learning model to locate and segment the lesion area, a first-level and a second-level chaotic sequence group is generated. The lesion area is encrypted at the first level, and the entire image is encrypted at the second level, realizing a two-layer encryption with hierarchical authorization. Different levels of decryption results are provided according to user permissions.

Benefits of technology

It achieves precise protection of lesion areas, takes into account the security and flexibility of medical images in the process of storage, transmission and sharing, meets the differentiated access needs of different users, and improves the security and flexibility of image information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122205012B_ABST
    Figure CN122205012B_ABST
Patent Text Reader

Abstract

The application provides a hierarchical authorization medical image double-layer encryption method combined with image segmentation, and relates to the technical field of image communication, and the method comprises the following steps: S10, acquiring an original medical image, performing lesion positioning and segmentation on the original medical image based on a deep learning model to obtain a lesion area and a non-lesion area; S20, generating a primary chaotic sequence group according to the lesion area, and generating a secondary chaotic sequence group according to the original medical image; S30, performing primary encryption on the lesion area by using the primary chaotic sequence group to obtain an encrypted lesion area subgraph; S40, filling the encrypted lesion area subgraph back to the corresponding position in the original medical image according to the position information of the lesion area, and fusing the encrypted lesion area subgraph with the non-lesion area to obtain an intermediate image; and S50, performing secondary encryption on the intermediate image by using the secondary chaotic sequence group to obtain a target ciphertext image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image communication technology, and in particular to a hierarchical authorization method for medical image dual-layer encryption that combines image segmentation. Background Technology

[0002] With the rapid development of medical imaging technology and medical informatization, medical images such as MRI, CT, and X-ray films of brain tumors have been widely used in clinical diagnosis, remote consultation, medical teaching, cloud storage, and medical data sharing. Medical images not only contain patients' anatomical structure and lesion characteristics, but also involve patients' personal privacy and sensitive health data. If these images are leaked, tampered with, or illegally accessed during transmission, storage, or sharing, it will adversely affect patient privacy and clinical treatment activities. Therefore, how to efficiently, securely, and flexibly protect medical images has become an important research issue in the field of medical image information security.

[0003] Most existing image encryption methods are based on traditional cryptographic algorithms or chaotic encryption algorithms, applying uniform encryption to the entire image. Because chaotic systems possess characteristics such as initial value sensitivity, pseudo-randomness, and ergodicity, they can effectively meet the scrambling and diffusion requirements in image encryption, and are therefore widely used in the field of image information security. However, most existing medical image encryption schemes typically employ whole-image encryption, failing to differentiate between lesion areas and non-lesion areas, resulting in all image content being encrypted in the same way. On the one hand, this method fails to reflect the high sensitivity and protection requirements of lesion areas during the diagnostic process; on the other hand, it is also detrimental to addressing the differentiated access needs of different users for image information at different stages of diagnosis and treatment.

[0004] In practical medical applications, different users typically have significantly different access permissions to medical images. For example, in scenarios involving general browsing, preliminary screening, or assisted diagnosis, some medical staff may only need to understand the approximate location, extent, or distribution of lesions; while in scenarios involving core diagnosis, preoperative evaluation, or expert consultation, high-privilege users require access to complete original medical images and detailed information about lesions. Most existing medical image encryption technologies are typically designed for single-user systems, and after decryption, they often only provide either "all visible" or "all invisible" results, lacking the ability to provide tiered display and differentiated protection for users with different permissions, thus failing to meet the actual needs of refined access control for medical images.

[0005] On the other hand, with the development of artificial intelligence technology, deep learning models have demonstrated high accuracy and automation in lesion detection, localization, and segmentation tasks in medical images. Deep learning models can accurately extract the location, boundaries, and mask information of lesion regions, providing a technical foundation for targeted protection of lesion areas. However, in existing technologies, deep learning lesion segmentation results are primarily used for auxiliary diagnosis, lesion identification, or quantitative analysis, and are rarely deeply integrated with subsequent image encryption processes. Summary of the Invention

[0006] This application provides a hierarchical authorization method for medical image encryption with image segmentation, which can provide different levels of decryption results according to user permissions through hierarchical encryption and achieve precise protection of sensitive lesion areas in medical images. It is more in line with medical scenarios and takes into account the security and flexibility of medical images in storage, transmission and sharing.

[0007] The first aspect of this application provides a two-layer encryption method for hierarchical licensing medical images that combines image segmentation, the method comprising: Step S10: Obtain the original medical image, and perform lesion localization and segmentation on the original medical image based on a deep learning model to obtain the lesion area and non-lesion area; Step S20: Generate a primary chaotic sequence group based on the lesion area, and a secondary chaotic sequence group based on the original medical image; Step S30: Use a first-level chaotic sequence group to perform first-level encryption on the lesion region to obtain an encrypted lesion region sub-graph; Step S40: Based on the location information of the lesion area, the encrypted lesion area sub-image is backfilled into the corresponding position in the original medical image, and then fused with the non-lesion area to obtain an intermediate image; Step S50: Use a two-level chaotic sequence group to process the intermediate image. Figure 2 The target ciphertext image is obtained through a multi-level encryption process, which is then used to perform hierarchical processing to grant different levels of access to image information to users at different levels.

[0008] In some embodiments, step S20: generating a primary chaotic sequence group based on the lesion region and a secondary chaotic sequence group based on the original medical image includes: The hash values ​​of the lesion region and the original medical image are calculated using the SHA-512 algorithm. The hash values ​​of both are then converted in format and the initial parameters of the chaotic mapping are calculated to generate a first-level authorization key and a second-level authorization key, respectively. The first-level authorization key and the second-level authorization key are both used as initial parameters for the chaotic mapping and input into the two-dimensional composite chaotic mapping model. The model performs a total preset number of iterations and discards the previous preset number of iterations. After each preset number of iterations, chaotic values ​​are sampled to generate a first-level chaotic sequence group and a second-level chaotic sequence group, which are used for scrambling and diffusion of first-level encryption and second-level encryption, respectively. The expression for the total preset number of times is: ,in, To discard the number of iterations, MN is the size parameter of the original medical image.

[0009] In some embodiments, the hash values ​​of both are subjected to format conversion and chaotic mapping initial parameter calculation to generate a first-level authorization key and a second-level authorization key, respectively, including: The hash value of the lesion area is divided into groups of 8 bits and converted into 64 decimal numbers; The first-level authorization key for hierarchical encryption is calculated based on 64 decimal digits. The hash value of the original medical image is subjected to the same operation as the hash value of the lesion region to obtain a secondary authorization key for hierarchical encryption. Both the primary and secondary authorization keys include chaotic initial values ​​and control parameters.

[0010] In some embodiments, the expression for the two-dimensional composite chaotic mapping model is: ; in, For control parameters, and Let be the horizontal chaos value and the vertical chaos value of the i-th iteration, respectively, and This represents a modulo-1 operation; when the model inputs a level-one authorization key, , , , They are respectively and The initial parameters of the chaotic mapping, when the model is input with the secondary authorization key. , They are respectively and The initial parameters of the chaotic mapping, This is the default value.

[0011] In some embodiments, step S10: acquiring the original medical image, performing lesion localization and segmentation on the original medical image based on a deep learning model to obtain lesion regions and non-lesion regions, including: Step S11: Obtain the original medical image and preprocess the original medical image. The preprocessing includes at least one of normalization, noise reduction and size adjustment to obtain the preprocessed medical image. Step S12: Use a preset deep learning model to locate and segment lesions in the preprocessed medical image to obtain lesion segmentation results; Step S13: Generate a mask corresponding to the lesion area based on the lesion segmentation results; Step S14: Based on the mask corresponding to the lesion area and the lesion area location information output by the deep learning model, the original medical image is divided into regions to obtain lesion areas and non-lesion areas.

[0012] In some embodiments, step S30: using a first-level chaotic sequence group to perform first-level encryption on the lesion region to obtain an encrypted lesion region sub-map, including: Step S31: Convert the lesion region into a lesion matrix to be encrypted. Based on the first-level chaotic sequence group, perform block and rotation processing on the lesion matrix to be encrypted to obtain lesion region block matrices of different shapes with scrambled spatial positions. Step S32: After performing transformation operations on the first-level chaotic sequence group, a new chaotic sequence group is obtained. Based on the new chaotic sequence group, different intra-block rearrangement strategies are applied to the scrambled lesion region block matrices of different shapes to obtain scrambled lesion region block matrices of different shapes. Step S33: Construct a dynamic S-box based on the new chaotic sequence group and the scrambled lesion region block matrix. Update the scrambled lesion region block matrix based on the pixel values ​​of the dynamic S-box. Then perform chain diffusion on the updated matrix to obtain the encrypted lesion region sub-graph.

[0013] In some embodiments, step S32, which involves applying different intra-block rearrangement strategies to the spatially scrambled lesion region block matrices of different shapes based on the new chaotic sequence group to obtain scrambled lesion region block matrices of different shapes, includes: For a square lesion region block matrix with spatially disordered location, the square lesion region block matrix is ​​divided into two regions along the diagonal to obtain an upper triangular region and a lower triangular region. Then, diagonal interpolation is performed according to the corresponding preset rules, and pixel values ​​are extracted and arranged according to the corresponding preset order to obtain the upper right unfolded sequence and the lower left unfolded sequence. Finally, the first and last parts are spliced ​​together to obtain a one-dimensional disordered sequence. Sort the new chaotic sequence group in ascending order to obtain the first-level index sequence; The one-dimensional scrambled sequence is rearranged into a square scrambled lesion region block matrix with the same size as the square lesion region block matrix based on the first-level index sequence. For a rectangular lesion region block matrix with disordered spatial location, it is expanded into a one-dimensional sequence in column priority order; In the new chaotic sequence group, a chaotic subsequence of the length corresponding to the rectangular lesion region block matrix is ​​randomly extracted and sorted in ascending order. Based on the ascending sorted chaotic subsequence, the position of the pixels in the one-dimensional sequence is rearranged to obtain a one-dimensional scrambled sequence, which is then reconstructed into a rectangular scrambled lesion region block matrix in column priority order.

[0014] In some embodiments, step S31, which involves dividing and rotating the matrix of lesions to be encrypted based on a first-order chaotic sequence group to obtain lesion region block matrices of different shapes with scrambled spatial positions, includes: The initial horizontal and vertical block values ​​of the lesion matrix to be encrypted are determined based on the scrambled chaotic sequence and the diffused chaotic sequence of the first-level chaotic sequence group, respectively. Based on the initial horizontal and vertical block values, a generalized Fibonacci block sequence and a generalized Fibonacci block sequence are constructed respectively. The matrix of lesions to be encrypted is then divided into blocks based on the constructed sequences to obtain lesion region block matrices of different shapes. The rotation control value is determined based on the scrambled chaotic sequence. Based on the rotation control value, the lesion region block matrix of different shapes is rotated at different angles to obtain the lesion region block matrix of different shapes with scrambled spatial positions. Step S33 involves constructing a dynamic S-box based on the new chaotic sequence group and the disordered lesion region block matrix, and updating the disordered lesion region block matrix based on the pixel values ​​of the dynamic S-box, including: The pixel values ​​of each pixel in the disordered lesion region block matrix are decomposed into high four bits and low four bits, forming high four-bit matrices and low four-bit matrices respectively. Based on the new chaotic sequence group, an index control sequence group is constructed and sorted in ascending order to obtain a rearranged index sequence group; After rearranging the high four-bit matrix and the low four-bit matrix according to the rearranged index sequence group, the two rearranged matrices are concatenated in binary with the high four bits first and the low four bits last, and combined into an 8-bit binary sequence. An initial dynamic S-box is constructed based on an 8-bit binary sequence. The row and column indices of the initial dynamic S-box are incremented by 1 to obtain the dynamic S-box. Following column-major order, the dynamic S-box is traversed sequentially to find the target pixel at the intersection of the target row and the target column. The target pixel is then used to replace the pixel at the corresponding position in the disordered lesion region block matrix. The dynamic S-box is updated once for each pixel replacement, and the updated dynamic S-box is then used for the replacement of the next pixel position until the pixel replacement operation of the disordered lesion region block matrix is ​​completed, resulting in the updated disordered lesion region block matrix.

[0015] In some embodiments, step S40: Based on the location information of the lesion area, the encrypted lesion area sub-image is backfilled into the corresponding position in the original medical image, and fused with the non-lesion area to obtain the expression of the intermediate image as shown below:

[0016] in, This represents the intermediate image. (r1, c1, r2, c2) represents the location information of the lesion region, i.e., the bounding box of the lesion region; (r1, c1) are the coordinates of the top left corner, and (r2, c2) are the coordinates of the top right corner. This indicates that when the pixel coordinates are within the bounding box of the lesion region, the pixel values ​​of the encrypted lesion region subimage are used. This means that when the coordinates are outside the bounding box, i.e., at other locations, the pixel values ​​of the non-lesion areas of the original medical image are preserved; Step S50: Use a two-level chaotic sequence group to process the intermediate image. Figure 2 Level 1 encryption yields the target ciphertext image, including: Step S51: Use a snake scan to read the pixels of the intermediate image and convert them into a one-dimensional pixel sequence.

[0017] Step S52: Perform transformation operations on the secondary chaotic sequence group to obtain the secondary scrambling control sequence, and obtain the secondary index sequence by sorting the secondary scrambling control sequence in ascending order; Step S53: Use the secondary index sequence to index and scramble the one-dimensional pixel sequence to obtain the scrambled one-dimensional sequence, and then fill the scrambled one-dimensional sequence into a two-dimensional matrix according to the zigzag path to obtain the rearranged image; Step S54: Perform a chain diffusion with dynamic feedback step on the rearranged image to obtain the final target ciphertext image.

[0018] In some embodiments, after obtaining the target ciphertext image in step S50, the method further includes performing hierarchical processing on the target ciphertext image, specifically including: Step S61: Divide medical image access permissions into levels according to user roles. User roles include at least ordinary medical staff users and core diagnosis and treatment users. Step S62: Distribute a secondary decryption key to ordinary medical users, enabling them to perform secondary decryption on the target ciphertext image to obtain the intermediate image; Step S63: Ordinary medical users obtain the location, extent, or distribution information of the lesion area based on the intermediate image, and ordinary medical users cannot recover the complete original medical image; Step S64: Assign a primary decryption key and a secondary decryption key to the core medical user, so that the core medical user first performs secondary decryption on the target encrypted image to obtain an intermediate image, and then performs primary decryption on the encrypted lesion area in the intermediate image to restore the complete original medical image. Step S65: Core diagnostic users perform diagnostic or consultation processes based on the restored complete original medical images.

[0019] Understandably, this application provides a hierarchical, two-layer encryption method for medical images that combines image segmentation. By combining deep learning-based lesion detection and segmentation with a chaotic encryption mechanism, the deep learning model automatically locates and segments lesion regions in the original medical image. Based on the lesion regions and the original medical image, a first-level chaotic sequence group and a second-level chaotic sequence group are generated respectively. Then, the first-level chaotic sequence group is used to perform first-level encryption on the lesion regions, and on this basis, the second-level chaotic sequence group is used to perform second-level encryption on the entire image. Compared with the traditional method of only performing single-layer encryption on the entire image, the hierarchical encryption method of this application can provide different levels of decryption results according to user permissions, thereby achieving precise protection of sensitive lesion regions in medical images, while taking into account the security and flexibility of medical images in the process of storage, transmission, and sharing.

[0020] Furthermore, by encrypting the lesion regions output by the deep learning model, the key texture and morphological features of the lesions can be precisely encrypted, making it more suitable for medical scenarios. Through a deep understanding of the semantics of lesions, a secure channel for on-demand release of diagnostic information is constructed. In this process, the macroscopic existence of lesions can be perceived by low-privilege users for workflow collaboration, while the microscopic diagnostic features of the lesions are strictly protected and only accessible to the final decision-maker. This refined representation of the essence of medical image information demonstrates significant advantages over other general or video surveillance encryption solutions in medical scenarios. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0022] Figure 1 A flowchart illustrating a hierarchical authorization medical image dual-layer encryption method combining image segmentation provided in an embodiment of this application; Figure 2 A schematic diagram of an application scenario for the hierarchical authorization medical image dual-layer encryption method combined with image segmentation provided in the embodiments of this application; Figure 3 A schematic diagram of the segmentation result of the square lesion region block matrix in the hierarchical authorization medical image dual-layer encryption method combined with image segmentation provided in the embodiments of this application; Figure 4 A schematic diagram of the upper triangle operation rules in the hierarchical authorization medical image dual-layer encryption method combined with image segmentation provided in the embodiments of this application; Figure 5 A schematic diagram of the lower triangular operation rules for a hierarchical authorization medical image dual-layer encryption method combining image segmentation provided in an embodiment of this application; Figure 6 This is a schematic diagram of a one-dimensional scrambling sequence for a hierarchical authorization medical image dual-layer encryption method that combines image segmentation, as provided in the embodiments of this application.

[0023] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.

[0025] The terms “first”, “second”, etc. used in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0026] The technical solution of this application and how the technical solution of this application solves the technical problem are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0027] Please see Figure 1 , Figure 1 A flowchart illustrating a hierarchical licensing medical image dual-layer encryption method combining image segmentation provided in this application is shown. This dual-layer encryption method may include the following steps: Step S10: Obtain the original medical image, and perform lesion localization and segmentation on the original medical image based on a deep learning model to obtain the lesion area and non-lesion area.

[0028] In one embodiment, step S10 includes the following steps: Step S11: Obtain the original medical image, and preprocess the original medical image I. The preprocessing includes at least one of normalization, noise reduction and size adjustment to obtain the preprocessed medical image I1.

[0029] Step S12: Use a preset deep learning model to locate and segment lesions in the preprocessed medical image I1 to obtain lesion segmentation result M1.

[0030] Step S13: Generate a mask M2 corresponding to the lesion area based on the lesion segmentation result M1.

[0031] Step S14: Based on the mask M2 corresponding to the lesion area and the lesion area location information output by the deep learning model, the original medical image I is divided into regions to obtain the lesion area R1 and the non-lesion area R2.

[0032] Understandably, this application introduces deep learning image segmentation technology into the encryption process, which can automatically extract key target regions in the image, providing accurate regional information support for subsequent layered encryption. This method reduces the subjectivity and instability of traditional manual region selection, enabling the encryption process to more accurately target sensitive areas and coordinate with subsequent encryption mechanisms, thus balancing intelligent processing capabilities with effective image encryption protection.

[0033] Step S20: Generate a first-level chaotic sequence group based on the lesion area, and generate a second-level chaotic sequence group based on the original medical image.

[0034] Specifically, firstly, the hash values ​​of the lesion region and the original medical image I (I is of size N×N) are calculated using the SHA-512 algorithm. Then, the hash values ​​of both are format-converted and the initial parameters for chaotic mapping are calculated to generate first-level authorization keys. and secondary authorization key .

[0035] In one implementation, the hash values ​​of both are format-converted and chaotic mapping initial parameters are calculated to generate a first-level authorization key and a second-level authorization key, including: Through formula The hash value of the lesion area is divided into groups of 8 bits and converted into 64 decimal numbers. ,in, The grouping index represents the hash value. ,and This indicates how to convert a hexadecimal number to a decimal number. This indicates a binary bit extraction operation.

[0036] The first-level authorization key, calculated using 64 decimal digits, is used as the primary key for hierarchical encryption. This primary key includes the initial chaotic value. and control parameters The calculation formula is as follows:

[0037] Among them, the initial values ​​of chaos include the initial values ​​of horizontal chaos. and vertical chaos initial value , , , and These represent the initial values ​​of chaos, respectively. and control parameters The corresponding initial offset is preset.

[0038] Similarly, the hash value of the original medical image is subjected to an operation that matches the hash value of the lesion region, resulting in a secondary authorization key used for hierarchical encryption. This secondary authorization key includes the chaotic initial value. and control parameters .

[0039] Specifically, the method for generating the secondary authorization key is consistent with the principle of the above-described implementation for generating the primary authorization key. The difference lies in that the source of the secondary authorization key is the original medical image, and the initial offset is... , , and The secondary authorization key includes the chaotic initial value. and control parameters This will not be elaborated upon here.

[0040] Finally, the first-level authorization key and the second-level authorization key are both used as initial parameters for the chaotic mapping and input into the two-dimensional composite chaotic mapping model. The model performs a total preset number of iterations and discards the previous preset number of iterations. After each preset number of iterations, chaotic values ​​are sampled to generate a first-level chaotic sequence group and a second-level chaotic sequence group, which are used for scrambling and diffusion of first-level encryption and second-level encryption, respectively.

[0041] Specifically, the expression for the two-dimensional composite chaotic mapping model (2D-SCCM) is as follows: ; in, For control parameters, and Let be the horizontal and vertical chaotic values ​​of the chaotic value in the i-th iteration, respectively. This represents a modulo-1 operation; when the model inputs a level-one authorization key, , , , They are respectively and The initial parameters of the chaotic mapping, when the model is input with the secondary authorization key. , They are respectively and The initial parameters of the chaotic mapping, This is the default value.

[0042] The expression for the total preset number of times is: .in, To discard the number of iterations, MN is the size parameter of the original medical image; this expression represents the number of iterations to discard. In each iteration, chaotic values ​​are sampled at preset intervals to generate a first-level chaotic sequence group. This first-level chaotic sequence group includes a scrambled chaotic sequence X1 and a diffused chaotic sequence Y1, used for scrambling and diffusion in the first-level encryption. Subsequently, a second-level authorization key is used. Repeat the above steps to generate a first-level chaotic sequence group, which includes a scrambled chaotic sequence X2 and a diffused chaotic sequence Y2, used for scrambling and diffusion in the second-level encryption.

[0043] Understandably, the hash values ​​of the lesion region and the original medical image are calculated using the SHA-512 algorithm to generate first- and second-level chaotic sequence sets. The generation of hash values ​​is independent of image size (fixed output of 512 bits), and the sampling interval and iteration number of the chaotic sequence can be dynamically adjusted according to image parameters without relying on a fixed resolution template.

[0044] Step S30: Use a first-level chaotic sequence group to perform first-level encryption on the lesion region to obtain an encrypted lesion region sub-graph.

[0045] Step S40: Based on the location information of the lesion area, the encrypted lesion area sub-image is backfilled into the corresponding position in the original medical image and fused with the non-lesion area to obtain an intermediate image.

[0046] Specifically, the expression for the intermediate image is as follows:

[0047] in, The image represents the intermediate region. (r1, c1, r2, c2) represents the location information of the lesion region, i.e., the bounding box of the lesion region. (r1, c1) are the coordinates of the top left corner, and (r2, c2) are the coordinates of the top right corner. This indicates that when the pixel coordinates are within the bounding box of the lesion region, the pixel values ​​of the encrypted lesion region subimage are used. This means that when the coordinates are outside the bounding box, i.e., at other locations, the pixel values ​​of the non-lesion areas of the original medical image are preserved.

[0048] Step S50: Use a two-level chaotic sequence group to process the intermediate image. Figure 2The target ciphertext image is obtained through a multi-level encryption process, which is then used to perform hierarchical processing to grant different levels of access to image information to users at different levels.

[0049] Understandably, the above technical solution combines deep learning lesion detection and segmentation with a chaotic encryption mechanism. A deep learning model automatically locates and segments lesion regions in the original medical image. First-level chaotic sequence groups and second-level chaotic sequence groups are generated based on the lesion regions and the original medical image, respectively. Then, the first-level chaotic sequence groups are used for first-level encryption of the lesion regions, and the second-level chaotic sequence groups are used for second-level encryption of the entire image. Compared to traditional methods that only perform single-layer encryption on the entire image, this application's hierarchical encryption method can provide different levels of decryption results based on user permissions, thereby achieving precise protection of sensitive lesion regions in medical images while also ensuring the security and flexibility of medical images during storage, transmission, and sharing.

[0050] Understandably, the above technical solution, by encrypting the mask of the lesion region output by the deep learning model, can effectively encrypt the key texture and morphological features of the lesion, making it more suitable for medical scenarios. Through a deep understanding of the semantics of the lesion, a secure channel for "on-demand release of diagnostic information" is constructed. In this process, the macroscopic existence of the lesion can be perceived by low-privilege users for workflow collaboration, while the microscopic diagnostic features of the lesion are strictly protected and only accessible to the final decision-maker. This refined representation of the essence of medical image information demonstrates significant advantages in medical scenarios compared to other general or video surveillance encryption solutions.

[0051] In some embodiments, step S30: using a first-level chaotic sequence group to perform first-level encryption on the lesion region to obtain an encrypted lesion region sub-map includes the following steps: Step S31: Convert the lesion region into a lesion matrix to be encrypted. Based on the first-level chaotic sequence group, perform block and rotation processing on the lesion matrix to be encrypted to obtain lesion region block matrices of different shapes with scrambled spatial positions.

[0052] Specifically, firstly, the lesion region R1 is converted into a lesion matrix R to be encrypted. 11 The matrix R of lesions to be encrypted is determined based on the scrambled chaotic sequence X1 and the diffused chaotic sequence Y1 of the first-level chaotic sequence group. 11 The initial horizontal block values ​​a1, a2 and the initial vertical block values ​​b1, b2 are given. The expressions for determining the initial horizontal block values ​​a1, a2 and the initial vertical block values ​​b1, b2 are as follows:

[0053] Where W and H are the lesion matrix R to be encrypted, respectively. 11 Width and height, Represents the modulo function. This represents the floor function.

[0054] Secondly, based on the initial horizontal and vertical block values, a horizontal generalized Fibonacci block sequence and a vertical generalized Fibonacci block sequence are constructed respectively, and the constructed sequences are used to encrypt the lesion matrix R. 11 By dividing the area into blocks, we obtain a block matrix R of lesion regions with different shapes. 111。

[0055] Among them, available This represents a horizontal or vertical generalized Fibonacci block sequence. The k-th term represents the horizontal or vertical generalized Fibonacci block sequence, and represents the block size or block index of the lesion matrix to be encrypted. The subsequent terms of the k-th term satisfy the recursive relationship of this formula.

[0056] Next, rotation control values ​​are determined based on the scrambled chaotic sequence X1, and the rotation control values ​​are used to adjust the block matrix R of lesion regions with different shapes. 111 By rotating the matrix at different angles, we obtain a matrix R' of lesion regions with different shapes and spatially disordered locations. 111 .

[0057] Specifically, for the s-th lesion region block matrix R' to be processed 111 Its rotation control value q(s) is generated by the scrambled chaotic sequence X1, and is expressed as: .

[0058] Where X1(s) represents the s-th chaotic value in the scrambled chaotic sequence, floor represents the floor operation, and mod(·,4) represents the modulo operation with respect to 4. The resulting rotation control value q(s)∈{1,2,3,4} corresponds to rotations of 90°, 180°, 270°, and 360°, respectively.

[0059] For example, when the object to be processed is the t-th square lesion region block matrix, let s=t. That is, according to the rotation control value... Rotate the t-th square sub-block by the corresponding angle to obtain the rotated square sub-block. For ease of description, with the t-th square lesion region block matrix fixed, the rotated square lesion region block matrix is ​​represented as:

[0060] Where q(t)∈{1,2,3,4} corresponds to rotations of the square lesion region block matrix by 90°, 180°, 270°, and 360°, respectively; a represents the side length of the rotated square lesion region block matrix; b represents the side length of the rotated square lesion region block matrix. c(i,j) represents the rotated square lesion region block matrix. The pixel value at the i-th row and j-th column, where i,j=1,2,...,a.

[0061] For example, when the object to be processed is the r-th rectangular lesion region block matrix, s=r. That is, based on the rotation control value... Rotate the r-th rectangular lesion region matrix by the corresponding angle to obtain the rotated rectangular lesion region matrix. , , Let represent the length and width of the rotated rectangular lesion region block matrix, respectively. This represents the pixel value at the i-th row and j-th column position in the rotated rectangular lesion region matrix.

[0062] Where q(r)∈{1,2,3,4} corresponds to the rectangular lesion region block matrix rotated by 90°, 180°, 270° and 360° respectively.

[0063] It is understandable that the matrix R'111 of lesion regions of different shapes with disordered spatial locations includes the rotated square lesion region matrix. and rectangular lesion area block matrix .

[0064] It is understandable that for lesion region block matrices R'111 of different shapes, rotating them at different angles by uniformly generating rotation control values ​​through the scrambled chaotic sequence X1 can unify the rotation processing method for lesion region block matrices R'111 of different shapes.

[0065] Step S32: After performing transformation operations on the first-level chaotic sequence group, a new chaotic sequence group is obtained. Based on the new chaotic sequence group, different intra-block rearrangement strategies are applied to the scrambled lesion region block matrices of different shapes to obtain scrambled lesion region block matrices of different shapes.

[0066] Specifically, the formula for the transformation operation is as follows: , in, This represents a new group of chaotic sequences. It is the intermediate value obtained by amplifying, rounding down, and modulo 256 operations on the scrambled chaotic sequence X1 of the first-order chaotic sequence group. It is the intermediate value obtained by amplifying, rounding down, and modulo 256 operations on the diffuse chaotic sequence Y1 of the first-order chaotic sequence group.

[0067] Step S33: Construct a dynamic S-box based on the new chaotic sequence group and the scrambled lesion region block matrix. Update the scrambled lesion region block matrix based on the pixel values ​​of the dynamic S-box. Then perform chain diffusion on the updated matrix to obtain the encrypted lesion region sub-graph.

[0068] Specifically, the expression for the disordered lesion region block matrix is ​​as follows: , This represents the pixel value at the i-th row and j-th column position of the scrambled lesion region block, where m and n represent the number of rows and columns of the scrambled lesion region block, respectively. In one embodiment, step S33 includes the following steps: Step S331: Disorder the lesion region block matrix Each pixel value is decomposed into high four bits and low four bits, forming a high four-bit matrix H and a low four-bit matrix L respectively: , in, This represents the pixel values ​​in the high four-bit matrix H. This represents the pixel values ​​of the lower four-bit matrix H, and .

[0069] Step S332: Construct an index control sequence group based on the new chaotic sequence group and sort it in ascending order to obtain a rearranged index sequence group.

[0070] Specifically, the construction formula for the index-controlled sequence group is as follows: , It is understandable that the index control sequence group includes the row index sequence. and column index sequence Both sequences have a length of mn.

[0071] Next, sort both D1 and D2 in ascending order to obtain the rearranged index sequence group: , in, Represents the sorting function. This is used to wrap multiple values ​​output by the sorting function. The "~" symbol represents a placeholder. It can be understood that the rearranged index sequence group includes the high-order rearranged index sequence. and low-order rearranged index sequence .

[0072] Step S333: After rearranging the high four-bit matrix and the low four-bit matrix according to the rearranged index sequence group, the two rearranged matrices are concatenated in binary with the high four bits first and the low four bits last, and combined into an 8-bit binary sequence.

[0073] Specifically, the high four-dimensional matrix H and the low four-dimensional matrix L are expanded column-wise into a sequence H. vand L v Then rearrange the index sequence according to the high-order digits. and low-order rearranged index sequence Rearrange them separately to obtain the rearranged sequence. and The rearrangement formula is: And respectively the rearranged sequences and Reconstructed The matrices are then rearranged to obtain the high four-dimensional matrices. and low four-dimensional matrix .

[0074] Next, the rearranged high four-dimensional matrix is ​​processed. and low four-dimensional matrix The binary sequence is concatenated element by element, with the most significant four bits first and the least significant four bits last, to obtain the 8-bit binary sequence corresponding to position (i,j). The concatenation formula is as follows:

[0075]

[0076] in, Represents the high four-dimensional matrix pixel elements, This represents the 4-bit binary expansion of the pixel element; Represents the lower four-dimensional matrix pixel elements, This represents the 4-bit binary expansion of the pixel element. This represents the 8-bit binary sequence corresponding to position (i,j).

[0077] Step S334: Construct an initial dynamic S-box based on an 8-bit binary sequence, and increment the row and column indices of the initial dynamic S-box by 1 to obtain the dynamic S-box.

[0078] Specifically, the 8-bit binary sequence B(i,j) is numbered from left to right as positions 1 to 8. Odd-numbered positions are used to form the row index binary string of the initial dynamic S-box, and even-numbered positions are used to form the column index binary string, i.e.:

[0079] in, The binary string representing the row index of the initial dynamic S-box. The binary string representing the column index of the initial dynamic S-box. to It is a single bit of the 8-bit binary sequence B(i,j) corresponding to pixel (i,j) after being split bit by bit. It is the first bit. It is the second bit. It is the 3rd bit. It is the 4th bit. It is the 5th bit. It is the 6th bit. It is the 7th bit. It is the 8th bit.

[0080] Since the decimal range corresponding to a binary string is 0 15. The dynamic S-box uses a 16×16 matrix index, so we increment the row and column indices of the initial dynamic S-box by 1 to obtain the dynamic S-box. The expression for the dynamic S-box is as follows:

[0081] in, This represents the row index of the dynamic S-box. Indicates the column index of the dynamic S-box. This represents the binary to decimal conversion function.

[0082] Step S335: Following column priority, traverse the dynamic S-box sequentially to find the target pixel at the intersection of the target row and the target column in the dynamic S-box. Replace the pixel at the corresponding position in the disordered lesion region block matrix with the target pixel. Update the dynamic S-box once for each pixel replacement. The updated dynamic S-box is then used for the replacement of the next pixel position until the pixel replacement operation of the disordered lesion region block matrix is ​​completed, resulting in the updated disordered lesion region block matrix.

[0083] Specifically, following column priority, i.e., traversing from top to bottom and from left to right, the pixel in the current dynamic S-box at row r(i,j) and column c(i,j) is found, and it replaces the pixel at position (i,j) of the scrambled lesion region block matrix F. The replacement formula is as follows: , in, S represents the pixel at position (i,j) after the scrambled lesion region block matrix F is replaced. t Let S represent the dynamic S-box corresponding to the t-th processing time, where t=1,2,...,mn.

[0084] After each pixel replacement is completed, the dynamic S-box is updated once to obtain the dynamic S-box at the next moment. This is then used to replace the next pixel position. Therefore, for an m×n matrix, a total of m×n dynamic S-box replacement and update operations are performed, thereby establishing a stronger temporal correlation between different pixel positions and enhancing the algorithm's confusion and diffusion capabilities.

[0085] The updated disordered lesion region block matrix after completing the above dynamic S-box replacement: .

[0086] Step S336: Perform chain diffusion on the updated matrix to obtain the encrypted lesion region sub-graph.

[0087] Specifically, the updated disordered lesion region block matrix G is expanded into a one-dimensional sequence T of length N in column-major order:

[0088] Where T(i) is the i-th element obtained after expanding the updated disordered lesion region block matrix G.

[0089] Next, using the new chaotic sequence Z, a dynamic diffusion step size St is generated for each pixel according to the following formula. i This is to achieve randomization of the diffusion path.

[0090]

[0091] Where Z(i) represents the i-th chaotic value in the new chaotic sequence Z, and MaxSt represents the maximum allowed jump range.

[0092] Based on this step size Calculate the jump feedback position Jp at the i-th position of a one-dimensional sequence T. i Since the step size may be greater than the current index, when the feedback position is less than 1, a loop wrapping mechanism is needed to correct the index and remap it to the sequence range. The specific operation is as follows: , Where N is the sequence length, the above processing ensures that the feedback position always maps within the range of valid sequences. The jump feedback position Jp is obtained. i Then, construct the corresponding jump feedback value V(i). When the feedback position is located in the part that has already completed diffusion, take the ciphertext value at the corresponding position as the feedback value; when the feedback position is located in the part that has not yet completed diffusion, take the intermediate sequence value at the corresponding position as the feedback value. Specifically, it is expressed as follows: , Represents the forward mapping function, The above equation represents the mapping function of the original sequence for a one-dimensional sequence. Perform chain diffusion to obtain a one-dimensional output sequence. ,in, , Finally, the one-dimensional output sequence is reconstructed into an m×n matrix to obtain the encrypted lesion region sub-graph E. b : ,in, The pixel represents the encrypted lesion region submap Eb.

[0093] In some embodiments, step S32: after transforming the first-level chaotic sequence group to obtain a new chaotic sequence group, and based on the new chaotic sequence group, applying different intra-block rearrangement strategies to the scrambled lesion region block matrices of different shapes to obtain scrambled lesion region block matrices of different shapes includes the following steps: Step S321: After performing transformation operations on the first-level chaotic sequence group, a new chaotic sequence group is obtained.

[0094] Step S322: Based on the new chaotic sequence group, different intra-block rearrangement strategies are used to obtain scrambled lesion region block matrices of different shapes with different spatial locations.

[0095] Specifically, different intra-block rearrangement strategies are adopted for scrambled lesion region block matrices of different shapes: for square scrambled lesion region block matrices, a secondary diagonal grouping and staggered recombination method is used for expansion; for rectangular scrambled lesion region block matrices, a position rearrangement method based on index matrix sorting is used for scrambling.

[0096] In the implementation of the sub-diagonal grouping and staggered recombination method, for a square lesion region block matrix, the following steps are performed: a1: will Figure 6 Divide the area along the diagonal into two regions, resulting in an upper triangular region and a lower triangular region. Both regions are isosceles triangles. The segmentation result is as follows: Figure 3 As shown.

[0097] a2: Perform diagonal interpolation according to the corresponding preset rules, extract and arrange pixel values ​​according to the corresponding preset order, and then concatenate the upper right and lower left unfolded sequences to obtain a one-dimensional scrambled sequence.

[0098] Specifically, due to the well-partitioned matrix, the number of pixels in each column allows pixels from one horizontal column to be inserted into another. The upper triangular operation rules are as follows: Figure 4 As shown, the sequence obtained after the operation is... The rules for the lower triangle operation are as follows: Figure 5 As shown, the sequence is obtained. .

[0099] Finally, as Figure 6 As shown, expand the sequence in the upper right corner. Expand sequence with lower left By concatenating the first and last parts, we obtain the t-th square lesion region block matrix. The corresponding one-dimensional scrambled sequence:

[0100] Here, ‖ represents the sequence concatenation operation.

[0101] a3: Sort the new chaotic sequence group in ascending order to obtain the first-level index sequence.

[0102] Specifically, for the new chaotic sequence group Sort in ascending order This yields the first-level index sequence. .

[0103] a4: Rearrange the one-dimensional scrambled sequence according to the first-level index sequence to form a square scrambled lesion region block matrix with the same size as the square lesion region block matrix.

[0104] Understandably, according to steps a1 to a4, the rotational diagonal interpolation scrambling process of the t-th square scrambled lesion region block matrix is ​​completed. The lesion matrix R to be encrypted... 11 Repeat steps a1 to a4 above for all the square scrambled lesion region block matrices obtained after block division to obtain the corresponding block-level scrambling results.

[0105] In the implementation of scrambling based on the positional rearrangement method of index matrix sorting, for a rectangular lesion region block matrix, the following steps are performed: b1: Expand the rectangular lesion region block matrix into a one-dimensional sequence in column-major order. The one-dimensional sequence can be defined as D. r The length is L, where L is the total number of elements contained in the rectangular lesion region block matrix.

[0106] b2: Randomly extract a chaotic subsequence of length corresponding to the rectangular lesion region block matrix from the new chaotic sequence group.

[0107] Specifically, the expression for the chaotic subsequence Zr is: , This represents the chaotic subsequence corresponding to the r-th rectangular lesion region block matrix. This represents the pixel value at the p-th position in the chaotic subsequence.

[0108] b3: After sorting the chaotic subsequence in ascending order, the positions of the pixels in the one-dimensional sequence are rearranged based on the sorted chaotic subsequence to obtain a one-dimensional scrambled sequence and reconstruct it into a rectangular scrambled lesion region block matrix in column priority order. This rectangular scrambled lesion region block matrix is ​​a two-dimensional matrix.

[0109] In some embodiments, step S50: The intermediate image is processed using a second-order chaotic sequence group. Figure 2 Level 1 encryption yields the target ciphertext image, including: Step S51: Use a snake scan to read the pixels of the intermediate image and convert them into a one-dimensional pixel sequence.

[0110] Specifically, in a serpentine scan, odd-numbered rows read pixels from left to right, while even-numbered rows read the middle image I from right to left. m The pixels are obtained, thus obtaining a one-dimensional pixel sequence S2 of length m×n.

[0111] Step S52: Perform transformation operations on the secondary chaotic sequence group to obtain the secondary scrambling control sequence, and obtain the secondary index sequence by sorting the secondary scrambling control sequence in ascending order.

[0112] Specifically, the expression for the second-level index sequence is as follows: , The second-level chaotic sequence group includes a scrambled chaotic sequence X2 and a diffused chaotic sequence Y2, where both X2 and Y2 have a length of m×n. After performing transformation operations on these two sequences, the transformed scrambled chaotic sequence X'2 and the diffused chaotic sequence Y'2 are obtained. These two transformed sequences constitute the second-level scrambling control sequence. Next, the secondary scrambling control sequence Sort the data in ascending order to obtain the secondary index sequence index2.

[0113] Step S53: Use the secondary index sequence to scramble the one-dimensional pixel sequence S2 to obtain the scrambled one-dimensional sequence, and then... The image is refilled into a two-dimensional matrix according to the zigzag path to obtain the rearranged image.

[0114] Specifically, the scrambling formula is: .in, This represents a scrambled one-dimensional sequence.

[0115] Step S54: Perform a chain diffusion with dynamic feedback step on the rearranged image to obtain the final target ciphertext image.

[0116] Please see Figure 2 The following uses an application scenario to illustrate some of the above technical content.

[0117] Step S1: Acquire the raw medical image; Step S2: Based on a deep learning model, the original medical image is used to locate and segment lesions, resulting in lesion regions (such as human portrait regions) and non-lesion regions (such as background regions). Step S3: Using the SHA-512 algorithm, calculate the initial chaos value X for the lesion region and the original medical image, respectively. B Y B And the initial chaotic values ​​Xp and Yp, the initial chaotic value X B Y B Combined with control parameter α B Generate a first-level authorization key, initial chaotic values ​​Xp and Yp combined with control parameter α p Generate a secondary authorization key; Step S4: Transfer the Level 1 Authorization Key 、 The secondary authorization keys are all used as initial parameters for the chaotic mapping and input into the two-dimensional composite chaotic mapping model, along with common control parameters. p (corresponding to the two-dimensional composite chaotic mapping model) Output the first-order chaotic sequence group S. B and the second-order chaotic sequence group S P ; Step S5: Divide and rotate the human image region (i.e., execute step S31), and then use the confusion algorithm (i.e., execute step S32) and the diffusion algorithm (i.e., execute step S33) according to the first-level chaotic sequence group S. B Complete regional-level encryption; Step S6: Perform image merging on the encrypted portrait region and background region (i.e., step S40), then sequentially pass through confusion algorithm B (i.e., steps S51, S52, S53) and diffusion algorithm B (i.e., step S54), resulting in a secondary chaotic sequence group S. P The global encryption is completed, and the final output is the target ciphertext image.

[0118] In some embodiments, the target ciphertext image is subjected to hierarchical processing. That is, after obtaining the target ciphertext image in step S50, the double-layer encryption method further includes performing hierarchical processing on the target ciphertext image, specifically including the following steps: Step S61: Divide medical image access permissions into levels according to user roles. User roles include at least ordinary medical staff users and core diagnosis and treatment users.

[0119] Step S62: Distribute a secondary decryption key to ordinary medical users, enabling them to perform secondary decryption on the target ciphertext image E to obtain the intermediate image. Here, I can be used... m Define the intermediate image.

[0120] Step S63: Ordinary medical users obtain the location, extent, or distribution information of the lesion area based on the intermediate image, and ordinary medical users cannot recover the complete original medical image.

[0121] Step S64: Assign a primary decryption key and a secondary decryption key to the core diagnostic and treatment user. The core diagnostic and treatment user first performs secondary decryption on the target encrypted image to obtain an intermediate image, and then performs primary decryption on the encrypted lesion area in the intermediate image to recover the complete original medical image. The original medical image can be defined as I.

[0122] Step S65: Core diagnostic users perform diagnostic or consultation processes based on the restored complete original medical images.

[0123] It is understood that the dual-layer encryption method proposed in this application has good versatility and adaptability, and can be applied to image data of various sizes. It can complete encryption and decryption processing without relying on fixed resolution or specific size templates. For medical images of different sizes and structures, this invention can maintain stable encryption effects and high processing efficiency, thus having stronger engineering application value and promotion potential.

[0124] Specifically, the hash value of the original medical image is calculated using the SHA-512 algorithm, and a first-level / second-level authorization key is generated by combining it with an initial external key, without relying on a fixed resolution template. In the expression for the total preset number of iterations, the size parameter of the original medical image (e.g., N×N) directly participates in the calculation, allowing the chaotic sequence sampling interval and iteration number to be dynamically adjusted according to the image parameters. In step S31, based on the scrambling / diffusion chaotic sequence of the first-level chaotic sequence group, the initial horizontal / vertical block values ​​of the lesion matrix to be encrypted are dynamically determined, and adaptive block division for lesion regions of different sizes is achieved through a generalized Fibonacci block sequence, without the need for a fixed block size template. Step S51 uses a serpentine scan (odd rows from left to right, even rows from right to left) to transform an intermediate image of arbitrary size into a one-dimensional pixel sequence, and combines the transformation operation of the second-level chaotic sequence group to generate a scrambling control sequence that matches the image size, ensuring that index scrambling and chain diffusion can be completed for images of different sizes.

[0125] Steps S61-S65 employ a hierarchical key design (secondary key for decrypting intermediate images, primary key + secondary key for decrypting complete images) to achieve hierarchical access control for medical images with different structures (such as those containing single or multiple lesion regions), and the decryption process does not depend on the original image size.

[0126] Understandably, the two-layer encryption method proposed in this application constructs a novel chaotic sequence generation mechanism / chaotic system and applies it to the image encryption process. This chaotic system possesses good initial value sensitivity, pseudo-randomness, and complex dynamic characteristics, enabling it to generate more complex and unpredictable keystreams for scrambling, spreading, or replacing image pixels. This effectively enhances the complexity of the encryption process, improves the algorithm's resistance to brute-force attacks, statistical analysis, and differential attacks, and further enhances overall encryption security.

[0127] Specifically, the hash value of the original medical image (strongly correlated with the image content) is calculated using the SHA-512 algorithm, and combined with the initial external key to generate a first-level / second-level authorization key, which serves as the initial parameter for the chaotic mapping. The uniqueness of the hash value ensures the sensitivity of the initial parameter to minor changes in the image, reflecting the sensitivity of initial values.

[0128] A composite mapping containing horizontal chaotic values ​​(xi) and vertical chaotic values ​​(yi) is constructed. Complex dynamic behaviors are generated by controlling parameters and modulo operations (modulo 1). The model dynamically generates sequences by a total preset number of iterations (including discarded iterations and sampling intervals) to avoid periodic phenomena and enhance complex dynamic characteristics.

[0129] The first / secondary chaotic sequence groups are generated by "discarding the preset number of iterations + interval sampling". The sampling interval and the total number of iterations are dynamically calculated according to the image size parameter to ensure that the sequence length matches the image size and avoid fixed template dependency.

[0130] The first-level chaotic sequence group (X1, Y1) is used for block rotation of the lesion region (horizontal / vertical generalized Fibonacci block sequence), dynamic S-box construction (based on high / low four-dimensional matrix rearrangement), and chain diffusion (dynamic feedback step size). The second-level chaotic sequence group (X2, Y2) is used for index scrambling and diffusion after the whole image snake scan, realizing differentiated applications of the key stream at different encryption levels. In the first-level encryption, the lesion region is dynamically segmented through a generalized Fibonacci block sequence. Combined with rotation control values ​​(generated based on chaotic sequences), different angle rotations are performed on block matrices of different shapes to destroy the spatial correlation of pixels. The dynamic S-box achieves non-linear replacement of pixel values ​​through high / low four-bit matrix rearrangement and real-time updates, resisting statistical analysis.

[0131] In the first-level encryption, a dynamic diffusion step size (Sti) is generated based on the new chaotic sequence. The feedback position is corrected through a circular wrap-around mechanism, so that the encryption of each pixel depends on the ciphertext values ​​of multiple preceding pixels, thereby enhancing the resistance to differential attacks.

[0132] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A hierarchical authorization method for medical images with dual-layer encryption, combining image segmentation, characterized in that, The methods include: Step S10: Obtain the original medical image, and perform lesion localization and segmentation on the original medical image based on a deep learning model to obtain the lesion region and non-lesion region; Step S20: Generate a primary chaotic sequence group based on the lesion region, and generate a secondary chaotic sequence group based on the original medical image; Step S30: Use the first-level chaotic sequence group to perform first-level encryption on the lesion region to obtain an encrypted lesion region sub-map; Step S31: Convert the lesion region into a lesion matrix to be encrypted, and perform block division and rotation processing on the lesion matrix to be encrypted based on the first-level chaotic sequence group to obtain lesion region block matrices of different shapes with scrambled spatial positions; Step S32: After performing transformation operations on the first-level chaotic sequence group, a new chaotic sequence group is obtained. Based on the new chaotic sequence group, different intra-block rearrangement strategies are applied to the scrambled lesion region block matrices of different shapes to obtain scrambled lesion region block matrices of different shapes. Step S33: Construct a dynamic S-box based on the new chaotic sequence group and the disordered lesion region block matrix, update the disordered lesion region block matrix based on the pixel values ​​of the dynamic S-box, and then perform chain diffusion on the updated matrix to obtain the encrypted lesion region sub-graph. Step S40: Based on the location information of the lesion area, the encrypted lesion area sub-image is backfilled into the corresponding position in the original medical image, and fused with the non-lesion area to obtain an intermediate image; Step S50: Use the second-level chaotic sequence group to perform full-image second-level encryption on the intermediate image to obtain the target ciphertext image, which is used to perform hierarchical processing so that users at different levels can obtain different levels of image information access permissions; Step S51: Use a snake scan to read the pixels of the intermediate image and convert them into a one-dimensional pixel sequence; Step S52: Perform transformation operations on the secondary chaotic sequence group to obtain the secondary scrambling control sequence, and obtain the secondary index sequence by sorting the secondary scrambling control sequence in ascending order; Step S53: Use the secondary index sequence to index and scramble the one-dimensional pixel sequence to obtain a scrambled one-dimensional sequence, and then fill the scrambled one-dimensional sequence into a two-dimensional matrix according to the zigzag path to obtain the rearranged image; Step S54: Perform a chain diffusion with dynamic feedback step size on the rearranged image to obtain the final target ciphertext image.

2. The method according to claim 1, characterized in that, Step S20: Generating a primary chaotic sequence group based on the lesion region and a secondary chaotic sequence group based on the original medical image, including: The hash values ​​of the lesion region and the original medical image are calculated using the SHA-512 algorithm. The hash values ​​of both are then converted in format and the initial parameters of the chaotic mapping are calculated to generate a first-level authorization key and a second-level authorization key, respectively. The first-level authorization key and the second-level authorization key are both used as initial parameters for the chaotic mapping and input into the two-dimensional composite chaotic mapping model. The model performs a total preset number of iterations and discards the previous preset number of iterations. After each preset number of iterations, chaotic values ​​are sampled to generate a first-level chaotic sequence group and a second-level chaotic sequence group, which are used for scrambling and spreading of the first-level encryption and the second-level encryption, respectively. The expression for the total preset number of times is: ,in, To discard the number of iterations, MN is the size parameter of the original medical image.

3. The method according to claim 2, characterized in that, The process of converting the format of both hash values ​​and calculating the initial parameters for chaotic mapping to generate a first-level authorization key and a second-level authorization key respectively includes: The hash value of the lesion area is divided into groups of 8 bits and converted into 64 decimal numbers; The first-level authorization key for hierarchical encryption is calculated based on 64 decimal digits. The hash value of the original medical image is subjected to an operation that matches the hash value of the lesion region to obtain a secondary authorization key for hierarchical encryption. Both the primary and secondary authorization keys include chaotic initial values ​​and control parameters.

4. The method according to claim 2, characterized in that, The expression for the two-dimensional composite chaotic mapping model is: ; in, For control parameters, and Let be the horizontal chaos value and the vertical chaos value of the i-th iteration, respectively, and This represents a modulo-1 operation; when the model inputs a level-one authorization key, , , , They are respectively and The initial parameters of the chaotic mapping, when the model is input with the secondary authorization key. , They are respectively and The initial parameters of the chaotic mapping, This is the default value.

5. The method according to claim 1, characterized in that, Step S10: Acquire the original medical image, and perform lesion localization and segmentation on the original medical image based on a deep learning model to obtain lesion regions and non-lesion regions, including: Step S11: Obtain the original medical image and preprocess the original medical image. The preprocessing includes at least one of normalization, noise reduction and size adjustment to obtain the preprocessed medical image. Step S12: Use a preset deep learning model to locate and segment lesions in the preprocessed medical image to obtain lesion segmentation results; Step S13: Generate a mask corresponding to the lesion region based on the lesion segmentation results; Step S14: Based on the mask corresponding to the lesion area and the lesion area location information output by the deep learning model, the original medical image is divided into regions to obtain lesion areas and non-lesion areas.

6. The method according to claim 1, characterized in that, The method, based on the new chaotic sequence group, employs different intra-block rearrangement strategies to obtain scrambled lesion region block matrices of different shapes at spatially disordered locations, including: For a square lesion region block matrix with spatially disordered location, the square lesion region block matrix is ​​divided into two regions along the diagonal to obtain an upper triangular region and a lower triangular region. Diagonal interpolation is performed according to the corresponding preset rules, and pixel values ​​are extracted and arranged according to the corresponding preset order to obtain the upper right unfolded sequence and the lower left unfolded sequence. Then, the first and last parts are spliced ​​together to obtain a one-dimensional disordered sequence. Sort the new chaotic sequence group in ascending order to obtain the first-level index sequence; The one-dimensional scrambled sequence is rearranged into a square scrambled lesion region block matrix with the same size as the square lesion region block matrix based on the first-level index sequence. For a rectangular lesion region block matrix with disordered spatial location, it is expanded into a one-dimensional sequence in column priority order; In the new chaotic sequence group, a chaotic subsequence of the length corresponding to the rectangular lesion region block matrix is ​​randomly extracted and sorted in ascending order. Based on the ascending sorted chaotic subsequence, the position of the pixels in the one-dimensional sequence is rearranged to obtain a one-dimensional scrambled sequence, which is then reconstructed into a rectangular scrambled lesion region block matrix in column priority order.

7. The method according to claim 1, characterized in that, The step S31, which involves dividing and rotating the matrix of lesions to be encrypted based on a first-order chaotic sequence group to obtain lesion region block matrices of different shapes with scrambled spatial positions, includes: The initial horizontal and vertical block values ​​of the lesion matrix to be encrypted are determined based on the scrambled chaotic sequence and the diffused chaotic sequence of the first-level chaotic sequence group, respectively. Based on the initial horizontal and vertical block values, a generalized Fibonacci block sequence and a generalized Fibonacci block sequence are constructed respectively. The lesion matrix to be encrypted is then divided into blocks based on the constructed sequences to obtain lesion region block matrices of different shapes. Based on the scrambled chaotic sequence, a rotation control value is determined. Based on the rotation control value, different shapes of lesion region block matrices are rotated at different angles to obtain lesion region block matrices of different shapes with scrambled spatial positions. Step S33, which involves constructing a dynamic S-box based on the new chaotic sequence group and the disordered lesion region block matrix, and updating the disordered lesion region block matrix based on the pixel values ​​of the dynamic S-box, includes: The pixel values ​​of each pixel in the disordered lesion region block matrix are decomposed into high four bits and low four bits, forming a high four-bit matrix and a low four-bit matrix respectively. Based on the new chaotic sequence group, an index control sequence group is constructed and sorted in ascending order to obtain a rearranged index sequence group; After rearranging the high four-bit matrix and the low four-bit matrix according to the rearranged index sequence group, the two rearranged matrices are concatenated in binary with the high four bits first and the low four bits last, and combined into an 8-bit binary sequence. An initial dynamic S-box is constructed based on an 8-bit binary sequence. The row and column indices of the initial dynamic S-box are incremented by 1 to obtain the dynamic S-box. Following column priority, the dynamic S-box is traversed sequentially to find the target pixel at the intersection of the target row and the target column. The target pixel is then used to replace the pixel at the corresponding position in the disordered lesion region block matrix. The dynamic S-box is updated once for each pixel replacement, and the updated dynamic S-box is then used for the replacement of the next pixel position until the pixel replacement operation of the disordered lesion region block matrix is ​​completed, resulting in the updated disordered lesion region block matrix.

8. The method according to claim 1, characterized in that, Step S40: Based on the location information of the lesion area, the encrypted lesion area sub-image is backfilled into the corresponding position in the original medical image, and fused with the non-lesion area to obtain the expression of the intermediate image as shown below: in, The image represents the intermediate image. (r1, c1, r2, c2) represents the location information of the lesion region, i.e., the bounding box of the lesion region; (r1, c1) are the coordinates of the upper left corner, and (r2, c2) are the coordinates of the upper right corner. This indicates that when the pixel coordinates are within the bounding box of the lesion region, the pixel value of the encrypted lesion region sub-image is used. This means that when the coordinates are outside the bounding box, i.e., at other locations, the pixel values ​​of the non-lesion area in the original medical image are retained.

9. The method according to claim 1, characterized in that, After obtaining the target ciphertext image in step S50, the method further includes performing hierarchical processing on the target ciphertext image, specifically including: Step S61: Divide medical image access permissions into levels according to user roles, where the user roles include at least ordinary medical staff users and core diagnosis and treatment users; Step S62: Assign a secondary decryption key to the ordinary medical user, enabling the ordinary medical user to perform secondary decryption on the target ciphertext image to obtain the intermediate image; Step S63: The ordinary medical user obtains the location information, range information or distribution information of the lesion area based on the intermediate image, and the ordinary medical user cannot recover the complete original medical image; Step S64: Assign a primary decryption key and a secondary decryption key to the core medical user, so that the core medical user first performs secondary decryption on the target encrypted image to obtain the intermediate image, and then performs primary decryption on the encrypted lesion area in the intermediate image to restore the complete original medical image; Step S65: The core diagnostic and treatment user performs diagnosis or consultation based on the restored complete original medical images.

Citation Information

Patent Citations

  • Robust video zero-watermarking method based on polar complex exponential transformation and residual neural network

    CN111984942A

  • Color image encryption method and device

    CN120186277A