Medical image retrieval method based on fuzzy hash network
By adopting a fuzzy hash network-based method in medical image retrieval, using self-attention mechanism and Transformer technology to process the complexity and uncertainty of medical images, the problem of insufficient search accuracy and discrimination in the prior art is solved, and more efficient medical image retrieval is achieved.
Patent Information
- Application Number
- CN202510132059.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-02-06
AI Technical Summary
Existing deep hashing algorithms are difficult to effectively process the complexity, uncertainty and data imbalance of images in medical image retrieval, resulting in insufficient retrieval accuracy and discrimination.
Using a medical image retrieval method based on a fuzzy hash network, a fuzzy hash network is constructed to generate hash codes and prediction categories by introducing a fuzzy mechanism of self-attention mechanism and a backpack parameter learning mechanism based on Transformer, and the discriminant and retrieval accuracy of the hash code is improved through multi-directional optimization loss function.
The model's ability to capture complex and fuzzy features of medical images is enhanced, the model's generalization ability is improved, the category imbalance problem is effectively dealt with, and the retrieval accuracy and hash code discrimination are improved.
Smart Images

Figure CN120067379A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and particularly to a medical image retrieval method based on a fuzzy hashing network. Background Art
[0002] The development of medical imaging technology has enabled doctors and researchers to obtain a vast amount of medical image data. For example, the Shanghai AI Laboratory has collected 4.6 million medical images and 19.7 million corresponding masks to build an ultra-large-scale medical image dataset. If similar pathological images can be retrieved quickly and accurately from the vast amount of medical image data, it will help doctors and researchers make diagnoses and conduct research more quickly. Therefore, designing and proposing an efficient retrieval algorithm for large-scale medical image data is a problem worthy of research.
[0003] Hashing algorithms are a class of efficient retrieval algorithms. However, most traditional hashing algorithms use manually extracted features, which are difficult to preserve the similarity in the original space, and have problems such as large semantic gaps, slow retrieval speeds, and low accuracy. In recent years, with the rapid development of deep learning technology, some deep hashing algorithms that combine deep learning technology have been proposed. The main strategy of such algorithms is to first use a convolutional neural network to extract features, and then generate hash codes to achieve image retrieval. In the paper titled "Deep hashing with minimal-distance-separated hash centers", a method for optimizing hash centers is proposed, which uses the Gilbert-Varshamov bound to constrain the distance between hash centers.
[0004] Although current deep hashing algorithms have shown a certain degree of effectiveness, they still face some challenges. First, the complex structures in medical images and the high uncertainty of early lesions make it difficult for existing methods to effectively extract the complex features of images. Deep hashing algorithms usually rely on neural networks to capture complex context relationships, but ignore the complexity of the original data. At the same time, the uncertainty of visual and semantic similarity weakens the discriminability of hash codes. Second, the sample numbers of common diseases and rare diseases or early diseases in medical images vary greatly, resulting in an imbalance between similar pairs and dissimilar pairs in the data, which in turn affects the learning effect of the model. Finally, existing methods mostly focus on pairwise or triplet relationships and ignore the local features of the data, thus limiting the performance of the model in distinguishing similar but not exactly the same samples.
[0005] To address these issues, in recent years, fuzzy systems have gradually become a research hotspot in the field of medical image analysis. A fuzzy system is an intelligent model with strong capabilities for data mining under uncertainty. It mainly achieves the adaptive capture of uncertain information through fuzzy membership degrees. In the paper titled "T2-FDL: a robust sparse representation method using adaptive type-2 fuzzy dictionary learning for medical image classification", a robust sparse representation method based on an adaptive type-2 fuzzy learning system was proposed, which addresses the impacts of noise and uncertainty on medical image classification. Currently, the application of fuzzy systems in the medical field mainly focuses on the diagnostic analysis of specific diseases, leveraging their advantages in dealing with uncertainty and complexity.
[0006] In summary, existing deep hashing algorithms still face numerous challenges in dealing with the complexity, uncertainty, and data 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 objective of the present invention is to provide a medical image retrieval method based on a fuzzy hashing network, mainly 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 more precise diagnostic support for clinicians and promoting the research and exploration of related diseases.
[0008] To achieve the above-mentioned objective of the invention, the technical solution adopted by the present invention is as follows: A medical image retrieval method based on a fuzzy hashing network includes the following steps:
[0009] S1: Establish a medical image database, preprocess the image samples in the database, divide the test set T q and the database T v , and randomly select n images from the database as the query set X is the image, and L ′ is the label;
[0010] S2: Construct a fuzzy hashing network based on fuzzy rules. This network includes a data fuzzification mechanism guided by the self-attention mechanism and a consequent parameter learning mechanism based on Transformer. Fuzzify the data through the Gaussian function, calculate the self-attention scores in the fuzzy space, and obtain the fuzzy representation using residual connections and layer normalization methods. The consequent parameter learning mechanism based on Transformer consists of a Transformer encoder and two multi-layer perceptrons. The Transformer encoder is responsible for defuzzification, and the two multi-layer perceptrons are used to generate hash codes and predict categories respectively.
[0011] S3: Calculate the loss function based on the hash codes and categories obtained in step S2: the hash center loss L H , the balance loss L B , the quantization loss L Q and the classification loss L C , to obtain the overall loss function: L = L H + αL C + βL B + λL Q , where α, β, and λ are hyperparameters.
[0012] S4: According to the overall loss function, use the alternating learning algorithm to alternately optimize the parameters of the fuzzy hashing network and save the trained fuzzy hashing network model.
[0013] S5: Input the t-th image sample q t in the test set Q into the fuzzy hashing network saved in step S4 to obtain the corresponding hash code b t ∈ {-1, 1} 1×k , where k is the length of the hash code; calculate the Hamming distance dist t between the hash code b H and the hash codes U in the database, and sort the Hamming distances in ascending order; return the top p retrieved images and calculate the mean average precision mAP of the retrieval as required.
[0014] Further, the step S2 includes the following steps:
[0015] S21: The fuzzy rule base of the fuzzy hashing network is defined as follows:
[0016]
[0017] Among them, x i is the i-th sample of the query set, is the self-attention-guided fuzzification function of the r-th rule antecedent, is 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 ) is the output of the r-th rule, and R is the number of rules;
[0018] S22: Use the Gaussian function as the membership function and utilize the fuzzy C-means clustering algorithm to estimate the center and width of the Gaussian function; after determining the antecedent parameters of the fuzzy hash network, calculate the normalized triggering intensity of the sample x i Then the representation of the sample x in the new fuzzy feature space is: i where x
[0019]
[0020] where x i,e =(1, x i ) ∈ R 1×(d+1) , and d is the dimension of the x i vector;
[0021] S23: Incorporate the idea of the self-attention mechanism and assign corresponding similarity weights to the feature vectors by evaluating the correlation scores between different samples; for the sample x i , the improved fuzzy mapping is represented as follows:
[0022]
[0023] where d + 1 represents the dimension of the vector, is to prevent overflow during the calculation of the softmax function; reflects the similarity between samples, a higher value indicates a stronger similarity between two samples in the feature space, while a lower value indicates the difference between samples;
[0024] S24: To retain the original fuzzified features, use residual connections and combine layer normalization methods to avoid the problem of gradient vanishing; thus, the final fuzzy mapping representation is:
[0025]
[0026] where LN(·) represents the layer normalization operation; based on Equation (4), the final fuzzy mapping representation of the query set X is
[0027] S25: For the fuzzy representation incorporating the self-attention idea obtain the hash code and class output of the r-th rule in the consequent parameter learning mechanism based on Transformer:
[0028]
[0029] Among them, the Transformer r (·) is the Transformer encoder operation of the r-th rule, is the multi-layer perceptron for predicting categories of the r-th rule, is the multi-layer perceptron for generating hash codes of the r-th rule;
[0030] S26: Therefore, the hash code and predicted category of the query set are respectively:
[0031]
[0032] Among them, maps the value to the range [-1, 1], θ h and θ c are the network parameters of the hash code branch and the predicted category branch respectively, and h(·; ·) and f(·; ·) are the hash function and the prediction function respectively.
[0033] Furthermore, the 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′ n ∈ {-1, 1} n×k , defined as follows:
[0035]
[0036] S311: For a single-label data set with c categories, determine a hash center in each category through the fuzzy C-means clustering algorithm, then generate c hash centers G = [g 1 , g 2 , …, g c ∈ {-1, 1} c×k ; Therefore, each sample x i in the query set X i determines a hash center g′ 1×c according to the label I′ i , that is, the semantic hash center of the 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, first determine a center through the fuzzy C-means clustering algorithm among samples sharing the same category. Then, a total of c centers G = [g 1 , g 2 , …, g c ∈ {-1, 1} c×k are generated for the corresponding c categories. Then, based on the label I′ i of the sample x i , determine the included categories and find the corresponding hash centers. Finally, determine the semantic hash center based on the values that appear more frequently in each bit among these centers, that is, the semantic hash center of the sample x i :
[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 . For the problem that the number of label information in the dataset varies, two loss functions applicable to single-label and multi-label datasets are used respectively;
[0040] (1) Single-label classification loss L single :
[0041]
[0042] (2) Multi-label classification loss L multi :
[0043]
[0044] S33: Calculate the balance loss L B . To ensure that the probabilities of +1 and -1 appearing in the bit hash code are the same, it is defined as follows:
[0045]
[0046] S34: Calculate the quantization loss L Q . By adding a regularization term to constrain the difference between the real-valued output and the hash code, it is defined as follows:
[0047]
[0048] S35: The overall loss function of the fuzzy hash network is:
[0049] L = L H + αLC +βL B +λL Q (30)
[0050] Among them, α, β, and λ are hyperparameters.
[0051] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0052] (1) Enhance the representation ability of uncertain information: By proposing a fuzzy hashing network and introducing a fuzzification mechanism of the self-attention mechanism 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) Improve the generalization ability of the model: The consequent parameter learning mechanism based on Transformer proposed in the present invention can dynamically adjust the parameters of the fuzzy system when processing complex medical image data, thereby enhancing the generalization 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 address the problem of class imbalance: The proposed hash center loss function can reasonably determine the hash center of each class and calculate the semantic hash center position of the samples by introducing fuzzy C-means clustering, thereby effectively addressing the problem of class imbalance in medical image data. This method not only enhances the intra-class compactness but also can effectively distinguish samples that are similar but do not belong to the same class.
[0055] (4) Improve the retrieval accuracy and discriminability of hash codes: Based on the hash center loss, balance loss, quantization loss, and classification loss, the present invention constructs a multi-faceted optimized loss function. Compared with traditional methods, the design of this multiple loss function further ensures the discriminability of hash codes and the accuracy of image retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention.
[0057] Figure 1 It is a schematic flow diagram of the medical image retrieval method based on the fuzzy hashing network of the present invention;
[0058] Figure 2 It is an overall block diagram of the medical image retrieval method based on the fuzzy hashing network of the present invention;
[0059] Figure 3The image retrieval results of the lung X-ray dataset based on the 36-bit hash code of the present invention. Detailed implementation manners
[0060] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0061] Embodiment 1:
[0062] Refer to Figures 1 to 3 , the technical solution provided in this embodiment is a medical image retrieval method based on a fuzzy hash network, including the following steps:
[0063] S1: Establish a lung X-ray image database, preprocess the image samples in the database. The processed database contains 47,723 images of 13 categories; 1,300 images are divided into a test set and 46,423 images are used as the database and 5,000 images are randomly selected from the database as the query set X is the image, and L ′ is the label;
[0064] S2: Construct a fuzzy hash network based on fuzzy rules. The 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 through a Gaussian function, the self-attention score is calculated in the fuzzy space, and the fuzzy representation is obtained by using residual connection and combining layer normalization method; the consequent parameter learning mechanism based on Transformer consists of a Transformer encoder and two multi-layer perceptrons; the Transformer encoder is responsible for defuzzification, and the two multi-layer perceptrons are respectively used to generate hash codes and predict categories;
[0065] S3: Calculate the loss function according to the hash code and category obtained in step S2: hash center loss L H , balance loss L B , quantization loss L Q and classification loss L C , to obtain the overall loss function: L = L H + αL C + βL B + λL Q , where α = 0.1, β = 0.003, λ = 0.1 are hyperparameters;
[0066] S4: According to 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: Input the t-th image sample q in the test set Q t into the fuzzy hashing network saved in step S4 to obtain the corresponding hash code b t ∈{-1, 1} 1×k , where k = 36 is the hash code length; calculate the Hamming distance dist between the hash code b t and the hash code U in the database H , and sort the Hamming distances in ascending order; return the top 8 retrieved images as required and calculate the average precision of the retrieval to be 0.426
[0068] According to the medical image retrieval method based on a fuzzy hashing network described in claim 1, wherein the specific steps of step S2 are as follows:
[0069] S21: The fuzzy rule base of the fuzzy hashing network is defined as follows:
[0070]
[0071] where x i is the i-th sample in the query set, is the self-attention-guided fuzzification function of the r-th rule antecedent, is 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 ) is the output of the r-th rule, and R = 2 is the number of rules;
[0072] S22: Use the Gaussian function as the membership function and use the fuzzy C-means clustering algorithm to estimate the center and width of the Gaussian function; after determining the antecedent parameters of the fuzzy hashing network, calculate the normalized triggering intensity of the sample x i Then the representation of the sample x in the new fuzzy feature space is: i
[0073]
[0074] where x i,e =(1, x i ) ∈ R 1×(d+1) , d = 6712 is the dimension of the x i vector;
[0075] S23: Incorporate the idea of the self-attention mechanism and assign corresponding similarity weights to the feature vectors by evaluating the correlation scores between different samples; for the sample x i , the improved fuzzy mapping is represented as follows:
[0076]
[0077] Among them, d + 1 = 6713 represents the dimension of the vector, which is to prevent overflow during the calculation of the softmax function; reflects the similarity between samples. A higher value indicates that two samples have a strong similarity in the feature space, while a lower value indicates the difference between samples;
[0078] S24: To retain the original fuzzified features, residual connections and layer normalization methods are used to avoid the problem of gradient vanishing; therefore, the final fuzzy mapping is represented as:
[0079]
[0080] Among them, LN(·) represents the layer normalization operation; based on Equation (4), the fuzzy mapping of the query set X is finally represented as
[0081] S25: For the fuzzy representation integrating the self-attention idea obtain the hash code and class output of the r-th rule in the consequent parameter learning mechanism based on Transformer:
[0082]
[0083] where Transformer r (·) is the Transformer encoder operation of the r-th rule, is the multi-layer perceptron for predicting the class of the r-th rule, is the multi-layer perceptron for generating the hash code of the r-th rule;
[0084] S26: Therefore, the hash code and predicted class of the query set are respectively:
[0085]
[0086] Among them, maps the value to the range [-1, 1], θ h and θ c are the network parameters of the hash code branch and the predicted class branch respectively, and h(·; ·) and f(·; ·) are the hash function and the prediction function respectively.
[0087] The medical image retrieval method based on the fuzzy hashing network according to claim 1, wherein the specific steps of step S3 are as follows:
[0088] 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′ 5000 ∈ {-1, 1} 5000×36 , defined as follows:
[0089]
[0090] S311: For a single-label dataset with 13 categories, determine a hash center in each category through the fuzzy C-means clustering algorithm, then generate 13 hash centers G = [g 1 , g 2 , …, g 13 ∈ {-1, 1} 13×36 ; Therefore, for each sample x i in the query set X i according to the label l′ 1×13 ∈ {0, 1} i determine a hash center g′ 1 , g′ 2 , …, g′ 5000 ∈ {-1, 1} 5000×36 ;
[0091] S312: For a multi-label dataset with 13 categories, first determine a center in the samples sharing the same category through the fuzzy C-means clustering algorithm, then generate 13 centers G = [g 1 , g 2 , …, g 13 ∈ {-1, 1} 13×36 ; Then, according to the label I′ i of the sample x i determine the included categories, and find the corresponding hash centers. Finally, determine the semantic hash center by the value that appears more frequently in each bit among these centers, that is, the semantic hash center of the sample x i :
[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 , for the problem that the number of label information in the dataset varies, two loss functions applicable to single-label datasets and multi-label datasets are used respectively;
[0094] (1) Single-label classification loss L single :
[0095]
[0096] (2) Multi-label classification loss L multi :
[0097]
[0098] S33: Calculate the balance loss L B , to ensure that the probabilities of +1 and -1 appearing in the bit hash code are the same, it is defined as follows:
[0099]
[0100] S34: Calculate the quantization loss L Q , by adding a regularization term to constrain the difference between the real-valued output and the hash code, it is 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] Among them, α = 0.1, β = 0.003, λ = 0.1 are hyperparameters.
[0105] Example 2:
[0106] Referring to Example 1, this example will use the parameters and results calculated in Example 1, and compare with other deep hash algorithms to prove the superiority of the non-example. In the specific comparison, we compared different deep hash algorithms in terms of the mean average precision mAP in retrieval. The final results show that the non-example is preferred compared to other deep hash algorithms.
[0107] 1. Comparison algorithms and metrics
[0108] Referring to the relevant research on deep hash algorithms, the following comparison algorithms are selected in this example:
[0109] 1) DPSH: It is a deep pairwise supervised hashing algorithm that jointly performs feature learning and hash code learning on samples with pairwise labels. (Paper title: "Feature learning based deep supervised hashing with pairwise labels")
[0110] 2) DBDH: It is a deep balanced discrete hashing algorithm that enables the network to directly learn discrete hash codes and proposes a loss function considering pairwise loss and hash code balance to maintain similarity relationships. (Paper title: "Deep balanced discrete hashing for image retrieval")
[0111] 3) VTS: It is an end-to-end trainable vision Transformer hashing model that extracts features using the ViT model, removes the MLP head, and attaches a hash module for training. (Paper title: "Vision transformer hashing for image retrieval")
[0112] 4) DPN: It is a hashing method based on a deep polarization network that avoids each channel of the network output being zero through a differentiable polarization loss. (Paper title: "Deep polarized network for supervised learning of accurate binary hashing codes")
[0113] To evaluate the retrieval performance, the mean average precision (mAP) at different hash code lengths (8 bits, 12 bits, 24 bits, 36 bits) is used as the evaluation metric in this embodiment.
[0114] 2. Comparison results
[0115] As can be seen from the table, this embodiment demonstrates significant performance advantages at all hash code lengths, proving the effectiveness of the data fuzzification mechanism guided by the self-attention mechanism and the posterior parameter learning mechanism based on Transformer, as well as the necessity of capturing global data relationships. In particular, as the hash bit length increases from 8 bits to 36 bits, the mAP of this embodiment increases from 0.371 to 0.426, indicating that the model can better retain 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 effects, medical image retrieval is performed on this embodiment with 36-bit hash codes, and the top 8 retrieved images are returned according to the ascending order of Hamming distance results. Figure 3These are the medical image retrieval results of 6 randomly selected test samples on the lung X-ray image database. Among them, a cross under the retrieved image represents a retrieval error, that is, there is no shared category between the test image and the retrieved image; a tick under the retrieved image represents a correct retrieval, that is, there is at least one shared category between the test image and the retrieved image. From Figure 3 it can be seen that in the non-embodiment, the correct 8 images were successfully retrieved for all 6 test samples on the lung X-ray image database, indicating that the non-embodiment has excellent retrieval effects.
[0117] In summary, the non-embodiment has significant advantages in the field of medical image retrieval. Especially when dealing with complex and uncertain medical images, it can provide more accurate retrieval results.
[0118] Table 1 Comparison table of non-embodiment and comparative algorithm in terms of mAP
[0119]
[0120] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, 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 retrieval method based on fuzzy hash network, characterized in that: The following steps are involved: S1: Establish a medical image database, preprocess the image samples in the database, and divide the test set T q and database T v , and randomly select n images from the database as the query set X is the image, L′ is the label; S2: A fuzzy hash network is constructed based on fuzzy rules. The network includes a data fuzzification mechanism guided by a self-attention mechanism and a subsequent parameter learning mechanism based on a Transformer. The data is fuzzified by a Gaussian function, the self-attention score is calculated in the fuzzy space, and the fuzzy representation is obtained by using a residual connection combined with a layer normalization method. The subsequent parameter learning mechanism based on a Transformer consists of a Transformer encoder and two multi-layer perceptrons. The Transformer encoder is responsible for defuzzification, and the two multi-layer perceptrons are used to generate hash codes and predict categories respectively. 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 , quantization loss L Q and classification loss L C , we get the overall loss function: L = L H +αL C +βL B +λL Q , where α, β, and λ are hyperparameters; S4: According to the overall loss function, the fuzzy hash network parameters are alternately optimized using an alternating learning algorithm, and the trained fuzzy hash network model is saved; S5: Take the tth image sample q in the test set Q t Input the fuzzy hash network saved in step S4 and get the corresponding hash code b t ∈{-1,1} 1×k , k is the length of the hash code; through the hash code b t Calculate the Hamming distance dist with the hash code U of the database H , and sort the Hamming distances in ascending order; return the first p images retrieved and calculate the average precision mAP of the retrieval as required.
2. The medical image retrieval method based on fuzzy hash network according to claim 1 is characterized in that: The step S2 comprises the following steps: S21: The fuzzy rule base of the fuzzy hash network is defined as follows: Among them, x i is the i-th sample in the query set, is the self-attention guided fuzzification function of the r-th rule antecedent, is the input data corresponding to the fuzzification function of the rth rule antecedent, TCPL r (x i ) is the consequent of the rth rule, f r (x i ) is the output of the rth rule, and R is the number of rules; S22: Use Gaussian function as the membership function and use fuzzy C-means clustering algorithm to estimate the center and width of the Gaussian function; after determining the antecedent parameters of the fuzzy hash network, calculate the sample x i Normalized trigger strength Then the sample x i The representation in the new fuzzy feature space is: Among them, x i,e =(1,x i )∈R 1×(d+1) , d is x i The dimension of the vector; S23: Integrate the idea of self-attention mechanism, by evaluating the correlation scores between different samples, assign corresponding similarity weights to feature vectors; for sample x i , the improved fuzzy mapping is expressed as follows: Among them, d+1 represents The dimension of the vector, This is to prevent overflow when calculating the softmax function; It reflects the similarity between samples. A higher value indicates that the two samples have a stronger similarity in the feature space, while a lower value indicates the difference between the samples. S24: In order to retain the original blurred features, residual connections are used in combination with layer normalization to avoid the gradient vanishing problem; therefore, the final blurred map is expressed as: Where LN(·) represents the layer normalization operation; based on formula (4), the fuzzy mapping of the query set X is finally expressed as S25: Fuzzy representation of the integration of self-attention ideas In the Transformer-based subsequent parameter learning mechanism, the hash code and category output of the rth rule are obtained: Transformer r (·) is the Transformer encoder operation of the rth rule, is the multi-layer perceptron for predicting categories of the rth rule, is the multi-layer perceptron used to generate hash codes for the rth rule; S26: Therefore, the hash codes and predicted categories of the query set are: in, Map the values to the range [-1,1], θ h and θ c are the network parameters of the hash code branch and the prediction category branch, h(·;·) and f(·;·) are the hash function and prediction function, respectively.
3. The medical image retrieval method based on fuzzy hash network according to claim 1 is characterized in that: The step S3 comprises the following steps: 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′] according to the sample label n ]∈{-1,1} n×k , defined as follows: S311: For a single-label data set with c categories, a hash center is determined in each category by the fuzzy C-means clustering algorithm, and c hash centers G = [g1, g2, ..., g c ]∈{-1,1} c×k ; Therefore, for 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 the query set X is G′=[g′1,g′2,…,g′ n ]∈{-1,1} n×k ; S312: For a multi-label dataset with c categories, first determine a center among samples sharing the same category using the fuzzy C-means clustering algorithm, then generate c centers G = [g1, g2, ..., g c ]∈{-1,1} c×k ; Then, according to the sample x i Label I′ i Determine the included categories and find the corresponding hash centers. Finally, determine the semantic hash centers by the values that appear most frequently in each bit of these centers, that is, sample x i The semantic hash center of: G′=sign(I′ i G)=[g′1,g′2,…,g′ n ]∈{-1,1} n×k (10) S32: Calculate the classification loss L C ,To address the problem of differences in the number of label information in the data sets, two loss functions suitable for single-label data sets and multi-label data sets were used respectively; (1) Single-label classification loss L single : (2) Multi-label classification loss L multi : S33: Calculate the balance loss L B , to ensure that the probability of +1 and -1 appearing in the bit hash code is the same, it is defined as follows: S34: Calculate the quantization loss L Q , by adding a regularization term to constrain the difference between the real-valued output and the hash code, defined as follows: S35: The overall loss function of the fuzzy hash network is: L=L H +αL C +βL B +λL Q (15) Among them, α, β, and λ are hyperparameters.
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
Methods, apparatus, and systems for transforming unstructured natural language information into structured computer- processable data
WO2019050968A1
Image search method, apparatus, device, and computer-readable storage medium
WO2020182019A1
Cited By
Agricultural disease hash retrieval method based on DV stabilization and adaptive feature enhancement
CN121278128A