Method and system for hiding encrypted medical image information based on mode and dynamic coding

By adopting the encryption method of pattern matching and dynamic Huffman encoding in DICOM images, the problem of embedding and extracting confidential information in the image is solved, and efficient information hiding and reversible image recovery are achieved.

CN120091087APending Publication Date: 2025-06-03SUZHOU WIND POWER SHIP INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510244564.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently embed and extract confidential information in encrypted DICOM images while ensuring the reversibility and losslessness of the images.

Method used

The encryption method based on pattern matching and dynamic Huffman encoding is adopted to realize the embedding and extraction of confidential information through pixel bit slices, pattern matching, dynamic Huffman encoding and reference error compression, and an encrypted stream is constructed to generate encrypted DICOM images.

Benefits of technology

It significantly improves the embedding capacity of information concealment, ensures reversible extraction of confidential information and lossless recovery of original images, and provides efficient encryption performance and good visual encryption effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120091087A_ABST
    Figure CN120091087A_ABST
Patent Text Reader

Abstract

The invention discloses an encrypted medical image information hiding method and system based on mode and dynamic coding. Under the rapid development of intelligent medical treatment, the fusion degree of information technology and medical treatment is continuously improved, and the safety of confidential information such as physiological data of patients and diagnosis reports of doctors is particularly important. The invention provides a reversible data hiding scheme suitable for encrypting a DICOM image on the basis of a DICOM international standard. By introducing technologies of pixel bit slicing, mode matching, dynamic Huffman coding and the like, a function of embedding confidential information in an encrypted image is realized. After the decryption system obtains the encrypted image, confidential information can be extracted according to the secret key type, or the original medical image is reconstructed in a lossless mode. Experimental results show that compared with an existing most advanced method, the method has remarkable advantages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data encryption and information hiding, and particularly relates to a reversible information hiding method for encrypted DICOM images based on pattern matching and dynamic Huffman coding. Background Art

[0002] In order to protect sensitive information and prevent the abuse of medical data, more and more information security technologies have been widely applied to the field of intelligent healthcare. Among them, data encryption and information hiding, as effective information security technologies, can be applied to various carriers such as text, audio, image, and video.

[0003] Digital Imaging and Communications in Medicine (DICOM) is an international standard in the field of medical imaging, used for storing, transmitting, and managing medical images and related information. It supports data interoperability among various devices such as CT, MRI, and X-ray, and at the same time contains patient information and image data to ensure data compatibility and integrity. DICOM has been widely applied in medical institutions and has become the core foundation of medical imaging informatization. Summary of the Invention

[0004] The object of the present invention is to propose an information hiding method for encrypted medical images based on patterns and dynamic coding. The present invention realizes the function of embedding confidential information in encrypted images by introducing technologies such as pixel bit slicing, pattern matching, and dynamic Huffman coding. After the decryption system obtains the encrypted image, it can extract the confidential information according to the key type or losslessly reconstruct the original medical image.

[0005] The technical solution steps of the present invention are as follows:

[0006] In the first aspect, the present invention provides an information hiding method for encrypted medical images based on patterns and dynamic coding, and its specific steps are as follows:

[0007] S1: Encrypt the confidential information using the information hiding key, perform pixel bit slicing on the original DICOM medical image, and compare it with a preset pattern guide to determine the pattern corresponding to each pixel, and at the same time complete the embedding of the confidential information in the first stage;

[0008] S2: Perform dynamic Huffman coding compression on all patterns according to the occurrence frequencies of the patterns corresponding to all pixels;

[0009] S3: For the last pattern, the method of referring to adjacent pixels is adopted, and further compression is performed by performing a second Huffman coding on the reference error; among the 16-bit data of the pixels represented by the last pattern, the first 4 bits embed confidential information, and the three subsequent 4-bit data segments are different from each other, and are also different from the confidential information of the first 4 bits, and none of them are 4 zero bits.

[0010] S4: Use the image encryption key to encrypt the auxiliary information required for image reconstruction, connect the length information of each part in the auxiliary information, the encrypted auxiliary information, and the encrypted confidential information to obtain an encrypted stream, and construct an encrypted medical image with this encrypted stream.

[0011] As a preference of the first aspect above, the pattern guide contains 25 patterns, which are oooo, oooa, ooao, oaoo, ooaa, oaoa, oaao, ooab, oaob, oabo, ssss, sssa, ssas, sass, ssaa, sasa, saas, ssab, sasb, sabs, saaa, saab, saba, sbaa, sabc in sequence. The corresponding reserved bits are: 0, 4, 4, 4, 4, 4, 4, 8, 8, 8, 0, 4, 4, 4, 4, 4, 4, 8, 8, 8, 4, 8, 8, 8, 12 in sequence. The corresponding freed bits are: 16, 12, 12, 12, 12, 12, 12, 8, 8, 8, 16, 12, 12, 12, 12, 12, 12, 8, 8, 8, 12, 8, 8, 8, 4 in sequence. Where o represents a 4-bit data segment of 0000, s represents the 4-bit confidential information embedded in the first stage, and a, b, and c represent the other 3 different 4-bit data segments except 0000.

[0012] As a preference of the first aspect above, the specific method of S1 is as follows:

[0013] S11: Obtain the original DICOM medical image, where each pixel is 16 bits. Divide the 16-bit data of each pixel into 4 segments through pixel bit slicing, and each 4-bit segment is used to determine a symbol. The 4 symbols together form a pattern. There are four symbols: o, a, b, and c. For each pixel, sequentially traverse the 4 segments of 4-bit data obtained by division. If a 4-bit data segment is 0000, the symbol is determined to be o. If it is not 0000, the symbols a, b, and c are used to represent different 4-bit data segments in sequence.

[0014] S12: Encrypt the confidential information using the information hiding key to obtain the encrypted confidential information bit stream; traverse each pixel of the DICOM medical image in sequence, and according to the predefined pattern guide, match and determine the pattern of each current pixel. If the pattern of the current pixel belongs to one of the top 10 patterns in the pattern guide, directly mark the pattern of the current pixel; if the pattern of the current pixel does not belong to one of the top 10 patterns in the pattern guide, extract a 4-bit confidential information segment from the encrypted confidential information bit stream and embed it into the first 4 most significant bits of the current pixel as the confidential information in the first stage, and mark the sign of the first 4 most significant bits as s. Then, use the five symbols s, o, a, b, and c to re-mark the 3 segments of 4-bit data in the current pixel that have not been embedded with confidential information. Next, according to the predefined pattern guide, determine and mark the pattern of the current pixel based on the re-marked 4 symbols; after marking the patterns of all pixels, determine the reserved bits and free bits corresponding to each pixel according to the pattern guide, where the reserved bits are used to reconstruct the image and the free bits are used to embed confidential information.

[0015] As a preference of the first aspect above, the specific method of S2 is as follows:

[0016] S21: Calculate the frequencies of the patterns corresponding to all pixels in the DICOM medical image, construct a Huffman tree based on the frequencies, and obtain the Huffman codes corresponding to all patterns; calculate the length differences between the free bits of all patterns and the Huffman codes to obtain the pure free bits; compare the pure free bits of each pattern in the Huffman tree except the last pattern sabc with the pure free bits of the last pattern sabc. If the former is less than the latter, change this pattern to the last pattern sabc and regenerate the Huffman tree;

[0017] S22: Dynamically repeat the process of S21 until the pure free bits of all patterns in the Huffman tree except the last pattern sabc are not less than the pure free bits of the last pattern sabc. According to the finally dynamically generated Huffman tree, output the dynamic Huffman code stream corresponding to all pixels to complete the dynamic Huffman coding compression.

[0018] As a preference of the first aspect above, the specific method of S3 is as follows:

[0019] S31: For each pixel of the last pattern in the dynamic Huffman code stream, if this pixel is not in the leftmost column of the DICOM medical image, select the adjacent pixel on its left in the image as its reference pixel; otherwise, select the adjacent pixel above it in the image as its reference pixel. The pixel in the upper left corner of the DICOM medical image does not participate in the reference compression;

[0020] S32: Traverse each pixel that has selected a reference pixel, subtract the current pixel from the reference pixel to obtain a reference error, then calculate the frequencies of all reference errors and construct a Huffman tree based on the frequencies, and finally output the Huffman coding stream of all reference errors to complete the second Huffman coding compression for the last mode.

[0021] Preferably, as in the first aspect above, the specific method of S4 is as follows:

[0022] S41: The auxiliary information is composed of four parts: the reserved bits of each mode in the mode guide, the rules of dynamic Huffman coding compression in S2, the dynamic Huffman coding stream obtained in S2, the rules of the second Huffman coding compression in S3, and the Huffman coding stream of all reference errors obtained in S3. Encrypt the auxiliary information using the image encryption key;

[0023] S43: Use the vacated bits of all pixels as the embedding space, store the length information of each component in the auxiliary information in S41 in plain text at the beginning of the bit stream, connect the encrypted confidential information bit stream and the encrypted auxiliary information bit stream to form an encrypted stream; divide the encrypted stream into 16-bit pixels and construct an encrypted DICOM image according to the original image size.

[0024] In a second aspect, the present invention provides a medical image information decryption system based on pattern matching and dynamic Huffman coding, which includes a data receiving module and a data decryption module;

[0025] The data receiving module is used to receive the encrypted DICOM image generated according to the medical image information hiding method described in any one of the first aspects above;

[0026] The data decryption module is used to, for the received encrypted DICOM image, according to the reverse process of the medical image information hiding method, use the information hiding key and the image encryption key to extract the confidential information and reconstruct the original DICOM image respectively.

[0027] Preferably, as in the second aspect above, the specific method for the data decryption module to extract the confidential information and reconstruct the original DICOM image is as follows:

[0028] S51: After receiving the encrypted DICOM image, read the length information of each component of the auxiliary information stored in plain text at the beginning of the bit stream to determine the positions of the auxiliary information and the confidential information in the bit stream;

[0029] S52: Decrypt and extract the confidential information using the information hiding key;

[0030] S53: Decrypt and extract the auxiliary information using the image encryption key, and decode and extract the patterns corresponding to all pixels according to the dynamic Huffman coding rule and the dynamic Huffman coding stream. According to the pattern guide, extract the reserved bits of other patterns except the last pattern to reconstruct the corresponding pixels. For the last pattern, decode and extract all reference errors according to its Huffman coding rule and Huffman coding stream, and calculate the reconstructed pixels by adding the reference pixels and the reference errors. After processing all pixels, the original DICOM image can be reconstructed.

[0031] In a third aspect, the present invention provides a computer program product, including a computer program / instructions, which, when executed by a processor, can implement the method for encrypting and hiding medical image information based on patterns and dynamic coding as described in any one of the above first aspects.

[0032] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it can implement the method for encrypting and hiding medical image information based on patterns and dynamic coding as described in any one of the above first aspects.

[0033] In a fifth aspect, the present invention provides a computer electronic device, which includes a memory and a processor;

[0034] The memory is used to store a computer program;

[0035] The processor is used to, when executing the computer program, implement the method for encrypting and hiding medical image information based on patterns and dynamic coding as described in any one of the above first aspects.

[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0037] The present invention provides a technical solution combining data encryption and information hiding, and realizes a reversible information hiding method for encrypted DICOM images with a high embedding capacity. This method is based on pattern matching and dynamic Huffman coding technology, and significantly improves the embedding capacity of information hiding while ensuring the encryption performance. Through the method of the present invention, a large amount of confidential information can be embedded in encrypted DICOM images, and it is ensured that the embedded confidential information can be reversibly extracted and the original image can be restored without loss. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a flowchart of the method of the present invention;

[0039] Figure 2 is an effect diagram of the constructed encrypted image;

[0040] Figure 3 is an example diagram of a test image;

[0041] Figure 4 It is a schematic diagram of the modules of a medical image information decryption system based on pattern matching and dynamic Huffman coding;

[0042] Figure 5 It is a schematic diagram of a computer electronic device. Specific implementation manners

[0043] To facilitate the understanding and implementation of the present invention by those of ordinary skill in the art, the following further describes its embodiments with reference to the accompanying drawings. It should be clear that the described embodiments are only one possibility, which is illustrative and explanatory and does not constitute a limitation on the present invention.

[0044] The following further describes in detail the specific implementation manners of the present invention with reference to the accompanying drawings:

[0045] With the rapid development of intelligent medicine, the integration degree of information technology and medicine is continuously improving, and the security of confidential information such as patients' physiological data and doctors' diagnostic reports is particularly important. In view of the above problems, based on the DICOM international standard, the present invention proposes an encrypted medical image information hiding method based on patterns and dynamic coding. The medical images in the present invention are DICOM images with a 16-bit depth, and this format is used to store, transmit, and manage medical images and related information, and can support data interconnection and interoperability for various devices such as CT, MRI, and X-ray. As Figure 1 shown, first, the original image is sliced by pixel bits and matched with a pattern guide to determine the pattern corresponding to each pixel. Then, dynamic Huffman coding is performed on the patterns of all pixels, and the confidential information is embedded using the information hiding key and the image encryption key to construct an encrypted image. During the decryption process, the information hiding key and the image encryption key are used to extract the confidential information and reconstruct the original DICOM image respectively. The following introduces the specific implementation steps of this method in the embodiments of the present invention.

[0046] S1: The electronic medical management system encrypts the confidential information using the information hiding key, slices the original DICOM medical image by pixel bits, and compares it with a preset pattern guide to determine the pattern corresponding to each pixel, and at the same time completes the embedding of the confidential information in the first stage.

[0047] In the present invention, a pattern guide needs to be pre-constructed. The pattern guide contains 25 patterns, which are oooo, oooa, ooao, oaoo, ooaa, oaoa, oaao, ooab, oaob, oabo, ssss, sssa, ssas, sass, ssaa, sasa, saas, ssab, sasb, sabs, saaa, saab, saba, sbaa, sabc in sequence. The corresponding reserved bits are: 0, 4, 4, 4, 4, 4, 4, 8, 8, 8, 0, 4, 4, 4, 4, 4, 4, 8, 8, 8, 4, 8, 8, 8, 12 in sequence. The corresponding freed bits are: 16, 12, 12, 12, 12, 12, 12, 8, 8, 8, 16, 12, 12, 12, 12, 12, 12, 8, 8, 8, 12, 8, 8, 8, 4 in sequence. Wherein, o represents a 4-bit data segment of 0000, s represents the 4-bit confidential information embedded in the first stage, and a, b, and c represent the other 3 different 4-bit data except 0000.

[0048] The above-mentioned pattern guide containing 25 patterns is shown in Table 1. This pattern guide can be used to match and determine the pattern corresponding to each pixel, determine the reserved bits and the freed bits. The reserved bits are used to reconstruct the image, and the freed bits are used to embed confidential information. In Table 1, Pattern 1 is oooo, indicating that 16 bits of this pixel are 0, that is, the pixel value is 0, which means that no information needs to be reserved, the reserved bits are 0, and the freed bits are 16. Patterns 2-4 are oooa, ooao, and oaoo respectively, indicating that a needs to be reserved, accounting for 4 bits, and 12 bits can be freed. Patterns 5-7 are ooaa, oaoa, and oaao respectively. Although a appears twice, only one a needs to be reserved, accounting for 4 bits, and 12 bits can be freed. Patterns 8-10 are ooab, oaob, and oabo respectively, indicating that both a and b need to be reserved, totaling 8 bits, and 8 bits can be freed. For Patterns 1-10, they are used to judge whether to perform the first-stage embedding. Since in a 16-bit depth DICOM image, the effective information of each pixel does not exceed 12 bits, the first 4 most significant bits of the pixel are generally 0000, which can be directly used to embed secret information. If the pattern of a pixel in the DICOM image does not belong to any of Patterns 1-10, then 4 bits of confidential information need to be embedded into the first 4 most significant bits of this pixel, and the first symbol o of this pixel is updated to symbol s after embedding. The other patterns after Patterns 1-10 are used to assist in the second-stage embedding. Patterns 11-20 are similar to Patterns 1-10, and the only difference is that o is replaced by s. Pattern 21 is saaa, where a appears three times, but only one a needs to be reserved, that is, 4 bits, and 12 bits can be freed. Patterns 22-24 are saab, saba, and sbaa respectively, and a and b are reserved for a total of 8 bits, and the number of vacant bits is 8 bits. The last pattern 25 is sabc, which means that among the 16-bit data of the pixel, the first 4 bits are embedded with confidential information, and the latter three 4-bit data are different from each other and are also different from the confidential information of the first 4 bits, that is, they are not all 4 zero bits 0000. The last pattern sabc needs to reserve 12 bits. After encoding the type using dynamic Huffman coding, this pattern will be further compressed for the second time after all patterns are compressed.

[0049] Table 1 Pattern Guide

[0050]

[0051]

[0052] In this embodiment, based on the pattern guide shown in Table 1 above, the specific implementation method of step S1 is as follows:

[0053] S11: Obtain the original DICOM medical image, where each pixel is 16 bits. Divide the 16-bit data of each pixel into 4 segments through pixel bit slicing. Each segment of 4 bits is used to determine a symbol, and 4 symbols together form a pattern. There are four types of symbols: o, a, b, and c. For each pixel, sequentially traverse the 4 segments of 4-bit data obtained by the division. If a segment of 4-bit data is 0000, the symbol is determined to be o. If it is not 0000, the symbols a, b, and c are used to represent different 4-bit data in sequence.

[0054] It should be noted that the symbols a, b, and c here do not specifically refer to the numerical values of a certain 4 bits. They are only used to distinguish the differences between 4-bit data. For example, assume there is 16-bit data, which is denoted as b1, b2, b3, and b4 after being divided into four segments. If b1 is 0000, the symbol is marked as o. Then, determine whether the 4-bit data corresponding to b2 is 0000. If it is, continue to mark the symbol as o. If not, mark the symbol as a. Further assume that the symbol of b2 is marked as a. Then, determine whether the 4-bit data corresponding to b3 is 0000 or the same as the 4-bit data corresponding to b2. If it is 0000, the symbol of b3 is marked as o. If it is the same as the 4-bit data corresponding to b2, the symbol is marked as a. If it is neither 0000 nor the same as the 4-bit data corresponding to b2, the symbol of b3 is marked as b. Further assume that the symbol of b3 is marked as b. Then, determine whether the 4-bit data corresponding to b4 is 0000 or the same as the 4-bit data corresponding to b2 / b3. If it is 0000, the symbol of b3 is marked as o. If it is the same as the 4-bit data corresponding to b2, the symbol is marked as a. If it is the same as the 4-bit data corresponding to b3, the symbol is marked as b. If it is neither 0000 nor the same as the 4-bit data corresponding to b2 and b3, the symbol of b4 is marked as c.

[0055] S12: Encrypt the confidential information using the information hiding key to obtain the encrypted confidential information bitstream; traverse each pixel of the DICOM medical image in sequence, and according to the predefined pattern guide, match and determine the pattern of each current pixel. If the pattern of the current pixel belongs to one of the top 10 patterns in the pattern guide, that is, any one of patterns 1 to 10 in Table 1, directly mark the pattern of the current pixel; if the pattern of the current pixel does not belong to one of the top 10 patterns in the pattern guide, extract a 4-bit confidential information segment (the first unextracted 4-bit segment needs to be extracted) from the encrypted confidential information bitstream and embed it into the first 4 most significant bits of the current pixel, and mark the sign of the first 4 most significant bits as s. Then, re-mark the 3 4-bit data segments in the current pixel that have not been embedded with confidential information with five symbols s, o, a, b, and c. Then, according to the predefined pattern guide, determine and mark the pattern of the current pixel based on the re-marked 4 symbols; after marking the patterns of all pixels, determine the reserved bits and free bits corresponding to each pixel according to the pattern guide, where the reserved bits are used to reconstruct the image and the free bits are used to embed confidential information.

[0056] It should be noted that after marking the sign of the first 4 most significant bits as s, since there may be 4-bit data in the subsequent 3 4-bit data segments that is the same as the confidential information embedded in the first 4 most significant bits, the subsequent 3 4-bit data segments need to be re-marked, and at this time, not only the four symbols o, a, b, and c are used, but the symbol s needs to be added, that is, five symbols s, o, a, b, and c are used for marking.

[0057] S2: Perform dynamic Huffman coding compression on all patterns according to the occurrence frequencies of the patterns corresponding to all pixels.

[0058] In this embodiment, the specific implementation method of step S2 is as follows:

[0059] S21: Calculate the frequencies of the patterns corresponding to all pixels in the DICOM medical image, construct a Huffman tree according to the frequencies, and obtain the Huffman codes corresponding to all patterns; calculate the length difference between the free bits of all patterns and the Huffman codes to obtain the pure free bits; compare the pure free bits of each pattern in the Huffman tree except the last pattern sabc with the pure free bits of the last pattern sabc. If the former is less than the latter, change the pattern to the last pattern sabc and regenerate the Huffman tree.

[0060] S22: Dynamically repeat the process of S21 until the pure vacated bits of all patterns in the Huffman tree except the last pattern sabc are not less than those of the last pattern sabc. According to the finally dynamically generated Huffman tree, output the dynamic Huffman coding stream corresponding to all pixels (formed by the Huffman codes corresponding to the patterns of all pixels), and complete the dynamic Huffman coding compression.

[0061] It should be noted that the rules of the dynamic Huffman coding compression in this step need to be recorded and added to the subsequent auxiliary information. Similarly, the dynamic Huffman coding stream corresponding to all pixels output in this step also needs to be recorded and added to the subsequent auxiliary information.

[0062] S3: For the last pattern, adopt the method of referring to adjacent pixels and further compress by performing the second Huffman coding on the reference error, so as to achieve the re-data compression for the last pattern after the compression in S2.

[0063] In this embodiment, the specific implementation method of step S3 is as follows:

[0064] S31: For each pixel of the last pattern in the dynamic Huffman coding stream, first select the reference pixel rp according to the following formula:

[0065]

[0066] As shown in the above formula, i and j represent the row and column indices of the current pixel p. The principle of selecting the reference pixel in this formula is: if this pixel is not in the leftmost column of the DICOM medical image (i.e., j≠1), then select the adjacent pixel on its left in the image as its reference pixel; if this pixel is in the leftmost column of the DICOM medical image (i.e., j = 1), then there is no pixel on its left for reference, and at this time, select the adjacent pixel above it in the image as its reference pixel. If the current pixel is located in the upper left corner (i.e., i = 1, j = 1), then this pixel is not subjected to reference compression, but the original pixel value is used to replace the reference error to construct the subsequent Huffman tree.

[0067] S32: Traverse each pixel that has selected a reference pixel, and subtract the current pixel p i,j from the reference pixel rp i,j to obtain the reference error e i,j , and the formula is as follows:

[0068] e i,j = p i,j - rp i,j

[0069] After calculating the reference errors of all pixels in the last pattern, calculate the frequencies of all reference errors, construct a Huffman tree based on the frequencies, and finally output the Huffman coding stream of all reference errors to complete the second Huffman coding compression for the last pattern.

[0070] It should be noted that the rules for the second Huffman coding compression in this step need to be recorded and added to the subsequent auxiliary information. Similarly, the Huffman coding stream of the reference errors of all pixels in the last pattern output in this step also needs to be recorded and added to the subsequent auxiliary information.

[0071] S4: Encrypt the auxiliary information required for image reconstruction using the image encryption key, concatenate the length information of each part in the auxiliary information, the encrypted auxiliary information, and the encrypted confidential information to obtain an encrypted stream, and construct an encrypted medical image based on this encrypted stream.

[0072] In the present invention, the length of the information that can be embedded in the image is the total length of the vacated bits of all pixels after compression in S1 to S3.

[0073] In this embodiment, the specific implementation method of step S4 is as follows:

[0074] S41: The auxiliary information consists of four parts: the reserved bits of each pattern in the pattern guide, the rules for dynamic Huffman coding compression in S2, the dynamic Huffman coding stream obtained in S2, the rules for the second Huffman coding compression in S3, and the Huffman coding stream of all reference errors obtained in S3. Encrypt the auxiliary information using the image encryption key.

[0075] S42: Use the vacated bits of all pixels as the embedding space, store the length information of each component in the auxiliary information in S41 in plain text at the beginning of the bit stream, concatenate the encrypted confidential information bit stream and the encrypted auxiliary information bit stream to form an encrypted stream; divide the encrypted stream into pixels of 16 bits each and construct an encrypted DICOM image according to the original image size.

[0076] The above steps S1 to S4 describe the process of generating an encrypted DICOM image by a reversible information hiding method for encrypted DICOM images with pattern matching and dynamic Huffman coding. In this embodiment, for an exemplary DICOM test image, the constructed encrypted DICOM image and its histogram are as Figure 2 shown.

[0077] It should be noted that confidential information such as medical privacy and auxiliary information for image reconstruction should be encrypted using different keys, specifically the information hiding key and the image encryption key. The two keys and the encryption / decryption algorithms can be designed and selected according to the actual situation.

[0078] In an embodiment of the present invention, a medical image information decryption method based on pattern matching and dynamic Huffman coding may be further provided. The specific approach is as follows: After receiving the encrypted DICOM image generated by the electronic medical management system according to the medical image information hiding method of pattern matching and dynamic Huffman coding described in the above S1 - S4 steps, the confidential information can be extracted and the original DICOM image can be reconstructed by using the information hiding key and the image encryption key respectively according to the reverse process of the above medical image information hiding method.

[0079] In this embodiment, the specific method for extracting the confidential information and reconstructing the original DICOM image is as follows:

[0080] S51: After receiving the encrypted DICOM image, read the length information of each component of the auxiliary information stored in plain text at the beginning of the bit stream to determine the positions of the auxiliary information and the confidential information in the bit stream;

[0081] S52: Decrypt and extract the confidential information using the information hiding key;

[0082] S53: Decrypt and extract the auxiliary information using the image encryption key. According to the dynamic Huffman coding rule and the dynamic Huffman coding stream, decode and extract the patterns corresponding to all pixels. According to the pattern guide, extract the reserved bits of other patterns except the last pattern to reconstruct the corresponding pixels. For the last pattern, according to its Huffman coding rule and the Huffman coding stream, decode and extract all reference errors, and calculate the reconstructed pixel p i,j by adding the reference pixel rp i,j and the reference error e i,j as follows:

[0083] p i,j = rp i,j + e i,j

[0084] After processing all pixels, the original DICOM image can be reconstructed.

[0085] It should be further noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described system can refer to the corresponding process in the foregoing method embodiment and will not be elaborated herein. In each embodiment provided in the present application, the division of steps or modules in the system and method is only a logical function division, and there may be other division methods in actual implementation. For example, multiple modules or steps can be combined or integrated together, and one module or step can also be split.

[0086] To further illustrate the technical effects of the present invention, the following specifically demonstrates the experimental results of the proposed method through the test images shown in Figure 3 As shown in Figure 3 . The experimental results of the proposed method are specifically demonstrated by the following test images. As shown in Table 2, this embodiment evaluates the visual quality, encryption performance, and security of the encrypted images. The metrics used include peak signal-to-noise ratio (PSNR), structural similarity (SSIM), number of pixel change rate (NPCR), unified average change intensity (UACI), and information entropy. The experimental results show that both the peak signal-to-noise ratio and the structural similarity approach 0, indicating that the visual quality of the encrypted images is poor and the details of the original images cannot be restored, reflecting a good visual encryption effect. At the same time, the number of pixel change rate and the unified average change intensity are close to the ideal values, indicating that the method has good encryption performance. The information entropy of the encrypted images is close to 16, indicating that the gray-scale distribution is close to being completely random and has high security.

[0087] Table 2 Evaluation of the visual quality, encryption performance, and security of the encrypted images generated by the present invention.

[0088]

[0089] As shown in Table 3, this embodiment evaluates the performance of different coding methods in terms of embedding capacity. The experimental results show that when using fixed-length coding, the average embedding capacity is 6.4757 bpp; after using Huffman coding, effective compression can be achieved, and the average embedding capacity is increased to 8.4928 bpp; while using the dynamic Huffman coding proposed by the present invention, more efficient compression is achieved, and the average embedding capacity is further increased to 8.8826 bpp. This result shows that the dynamic Huffman coding proposed by the present invention has significant advantages in terms of compression performance, and its high-efficiency compression ability directly improves the embedding capacity.

[0090] Table 3 Evaluation of the embedding capacity of different coding methods used in the present invention.

[0091]

[0092] As shown in Table 4, the embedding capacity of the existing reversible information hiding scheme for encrypted DICOM images is compared in this embodiment. For the Dzwonkowski and Rykaczewski scheme [1], when using the (7,4) Hamming code, the average embedding capacity is 1.7143 bpp; when using the (23,12) Golay code, the average embedding capacity is 1.9130 bpp. The average embedding capacity of the Dzwonkowski and Czaplewski scheme [2] is 7.8739 bpp, while the average embedding capacity of the scheme of Panchikkil et al. [3] is 5.8146 bpp. In contrast, the average embedding capacity of the method proposed in the present invention reaches 8.8826 bpp, which is significantly higher than other schemes. Even when compared with the Dzwonkowski and Czaplewski scheme [2] with the highest embedding capacity, the embedding capacity of the present invention is still increased by about 1 bpp. This result shows that the present invention has significant advantages in terms of embedding capacity.

[0093] Table 4 Comparison of the embedding capacity between the present invention and other reversible information hiding schemes for encrypted DICOM images.

[0094]

[0095] The specific practices of the relevant work in the three existing technical schemes [1], [2], and [3] for comparison in Table 4 above can be found in the following literature:

[0096] [1]. Dzwonkowski, M. and Rykaczewski, R., 2021. Reversible data hiding in encrypted DICOM Images using cyclic binary golay(23,12) code. IEEE Access, 9, pp. 60503 - 60515.

[0097] [2]. Dzwonkowski, M. and Czaplewski, B., 2022. Reversible data hiding in encrypted DICOM images using sorted binary sequences of pixels. Signal Processing, 199, p. 108621.

[0098] [3].Panchikkil,S.,Manikandan,V.M.,Pratim Roy,P.,Wang,S.and Zhang,Y.,2024.An adaptive block-wise prediction error-based(AdaBPE)reversible data hiding in encrypted images for medical image transmission.CAAI Transactions on Intelligence Technology.

[0099] Similarly, based on the same inventive concept, the present invention provides a medical image information decryption system based on pattern matching and dynamic Huffman coding, as Figure 4 shown, which includes a data receiving module and a data decryption module;

[0100] The data receiving module is used to receive the encrypted DICOM image generated by the encrypted medical image information hiding method based on pattern and dynamic coding as described above;

[0101] The data decryption module is used to, for the received encrypted DICOM image, according to the reverse process of the encrypted medical image information hiding method based on pattern and dynamic coding, use the information hiding key and the image encryption key to respectively extract the confidential information and reconstruct the original DICOM image. The specific decryption process can be seen in S51 - S53 shown above and will not be elaborated here.

[0102] Similarly, based on the same inventive concept, the present invention provides a computer program product, including computer programs / instructions, which when executed by a processor, can implement the encrypted medical image information hiding method based on pattern and dynamic coding as described above.

[0103] In addition, when the logical instructions in the above-mentioned memory are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.

[0104] Therefore, based on the same inventive concept, the present invention provides a computer-readable storage medium corresponding to an encrypted medical image information hiding method based on patterns and dynamic coding. A computer program is stored on the storage medium, and when the computer program is executed by a processor, the encrypted medical image information hiding method based on patterns and dynamic coding as described above can be implemented.

[0105] Therefore, based on the same inventive concept, as Figure 5 shown, the present invention also provides a computer electronic device corresponding to an encrypted medical image information hiding method based on patterns and dynamic coding provided in the above embodiment. It includes a memory and a processor;

[0106] The memory is used to store a computer program;

[0107] The processor is used to implement the encrypted medical image information hiding method based on patterns and dynamic coding as described above when executing the computer program.

[0108] Specifically, in the computer-readable storage media of the above three embodiments, the computer program stored is executed by the processor, and the steps of the foregoing S1 to S4 can be executed.

[0109] It can be understood that the above storage medium may include a random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory. At the same time, the storage medium may also be various media such as a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc that can store program codes.

[0110] It can be understood that the above processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0111] In addition, it should be noted that those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the foregoing method embodiments, and will not be elaborated here. In the embodiments provided in the present application, the division of steps or modules in the system and method is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or steps can be combined or integrated together, and a module or step can also be split.

[0112] The above embodiments are only the preferred solutions of the present invention and are not used to limit the present invention. Those of ordinary skill in the art can still make various changes, substitutions or improvements without departing from the spirit and scope of the claims of the present invention. Therefore, any technical solutions obtained by equivalent substitution or equivalent transformation shall be regarded as falling within the protection scope of the present invention.

Claims

1. A method for hiding encrypted medical image information based on patterns and dynamic coding, characterized in that: The specific steps are as follows: S1: Encrypt confidential information using information hiding keys, slice pixel bits of original DICOM medical images, and compare them with the preset pattern guide to determine the pattern corresponding to each pixel, completing the first stage of confidential information embedding; S2: Perform dynamic Huffman coding compression on all patterns according to the occurrence frequency of the patterns corresponding to all pixels; S3: For the last pattern, a method of referring to adjacent pixels is adopted to further compress the reference error by performing a second Huffman coding; in the 16-bit data representing the pixel of the last pattern, the first 4 bits are embedded with confidential information, and the following three 4-bit data are different from each other and are all different from the confidential information of the first 4 bits, and are not 4 zero bits; S4: Use the image encryption key to encrypt the auxiliary information required for image reconstruction, connect the length information of each part of the auxiliary information, the encrypted auxiliary information and the encrypted confidential information to obtain an encrypted stream, and use the encrypted stream to construct an encrypted medical image.

2. The encrypted medical image information hiding method based on pattern and dynamic coding according to claim 1 is characterized in that: The mode guide includes 25 modes, namely oooo, oooa, ooao, ooaa, oaoa, oaao, ooab, oaob, oabo, ssss, sssa, ssas, sass, ssaa, sasa, saas, ssab, sasb, sabs, saaa, saab, saba, sbaa, sabc, and the corresponding reserved bits are: 0, 4, 4, 4, 4, 4, 8, 8, The corresponding vacated bits are: 16, 12, 12, 12, 12, 12, 8, 8, 16, 12, 12, 12, 12, 12, 8, 8, 8, 16, 12, 12, 12, 12, 12, 8, 8, 8, 12, 8, 8, 8, 8, 4; where o represents a 4-bit data of 0000, s represents the 4-bit confidential information embedded in the first stage, and a, b, and c represent three different 4-bit data except 0000.

3. The encrypted medical image information hiding method based on pattern and dynamic coding according to claim 2 is characterized in that: The specific method of S1 is as follows: S11: Acquire an original DICOM medical image, where each pixel is 16 bits, and divide the 16-bit data of each pixel into 4 segments by pixel bit slicing, where 4 bits in each segment are used to determine a symbol, and the 4 symbols together constitute a pattern; wherein the symbols are o, a, b, and c, and for each pixel, traverse the 4 segments of 4-bit data obtained by the division in sequence, and if a segment of 4-bit data is 0000, determine that the symbol is o, and if it is not 0000, use symbols a, b, and c to represent different 4-bit data in sequence; S12: Encrypt the confidential information using the information hiding key to obtain an encrypted confidential information bit stream; Traverse each pixel of the DICOM medical image in turn, match and determine the mode of each current pixel according to the predefined mode guide, if the mode of the current pixel belongs to one of the first 10 modes in the mode guide, directly mark the mode of the current pixel; if the mode of the current pixel does not belong to one of the first 10 modes in the mode guide, extract a 4-bit confidential information from the encrypted confidential information bit stream and embed it into the first 4 most significant bits of the current pixel as the confidential information of the first stage, and mark the symbol of the first 4 most significant bits as s, and then re-mark the 3 4-bit data in the current pixel that have not yet been embedded with confidential information with five symbols of s, o, a, b, and c, and then determine the mode of the current pixel based on the re-marked 4 symbols according to the predefined mode guide and mark it; After marking the patterns of all pixels, the reserved bits and vacated bits corresponding to each pixel are determined according to the pattern guide, where the reserved bits are used to reconstruct the image and the vacated bits are used to embed confidential information.

4. The encrypted medical image information hiding method based on pattern and dynamic coding according to claim 3 is characterized in that: The specific method of S2 is as follows: S21: Calculate the frequencies of the patterns corresponding to all pixels in the DICOM medical image, construct a Huffman tree according to the frequencies, and obtain the Huffman codes corresponding to all the patterns; calculate the length difference between the vacated bits of all the patterns and the Huffman codes, so as to obtain the pure vacated bits; compare the pure vacated bits of each pattern except the last pattern sabc in the Huffman tree with the pure vacated bits of the last pattern sabc, if the former is less than the latter, change the pattern to the last pattern sabc, and regenerate the Huffman tree; S22: Dynamically repeat the process of S21 until the pure vacated bits of all modes except the last mode sabc in the Huffman tree are not less than the pure vacated bits of the last mode sabc, and output the dynamic Huffman coding stream of the modes corresponding to all pixels according to the final dynamically generated Huffman tree to complete the dynamic Huffman coding compression.

5. The method for hiding encrypted medical image information based on patterns and dynamic coding according to claim 4 is characterized in that: The specific method of S3 is as follows: S31: for each pixel of the last mode in the dynamic Huffman coding stream, if the pixel is not in the leftmost column of the DICOM medical image, the adjacent pixel on the left of the pixel in the image is selected as the reference pixel, otherwise the adjacent pixel above the pixel in the image is selected as the reference pixel, and the pixel in the upper left corner of the DICOM medical image does not participate in the reference compression; S32: traverse each pixel for which a reference pixel is selected, subtract the current pixel from the reference pixel to obtain a reference error, calculate the frequencies of all reference errors and construct a Huffman tree based on the frequencies, and finally output the Huffman coding stream of all reference errors to complete the second Huffman coding compression for the last mode.

6. The encrypted medical image information hiding method based on pattern and dynamic coding according to claim 5 is characterized in that: The specific method of S4 is as follows: S41: auxiliary information consisting of four parts: the reserved bits of each mode in the mode guide, the rules of dynamic Huffman coding compression in S2, the dynamic Huffman coding stream obtained in S2, the rules of the second Huffman coding compression in S3, and the Huffman coding stream of all reference errors obtained in S3. The auxiliary information is encrypted using the image encryption key; S43: Use the freed bits of all pixels as embedding space, store the length information of each component in the auxiliary information described in S41 in plain text at the beginning of the bit stream, connect the encrypted confidential information bit stream and the encrypted auxiliary information bit stream to form an encrypted stream; divide the encrypted stream into 16 bits per pixel, and construct and generate an encrypted DICOM image according to the original image size.

7. A medical image information decryption system based on pattern matching and dynamic Huffman coding, characterized in that: It includes a data receiving module and a data decryption module; The data receiving module is used to receive the encrypted DICOM image generated according to the medical image information hiding method according to any one of claims 1 to 6; The data decryption module is used to extract confidential information and reconstruct the original DICOM image according to the inverse process of the medical image information hiding method using the information hiding key and the image encryption key for the received encrypted DICOM image.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, it can implement the encrypted medical image information hiding method based on pattern and dynamic coding as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, it can implement the encrypted medical image information hiding method based on pattern and dynamic coding as described in any one of claims 1 to 6.

10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the encrypted medical image information hiding method based on pattern and dynamic coding as described in any one of claims 1 to 6 when executing the computer program.