A medical image retrieval method based on fuzzy hash network
By combining a fuzzy hashing network-based approach with self-attention and the consequent parameter learning mechanism of Transformer, the problems of image complexity and data imbalance in medical image retrieval are solved, achieving more efficient medical image retrieval.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANTONG UNIV
- Filing Date
- 2025-02-06
- Publication Date
- 2026-05-05
AI Technical Summary
Existing deep hashing algorithms struggle to effectively handle image complexity, uncertainty, and data imbalance in medical image retrieval, resulting in slow retrieval speed and low accuracy.
We employ a fuzzy hash network-based approach, combining self-attention and Transformer consequent parameter learning mechanisms. Through fuzzy rule bases, fuzzy C-means clustering, and multiple loss functions, we optimize hash center and hash code generation, thereby improving the model's uncertainty handling capabilities and data balance.
It enhances the accuracy of medical image retrieval and the discriminative power of hash codes, improves the generalization ability of the model, and can better handle complex and uncertain medical image data, thereby improving retrieval accuracy.
Smart Images

Figure CN120067379B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and in particular to a medical image retrieval method based on fuzzy hash networks. Background Technology
[0002] The development of medical imaging technology has enabled doctors and researchers to access massive amounts of medical image data. For example, the Shanghai Artificial Intelligence Laboratory has collected 4.6 million medical images and 19.7 million corresponding masks, constructing a massive medical image dataset. If similar pathological images can be retrieved quickly and accurately from this vast amount of medical image data, it will help doctors and researchers conduct diagnoses and research more rapidly. Therefore, designing and proposing an efficient retrieval algorithm for large-scale medical image data is a worthwhile research topic.
[0003] Hash algorithms are a class of efficient retrieval algorithms; however, traditional hash algorithms mostly rely on manually extracted features, making it difficult to preserve similarities in the original space. This results in problems such as large semantic discrepancies, slow retrieval speed, and low accuracy. In recent years, with the rapid development of deep learning technology, some deep hashing algorithms that combine deep learning techniques have been proposed. The main strategy of these algorithms is to first use convolutional neural networks to extract features, and then generate hash codes to achieve image retrieval. The research paper titled "Deep hashing with minimal-distance-separated hash centers" proposes a method to optimize hash centers by using the Gilbert-Varshamov bound to constrain the distance between hash centers.
[0004] While current deep hashing algorithms have demonstrated some effectiveness, they still face several challenges. First, the complex structures and high uncertainty of early lesions in medical images make it difficult for existing methods to effectively extract complex image features. Deep hashing algorithms typically rely on neural networks to capture complex contextual relationships, but ignore the complexity of the original data; furthermore, the uncertainty of visual and semantic similarity weakens the discriminative power of the hash codes. Second, the significant difference in the number of samples of common diseases versus rare diseases or early symptoms in medical images leads to an imbalance between similar and dissimilar pairs in the data, thus affecting the model's learning performance. Finally, existing methods often focus on pairwise or triplet relationships, neglecting local features of the data, thereby limiting the model's performance in distinguishing similar but not identical samples.
[0005] To address these issues, fuzzy systems have become a research hotspot in the field of medical image analysis in recent years. A fuzzy system is an intelligent model with strong capabilities for mining uncertain data, primarily achieving adaptive capture of uncertain information through fuzzy membership degrees. The research paper titled "T2-FDL: a robust sparse representation method using adaptive type-2 fuzzy dictionary learning for medical image classification" proposes a robust sparse representation method based on an adaptive type-2 fuzzy learning system, addressing the impact of noise and uncertainty on medical image classification. Current applications of fuzzy systems in the medical field mainly focus on the diagnostic analysis of specific diseases, leveraging their advantages in handling uncertainty and complexity.
[0006] In summary, existing deep hashing algorithms still face numerous challenges in addressing the complexity, uncertainty, and imbalance of medical images. Therefore, combining the advantages of fuzzy systems and proposing a medical image retrieval method based on fuzzy hashing will become an important direction for solving current problems. Summary of the Invention
[0007] The purpose of this invention is to provide a medical image retrieval method based on fuzzy hash networks, primarily addressing the problems of image complexity, uncertainty, and data imbalance in medical image retrieval. This method aims to improve the accuracy of medical image retrieval, thereby providing clinicians with more precise diagnostic support and promoting research and exploration of related diseases.
[0008] To achieve the above-mentioned objectives, the present invention employs the following technical solution: a medical image retrieval method based on a fuzzy hash network, comprising the following steps:
[0009] S1: Establish a medical image database, preprocess the image samples in the database, and divide the database into test sets T. q And database T v And randomly select n images from the database as the query set. X is the image, L ′ For tags;
[0010] S2: A fuzzy hashing network is constructed based on fuzzy rules. This network includes a data fuzzification mechanism guided by a self-attention mechanism and a consequent parameter learning mechanism based on Transformer. The data is fuzzified using a Gaussian function, and the self-attention score is calculated in the fuzzy space. The fuzzy representation is obtained by using residual connections and combining them with layer normalization. The consequent parameter learning mechanism based on Transformer consists of a Transformer encoder and two multilayer perceptrons. The Transformer encoder is responsible for defuzzification, and the two multilayer perceptrons are used to generate hash codes and predict categories, respectively.
[0011] S3: Calculate the loss function based on the hash code and category obtained in step S2: Hash center loss L H Balance loss L B Quantification loss L Q And classification loss L C The overall loss function is obtained as: L = L H +αL C +βL B +λL Q , where α, β, and λ are hyperparameters;
[0012] S4: Based on the overall loss function, use the alternating learning algorithm to alternately optimize the parameters of the fuzzy hash network, and save the trained fuzzy hash network model;
[0013] S5: Take the t-th image sample q from the test set Q. t Input the fuzzy hash network saved in step S4 to obtain the corresponding hash code b. t ∈{-1,1} 1×k k is the hash code length; through hash code b t Calculate the Hamming distance dist with the hash code U of the database. H The Hamming distances are sorted in ascending order; the first p retrieved images are returned as required, and the average precision (mAP) of the retrieval is calculated.
[0014] Further, step S2 includes the following steps:
[0015] S21: The fuzzy rule base of the fuzzy hash network is defined as follows:
[0016]
[0017] Where, x i For the i-th sample in the query set, Let be the self-attention-guided fuzzification function for the r-th rule antecedent. For the input data corresponding to the fuzzification function of the r-th rule antecedent, TCPL r (x i) is the consequent of the r-th rule, f r (x i Let ) be the output of the r-th rule, and R be the number of rules;
[0018] S22: A Gaussian function is used as the membership function, and the center and width of the Gaussian function are estimated using the fuzzy C-means clustering algorithm; after determining the antecedent parameters of the fuzzy hash network, the sample x is calculated. i Normalized trigger strength Then sample x i The representation in the new fuzzy feature space is:
[0019]
[0020] Where, x i,e =(1,x i )∈R 1×(d+1) d is x i The dimension of a vector;
[0021] S23: Incorporating the idea of self-attention mechanism, it assigns corresponding similarity weights to feature vectors by evaluating the relevance scores between different samples; for sample x i The improved fuzzy mapping is represented as follows:
[0022]
[0023] Where d+1 represents The dimension of a vector This is to prevent overflow during the calculation of the softmax function; It reflects the similarity between samples. A higher value indicates that the two samples are highly similar in the feature space, while a lower value indicates that the samples are different.
[0024] S24: To preserve the original fuzzy features, residual connections are used in conjunction with layer normalization to avoid the gradient vanishing problem; therefore, the final fuzzy mapping is represented as:
[0025]
[0026] Where LN(·) represents the layer normalization operation; based on equation (4), the fuzzy mapping of the query set X is finally represented as
[0027] S25: Fuzzy representation of the concept of self-attention The hash code and category output of the r-th rule are obtained in the Transformer-based consequent parameter learning mechanism:
[0028]
[0029] Transformer r (·) represents the Transformer encoder operation for the r-th rule. Let r be the r-th rule used for predicting the category of the multilayer perceptron. Let r be the multilayer perceptron used to generate hash codes for the r-th rule;
[0030] S26: Therefore, the hash code and predicted category of the query set are as follows:
[0031]
[0032] in, Map the values to the range [-1, 1]. θ h and θ c These are the network parameters for the hash code branch and the prediction category branch, respectively, and h(·;·) and f(·;·) are the hash function and the prediction function, respectively.
[0033] Further, step S3 includes the following steps:
[0034] S31: Calculate the hash center loss L H By determining a hash center in each category, and then determining the final semantic hash center G′=[g′1,g′2,…,g′] based on the sample labels. n ]∈{-1,1} n×k The definition is as follows:
[0035]
[0036] S311: For a single-label dataset with c categories, a hash center is determined in each category using the fuzzy C-means clustering algorithm, thus generating c hash centers G = [g1, g2, ..., g...]. c ]∈{-1,1} c×k Therefore, each sample x in the query set X i According to label I′ i ∈{0,1} 1×c Determine a hash center g′ i That is, the semantic hash center of query set X is G′=[g′1,g′2,…,g′ n ]∈{-1,1} n×k ;
[0037] S312: For a multi-label dataset with c categories, firstly, a center is determined among samples sharing the same category using the fuzzy C-means clustering algorithm. Then, c centers G = [g1, g2, ..., g3] are generated for each of the c categories.c ]∈{-1,1} c×k Then, based on sample x i The tag I′ i The included categories are determined, and the corresponding hash centers are found. Finally, the semantic hash center, i.e., the sample x, is determined by the value that appears most frequently in each bit of these centers. i Semantic hash center:
[0038] G′=sign(I ′ i G)=[g′1,g′2,…,g′ n ]∈{-1,1} n×k (25)
[0039] S32: Calculate the classification loss L C To address the issue of differences in the number of labels in the datasets, two loss functions were used, one applicable to single-label datasets and the other to multi-label datasets.
[0040] (1) Single-label classification loss L single :
[0041]
[0042] (2) Multi-label classification loss L multi :
[0043]
[0044] S33: Calculate the equilibrium loss L B To ensure that the probability of +1 and -1 appearing in the bit hash code is the same, the following definition is made:
[0045]
[0046] S34: Calculate the quantization loss L Q The difference between the real-valued output and the hash code is constrained by adding a regular expression term, defined as follows:
[0047]
[0048] S35: The overall loss function of the fuzzy hash network is:
[0049] L = L H +αL C +βL B +λL Q (30)
[0050] Where α, β, and λ are hyperparameters.
[0051] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0052] (1) Enhance the ability to represent uncertain information: By proposing a fuzzy hash network and introducing a fuzzification mechanism based on self-attention and a consequent parameter learning mechanism based on Transformer, the model can effectively process uncertain information in medical images, thereby enhancing the model's ability to capture complex and fuzzy features of medical images.
[0053] (2) Improved generalization ability of the model: The Transformer-based consequent parameter learning mechanism proposed in this invention can dynamically adjust the parameters of the fuzzy system when processing complex medical image data, thereby enhancing the generalization ability of the model. Compared with traditional linear functions, the introduction of Transformer can better adapt to large-scale and complex medical image data.
[0054] (3) Effectively addressing class imbalance: The proposed hash center loss function introduces fuzzy C-means clustering to reasonably determine the hash center of each class and calculates the semantic hash center position of the sample, thus effectively addressing the class imbalance problem in medical image data. This method not only enhances intra-class compactness but also effectively distinguishes similar samples that do not belong to the same class.
[0055] (4) Improving retrieval accuracy and hash code discriminability: Based on hash center loss, balance loss, quantization loss, and classification loss, this invention constructs a multi-faceted optimized loss function. Compared with traditional methods, this multi-loss function design further ensures the discriminability of hash codes and the accuracy of image retrieval. Attached Figure Description
[0056] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0057] Figure 1 This is a schematic flowchart of the medical image retrieval method based on fuzzy hash network of the present invention;
[0058] Figure 2 This is an overall block diagram of the medical image retrieval method based on fuzzy hash networks of the present invention;
[0059] Figure 3 The image retrieval results of the lung X-ray dataset based on 36-bit hash codes are presented in this invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0061] Example 1:
[0062] See Figures 1 to 3 This embodiment provides a technical solution for medical image retrieval based on a fuzzy hash network, comprising the following steps:
[0063] S1: Establish a lung X-ray image database, preprocess the image samples in the database, and the processed database contains 47,723 images in 13 categories; divide 1,300 images into a test set. And 46,423 images as the database And randomly select 5000 images from the database as the query set. X is the image, L ′ For tags;
[0064] S2: A fuzzy hashing network is constructed based on fuzzy rules. This network includes a data fuzzification mechanism guided by a self-attention mechanism and a consequent parameter learning mechanism based on Transformer. The data is fuzzified using a Gaussian function, and the self-attention score is calculated in the fuzzy space. The fuzzy representation is obtained by using residual connections and combining them with layer normalization. The consequent parameter learning mechanism based on Transformer consists of a Transformer encoder and two multilayer perceptrons. The Transformer encoder is responsible for defuzzification, and the two multilayer perceptrons are used to generate hash codes and predict categories, respectively.
[0065] S3: Calculate the loss function based on the hash code and category obtained in step S2: Hash center loss L H Balance loss L B Quantification loss L Q And classification loss L C The overall loss function is obtained as: L = L H +αL C +βL B +λL Q , where α = 0.1, β = 0.003, and λ = 0.1 are hyperparameters;
[0066] S4: Based on the overall loss function, use the alternating learning algorithm to alternately optimize the parameters of the fuzzy hash network, and save the trained fuzzy hash network model;
[0067] S5: Take the t-th image sample q from the test set Q. tInput the fuzzy hash network saved in step S4 to obtain the corresponding hash code b. t ∈{-1,1} 1×k k = 36 is the hash code length; through hash code b t Calculate the Hamming distance dist with the hash code U of the database. H The Hamming distances are sorted in ascending order; the first 8 retrieved images are returned as required, and the average precision of the retrieval is calculated to be 0.426.
[0068] The medical image retrieval method based on fuzzy hash network according to claim 1, wherein step S2 comprises the following specific steps:
[0069] S21: The fuzzy rule base of the fuzzy hash network is defined as follows:
[0070]
[0071] Where, x i For the i-th sample in the query set, Let be the self-attention-guided fuzzification function for the r-th rule antecedent. For the input data corresponding to the fuzzification function of the r-th rule antecedent, TCPL r (x i ) is the consequent of the r-th rule, f r (x i ) represents the output of the r-th rule, where R = 2 is the number of rules;
[0072] S22: A Gaussian function is used as the membership function, and the center and width of the Gaussian function are estimated using the fuzzy C-means clustering algorithm; after determining the antecedent parameters of the fuzzy hash network, the sample x is calculated. i Normalized trigger strength Then sample x i The representation in the new fuzzy feature space is:
[0073]
[0074] Where, x i,e =(1,x i )∈R 1×(d+1) d = 6712 is x i The dimension of a vector;
[0075] S23: Incorporating the idea of self-attention mechanism, it assigns corresponding similarity weights to feature vectors by evaluating the relevance scores between different samples; for sample x i The improved fuzzy mapping is represented as follows:
[0076]
[0077] Where d+1=6713 represents The dimension of a vector This is to prevent overflow during the calculation of the softmax function; It reflects the similarity between samples. A higher value indicates that the two samples are highly similar in the feature space, while a lower value indicates that the samples are different.
[0078] S24: To preserve the original fuzzy features, residual connections are used in conjunction with layer normalization to avoid the gradient vanishing problem; therefore, the final fuzzy mapping is represented as:
[0079]
[0080] Where LN(·) represents the layer normalization operation; based on equation (4), the fuzzy mapping of the query set X is finally represented as
[0081] S25: Fuzzy representation of the concept of self-attention The hash code and category output of the r-th rule are obtained in the Transformer-based consequent parameter learning mechanism:
[0082]
[0083] Transformer r (·) represents the Transformer encoder operation for the r-th rule. Let r be the r-th rule used for predicting the category of the multilayer perceptron. Let r be the multilayer perceptron used to generate hash codes for the r-th rule;
[0084] S26: Therefore, the hash code and predicted category of the query set are as follows:
[0085]
[0086] in, Map the values to the range [-1, 1]. θ h and θ c These are the network parameters for the hash code branch and the prediction category branch, respectively, and h(·;·) and f(·;·) are the hash function and the prediction function, respectively.
[0087] The medical image retrieval method based on fuzzy hash network according to claim 1 is characterized in that step S3 specifically comprises the following steps:
[0088] S31: Calculate the hash center loss L HBy determining a hash center in each category, and then determining the final semantic hash center G′=[g′1,g′2,…,g′] based on the sample labels. 5000 ]∈{-1,1} 5000×36 The definition is as follows:
[0089]
[0090] S311: For a single-label dataset with 13 categories, a hash center is determined in each category using the fuzzy C-means clustering algorithm, resulting in 13 hash centers G = [g1, g2, ..., g...]. 13 ]∈{-1,1} 13×36 Therefore, each sample x in the query set X i According to label l′ i ∈{0,1} 1×13 Determine a hash center g′ i That is, the semantic hash center of query set X is G′=[g′1,g′2,…,g′ 5000 ]∈{-1,1} 5000×36 ;
[0091] S312: For a multi-label dataset with 13 categories, firstly, a center is determined in samples sharing the same category using the fuzzy C-means clustering algorithm. This generates 13 centers G = [g1, g2, ..., g...]. 13 ]∈{-1,1} 13×36 Then, based on sample x i The tag I′ i The included categories are determined, and the corresponding hash centers are found. Finally, the semantic hash center, i.e., the sample x, is determined by the value that appears most frequently in each bit of these centers. i Semantic hash center:
[0092] G′=sign(I′ i G)=[g′1,g′2,…,g′ 5000 ]∈{-1,1} 5000×36 (40)
[0093] S32: Calculate the classification loss L C To address the issue of differences in the number of labels in the datasets, two loss functions were used, one applicable to single-label datasets and the other to multi-label datasets.
[0094] (1) Single-label classification loss L single :
[0095]
[0096] (2) Multi-label classification loss L multi :
[0097]
[0098] S33: Calculate the equilibrium loss L B To ensure that the probability of +1 and -1 appearing in the bit hash code is the same, the following definition is made:
[0099]
[0100] S34: Calculate the quantization loss L Q The difference between the real-valued output and the hash code is constrained by adding a regular expression term, defined as follows:
[0101]
[0102] S35: The overall loss function of the fuzzy hash network is:
[0103] L = L H +αL C +βL B +λL Q (45)
[0104] Where α = 0.1, β = 0.003, and λ = 0.1 are hyperparameters.
[0105] Example 2:
[0106] Referring to Example 1, this example will use the parameters and results calculated in Example 1 to compare with other deep hashing algorithms, demonstrating the superiority of this example. In the specific comparison, we compared the average precision (mAP) of different deep hashing algorithms. The final results show that this example is preferred compared to other deep hashing algorithms.
[0107] 1. Comparison of algorithms and metrics
[0108] Referring to relevant research on deep hashing algorithms, the following comparison algorithms were selected in this embodiment:
[0109] 1) DPSH: A deep pairwise supervised hashing algorithm that jointly learns features and hash codes from samples with paired labels. (Paper title: "Feature learning based deep supervised hashing with pairwise labels")
[0110] 2) DBDH: This is a deep balanced discrete hashing algorithm that enables networks to directly learn discrete hash codes. It proposes a loss function that considers pairwise loss and hash code balance to maintain similarity relationships. (Paper title: "Deep balanced discrete hashing for image retrieval")
[0111] 3) VTS: This is an end-to-end trainable visual Transformer hashing model. It uses the ViT model to extract features, removes the MLP header, and adds a hashing module for training. (Paper title: "Vision transformer hashing for image retrieval")
[0112] 4) DPN: A hashing method based on deep polarized networks, which avoids each channel of the network output being zero through differentiable polarization loss. (Paper title: "Deep polarized network for supervised learning of accurate binary hashing codes")
[0113] To evaluate retrieval performance, the non-example uses the average precision (mAP) at different hash code lengths (8 bits, 12 bits, 24 bits, 36 bits) as the evaluation metric.
[0114] 2. Comparison Results
[0115] As can be seen from the table, the non-standard implementation exhibits significant performance advantages across all hash code lengths, demonstrating the effectiveness of the self-attention-guided data blurring mechanism and the Transformer-based consequent parameter learning mechanism, as well as the necessity of capturing data relationships globally. Specifically, as the hash bit length increases from 8 bits to 36 bits, the mAP of the non-standard implementation increases from 0.371 to 0.426, indicating that the model can better preserve the semantic information of images when processing higher-dimensional hash codes, thereby further improving the accuracy of image retrieval.
[0116] To further compare the retrieval results, the non-example was used to perform medical image retrieval on a 36-bit hash code, and the first 8 retrieved images were returned based on the ascending order of the Hamming distance. Figure 3 This is the result of a medical image search on six randomly selected test samples from a lung X-ray image database. A cross under the searched image indicates a search error, meaning the test image and the searched image do not share a category; a checkmark under the searched image indicates a successful search, meaning the test image and the searched image share at least one category. Figure 3As can be seen, the non-example successfully retrieved 8 correct images for all 6 test samples in the lung X-ray image database, indicating that the non-example has excellent retrieval performance.
[0117] In summary, the non-standard implementation method has significant advantages in the field of medical image retrieval, especially in providing more accurate retrieval results when dealing with complex and uncertain medical images.
[0118] Table 1 Comparison of mAP between the non-example and the comparison algorithm.
[0119]
[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A medical image retrieval method based on a fuzzy hash network, characterized in that, Includes the following steps: S1: Establish a medical image database, preprocess the image samples in the database, and divide the database into test sets. and database And randomly select n images from the database as the query set. , For image, For tags; S2: A fuzzy hashing network is constructed based on fuzzy rules. This network includes a data fuzzification mechanism guided by a self-attention mechanism and a consequent parameter learning mechanism based on Transformer. The data is fuzzified using a Gaussian function, and the self-attention score is calculated in the fuzzy space. The fuzzy representation is obtained by using residual connections and combining them with layer normalization. The consequent parameter learning mechanism based on Transformer consists of a Transformer encoder and two multilayer perceptrons. The Transformer encoder is responsible for defuzzification, and the two multilayer perceptrons are used to generate hash codes and predict categories, respectively. Step S2 includes the following steps: S21: The fuzzy rule base of the fuzzy hash network is defined as follows: ; in, For the i-th sample in the query set, Let be the self-attention-guided fuzzification function for the r-th rule antecedent. Let r be the input data corresponding to the fuzzification function of the r-th rule antecedent. It is the consequent of the r-th rule. This is the output of the r-th rule, where R is the number of rules; S22: A Gaussian function is used as the membership function, and the center and width of the Gaussian function are estimated using the fuzzy C-means clustering algorithm; after determining the antecedent parameters of the fuzzy hash network, the sample is calculated. Normalized trigger strength Then the sample The representation in the new fuzzy feature space is: ; in, , for The dimension of a vector; S23: Incorporating the idea of self-attention mechanism, it assigns corresponding similarity weights to feature vectors by evaluating the relevance scores between different samples; for samples... The improved fuzzy mapping is represented as follows: ; in, It represents The dimension of a vector This is to prevent overflow during the calculation of the softmax function; It reflects the similarity between samples. A higher value indicates that the two samples are highly similar in the feature space, while a lower value indicates that the samples are different. S24: To preserve the original fuzzy features, residual connections are used in conjunction with layer normalization to avoid the gradient vanishing problem; therefore, the final fuzzy mapping is represented as: ; in, The normalization operation represents the layer; based on equation (4), the fuzzy mapping of the query set X is finally represented as ; S25: Fuzzy representation of the concept of self-attention The hash code and category output of the r-th rule are obtained through the Transformer-based consequent parameter learning mechanism: ; ; in For the Transformer encoder operation of the r-th rule, Let r be the r-th rule used for predicting the category of the multilayer perceptron. Let r be the multilayer perceptron used to generate hash codes for the r-th rule; S26: Therefore, the hash code and predicted category of the query set are as follows: ; ; in, Map the values to the range [-1, 1]. , and These are the network parameters for the hash code branch and the prediction class branch, respectively. and These are the hash function and the prediction function, respectively. S3: Calculate the loss function based on the hash code and category obtained in step S2: hash center loss. Balance loss Quantification of loss and classification loss The overall loss function is obtained as follows: ,in , , For hyperparameters; S4: Based on the overall loss function, use the alternating learning algorithm to alternately optimize the parameters of the fuzzy hash network, and save the trained fuzzy hash network model; S5: Test set The t-th image sample Input the fuzzy hash network saved in step S4 to obtain the corresponding hash code. k is the hash code length; through the hash code Calculate the Hamming distance with the hash code U of the database. The Hamming distances are sorted in ascending order; the first p retrieved images are returned as required, and the average precision (mAP) of the retrieval is calculated.
2. The medical image retrieval method based on fuzzy hash network according to claim 1, characterized in that, Step S3 includes the following steps: S31: Calculate the hash center loss The final semantic hash center is determined by identifying a hash center in each category and then based on the sample's label. The definition is as follows: ; S311: For a single-label dataset with c categories, a hash center is determined in each category using the fuzzy C-means clustering algorithm, thus generating c hash centers. Therefore, query set Each sample in According to the label Determine a hash center query set The semantic hash center is ; S312: For a multi-label dataset with c categories, first determine a center in samples sharing the same category using the fuzzy C-means clustering algorithm, thus generating c centers for the corresponding c categories. ; Then, based on the sample tags The included categories are determined, and the corresponding hash centers are found. Finally, the semantic hash center, i.e., the sample, is determined by the value that appears most frequently in each bit of these centers. Semantic hash center: ; S32: Calculate classification loss To address the issue of differences in the number of labels in the datasets, two loss functions were used, one applicable to single-label datasets and the other to multi-label datasets. (1) Single-label classification loss : ; (2) Multi-label classification loss : ; S33: Calculate the equilibrium loss To ensure that the probability of +1 and -1 appearing in the bit hash code is the same, the following definition is made: ; S34: Calculate quantization loss The difference between the real-valued output and the hash code is constrained by adding a regular expression term, defined as follows: ; S35: The overall loss function of the fuzzy hash network is: ; in, , , This is a hyperparameter.
Citation Information
Patent Citations
Visual Transform hash method for lung X-ray image retrieval
CN116128846A
Fuzzy Transform Hash method for medical image retrieval target attack
CN118093911A