Medical image retrieval method of dynamic locality sensitive hashing based on approximate matching
By using the dynamic local sensitive hashing method and the weighted k-nearest neighbor algorithm in medical image retrieval, the problem of shallow features being difficult to meet the accuracy of medical image recognition and the large amount of calculation required for massive data retrieval is solved, and efficient and accurate medical image retrieval is achieved. .
Patent Information
- Application Number
- CN202410581169.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-11
AI Technical Summary
It is difficult for the existing technology to use shallow features in medical image retrieval to meet the high similarity recognition accuracy requirements, and the retrieval of massive medical image data is computationally intensive and time-consuming.
A dynamic local sensitive hashing method based on approximate matching is used to construct a retrieval index by extracting directional gradient histograms, local binary patterns and Haar-like eigenvalues, and combined with the weighted k-nearest neighbor algorithm to dynamically adjust the hash bucket granularity and construct a composite hash Hash functions and multi-index hash tables optimize hash table retrieval performance and adjust the distance formula between similar pictures.
It improves the efficiency and accuracy of medical image retrieval, reduces hash conflicts, reduces retrieval time, and meets the high accuracy and low time overhead of clinical needs.
Smart Images

Figure CN118551071A
Abstract
Description
Technical Field
[0001] The invention relates to a medical image retrieval method based on a dynamic local sensitive hashing method of approximate matching, and belongs to the field of medical image retrieval. Background Art
[0002] Image similarity in image retrieval is determined by calculating the distance between image features in a feature index library constructed from shallow features such as color, shape, and texture of the image.
[0003] The integration of medical imaging technology and computer vision technology, especially the application of computer-aided detection and computer-aided diagnosis in medical image retrieval, provides a retrieval basis for medical retrieval of similar case images. Medical images have the characteristics of small differences between classes and large differences within classes. Therefore, the above-mentioned shallow feature method for medical image retrieval is difficult to meet the demand for high similarity medical image recognition accuracy.
[0004] With the increase in hospital diagnosis cases, a large amount of medical imaging data is generated. How to reduce the amount of image calculation and the time cost in the retrieval of massive medical imaging data has become an urgent problem to be solved. Summary of the invention
[0005] The purpose of the present invention is to solve the technical problems of low accuracy of medical image recognition and large computational and time-consuming retrieval of massive medical image data by using shallow features for massive medical image retrieval. A medical image retrieval method based on dynamic local sensitive hashing method of approximate matching is proposed.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] The medical image retrieval method of the present invention based on the dynamic local sensitive hashing method of approximate matching comprises the following steps:
[0008] Step 1: Input image data into the original image database.
[0009] Step 2: Extract the eigenvalues of the directional gradient histogram, the eigenvalues of the local binary pattern and the Haar-like eigenvalues based on the image data obtained in step 1 to construct the image retrieval index.
[0010] Step 2.1: Construct an index dataset I of N images. As shown in formula (1):
[0011]
[0012] After inputting the picture data, the index image database forms an index data set I of N images. i Represents an image with index i in the dataset.
[0013] Step 2.2: Define the corresponding label vector L for each image in the index dataset I. As shown in formula (2):
[0014]
[0015] Among them, Li∈{0,1} c , C is used to count the total number of label categories of the index dataset I, and the label indicates the category to which the current image belongs.
[0016] Step 2.3: Extract the eigenvalues of the directional gradient histogram of the image to characterize the edge semantic processing of the lesion area.
[0017] Step 2.4: Extract the local binary pattern feature values of the image for texture semantic processing to characterize the lesion area.
[0018] Step 2.5: Extract Haar-like eigenvalues to characterize the grayscale change feature processing of the lesion area.
[0019] Step 2.6: Construct an image retrieval index based on the feature values obtained from steps 2.3 to 2.5 to improve the accuracy of medical image retrieval.
[0020] Step 3: Based on the image retrieval index obtained in step 2, the medical image retrieval method is optimized using the dynamic local sensitive hashing method and the weighted k-nearest neighbor algorithm.
[0021] Step 3.1: According to the index data set I obtained in step 2 and the feature values of the image, a hash address is assigned to construct a hash function and mapped into a hash table, that is, a dynamic local sensitive hashing method.
[0022] Step 3.2: Define the retrieval keywords based on the label vector L obtained in step 2.
[0023] Step 3.3: Establish the corresponding relationship between the search keyword and the hash function;
[0024] Step 3.3.1: To satisfy the stable distribution of data in the hash table, the hash function is defined as shown in formula (3):
[0025]
[0026] Where S is a random n-dimensional vector that follows the standard normal distribution N(0,1), m is the data set vector, F is a random integer selected from (0,W), and W is the length of the segment on the line;
[0027] Step 3.3.2: Construct a composite hash function and set a multi-index hash table through a hash function, as shown in formula (4); used to improve the collision probability of neighboring points and the non-collision probability of non-neighboring points in the hash table; thereby, reducing the collision of the hash table on the hash bucket to improve the performance of hash table retrieval;
[0028] g1(m i )=(h 11 (m i ),h 12 (m i ),…,(h 1Z (m i ))(i=1,…,z)
[0029] …
[0030] g V (m i )=(h V1 (m i ),h V2 (m i ),…,(h VZ (m i ))(i=1,…,z) (4)
[0031] Among them, V, Z are randomly generated matrices based on the data set The dimension of this matrix maps the data set into V projection spaces.
[0032] Step 3.4: Retrieve image data from the hash table and use K nearest neighbors to display the retrieval results.
[0033] Step 3.4.1: Enter the keyword to be searched and calculate the address of each hash function where the query point falls. If the hash function family is constructed by n hash functions, n addresses can be calculated.
[0034] Step 3.4.2: Calculate the distance between the remaining addresses in the hash table and the address in the n search address field in step 3.4.1 to form a local neighborhood structure. The distance measure for the local neighborhood structure is shown in formula (5):
[0035]
[0036] Among them, x i is the hash address obtained in step 3.4.1, x j For x i In the field with x i Close points, w ij is x i From its neighborhood x j ∈N(x i) to obtain the reconstruction matrix, that is, to construct the neighborhood linear neighborhood weight matrix w ij As shown in formula (6), it is used to measure x j With x i similarity.
[0037]
[0038] st∑ j w ij =1,w jk ≥0 (7)
[0039] Among them, the linear neighborhood weight matrix of the neighborhood must satisfy the conditions shown in formula (7). j ) jk represents the local Gram matrix; x i The Gram matrix at the point is expressed as (G j ) jk =(x i -y i ) T (x i -y i ).
[0040] Step 3.4.3: Sort the results according to the obtained distance and select the nearest K neighboring search results for display.
[0041] The present invention utilizes step 3 to optimize the medical image retrieval method (i.e., after extracting the directional gradient histogram eigenvalues, local binary pattern eigenvalues and Haar-like eigenvalues from the image data according to step 2 to construct the image retrieval index, the medical image retrieval method is optimized using the dynamic local sensitive hashing method and the weighted k-nearest neighbor algorithm), to achieve the optimization of the medical image retrieval method.
[0042] Beneficial effects:
[0043] The present invention discloses a medical image retrieval method based on a dynamic local sensitive hashing method of approximate matching. In order to solve the hash conflict problem caused by the unclear semantic features of shallow features in the existing approximate matching algorithm, the uneven distribution of data in the data set, and the large amount of calculation and time overhead when the amount of data is too large, an image retrieval strategy based on a dynamic local sensitive hashing algorithm and a weighted K-nearest neighbor algorithm is proposed to dynamically adjust the granularity of the hash bucket to reduce the hash conflicts generated on the bucket during retrieval. A hash function that satisfies a stable distribution is established, and a composite hash function is constructed through the hash function and a multi-index hash table is set to increase the collision probability of neighbor points in the hash table and the non-collision probability of non-neighbor points, thereby reducing the collision of the hash table on the hash bucket to improve the performance of the hash table retrieval. The similarity graph is adjusted by the neighborhood linear neighborhood weight matrix
[0044] The distance formula between slices uses the optimized K nearest neighbor algorithm to solve the problem of long image retrieval time and low efficiency caused by the linear search image retrieval method. The images calculated by this method can provide image similarity guarantee, which can improve the efficiency and accuracy of medical image retrieval and meet clinical needs well. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of a medical image retrieval method based on dynamic local sensitive hashing method of approximate matching;
[0046] Figure 2 This is a CT image of the lungs;
[0047] Figure 3 This is a CT image of the liver;
[0048] Figure 4 This is a CT image of the kidney;
[0049] Figure 5 For chest X-ray; DETAILED DESCRIPTION
[0050] In order to better illustrate the purpose and advantages of the present invention, the invention is further described below in conjunction with the accompanying drawings and examples. It should be noted that the implementation of the present invention is not limited to the following embodiments, and any form of modification or change made to the present invention will fall within the protection scope of the present invention.
[0051] Example
[0052] like Figure 1 As shown, the medical image retrieval method of the present invention based on the dynamic local sensitive hashing method of approximate matching is specifically implemented in the following steps:
[0053] Step 1: Input image data into the original image database.
[0054] Step 2: Extract the eigenvalues of the directional gradient histogram, the eigenvalues of the local binary pattern and the Haar-like eigenvalues based on the image data obtained in step 1 to construct the image retrieval index.
[0055] Step 2.1: Construct an index dataset I of N images. As shown in formula (8):
[0056]
[0057] After inputting the picture data, the index image database forms an index data set I of N images. i Represents an image with index i in the dataset.
[0058] Step 2.2: Define the corresponding label vector L for each image in the index dataset I. As shown in formula (9):
[0059]
[0060] Among them, Li∈{0,1} c , C is used to count the total number of label categories of the index dataset I, and the label indicates the category to which the current image belongs.
[0061] Step 2.3: Extract the eigenvalues of the directional gradient histogram of the image to characterize the edge semantic processing of the lesion area.
[0062] In the embodiment, when extracting the eigenvalues of the directional gradient histogram of the image, the image is first grayed, and the input image is normalized in color space as shown in formula (10), and the contrast of the image is adjusted to reduce the impact of local shadows and illumination changes in the image, while suppressing noise interference. The gamma coefficient is preferably 1 / 2.
[0063] I(x,y)=I(x,y) gamma (10)
[0064] Secondly, the size and direction gradient of each pixel in the image are calculated as shown in equations (11) and (12) to capture the contour information and further weaken the interference of illumination.
[0065]
[0066] a(x,y)=tan -1 (G x (x,y) / G y (x,y)) (12)
[0067] Among them, G(x,y) is the magnitude of each pixel gradient, α(x,y) is the direction of each pixel gradient, then G x (x,y) and G y (x,y) are represented by, G x (x,y)=I(x+1,y)-I(x-1,y), G y (x,y)=I(x,y+1)-I(x,y-1).
[0068] Finally, the image is segmented into units and the number of gradient histogram gradients of the units is counted. The segmented units are re-blocked and the feature values obtained after the blocks are used as the directional gradient histogram features. Thus, the edge semantic processing of the lesion area is completed.
[0069] Step 2.4: Extract the local binary pattern feature values of the image for texture semantic processing to characterize the lesion area.
[0070] In the embodiment, in extracting the local binary pattern feature value of the image, a window of 3*3 is defined as an example, and the grayscale values of the adjacent 8 pixels are compared with the central pixel of the window as the threshold. If the surrounding pixel value is greater than the central pixel value, the position of the pixel point is marked as 1, otherwise it is 0. The local binary pattern feature value of the central pixel point of the 3*3 window is obtained. Thus, the texture semantic processing of characterizing the lesion area is completed.
[0071] Step 2.5: Extract Haar-like eigenvalues to characterize the grayscale change feature processing of the lesion area.
[0072] In the embodiment, edge features, linear features, center features and diagonal features of the image are extracted and combined into a feature template. The feature template contains two kinds of rectangles, white and black, and the feature value of the template is defined as the sum of pixels of the white rectangle minus the sum of pixels of the black rectangle.
[0073] Step 2.6: Construct an image retrieval index based on the feature values obtained from steps 2.3 to 2.5 to improve the accuracy of medical image retrieval.
[0074] In the embodiment, the above three eigenvalues are used to construct the image retrieval index by using the data labels shown in formula (13) through the similarity matrix S.
[0075] S={s ij}{0,1} N*N (13)
[0076] If at least one of the labels is the same, s ij =1; when the samples are different for all labels, s ij =0.
[0077] Step 2.6: Construct an image retrieval index based on the feature values obtained from steps 2.3 to 2.5 to improve the accuracy of medical image retrieval.
[0078] Step 3: Based on the image retrieval index obtained in step 2, the medical image retrieval method is optimized using the dynamic local sensitive hashing method and the weighted k-nearest neighbor algorithm.
[0079] Step 3.1: According to the index data set I obtained in step 2 and the feature values of the image, a hash address is assigned to construct a hash function and mapped into a hash table, that is, a dynamic local sensitive hashing method.
[0080] In the embodiment, when the hash table length is a fixed value, when there are many keywords and the hash table is clustered, the performance will drop sharply. Therefore, the hash bucket granularity is dynamically adjusted to reduce the hash conflicts generated on the bucket during retrieval.
[0081] Step 3.2: Define the retrieval keywords based on the label vector L obtained in step 2.
[0082] Step 3.3: Establish the corresponding relationship between the search keyword and the hash function;
[0083] Step 3.3.1: To satisfy the stable distribution of data in the hash table, the hash function is defined as shown in formula (14):
[0084]
[0085] Where S is a random n-dimensional vector that follows the standard normal distribution N(0,1), m is the data set vector, F is a random integer selected from (0,W), and W is the length of the segment on the line;
[0086] Step 3.3.2: Construct a composite hash function through a hash function and set a multi-index hash table, as shown in formula (15); used to improve the collision probability of neighboring points and the non-collision probability of non-neighboring points in the hash table; thereby, reducing the collision of the hash table on the hash bucket to improve the performance of hash table retrieval;
[0087] g1(m i )=(h 11 (m i ),h 12 (m i ),…,(h 1Z (m i ))(i=1,…,z)
[0088] …
[0089] g V (m i )=(h V1 (m i ),h V2 (m i ),…,(h VZ (m i ))(i=1,…,z) (15)
[0090] Among them, V, Z are randomly generated matrices based on the data set The dimension of this matrix maps the data set into V projection spaces.
[0091] In the embodiment, V, Z are randomly generated matrices based on the data set The matrix maps the data set into V projection spaces. That is, a series of single hash functions are h1,h2,…,h n , select h1 to h k The composition function g(x) is shown in formula (16).
[0092] g1(m i )=(h 11 (m i ),h 12 (m i ),…,(h 1Z (m i ))(i=1,…,z)
[0093] …
[0094] g V (m i )=(h V1 (m i ),h V2 (m i ),…,(h VZ (m i ))(i=1,…,z) (16)
[0095] Step 3.4: Retrieve image data from the hash table and use K nearest neighbors to display the retrieval results.
[0096] Step 3.4.1: Enter the keyword to be searched and calculate the address of each hash function where the query point falls. If the hash function family is constructed by n hash functions, n addresses can be calculated.
[0097] Step 3.4.2: Calculate the distance between the remaining addresses in the hash table and the address in the n search address field in step 3.4.1 to form a local neighborhood structure. The distance measure for the local neighborhood structure is shown in formula (17):
[0098]
[0099] Among them, x i is the hash address obtained in step 3.4.1, x j For x i In the field with x i Close points, w ij is x i From its neighborhood x j ∈N(x i ) to obtain the reconstruction matrix, that is, to construct the neighborhood linear neighborhood weight matrix w ij As shown in formula (18), it is used to measure x j With x i similarity.
[0100]
[0101] st∑ j w ij =1,w jk ≥0 (19)
[0102] Among them, the neighborhood linear neighborhood weight matrix must satisfy the conditions shown in formula (19). (G j ) jk represents the local Gram matrix; x i The Gram matrix at the point is expressed as (G j ) jk =(x i -y i ) T (x i -y i ).
[0103] In the embodiment, the image feature information corresponding to the label is used as the input matrix, the k neighboring points of the point are found by the local neighborhood structure distance measurement method, and the constraint conditions are set for the reconstruction matrix The weight is 0, that is, w ij =0, w ij >0. Thus, the neighborhood linear neighborhood weight matrix w is constructed ij . Select unlabeled data x u (l+1≤u≤n) transmits label information, and uses the label vector f=(f1,f2,...f n ) T The reconstruction error is minimized, thereby obtaining the category information of unlabeled data.
[0104]
[0105] The category information of the unlabeled data is iteratively optimized as shown in formula (21), and the data point x after t+1 iterations is obtained. i The category information is
[0106]
[0107] Among them, 0<α<1, is the data point x i The adjustment factor for obtaining label information from neighboring points; f j t Represents data point x i By finding the k neighbors of the data point corresponding to the iterative category information, we can obtain the corresponding hash address information j of the data point as shown in formula (22): * .
[0108]
[0109] Among them, x0 is the new test data without label information, and the neighbor point x0i ∈X comes from the original data and the data obtained from K nearest neighbors, x 0i According to the distance to x0, they are arranged in ascending order from 1 to k, w(x0,x 0i ) represents x0 and x 0i The weight between them. i ) is the nearest neighbor point x 0i The probability of belonging to the jth class. 0i ∈x u When F(j,l i )∈[0,1],x 0i ∈x l When F(j,l i )=1.
[0110] Step 3.4.3: Sort the results according to the obtained distance and select the nearest K neighboring search results for display.
[0111] In the embodiment, K in the K nearest neighbor algorithm represents the K images most similar to the direct search results in image retrieval. In the actual retrieval process, this value should be a positive integer that does not exceed the amount of image data in the retrieval database. The parameter K is preferably 5 or 7.
[0112] Table 1 Database image recall rate comparison experimental results
[0113]
[0114] from Figure 2 , Figure 3 , Figure 4 , Figure 5 As can be seen from Table 1 and Table 2, the precision rates of the present invention for the four keywords of lung, liver, kidney and chest X-ray in the database reached 98%, 95%, 98% and 97% respectively, and the recall rates reached 92%, 97%, 94% and 98% respectively. In order to further evaluate the superiority of the present invention, the present invention selected the traditional hash algorithm before improvement as the comparison method of the present invention. It can be seen from the table that through the improvement of the hash table and the hash function, and the optimization of the K nearest neighbor algorithm, the precision rates of the present invention for the four keywords of lung, liver, kidney and chest X-ray were increased by 12%, 7%, 6% and 7% respectively, and the recall rates were increased by 5%, 12%, 3% and 9% respectively.
[0115] Table 2 Database image precision comparison experimental results
[0116]
[0117] Furthermore, Table 3 provides the average time required for searching images in a database by the present invention and the traditional hash algorithm. It can be seen from the table that the present invention reduces the search time by 21% by optimizing the search process.
[0118] The results show that the medical image retrieval method based on approximate matching dynamic local sensitive hashing proposed in the present invention can significantly improve the accuracy of image retrieval and reduce the time required for image retrieval.
Claims
1. Medical image retrieval method based on dynamic locality sensitive hashing with approximate matching, Features: The following steps are included: Step 1: Input image data into the original image database; Step 2: Extract directional gradient histogram eigenvalues, local binary pattern eigenvalues and Haar-like eigenvalues based on the image data obtained in step 1 to construct an image retrieval index; Step 3: Based on the image retrieval index obtained in step 2, the medical image retrieval method is optimized using the dynamic local sensitive hashing method and the weighted k-nearest neighbor algorithm; Step 3.1: According to the index data set I obtained in step 2 and the feature values of the image, a hash address is assigned to construct a hash function and mapped into a hash table, i.e., a dynamic local sensitive hashing method; Step 3.2: Define the search keyword based on the label vector L obtained in step 2; Step 3.3: Establish the corresponding relationship between the search keyword and the hash function; Step 3.3.1: To satisfy the stable distribution of data in the hash table, the hash function is defined as shown in formula (1): Where S is a random n-dimensional vector that follows the standard normal distribution N(0,1), m is the data set vector, F is a random integer selected from (0,W), and W is the length of the segment on the line; Step 3.3.2: Construct a composite hash function and set a multi-index hash table through a hash function, as shown in formula (2); used to improve the collision probability of neighboring points and the non-collision probability of non-neighboring points in the hash table; thereby, reducing the collision of the hash table on the hash bucket to improve the performance of hash table retrieval; g 1 (m i )=(h 11 (m i ),h 12 (m i ),…,(h 1Z (m i ))(i=1,…,z) …… g V (m i )=(h V1 (m i ),h V2 (m i ),…,(h VZ (m i ))(i=1,…,z) (2) Among them, V, Z are randomly generated matrices based on the data set The dimension of this matrix maps the data set to V projection spaces; Step 3.4: Retrieve and access the image data in the hash table and use K nearest neighbors to display the retrieval results; Step 3.4.1: Enter the keyword to be searched, and calculate the address of each hash function where the query point falls. If the hash function family is constructed by n hash functions, then n addresses can be calculated; Step 3.4.2: Calculate the distance between the remaining addresses in the hash table and the address in the n search address field in step 3.4.1 to form a local neighborhood structure; the distance measure of the local neighborhood structure is shown in formula (3): Among them, x i is the hash address obtained in step 3.4.1, x j For x i In the field with x i Close points, w ij is x i From its neighborhood x j ∈N(x i ) to obtain the reconstruction matrix, that is, to construct the neighborhood linear neighborhood weight matrix w ij As shown in formula (4), it is used to measure x j With x i similarity; s.t.∑ j w ij =1,w jk ≥0 (5) Among them, the neighborhood linear neighborhood weight matrix must satisfy the conditions shown in formula (5); (G j ) jk represents the local Gram matrix; x i The Gram matrix at the point is expressed as (G j ) jk =(x i -y i ) T (x i -y i ); Step 3.4.3: Sort the results according to the obtained distance and select the nearest K neighboring search results for display.
2. The medical image retrieval method based on dynamic local sensitive hashing based on approximate matching as claimed in claim 1, Features: The parameter K is selected as 7.
3. The medical image retrieval method based on dynamic local sensitive hashing based on approximate matching as claimed in claim 1, Features: Step 2 is implemented as follows: Step 2.1: Construct an index dataset I of N images, as shown in formula (6): After inputting the image data, the index image database forms an index data set I of N images; where I i Represents an image with index i in the dataset; Step 2.2: Define the corresponding label vector L for each image in the index dataset I; as shown in formula (7): Among them, Li∈{0,1} c , C is used to count the total number of label categories of the index dataset I, and the label indicates the category to which the current image belongs; Step 2.3: Extract the eigenvalues of the directional gradient histogram of the image to characterize the edge semantic processing of the lesion area; Step 2.4: Extract the local binary pattern feature value of the image to characterize the texture semantic processing of the lesion area; Step 2.5: Extract Haar-like eigenvalues to characterize the grayscale change feature processing of the lesion area; Step 2.6: Construct an image retrieval index based on the feature values obtained from steps 2.3 to 2.5 to improve the accuracy of medical image retrieval.
Citation Information
Patent Citations
Method for detecting approximately repeated image
CN106570141A
Ciphertext image retrieval method and system under a cloud environment
CN108959478A
Hierarchical structure-based local sensitive hash image indexing method
CN109829066A
Image search method, apparatus, device, and computer-readable storage medium
WO2020182019A1
