A medical image encryption retrieval method

CN118171309BActive Publication Date: 2024-09-06SUZHOU HEALTH & FAMILY PLANNING STATISTICS INFORMATION CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410609996.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2024-09-06
Estimated Expiration
2044-05-16

Smart Images

  • Figure CN118171309B
    Figure CN118171309B
Patent Text Reader

Abstract

The present application discloses a method for encrypted retrieval of medical images, including: when receiving a ciphertext image from an image owner, decrypting the image to be stored using a first private key, and in a secure computing environment: obtaining a first feature vector of the image to be stored and converting it into a binary code; dividing the image and the first feature vector into multiple subsets according to the size of the binary code and a preset subset size benchmark, and each subset is assigned a unique label; when receiving a ciphertext image from an image retriever, decrypting the query image, and in a secure computing environment: obtaining a second feature vector of the query image and converting it into a binary code; matching it to a target subset according to the subset unique label; determining a candidate image set according to the similarity between the second feature vector and the first feature vector in the target subset and encrypting and transmitting it to the image retriever. In this way, the efficiency and accuracy of image retrieval can be improved while ensuring the security of images and image features, and the computational cost during retrieval can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image retrieval, and in particular to a method for encrypting and retrieving medical images. Background Art

[0002] With the development of cloud computing and cloud storage, more and more images are stored in the cloud to overcome the problem of insufficient local data storage capacity. However, the large number of stored images causes inconvenience to users when searching. In addition, some images contain users' private information, such as medical images in the medical field. If medical images are maliciously leaked, it will have a serious negative impact on patients. Therefore, the security of these image data needs to be improved.

[0003] Public cloud or private cloud services provide enterprises or individuals with cost-effective storage and basic application (such as retrieval) services. However, it is worth considering whether the providers of these services are trustworthy and whether their security protection capabilities can resist external attacks. Medical images contain a large amount of private information of patients. If security measures are not taken effectively, they cannot be provided for use. At the same time, the effective use of medical images is very important. For image retrieval services, doctors can quickly compare and draw conclusions on medication by looking for similar images, and patients can also obtain medication results for similar cases based on their own images (in this scenario, the patient's own images also need to prevent the service provider from obtaining them without authorization). Therefore, it is necessary to consider a medical image encryption retrieval method that can not only protect the image, but also provide efficient and accurate retrieval services, and can also ensure the security of the images used in retrieval queries. Summary of the invention

[0004] This application provides a medical image encryption retrieval method, which can improve the efficiency and accuracy of image retrieval and reduce the computational cost during retrieval while ensuring the security of images and image features.

[0005] The present application provides a medical image encryption retrieval method, which is applied to a retrieval service provider and integrates a secure computing environment provided by a security service provider through an encapsulation interface. The method includes:

[0006] When receiving the encrypted image transmitted by the image owner, transmitting it to the secure computing environment through the encapsulation interface, and decrypting the encrypted image using the first private key to obtain the image to be stored, including:

[0007] S201, obtaining a first feature vector of an image to be stored; S202, converting the first feature vector into a binary code using a preset hash algorithm; S203, dividing all binary code corresponding images and the first feature vector into a plurality of subsets according to the size of all binary codes and a preset subset size benchmark, each subset being assigned a unique label including a subset number, an interval range of the binary code, and a discrete degree value of the binary code;

[0008] When the ciphertext image transmitted by the image searcher is received, it is transmitted to the secure computing environment through the encapsulation interface, and the ciphertext image is decrypted using the first private key to obtain the query image and the symmetric key, including:

[0009] S401, obtaining a second feature vector of the query image;

[0010] S402, converting the second feature vector into a binary code using a preset hash algorithm;

[0011] S403, determining, according to the unique labels of all subsets, a subset corresponding to a binary code interval range matched by the binary code of the second feature vector as a target subset;

[0012] S404, calculating the similarity between the second feature vector and the first feature vector of the image in the target subset by Euclidean distance, and determining a candidate image set according to the similarity;

[0013] S405, encrypting the candidate image set with a symmetric key and transmitting it to the image searcher.

[0014] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0015] Through the secure computing environment and trusted hardware technology created by the security service provider for the retrieval service provider, all programs involved in the image encryption retrieval method are encapsulated into a container that does not require network access and uploaded to the secure computing environment. This not only ensures the confidentiality of data during image processing and retrieval, effectively prevents the transmission and storage of images and their feature information in plain text, avoids private leakage, but also simplifies the deployment and maintenance process of multi-party secure computing systems in existing technologies, reducing operating and computing costs;

[0016] The image feature vector is converted into a binary code using a preset hash algorithm and divided into subsets according to its size. Images with the same or similar binary codes are divided into a subset as much as possible. When searching, the binary code of the query image is directly used to locate the subset that is roughly similar to it, which narrows the search scope. It only needs to calculate the similarity within the subset without traversing the entire image library, which greatly reduces the cost of subsequent similarity calculations for searched images and improves the search efficiency.

[0017] By setting a unique label for each subset, including the binary code range and the corresponding discreteness value, the corresponding target subset can be quickly located according to the binary code during retrieval, and the discreteness value can quantify the diversity or discreteness of the binary code in the subset. Since it cannot be guaranteed that the binary codes in all subsets are the same when dividing the subsets, it is necessary to represent the discreteness value. In subsequent retrieval, the concentration of the image in the subset can be considered according to the discreteness value. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of a framework of an application scenario of the medical image encryption retrieval method according to an embodiment of the present invention;

[0019] Figure 2 A schematic diagram of a flow chart of a medical image encryption retrieval method according to an embodiment of the present invention;

[0020] Figure 3 The figure is a flowchart of a medical image encryption retrieval method according to a specific embodiment of the present invention. DETAILED DESCRIPTION

[0021] To facilitate the understanding of the present invention, the present application will be described more comprehensively below with reference to the relevant drawings; the drawings show preferred embodiments of the present invention, but the present invention can be implemented in many different forms and is not limited to the embodiments described herein; on the contrary, the purpose of providing these embodiments is to enable a more thorough and comprehensive understanding of the disclosed content of the present invention.

[0022] It should be noted that the terms “vertical”, “horizontal”, “up”, “down”, “left”, “right” and similar expressions used in this document are only for illustrative purposes and do not represent the only implementation method.

[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which the present invention belongs; the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the term "and / or" used herein includes any and all combinations of one or more related listed items. Example

[0024] In the prior art, the overall process of image searchable encryption is as follows: the user is the image searcher, and the cloud service provider is the high-performance server owned by the hospital. The image owner encrypts the image and uploads it to a cloud server. The cloud server is responsible for storing the ciphertext image. The cloud server usually needs to extract ciphertext features from the ciphertext image in preparation for user retrieval. When the image search user appropriately encrypts the image to be retrieved, the ciphertext image to be retrieved is sent to the cloud server. The cloud server extracts the image features of the ciphertext image, and then the cloud server obtains the relevant ciphertext image closest to the retrieved image through a suitable feature distance measurement algorithm, and sends these images back to the user. The key related to the ciphertext image is obtained by the user through communication with the image owner in a specific way, and the relevant image is decrypted to obtain the relevant image.

[0025] The core step of the above process is how the cloud server extracts features from two encrypted images and compares feature measurement values. Based on this classification, the first category is based on statistical features (weak feature description capabilities but simple extraction operations), such as using the RGB values ​​of statistical images as features. At this time, disrupting the order of the pixels of the image can be used as an encryption method, and it will not affect feature extraction. At this time, both image encryption and feature extraction for retrieval are completed, but this type of solution has low retrieval accuracy due to the weak retrieval capabilities of the statistical features themselves; the second category is based on deep features (strong feature description capabilities but complex extraction operations), that is, convolutional neural networks complete feature extraction and use corresponding features for distance measurement. Due to the superiority of deep learning itself, this type of solution is much higher than the first category in retrieval accuracy; but convolutional neural networks usually involve operations such as addition, subtraction, multiplication and comparison. When the above calculation process needs to be completed in the ciphertext state, it is much more complicated than the first category of solutions. It usually requires the use of heavier cryptographic solutions (such as multi-party secure computing, homomorphic encryption) and two or more cloud servers jointly provide ciphertext retrieval services.

[0026] Therefore, in the embodiment of the present invention, based on the trusted execution environment technology, a secure area (usually referred to as a confidential computing environment) is created through auxiliary measures such as a memory encryption coprocessor chip to ensure that when the calculation is actually carried out, the actual data in the machine memory to which the confidential computing environment belongs is in an encrypted state and cannot be scanned by the outside world to obtain data without authorization. The technology itself is only responsible for encryption at the memory level, but it is easy to further complete encryption at the disk level by introducing a key. At the same time, the confidential computing environment can provide proof to the remote end, that is, the remote end can verify whether a certain environment is a confidential computing environment. This technology can ensure that even if the machine is not local, attackers (such as the owner of the machine) cannot obtain data in the confidential computing environment without authorization.

[0027] In addition, image features are the basic elements for image retrieval, but some studies in recent years have shown that features such as SIFT, HOG and Bow can be used to reversely restore some information of the original image. Due to the development of deep learning, convolutional neural network features have better effects than these manual features, and have been widely used in image classification, target detection and image retrieval. However, this feature contains the semantic information of the image and has also been studied to restore the original image information. Therefore, image features are also facing the risk of privacy leakage.

[0028] Based on this, an embodiment of the present invention proposes a medical image encryption retrieval method.

[0029] Reference Figure 1 A medical image encryption retrieval method according to an embodiment of the present invention is applied in Figure 1 in the scene.

[0030] Specifically, the security service provider is responsible for providing a secure computing environment (secure area) and supporting security extension tools. The secure computing environment is created based on trusted hardware (such as Intel TDX, AMD SEV, etc.), which can ensure the security of the image during the processing process, and provide an encapsulation interface that supports loading preset programs (used to implement the image encryption retrieval process, packaged into a static program, such as a Docker container, provided by a third party, which can be a retrieval service provider), including the first private key prikey (only known to the security service provider) decryption function; the security extension tool is used for image encryption and decryption operations, including the first public key pubkey encryption function corresponding to the first private key prikey and the symmetric key symkey generation function.

[0031] Retrieval service provider: responsible for providing image retrieval services, encapsulating preset programs into containers that do not require network access, and uploading them to the secure computing environment provided by the security service provider. It can read the decrypted image data to perform corresponding image processing operations, and move out of the secure computing environment for interaction based on the retrieval results.

[0032] Image owners and image searchers: Use the security extension tool to encrypt the image to be uploaded to obtain the ciphertext image, and upload the ciphertext image and the generated symmetric key to the platform of the search service provider. The user encrypts the image and the symmetric key symkey according to the first public key pubkey provided by the security extension tool to obtain the ciphertext image.

[0033] Figure 2 It is a flowchart of a medical image encryption retrieval method according to an embodiment of the present invention.

[0034] like Figure 2As shown, a medical image encryption retrieval method is applied to a retrieval service provider, integrated with a secure computing environment provided by a security service provider, including an encapsulation interface and a security extension tool, and is used to receive a ciphertext image through the encapsulation interface, including the following steps:

[0035] S101, when receiving the encrypted image transmitted by the image owner, transmitting it to the secure computing environment through the encapsulation interface, and decrypting the encrypted image using the first private key to obtain the image to be stored, including:

[0036] S201, obtaining a first feature vector of an image to be stored.

[0037] Specifically, a pre-trained convolutional neural network is used to extract the high-dimensional features of the last layer of the image to be stored as the first feature vector. The convolutional neural network can be set to VGG13 or VGG16, and the present invention does not limit or elaborate on this.

[0038] S202: Convert the first feature vector into a binary code using a preset hash algorithm.

[0039] Specifically, the preset hash algorithm is set to an LSH (position sensitive hash) function, and m LSH functions are used to map each first eigenvector into m binary hash codes, each hash code being a brief representation of a certain characteristic of the first eigenvector; a sequentially arranged binary code is generated using the m hash codes, specifically: a variable i is initialized to 1, and the variable is used to track the bit of the hash code currently being processed; the hash code is encoded from left to right, and the number of encoded bits increases from 1, and this step is repeated r times; in each repetition, the i-th bit of the m hash codes is added to the binary code in turn, and i is increased by 1, and the next bit is processed until all hash code bits are processed.

[0040] As a result, the originally scattered m hash codes are integrated into a single, line-sequential binary code, ultimately generating a compact binary code that contains the key information of the first eigenvector.

[0041] S203, according to the size of all binary codes and a preset subset size benchmark, all binary code corresponding images and first feature vectors are divided into multiple subsets, each subset is assigned a unique label and includes at least one image and a corresponding first feature vector, and the unique label of each subset includes a subset number, an interval range of the binary code, and a discrete degree value of the binary code.

[0042] Wherein, step S203 specifically includes:

[0043] S301, sorting all binary codes in ascending order according to their corresponding decimal values ​​to obtain a binary code sequence, wherein each binary code in the binary sequence corresponds to an element, each element includes an image and a corresponding first eigenvector, and each element is assigned an element number.

[0044] S302, determining a preset subset size benchmark based on the number of binary codes that appear most frequently in the binary sequence, and dividing all images in the binary sequence and the corresponding first feature vectors into a plurality of subsets in sequence based on the preset subset size benchmark.

[0045] Among them, the preset subset size benchmark is determined as the number corresponding to the binary code with the highest frequency of occurrence in the binary sequence, that is, the number of elements contained in each subset, and each element is set as an image and a corresponding first eigenvector to ensure that the elements in the divided subsets are less than or equal to the preset subset size benchmark.

[0046] Specifically, based on a preset subset size benchmark, all images in the binary sequence and the corresponding first feature vectors are divided into multiple subsets, specifically including:

[0047] A1. Set the subset number i and the element number j in the binary sequence, start counting from 1, and prepare an empty subset S[i].

[0048] A2. According to the preset subset size reference p, p consecutive elements (including the image and the corresponding first eigenvector) are taken from the binary sequence starting from the position of element number j, and filled into the subset S[i].

[0049] A3. Check whether there is an image with the same maximum value as the binary code that is not completely filled in the current subset S[i]. If so, jump the value of j to the image with the smallest element number in the image with the same maximum binary code. Otherwise, determine the value of j to be j+p and increase i by 1. Repeat the above A1 to A3 processes. After each iteration, i and j will increase accordingly to process the next subset until j is greater than the total number of elements in the binary sequence.

[0050] A4. Set a unique label for the subset S[i], including the subset number, the interval range of the binary code (the minimum and maximum values ​​of the binary code), and the discrete degree value of the binary code.

[0051] The discreteness value of the binary code is obtained according to the standard deviation of the sizes of all binary codes in the subset.

[0052] Therefore, by storing all the images to be stored and the corresponding first feature vectors in the secure computing environment of the retrieval service provider through an integrated encapsulation interface, the secure computing environment securely stores and provides for the image encryption retrieval program to call. Since the memory where the secure computing environment is located is always physically encrypted and network communication is impossible, it is prevented that the cloud owner performs some unauthorized operations on the feature data (data mining, clustering and analysis, etc.) and the attacker uses the features to restore the original image information, thereby ensuring the privacy of user information.

[0053] S102, when receiving the encrypted image transmitted by the image searcher, it is transmitted to the secure computing environment through the encapsulation interface, and the encrypted image is decrypted using the first private key to obtain the query image and the symmetric key, such as Figure 3 As shown, including:

[0054] S401, obtaining a second feature vector of the query image.

[0055] Among them, the query image is the image used when retrieving the target image, such as some image-based search scenarios. In the medical field, patients or medical staff can use the CT images taken by the patients to search for images similar to the CT images in the CT image database to refer to the treatment plans of the medical records with similar images.

[0056] S402: Convert the second feature vector into a binary code using a preset hash algorithm.

[0057] Specifically, the specific method of converting into binary code can refer to step S202.

[0058] S403 , according to the unique labels of all subsets, determine the subset corresponding to the binary code interval range matched by the binary code of the second feature vector as the target subset.

[0059] S404, calculating similarity between the second feature vector and feature vectors of images in the target subset by Euclidean distance, and sorting them in descending order, taking the first k images as a candidate image set.

[0060] S405, encrypting the candidate image set with the symmetric key and transmitting it to the image searcher, and the image searcher decrypts the candidate image set locally according to the symmetric key.

[0061] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:

[0062] Through the secure computing environment and trusted hardware technology created by the security service provider for the retrieval service provider, all programs involved in the image encryption retrieval method are encapsulated into a container that does not require network access and uploaded to the secure computing environment. This not only ensures the confidentiality of data during image processing and retrieval, effectively prevents the transmission and storage of images and their feature information in plain text, avoids private leakage, but also simplifies the deployment and maintenance process of multi-party secure computing systems in existing technologies, reducing operating and computing costs;

[0063] The image feature vector is converted into a binary code using a preset hash algorithm and divided into subsets according to its size. Images with the same or similar binary codes are divided into a subset as much as possible. When searching, the binary code of the query image is directly used to locate the subset that is roughly similar to it, which narrows the search scope. It only needs to calculate the similarity within the subset without traversing the entire image library, which greatly reduces the cost of subsequent similarity calculations for searched images and improves the search efficiency.

[0064] By setting a unique label for each subset, including the binary code range and the corresponding discreteness value, the corresponding target subset can be quickly located according to the binary code during retrieval, and the discreteness value can quantify the diversity or discreteness of the binary code in the subset. Since it cannot be guaranteed that the binary codes in all subsets are the same when dividing the subsets, it is necessary to represent the discreteness value. In subsequent retrieval, the concentration of the image in the subset can be considered according to the discreteness value. Example

[0065] In the first embodiment, the binary code size of the image feature vector is sorted and divided using a preset hash algorithm, which can quickly locate the image range that is roughly similar to the query image, thereby reducing the search range and improving the search efficiency. However, the hash algorithm may have the problem of binary code limitations, that is, images that are highly similar to the query image may be divided into different subsets due to the randomness of the hash function and the discretization of the projection. Although the algorithm can narrow the search range to one subset, there is also the problem of singularity in the subset division based on the LSH hash algorithm, especially when processing medical images, because most medical images are grayscale images, there may be a lot of noise, artifacts and other problems, which may affect the accuracy of the LSH algorithm.

[0066] Therefore, in order to further improve the accuracy and efficiency of image retrieval, the embodiments of the present application perform certain optimizations based on the above embodiments.

[0067] In some embodiments, before step S201, the method further includes:

[0068] S501, obtaining a grayscale image of an image to be stored, and performing noise reduction processing on the grayscale image using a Gaussian filtering method, and obtaining a first edge contour of each image to be stored using a Sobel edge detection algorithm.

[0069] Specifically, when processing grayscale medical images, contour delineation is an important step in identifying key structures in the image. By applying the Sobel edge detection algorithm, the edges in the image can be accurately identified, thereby delineating the contours representing the main structures. For example, in a CT scan image, the boundaries of the lungs, heart, or other organs can be identified, i.e., the first edge contour.

[0070] S502: Obtain a first contour description set of a first edge contour, where the first contour description set includes an area value, a perimeter value, a centroid position, and a direction value.

[0071] In some embodiments, the first contour description set is set to a four-dimensional vector, represented as [A, P, (Cx, Cy), D], where A is the area value, P is the perimeter value, (Cx, Cy) is the center of mass position coordinate, and D is the direction value.

[0072] Specifically, the area value is determined as the total number of pixels inside the first edge contour; the perimeter value is determined as the total length of the first edge contour line, that is, the sum of the distances between all adjacent pixels on the first edge contour; the center of mass position is determined as the average value of the position coordinates of all pixels inside the first edge contour in the grayscale image; the direction value is determined as the value of the overall orientation of the first edge contour, and an ellipse is fitted by the least squares method to approximate the first edge contour, and the angle between the major axis of the ellipse and the horizontal direction is used as the direction value.

[0073] The first edge contour is approximated by fitting an ellipse by the least square method, and the angle between the major axis of the ellipse and the horizontal direction is used as the direction value, specifically including:

[0074] B1. Obtain the coordinates of the edge pixels on the first edge contour, and use the least squares method to fit these points to an ellipse. The general equation of the ellipse can be expressed as (A +Bxy+C +Dx+Ey+F=0, where (A, B, C, D, E,F) are the parameters of the ellipse that need to be solved.

[0075] B2. For each edge point (x_i, y_i), substitute its coordinates into the ellipse equation to construct a system of equations.

[0076] B3. Solve the system of equations by the least squares method and obtain the ellipse parameters (A, B, C, D, E, F).

[0077] B4. Based on the parameters of the ellipse, calculate the major axis of the ellipse, that is, the longest diameter of the ellipse.

[0078] It should be noted that the parameter values ​​in the above-mentioned first contour description set can all be assisted by corresponding functions in the OpenCV image processing library to generate corresponding parameter values, thereby simplifying the calculation process.

[0079] S503: For the first contour description sets of all images to be stored, use a preset weighted Euclidean distance algorithm to calculate contour similarities between each pair. The preset weighted Euclidean distance algorithm is:

[0080] Similarity )= , where F1 and F2 are the first contour description sets of the two images, respectively, represented as a four-dimensional vector [A, P, (Cx, Cy), D], and Distance(F1, F2) is a weighted Euclidean distance function, set to:

[0081]

[0082] in, , , are the weights of area value, perimeter value, centroid position and direction value respectively. These weights can be adjusted according to the importance of the features. A1, P1, ( , ), D1 respectively represent the area value, perimeter value, centroid position coordinates, and direction value of the first edge contour of one of the two images, A2, P2, ( , ), D2 respectively represent the area value, perimeter value, center of mass position coordinates, and direction value of the first edge contour of another image.

[0083] S504, dividing the images with contour similarity greater than the first threshold T into a sub-block, which can be achieved by using the K-means clustering algorithm to obtain several sub-blocks, each of which contains all the images to be stored with contour similarity greater than the first threshold, and each sub-block is assigned a unique index, and the unique index includes the average value of the first contour description set of all images to be stored, that is, the average contour description set.

[0084] S505, based on each sub-block, execute steps S201 to S203 to obtain several sub-blocks assigned with unique indexes, each sub-block includes several subsets assigned with unique labels, each subset is assigned with a double-layer index structure, the first-layer index is set to the unique index of the corresponding sub-block, and the second-layer index is set to the corresponding unique label.

[0085] In some embodiments, before step S403, the method further includes:

[0086] S601, obtaining a first edge contour of a query image and a corresponding first contour description set.

[0087] Specifically, the specific implementation method of obtaining the contour description set of the image can refer to the aforementioned steps S501 to S502, and the implementation principle is the same, except that the processing object is changed to the query image.

[0088] S602, based on the unique index of each sub-block and the first contour description set of the query image, locate the target sub-block, and execute step S403 based on all subsets in the target sub-block.

[0089] Among them, based on the unique index of each sub-block and the first contour description set of the query image, locating the target sub-block specifically includes: using a preset weighted Euclidean distance algorithm to calculate the contour similarity between the first contour description set of the query image and the average contour description set of each sub-block, and determining the sub-block with the highest contour similarity as the target sub-block.

[0090] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:

[0091] Based on the particularity of medical images, by introducing edge contour description sets and weighted Euclidean distance algorithm, all images are roughly divided initially, which can better adapt to the complexity of medical images. Based on this, the LSH algorithm is used to divide the subsets, which can more accurately reflect the similarity between images and optimize the subset division results, so that images divided into the same subset are more likely to have higher similarity, thereby enhancing the accuracy of local positioning during image retrieval;

[0092] The introduction of edge contour description sets can overcome the limitations or singularity problems that the image retrieval method of the LSH algorithm may encounter when facing medical images, and avoid to the greatest extent the situation that dissimilar images may also produce the same binary code, that is, images that are highly similar to the reference image may be divided into different subsets due to the randomness of the hash function and the discretization of the projection, thereby improving the accuracy of image retrieval. Example

[0093] In medical image retrieval, due to the complexity of medical images and the discretization characteristics of the LSH algorithm, images that are highly similar to the query image are sometimes divided into different subsets due to slight differences in hash codes, especially near the subset boundaries, which may lead to incomplete or inaccurate retrieval results. Regarding the problem of similar images being ignored near the subset boundaries mentioned in the first embodiment, that is, during the subset division process, if the binary code of the query image happens to be near the boundary of the subset, then the retrieval results may be affected, because the images in the adjacent subsets may also have a high degree of similarity with the query image, but are ignored because they are divided into different subsets.

[0094] Therefore, the embodiments of the present application are optimized to a certain extent based on the above embodiments.

[0095] In some embodiments, the determination of the target subset in step S403 further includes:

[0096] S701, when the discrete degree value of the binary code in the unique label of the target subset is greater than the discrete threshold, detect whether the binary code of the query image is located at the boundary of the binary code interval range of the target subset, if so, execute S702.

[0097] The determination index of the boundary of the binary code interval range is set as: within a preset range from the maximum value or minimum value of the binary code. The preset range is much smaller than the difference between the maximum value and the minimum value, and is set according to the actual application.

[0098] Specifically, if the binary code of the query image is located at the boundary of the target subset and the discrete value of the subset is large, it means that the adjacent subset of the subset may contain images that are highly similar to the query image. Therefore, it is necessary to expand the search range, in addition to searching the target subset, to search the subsets adjacent to the target subset.

[0099] S702, using a preset window block to dynamically select images in adjacent subsets and add them to the target subset, thereby updating the original target subset.

[0100] The size of the preset window block is set to be the same as the size of the preset range.

[0101] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:

[0102] By introducing a search range expansion mechanism with dynamic selection of window blocks, it is decided whether to expand the search range to adjacent subsets according to the position of the binary code of the query image in the target subset and the discrete degree value of the target subset. This mechanism makes the retrieval process more flexible and accurate, effectively avoiding the situation where adjacent subsets may contain images that are highly similar to the query image, thereby improving the completeness and accuracy of image retrieval. Example

[0103] In response to the problem that similar images near the subset boundary may be ignored due to the LSH algorithm mentioned in Example 1, this embodiment dynamically selects images based on preset window blocks and proposes a dynamic window block-based strategy to expand the search range to capture images that may be highly similar to the query image.

[0104] In some embodiments, step S702 further includes:

[0105] S801, if the binary code of the query image is close to the minimum value of the binary code interval, then start from the minimum value of the binary code in the target subset and slide the window block forward, with the step size of each slide being equal to the size of the window block, until the number of slides reaches a preset number; similarly, if the binary code of the query image is close to the maximum value of the binary code interval, then start from the maximum value of the binary code in the target subset and slide the window block backward.

[0106] S802, for each image in the sliding window block, calculate the similarity value between the first feature vector of the image farthest from the target subset in the window block and the second feature vector of the query image.

[0107] The similarity values ​​between feature vectors may be calculated using methods such as Euclidean distance and cosine similarity, which will not be elaborated in detail in the present invention.

[0108] S803, based on the preset number of similarity values ​​and the corresponding binary codes, a binary code-similarity value curve is drawn, where the horizontal axis represents the binary code of the image farthest from the target subset in the window block, and the vertical axis represents its corresponding similarity value.

[0109] S804, according to the trend of the curve graph, obtain the binary code range corresponding to the curve segment that meets the preset conditions (the similarity value is greater than the preset reference value and the trend is rising), and select the images whose binary codes are in the binary code range from all the images over which the window block slides, and add them to the target subset.

[0110] In some embodiments, step S804 further includes:

[0111] C1. If there is no similarity value greater than the preset reference value, the size of the window block is dynamically adjusted according to the discrete degree value of the binary code of the target subset. If the discrete degree is large, it means that the images in the subset are widely distributed, and the window block size may need to be reduced to more accurately locate similar images; conversely, if the discrete degree is small, the window block size can be appropriately increased to expand the search range.

[0112] Specifically, the adjusted window block size is determined as: W_new=W_initial*α, wherein W_new is the adjusted window block size, W_initial is the originally preset window block size, and α is the adjustment factor.

[0113] The adjustment factor is determined according to the binary code discreteness value of the target subset, specifically:

[0114] = , where f is the binary code discreteness value of the target subset, is the discrete threshold, It is a preset maximum discrete degree value. The maximum discrete degree value is limited to prevent the adjustment factor from being too small, so that the adjustment factor is always within a reasonable range.

[0115] Therefore, the adjustment factor is determined by the discrete degree value of the binary code, thereby achieving the effect of dynamically adjusting the window block size.

[0116] C2. Re-execute steps S801 to S803 using the adjusted window block size.

[0117] C3. If there is a curve segment that meets the preset conditions in the curve graph, execute step S804 to select an image whose binary code is within the binary code range and add it to the target subset; otherwise, it can be considered that there is no image that is highly similar to the query image in the adjacent subsets of the target subset, and the original target subset can be kept.

[0118] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:

[0119] By dynamically adjusting the size of the window block, the search precision is adaptively adjusted according to the discreteness of the target subset, avoiding the problem that the search may be inaccurate or the range may be too large or too small due to the fixed window block size;

[0120] By drawing a curve graph of binary code-similarity value, visual assistance is provided for the decision-making process. When it is found that there is no curve segment that meets the preset conditions, the window block size can be adaptively adjusted in time according to the discrete degree value of the target subset. It can provide more intuitive retrieval process results for subsequent administrators to manage the platform of the retrieval service provider and optimize relevant parameters accordingly, thereby improving the overall retrieval accuracy and efficiency.

[0121] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A medical image encryption retrieval method, characterized in that: Applied to a retrieval service provider, the secure computing environment provided by a security service provider is integrated through an encapsulation interface, and the method includes: When receiving the encrypted image transmitted by the image owner, transmitting it to the secure computing environment through the encapsulation interface, and decrypting the encrypted image using the first private key to obtain the image to be stored, including: S201, obtaining a first feature vector of an image to be stored; S202, converting the first feature vector into a binary code using a preset hash algorithm; S203, dividing all binary code corresponding images and the first feature vector into a plurality of subsets according to the size of all binary codes and a preset subset size benchmark, each subset being assigned a unique label including a subset number, an interval range of the binary code, and a discrete degree value of the binary code; The method of dividing all binary code corresponding images and first feature vectors into a plurality of subsets according to the size of all binary codes and a preset subset size benchmark specifically includes: S301, sorting all binary codes in ascending order according to their corresponding decimal values ​​to obtain a binary code sequence, wherein each binary code in the binary sequence corresponds to an element, each element includes an image and a corresponding first eigenvector, and each element is assigned an element number; S302, determining a preset subset size benchmark based on the number of binary codes that appear most frequently in the binary sequence, and dividing all images in the binary sequence and the corresponding first feature vectors into a plurality of subsets in sequence based on the preset subset size benchmark; Among them, S302 specifically includes: A1. Set the subset number i and the element number j in the binary sequence, start counting from 1, and prepare an empty subset S[i]; A2. According to the preset subset size reference p, take out p consecutive elements starting from the position of element number j in the binary sequence and fill them into the subset S[i]; A3, check whether there is an image with the same maximum value as the binary code that is not completely filled in the current subset S[i]. If so, jump the value of j to the image with the smallest element number in the image with the same maximum value as the binary code. Otherwise, determine the value of j to be j+p, and increase i by 1. Repeat the above A1 to A3 processes until j is greater than the total number of elements in the binary sequence. When the ciphertext image transmitted by the image searcher is received, it is transmitted to the secure computing environment through the encapsulation interface, and the ciphertext image is decrypted using the first private key to obtain the query image and the symmetric key, including: S401, obtaining a second feature vector of the query image; S402, converting the second feature vector into a binary code using a preset hash algorithm; S403, determining, according to the unique labels of all subsets, a subset corresponding to a binary code interval range matched by the binary code of the second feature vector as a target subset; S404, calculating the similarity between the second feature vector and the first feature vector of the image in the target subset by Euclidean distance, and determining a candidate image set according to the similarity; S405, encrypting the candidate image set with a symmetric key and transmitting it to the image searcher.

2. The medical image encryption retrieval method according to claim 1, characterized in that: The encapsulation interface includes a first private key, and the security service provider also provides a security extension tool, which includes a first public key and a symmetric key corresponding to the first private key; The ciphertext image is obtained by encrypting the image and the symmetric key with the first public key.

3. The medical image encryption retrieval method according to claim 1, characterized in that: Before S201, the method further includes: S501, obtaining a grayscale image of an image to be stored, and obtaining a first edge contour of each image to be stored using a Sobel edge detection algorithm; S502, obtaining a first contour description set of a first edge contour, wherein the first contour description set is set to a four-dimensional vector including an area value, a perimeter value, a centroid position, and a direction value; S503, for the first contour description sets of all images to be stored, respectively calculate contour similarities between any two of them using a preset weighted Euclidean distance algorithm; S504, dividing the images with contour similarity greater than the first threshold into a sub-block to obtain a plurality of sub-blocks, each of which contains all the images to be stored with contour similarity greater than the first threshold, and each sub-block is assigned a unique index, and the unique index includes an average contour description set of the first contour description sets of all the images to be stored; S505, based on each sub-block, execute steps S201 to S203 to obtain several sub-blocks assigned with unique indexes, each sub-block includes several subsets assigned with unique labels, each subset is assigned with a double-layer index structure, the first-layer index is set to the unique index of the corresponding sub-block, and the second-layer index is set to the corresponding unique label.

4. The medical image encryption retrieval method according to claim 3, characterized in that: The preset weighted Euclidean distance algorithm is: F1 and F2 are the first contour description sets of the two images, respectively, expressed as [A, P, (Cx, Cy), D], where A is the area value, P is the perimeter value, (Cx, Cy) is the centroid position coordinate, and D is the direction value; Among them, Distance(F1, F2) is the weighted Euclidean distance function, which is set as: Among them, w A 、w P 、w C 、w D are the weights of area, perimeter, centroid and direction respectively, A1, P1, (C x1 , C y1 ), D1 respectively represent the area value, perimeter value, centroid position coordinates, and direction value of the first edge contour of one of the two images, A2, P2, (C x2 , C y2 ), D2 respectively represent the area value, perimeter value, centroid position coordinates, and direction value of the first edge contour of another image; Among them, the area value is determined as the total number of pixels inside the first edge contour; the perimeter value is determined as the sum of the distances between all adjacent pixels on the first edge contour; the centroid position is determined as the average value of the position coordinates of all pixels inside the first edge contour in the grayscale image; and the direction value is determined as the angle between the major axis of the ellipse approximating the first edge contour and the horizontal direction.

5. The medical image encryption retrieval method according to claim 3, characterized in that: Before step S403, the method further includes: S601, obtaining a first edge contour of a query image and a corresponding first contour description set; S602, based on the unique index of each sub-block and the first contour description set of the query image, locate the target sub-block, and execute step S403 based on all subsets in the target sub-block; Among them, based on the unique index of each sub-block and the first contour description set of the query image, locating the target sub-block specifically includes: using a preset weighted Euclidean distance algorithm to calculate the contour similarity between the first contour description set of the query image and the average contour description set of each sub-block, and determining the sub-block with the highest contour similarity as the target sub-block.

6. The medical image encryption retrieval method according to claim 1, characterized in that: The determination of the target subset in S403 further includes: S701, when the discrete degree value of the binary code in the unique label of the target subset is greater than the discrete threshold, detect whether the binary code of the query image is located at the boundary of the binary code interval range of the target subset, if so, execute S702; The determination index of the boundary of the binary code interval range is set as: within a preset range from the maximum value or minimum value of the binary code; S702, using a preset window block to dynamically select images in adjacent subsets and add them to the target subset, thereby updating the original target subset; The size of the preset window block is set to be the same as the size of the preset range.

7. The medical image encryption retrieval method according to claim 6, characterized in that: The S702 further includes: S801, if the binary code of the query image is close to the minimum value of the binary code interval, start from the minimum value of the binary code in the target subset and slide the window block forward, with the step length of each slide being equal to the size of the window block, until the number of slides reaches a preset number; otherwise, start from the maximum value of the binary code in the target subset and slide the window block backward; S802, for each image in the sliding window block, calculating a similarity value between a first feature vector of an image in the window block that is farthest from the target subset and a second feature vector of the query image; S803, based on the preset number of similarity values ​​and the corresponding binary codes, a binary code-similarity value curve is drawn, where the horizontal axis represents the binary code of the image farthest from the target subset in the window block, and the vertical axis represents the corresponding similarity value; S804, according to the trend of the curve graph, obtain the binary code range corresponding to the curve segment that meets the preset conditions, and select images whose binary codes are within the binary code range from all the images over which the window block slides, and add them to the target subset.

8. The medical image encryption retrieval method according to claim 7, characterized in that: The preset condition is that the similarity value is greater than a preset reference value and the trend is rising.

9. The medical image encryption retrieval method according to claim 8, characterized in that: The S804 further includes: C1. If there is no curve segment that meets the preset conditions, the size of the window block is dynamically adjusted according to the discrete degree value of the binary code of the target subset. The adjusted window block size is determined as: W_new = W_initial*α, W_new is the adjusted window block size, W_initial is the originally preset window block size, and α is the adjustment factor; The adjustment factor is determined according to the binary code discreteness value of the target subset, specifically: Among them, f is the binary code discrete value of the target subset, f0 is the discrete threshold, and f m is the preset maximum discrete value; C2, re-execute steps S801 to S803 using the adjusted window block size; C3. If there is a curve segment that meets the preset condition in the curve graph, execute step S804 to select an image whose binary code is within the binary code range and add it to the target subset; otherwise, keep the original target subset unchanged.