Hash image retrieval method and system based on improved triple loss
By improving the triple loss and center aggregation strategy, multiple centers are generated to represent complex semantic information, solving the problem that the prior art is difficult to capture complex semantic information of images, and achieving more efficient image retrieval accuracy.
Patent Information
- Application Number
- CN202411740413.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-18
AI Technical Summary
Existing supervised hashing methods are difficult to fully capture complex semantic information in images in image retrieval, and small batch sampling may not effectively capture the overall neighborhood structure.
The overall target loss function constructed with improved triple loss and center aggregation strategies is employed to represent complex semantic information by generating multiple centers and encourage images to be close to the most similar semantic centers.
提高了图像检索的精度,能够更好地符合现实情况,检索出与查询图像视觉和语义上相似的图像。
Smart Images

Figure CN119646249A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image retrieval, and in particular relates to a hash image retrieval method and system based on improved triplet loss. Background Art
[0002] With the development of multimedia technology and smart devices, people have more convenient and diverse ways to obtain multimedia data. Multimedia data such as images, texts, and videos are uploaded to the Internet on a large scale. How to efficiently and accurately obtain the samples required by users from multimedia data has become a current research hotspot. Approximate nearest neighbor search algorithms are widely used in large-scale data set retrieval due to their efficiency, scalability, and resource saving advantages. Among them, hash learning has attracted widespread attention due to its fast retrieval speed, good retrieval effect, and low storage overhead. It is one of the classic representative methods of approximate nearest neighbor search. With the development of deep learning technology, people combine deep learning with hash learning for large-scale image retrieval.
[0003] Most existing supervised hashing methods usually use SoftMax loss or triplet loss to optimize the parameters of the model. Although existing deep hashing methods have achieved good performance in the field of image retrieval, the following problems still exist: (1) The SoftMax loss optimization process can make samples of the same category closer to the center, but in the real world, images often contain more complex semantic information. The single center point obtained by SoftMax loss may not be able to fully capture the complex structure of the category; (2) Triplet loss is sampled in small batch processing, and small batch sampling may not be able to capture the overall neighborhood structure well.
[0004] In view of this, how to design an image retrieval technology that explores the complex semantic information contained in the image and maintains the neighbor relationship between the original samples is a technical problem to be solved by the present invention. Summary of the invention
[0005] The present invention provides a hash image retrieval method and system based on improved triplet loss, which can improve retrieval accuracy and better conform to actual conditions.
[0006] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0007] In one aspect, the present invention provides a hash image retrieval method based on improved triplet loss, comprising the following steps:
[0008] Inputting the query set image into the trained hash network model based on improved triplet loss to obtain the hash code of the query set image;
[0009] Comparing the difference between the hash code of the query set image and each hash code in the hash code library;
[0010] sorting the degree of difference, and outputting the search result according to the sorting result;
[0011] Among them, the method for training the hash network model based on the improved triplet loss is: training the hash network model with the goal of minimizing the overall target loss function constructed based on the improved triplet loss and the center aggregation strategy.
[0012] The above-mentioned hash image retrieval method based on improved triplet loss, the training method of the hash network model based on improved triplet loss specifically comprises the following steps:
[0013] Use an image feature extractor to extract image features in a training sample set;
[0014] Inputting the image features into a hash network model;
[0015] Iterative training is performed with the goal of minimizing the overall target loss function constructed based on the improved triplet loss and center aggregation strategy to optimize the hash network model.
[0016] As described above, the hash image retrieval method based on improved triplet loss, the overall objective loss function is:
[0017]
[0018] Among them, L z represents the overall target loss function; N represents the total number of samples; L SoftTriple (u i ) represents the improved triplet loss function; α represents the hyperparameter; C represents the total number of categories; K represents the number of centers set; represents the center aggregation strategy function; w j 1 represents the matrix with the jth center number of 1; Represents the j-th matrix with K number of centers.
[0019] As described above, the hash image retrieval method based on improved triplet loss, the improved triplet loss function is:
[0020]
[0021] in, represents the improved triplet loss function; λ represents the first hyperparameter; Indicates that the label corresponding to the i-th sample is l i Regularizer under the condition; δ represents the set threshold.
[0022] As described above, the hash image retrieval method based on improved triplet loss, the center clustering strategy function is:
[0023]
[0024] in, represents the center aggregation strategy function; t represents the tth center; s represents the sth center; K represents the number of centers set; represents the transpose of the j-th matrix with s centers; Represents the j-th matrix with t number of centers.
[0025] As described above, the hash image retrieval method based on improved triplet loss, the image feature extractor adopts the Resnet50 network.
[0026] In the hash image retrieval method based on improved triplet loss, the step of comparing the difference between the hash code of the query set image and each hash code in the hash code library includes:
[0027] The Hamming distance between the hash code of the query set image and each hash code in the hash code library is calculated, and the smaller the Hamming distance is, the smaller the degree of difference is.
[0028] The hash image retrieval method based on improved triplet loss as described above further includes calculating the average accuracy of the query set images according to the retrieval results, and the formula is as follows:
[0029]
[0030] Wherein, AP(i) represents the average accuracy of the i-th image in the query set; N q Represents the total number of samples of the query set image; mAP represents the average accuracy of the query set image.
[0031] In another aspect, the present invention provides a hash image retrieval system based on improved triplet loss, comprising:
[0032] An acquisition module, for receiving a query set image;
[0033] A retrieval module having a built-in hash network model based on improved triplet loss, wherein the hash network model retrieves the query set images received by the acquisition module.
[0034] The output module receives the search results obtained by the search module and outputs the search results.
[0035] In another aspect, the present invention further provides an electronic device, comprising: a processor, and a memory and a transceiver communicatively connected to the processor;
[0036] The memory stores computer-executable instructions; the transceiver is used to send and receive data;
[0037] The processor executes the computer-executable instructions stored in the memory to implement any of the above methods.
[0038] Compared with the prior art, the advantages and positive effects of the present invention are: by using a hash network model based on improved triplet loss for image retrieval, the improved triplet loss can generate multiple centers to represent complex semantic information, encourage images to be close to the most similar center point, and be able to retrieve images that are visually and semantically similar to the query image; the center aggregation strategy can determine the appropriate number of centers for different data sets, can better retrieve complex query set images, and has good retrieval performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 It is a flowchart of an embodiment of a hash image retrieval method based on improved triplet loss of the present invention;
[0041] Figure 2 This is a structural schematic diagram of a hash network model based on improved triplet loss in one embodiment of a hash image retrieval method based on improved triplet loss of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] It should be noted that in the description of the present invention, the terms "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings, which are only for the convenience of description, and do not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0044] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0045] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.
[0046] The disclosure below provides many different embodiments or examples to realize different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or reference letters in different examples, and this repetition is for the purpose of simplicity and clarity, which itself does not indicate the relationship between the various embodiments and / or settings discussed. In addition, the present invention provides various specific examples of processes and materials, but those of ordinary skill in the art can be aware of the application of other processes and / or the use of other materials.
[0047] like Figure 1 to Figure 2As shown, the present application provides a hash image retrieval method based on improved triplet loss, which generates multiple centers to represent the complex semantic information contained in images in the real world by improving triplet loss, encourages image hash coding to be close to the most similar semantic center, and improves the accuracy of retrieval. A hash image retrieval method based on improved triplet loss includes the following steps:
[0048] First, input the query set image into the trained hash network model based on improved triplet loss to obtain the hash code of the query set image. The formula for obtaining the hash code is as follows:
[0049] b p =sign(h i )
[0050] Among them, b p Represents the hash code of the query set image, which is a discretized binary code; h i represents the output of the hash layer in the hash network model, which is a continuously output hash code vector; sign(·) represents the sign (bit-based conversion) function, which is used to convert the continuously output hash code vector into a discrete binary hash code. If h i >1,sign(h i )=1; otherwise sign(h i )=-1.
[0051] Then, compare the difference between the hash code of the query set image and the hash code library, specifically:
[0052] The difference between the hash code of the query set image and each hash code in the hash code library is compared by calculating the Hamming distance between the hash code of the query set image and each hash code in the hash code library. The formula for calculating the Hamming distance is as follows:
[0053]
[0054] Among them, d H (A, B) represents the Hamming distance between hash code A and hash code B; A i represents the i-th character in the hash code A; B i represents the i-th character in the hash code B; A represents the hash code of one of the query set images; B represents the hash code of another image in the query set; N q Represents the total number of samples in the query set images.
[0055] Among them, the hash coding library is obtained by inputting several image databases into a trained hash network model based on improved triplet loss.
[0056] Then, the hash codes of the query set images are sorted according to the degree of difference, that is, the Hamming distance is in ascending order, and the retrieval results are output according to the sorting, that is, the images are output in ascending order of the Hamming distance.
[0057] Finally, the average accuracy of the query set images is calculated based on the retrieval results. The calculation formula is as follows:
[0058]
[0059] Where AP(i) represents the average accuracy of the i-th image in the query set; N q It represents the total number of samples of the query set images; mAP represents the average accuracy of the query set images. The average accuracy is an important indicator to measure the quality of the model. Calculating the average accuracy can intuitively show the advantages and disadvantages of the model, which is convenient for later adjustment of the model based on the average accuracy.
[0060] This application realizes image retrieval through a hash network model based on improved triplet loss. The hash network model based on improved triplet loss needs to be used after training. The training method includes the following steps:
[0061] After the training sample enters the pre-trained Resnet50 network as an input image, it first passes through a convolutional layer for feature extraction. The convolutional layer can stabilize the training and increase the nonlinear characteristics. The size of the convolutional layer is: 7×7 convolution kernel, stride 2; then, the image features extracted by the convolutional layer are batch normalized and ReLU activation function, the calculation formula is as follows:
[0062] ReLU(x)=max(0,x)
[0063] Among them, x represents the input value of the ReLU activation function.
[0064] Then, the image features after adding nonlinear characteristics are subjected to the maximum pooling operation. The pooling kernel of the maximum pooling operation is 3×3 and the stride is 2. The maximum pooling operation can halve the size of the feature map after adding nonlinear characteristics, thereby extracting more semantic features. The feature map is a representation of multi-level features extracted from the input image. Batch normalization is performed after each convolutional layer to standardize the activation value, which can alleviate the gradient explosion and gradient disappearance problems, and ensure that the input of each layer remains in the appropriate range, so that the activation function remains in its effective area.
[0065] Next, multiple residual blocks perform deep feature extraction on the feature map with half the size. The residual formula is as follows:
[0066] Y = ReLU(X + F(X))
[0067] Among them, Y represents the output of the residual block; X represents the input value entering the residual block; F(X) represents the result after the input value X is processed by convolution and activation function.
[0068] The Resnet50 network of this application includes 16 residual blocks, which are distributed in four stages. The first stage: 3 residual blocks are used to extract low-level features and process the basic information of the initial input image; the second stage: 4 residual blocks are used to extract mid-level features and enhance the recognition ability of more complex patterns; the third stage: 6 residual blocks are used to extract high-level features, which can capture more abstract semantic information and are suitable for more complex feature combinations; the fourth stage: 3 residual blocks are used to further refine feature extraction and provide a higher level of semantic understanding for the final classification. Each stage contains a different number of residual blocks, each of which consists of two convolutional layers with a size of 3×3, and the input and output are added through residual connections.
[0069] In the residual block, the input is added to the output after processing by the convolutional layer to form a new output. This addition is to introduce residual learning, so that the network can be better optimized during training and reduce the gradient vanishing problem. This addition is not contradictory. In the final stage of the network, after being processed by multiple residual blocks, the final output is the result of global average pooling and fully connected layers. The addition of input and output in the residual block is only performed at the local level, and the final output layer uses the feature representation after being processed by all residual blocks.
[0070] After all residual blocks perform deep feature extraction on the feature map, the feature map is aggregated using a global average pooling layer. Global average pooling averages all pixel values of the feature map of each channel to generate a feature vector of a fixed length that can represent the global features of the entire input image. The feature vector is mapped to the category space through a fully connected layer, which is usually the number of heavy categories of the target task.
[0071] Finally, the output of the fully connected layer is converted into a probability distribution through the SoftMax layer to extract the high-dimensional features of the input image.
[0072] In ResNet50, the residual connection ensures that the gradient can flow well during back propagation by directly passing the input to the output layer, which helps to alleviate the gradient disappearance problem and enables the network to be effectively trained even with increased depth.
[0073] S12, inputting the image features into a hash layer, specifically,
[0074] A hidden layer, namely a hash layer, is added after the fully connected layer of the Resnet50 network to build a hash network model. The hash layer can map the high-dimensional features extracted by the image feature extractor into a p-bit hash code, where p represents the length of the hash code. The output of the hash layer is as follows:
[0075]
[0076] Among them, h i represents the output of the hashing layer; represents the transpose of the weight parameter, and W H ∈R P×2045 ; R P×2045 represents the dimension of the space R; P represents the number of images input to the network in each batch during the training phase; u i represents the features of the i-th image; v H represents the bias parameter, and v H ∈R P×1 ; R P×1 Represents the dimension of space R.
[0077] S13, iterative training is performed to minimize the overall target loss function based on the improved triple loss and center aggregation strategy to optimize the hash network model. Specifically:
[0078] The improved triplet loss generates multiple centers to represent the complex meaning information of the training image set, encouraging images to be close to the most similar semantic center. Assume that the feature of the i-th image is u i , whose corresponding label is l i , after the neural network output passes through the SoftMax operator, its probability distribution is obtained, and its formula is as follows:
[0079]
[0080] Among them, P r ((L=l i )|u i ) means when L=l i Time characteristic u i The distribution of; L represents the label; l i Indicates the label of the i-th image; u i Represents the features of the i-th image; Indicates the label l i With feature u i Similarity matrix; C represents the number of categories; represents the weight and feature u of the jth class i The similarity matrix of .
[0081] Here [w1, ...w C ]∈Rq×C represents the output of the last fully connected layer, so the corresponding SoftMax loss formula is as follows:
[0082]
[0083] Among them, L SoftMax (u i ) represents SoftMax loss; l i Indicates the label of the i-th image; u i Represents the features of the i-th image; Indicates the label l i With feature u i Similarity matrix; C represents the number of categories; represents the similarity matrix of the jth class.
[0084] In order to study the relationship between the improved triplet loss and the triplet loss, given a set of triples (u i ,u j ,u k ), in hash learning, the goal of triple loss is to learn a hash function that can map similar samples to close points and dissimilar samples to distant points by keeping the distance between similar samples smaller than the distance between dissimilar samples. In this way, similarity can be maintained in the hash space, making similar samples closer in the hash space, thereby improving the efficiency and accuracy of retrieval. The corresponding triple loss can be expressed as:
[0085]
[0086] Among them, δ represents the set threshold; represents the transpose of the features of the i-th image; u r Represents the features of the rth image; u i represents the features of the i-th image; u j Indicates the characteristics of the j-th image.
[0087] When the SoftMax formula When both are unit lengths, Represents the similarity matrix between labels and features; the standardized SoftMax loss can be expressed as follows:
[0088]
[0089] Where λ represents the first hyperparameter; Indicates the label l i With feature u i Similarity matrix of represents the similarity matrix of the jth class.
[0090] Through the above formula, it is found that the normalized SoftMax loss that minimizes λ is equivalent to the smooth triplet loss.
[0091] Multi-center: Assuming that the number of centers set for each class is K, the similarity between each sample and the class can be defined as the following formula:
[0092]
[0093] Among them, S i,C Indicates the similarity between each sample and the class; Represents the feature transpose of the i-th image; Represents a matrix with C number of categories and K number of centers;
[0094] Can be equivalent to:
[0095]
[0096] Among them, q k represents the distribution of the corresponding class when the number of centers is K; q∈Δ, where represents the transpose of the features of the i-th image; Represents a matrix with C number of categories and K number of centers.
[0097] In order to solve the problem of non-smoothness of the maximum operator and sensitivity between multiple centers after the FC layer of SoftMax, the robustness is improved by maximizing the smoothing operator. The formula is as follows:
[0098]
[0099] Where γ represents the second hyperparameter; H(q) represents the entropy of distribution q; represents the transpose of the features of the i-th image; Represents a matrix with C number of categories and K number of centers.
[0100] Introducing γ into the probability distribution H(q), the final q k The calculation formula is as follows:
[0101]
[0102] Where γ represents the second hyperparameter; represents the transpose of the features of the i-th image; Represents a matrix with C number of categories and K number of centers.
[0103] According to the above formula, the formula for the regularizer is as follows:
[0104]
[0105] Among them, S′ i,C represents the regularizer when the number of sample categories of the i-th sample is C; γ represents the second hyperparameter; represents the transpose of the features of the i-th image; Represents a matrix with C number of categories and K number of centers.
[0106] By applying smoothed similarity, the formula for the improved triplet loss function is finally obtained as follows:
[0107]
[0108] Where λ represents the first hyperparameter; Indicates that the label corresponding to the i-th sample is l i Regularizer under the condition; δ represents the set threshold.
[0109] Through the center clustering strategy and integrated into the improved triplet loss, the model can cluster the number of centers during the optimization process. First, set a sufficiently large number of centers K, and then encourage similar centers to merge under the action of norms L1 and L2, so as to maintain the diversity of centers while reducing the number of centers. For each center The formula for obtaining feature similarity is as follows:
[0110]
[0111] in, Indicates the feature similarity of the center; The jth matrix with center at 1; represents the j-th matrix with center t; represents a matrix with the jth center being K; K represents the set number of centers.
[0112] if and similar, then they can be collapsed into the same one, where Therefore, The L2 norm of the form is regularized to obtain a set of sparse centers, the formula of which is as follows:
[0113]
[0114] in, represents the matrix under L2 norm; represents the j-th matrix with s centers; K represents the set number of centers.
[0115] By accumulating L1 and L2 norms, we canth The regularizer is obtained on the class. Since the regularizer weight w has unit length, the final simplified representation is as follows:
[0116]
[0117] in, represents the center aggregation strategy function; t represents the tth center; s represents the sth center; K represents the number of centers set; represents the transpose of the j-th matrix with s centers; Represents the j-th matrix with t number of centers.
[0118] After adding the regularizer, the formula for the final overall objective loss function is as follows:
[0119]
[0120] Among them, L represents the overall target loss function; N represents the total number of training samples; represents the improved triplet loss function; α represents a hyperparameter. In this application, the value of the hyperparameter is 0.3. After many experiments, the model works best when the hyperparameter value is 0.3; C represents the total number of categories; K represents the number of centers set; represents the center aggregation strategy function; represents the j-th matrix with center 1; Represents the j-th matrix with k number of centers.
[0121] The present application provides a hash image retrieval system based on improved triplet loss, comprising:
[0122] An acquisition module, for receiving a query set image;
[0123] A retrieval module is built with a hash network model based on improved triplet loss, and the hash network model retrieves the query set image received by the acquisition module.
[0124] The output module receives the search results obtained by the search module and outputs the search results.
[0125] The present application also provides an electronic device, comprising: a processor, and a memory and a transceiver communicatively connected to the processor;
[0126] The memory stores computer executable instructions; the transceiver is used to send and receive data;
[0127] The processor executes the computer-executable instructions stored in the memory to implement the method described above.
[0128] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0129] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions claimed to be protected by the present invention.
Claims
1. A hash image retrieval method based on improved triplet loss, characterized in that: The following steps are involved: Inputting the query set image into the trained hash network model based on improved triplet loss to obtain the hash code of the query set image; Comparing the difference between the hash code of the query set image and each hash code in the hash code library; sorting the degree of difference, and outputting the search result according to the sorting result; Among them, the method for training the hash network model based on the improved triplet loss is: training the hash network model with the goal of minimizing the overall target loss function constructed based on the improved triplet loss and the center aggregation strategy.
2. The hash image retrieval method based on improved triplet loss according to claim 1, characterized in that: The training method of the hash network model based on improved triplet loss specifically includes the following steps: Use an image feature extractor to extract image features in a training sample set; Inputting the image features into a hash network model; Iterative training is performed with the goal of minimizing the overall target loss function constructed based on the improved triplet loss and center aggregation strategy to optimize the hash network model.
3. The hash image retrieval method based on improved triplet loss according to claim 2 is characterized in that: The overall objective loss function is: Among them, L z represents the overall target loss function; N represents the total number of samples; represents the improved triplet loss function; α represents the hyperparameter; C represents the total number of categories; K represents the number of centers set; represents the center aggregation strategy function; represents the matrix with the jth center number of 1; Represents the j-th matrix with K number of centers.
4. The hash image retrieval method based on improved triplet loss according to claim 3 is characterized in that: The improved triplet loss function is: in, represents the improved triplet loss function; λ represents the first hyperparameter; Indicates that the label corresponding to the i-th sample is l i Regularizer under the condition; δ represents the set threshold.
5. The hash image retrieval method based on improved triplet loss according to claim 1, characterized in that: The center aggregation strategy function is: in, represents the center aggregation strategy function; t represents the tth center; s represents the sth center; K represents the number of centers set; represents the transpose of the j-th matrix with s centers; Represents the j-th matrix with t number of centers.
6. The hash image retrieval method based on improved triplet loss according to claim 2, characterized in that: The image feature extractor adopts the Resnet50 network.
7. The hash image retrieval method based on improved triplet loss according to claim 1, characterized in that: The step of comparing the difference between the hash code of the query set image and each hash code in the hash code library comprises: The Hamming distance between the hash code of the query set image and each hash code in the hash code library is calculated, and the smaller the Hamming distance is, the smaller the degree of difference is.
8. The hash image retrieval method based on improved triplet loss according to claim 1, characterized in that: The method also includes calculating the average accuracy of the query set images according to the retrieval results, and the formula is as follows: Wherein, AP(i) represents the average accuracy of the i-th image in the query set; N q Represents the total number of samples of the query set image; mAP represents the average accuracy of the query set image.
9. A hash image retrieval system based on improved triplet loss, characterized in that: include: An acquisition module, for receiving a query set image; A retrieval module having a built-in hash network model based on improved triplet loss as described in any one of claims 1 to 8, wherein the hash network model retrieves the query set image received by the acquisition module, The output module receives the search results obtained by the search module and outputs the search results.
10. An electronic device, characterized in that: include: A processor, and a memory and a transceiver communicatively connected to the processor; The memory stores computer-executable instructions; the transceiver is used to send and receive data; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.
Citation Information
Cited By
Image retrieval model training method, image retrieval method, equipment and medium
CN121706857A