A method and device for training an unsupervised hash image retrieval model

By combining data augmentation and contrastive learning with threshold constraints and structural similarity loss, the problem of negative sample over-optimization in unsupervised hashing methods is solved, thereby improving the accuracy of unsupervised hashing image retrieval and its ability to preserve abstract semantic information.

CN117131220BActive Publication Date: 2025-11-28SOUTH CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310533938.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2025-11-28
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

Existing unsupervised hashing methods cannot effectively capture the nonlinear similarity between images in image retrieval, and are prone to performance degradation due to over-optimization with negative samples.

Method used

Image pairs are generated through data augmentation, and feature interaction and sentiment analysis are combined. A hash model is trained using contrastive learning and thresholding to limit negative samples. Structural similarity loss and regularization terms are introduced to optimize the model training process.

Benefits of technology

It improves the accuracy of image retrieval, prevents the model from focusing excessively on pixel details, preserves abstract semantic information, and enhances the similarity of feature vectors of hash codes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117131220B_ABST
    Figure CN117131220B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of training method and device of unsupervised hash image retrieval model, wherein a kind of training method of unsupervised hash image retrieval model generates two images by using data enhancement to the same image. Then two images are input into hash model, feature extraction is carried out, and the corresponding image feature is obtained, the image feature is input into different processing layer respectively, and the corresponding hash code, hash vector and latent vector are obtained, and the contrast loss between two hash vectors is calculated, simultaneously, to prevent the over-optimization of negative sample, a threshold is introduced to limit the over-optimization of negative sample;And the structural similarity loss of the hash code set of two enhanced images is calculated, and the network is updated according to two losses until convergence, finally a complete training unsupervised hash retrieval model is obtained for image retrieval, to improve the accuracy of retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image retrieval, in particular to an unsupervised hash image retrieval model training method and device. BACKGROUND

[0002] With the explosive growth of image data, how to conduct fast similarity retrieval has become one of the basic requirements of large-scale information retrieval. Hash image retrieval method is one of the main solutions to this problem. The goal of hash image retrieval method is to convert high-dimensional features and similarity information into compact binary codes, thereby speeding up the operation and saving storage space.

[0003] Existing hash methods can be divided into supervised hash and unsupervised hash according to whether prior semantic information is used. Supervised hash uses semantic labels for training and achieves good retrieval performance. In practical applications, supervised hash method is very dependent on large-scale annotated data sets, while in reality there are larger-scale unlabeled data sets. Collecting a large amount of labeled data is not only expensive but also time-consuming. In sharp contrast, unsupervised hash method uses unlabeled training data to guide hash learning. It is more suitable for solving large-scale unlabeled image retrieval problems.

[0004] Please refer to Figure 1 , Figure 1 The present application relates to the field of image retrieval, in particular to an unsupervised hash image retrieval model training method and device.

[0005] Traditional unsupervised hashing methods use hand-crafted image feature descriptors for feature extraction. Unsupervised deep hashing methods use deep neural networks as hash functions, and the hash function learning process does not require supervision information. Due to the low model capacity, these methods cannot well capture the nonlinear similarity between images. At present, many unsupervised deep hashing methods use the way of reconstructing the input data, which basically prompts the hash code to retain as much information of the original data as possible. However, this may make the model spend a lot of computing power to reconstruct useless background information, and ignore to retain the distinctive semantic information which is more important to the hash task; and the traditional model will calculate all the negative sample influences, and the negative samples will be gradually pushed away as the model is trained. This processing method will push some originally well-clustered samples away from the class center, resulting in over-optimization of negative samples, thereby reducing the performance of the model. SUMMARY

[0006] Therefore, the present application proposes a training method and device of an unsupervised hashing image retrieval model, which generates two images by using data augmentation on the same image. Then the two images are input into the hash model, and the similarity of the hash codes after the hash coding of the two images is maximized, and at the same time, in order to prevent over-optimization of negative samples, a threshold is introduced to limit the over-optimization of negative samples.

[0007] The present application is realized by the following technical solutions:

[0008] On the one hand, the present application provides a sentiment analysis method fusing syntax information and feature interaction, which comprises:

[0009] An input image training sample set is subjected to data augmentation to obtain a first enhanced image set and a second enhanced image set, wherein each image in the sample set has a corresponding first enhanced image and a second enhanced image;

[0010] The first enhanced image set is subjected to feature extraction to obtain a first image feature set;

[0011] The second enhanced image set is subjected to feature extraction to obtain a second image feature set;

[0012] The first image feature set is subjected to mapping and hash coding to obtain a first latent vector set, a first hash continuous vector set and a first hash code set;

[0013] The second image feature set is subjected to mapping and hash coding to obtain a second latent vector set, a second hash continuous vector set and a second hash code set;

[0014] A feature vector similarity matrix is constructed according to the first image feature set and the second image feature set;

[0015] The cosine distance between each pair of hash continuous vectors in the first hash continuous vector set and the second hash continuous vector set is calculated and compared with a boundary threshold, and if the cosine distance is less than the boundary threshold, the contrast loss of the enhanced image is calculated according to the latent vectors corresponding to the two hash continuous vectors.

[0016] The structural similarity loss is calculated according to the first hash code set and the second hash code set.

[0017] The contrast loss and the structural similarity loss are taken as the total loss of the model, and the network in the model is updated according to the total loss until the model converges.

[0018] Further, the cosine distance between each pair of hash continuous vectors in the first hash continuous vector set and the second hash continuous vector set is calculated and compared with a boundary threshold, and if the cosine distance is less than the boundary threshold, the contrast loss of the enhanced image is calculated according to the latent vectors corresponding to the two hash continuous vectors, and the specific calculation formula is as follows:

[0019]

[0020]

[0021] Wherein represents the hash layer The cosine distance of , m is the boundary threshold for controlling whether the negative sample participates in training, 1 indicates that the negative sample participates in training , 0 indicates that the negative sample does not participate in training.

[0022] Further, the structural similarity loss is calculated according to the first hash code set and the second hash code set, specifically including:

[0023] The hash code similarity matrix is constructed according to the first hash code set and the second hash code set.

[0024] The structural similarity loss is calculated according to the feature vector similarity matrix and the hash code similarity matrix.

[0025] Further, the structural similarity loss is calculated according to the feature vector similarity matrix and the hash code similarity matrix, which is calculated by the following formula:

[0026] Let the binary coding of all images with a given length L be B={b i},(i=1...N).

[0027]

[0028]

[0029]

[0030] representation of hash code and similarity of is the hash code of the i-th image in the batch. is the hash code of the k-th image in the batch. In this paper, the sign function is used to map the feature vector to the hash code. The hash layer weight W h ∈R L×4096 , bias v h ∈R L×1 The superscript j represents different augmented samples.

[0031] Further, the calculation formula of the total loss of the model is as follows:

[0032]

[0033] where L c is the improved contrastive loss, L n is the structural similarity loss, where a is a hyperparameter controlling the influence of L n loss.

[0034] Further, a regularization term is introduced in the model, and the calculation formula is as follows:

[0035]

[0036] At this time, the calculation formula of the total loss L is as follows:

[0037]

[0038] where β is a hyperparameter controlling the influence of L R loss.

[0039] On the other hand, the application also provides a device for training an unsupervised hash image retrieval model, comprising:

[0040] An image preprocessing module is configured to input an image training sample set, perform data augmentation on images in the sample set, and obtain a first set of augmented images and a second set of augmented images, wherein each image in the sample set has a corresponding first augmented image and a second augmented image.

[0041] A first feature extraction module is configured to perform feature extraction on the first set of augmented images to obtain a first set of image features.

[0042] A second feature extraction module is configured to perform feature extraction on the second set of augmented images to obtain a second set of image features.

[0043] The first feature processing module is configured to map and hash code the first image feature set to obtain a first latent vector set, a first hash continuous vector set and a first hash code set.

[0044] The second feature processing module is configured to map and hash code the second image feature set to obtain a second latent vector set, a second hash continuous vector set and a second hash code set.

[0045] The feature vector similarity matrix construction module is configured to construct a feature vector similarity matrix according to the first image feature set and the second image feature set.

[0046] The contrast loss calculation module is configured to calculate the cosine distance between two hash continuous vectors in the first hash continuous vector set and the second hash continuous vector set, and compare the cosine distance with a boundary threshold value. If the cosine distance is less than the boundary threshold value, the contrast loss of the enhanced image is calculated according to the latent vectors corresponding to the two hash continuous vectors.

[0047] The structural similarity loss calculation module is configured to calculate the structural similarity loss according to the first hash code set and the second hash code set.

[0048] The network updating module is configured to take the contrast loss and the structural similarity loss as a total loss of the model, and update the network in the model according to the total loss until the model converges.

[0049] Further, the structural similarity loss calculation module comprises:

[0050] The hash code similarity matrix construction submodule is configured to construct a hash code similarity matrix according to the first hash code set and the second hash code set.

[0051] The structural similarity loss calculation submodule is configured to calculate the structural similarity loss according to the feature vector similarity matrix and the hash code similarity matrix.

[0052] Further, the method further comprises:

[0053] The regularization adding module is configured to add a regularization term to the model to update the total loss of the model.

[0054] In another aspect, the present application also provides a computer device, comprising:

[0055] at least one memory and at least one processor;

[0056] The memory is configured to store one or more programs.

[0057] When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of the training method of the unsupervised hash image retrieval model according to any one of the above.

[0058] This application proposes using contrastive learning to achieve unsupervised learning, enabling the model to focus on abstract semantic information rather than excessively focusing on pixel details. Simultaneously, to address the issue of sample over-optimization in contrastive learning, this invention introduces a threshold in the contrastive loss to limit negative samples, thereby preventing suboptimization of the model. Then, hash codes are generated by combining structural similarity, which allows the hash codes to retain the similarity of feature vectors. Through the above methods, the unsupervised hash model is trained, resulting in a fully trained unsupervised hash retrieval model for image retrieval, thereby improving retrieval accuracy.

[0059] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description

[0060] Figure 1 A flowchart illustrating an unsupervised hash image retrieval method based on contrastive learning provided in this application;

[0061] Figure 2 A flowchart illustrating a training method for an unsupervised hash image retrieval model provided in this application;

[0062] Figure 3 This application provides a structural block diagram of an apparatus for training an unsupervised hash image retrieval model. Detailed Implementation

[0063] Based on the performance issues encountered by existing unsupervised hashing image retrieval models, this study argues that training an accurate unsupervised hashing image retrieval model is crucial. Please refer to [link / reference]. Figure 2 and Figure 3 , Figure 2 A flowchart illustrating a training method for an unsupervised hash image retrieval model provided in this application; Figure 3 To execute Figure 2 The diagram shows a structural block diagram of an apparatus for training an unsupervised hash image retrieval model. The training method for the unsupervised hash image retrieval model in this application specifically includes:

[0064] S10: Input the image training sample set, perform data augmentation on the images in the sample set to obtain a first augmented image set and a second augmented image set, wherein each image in the sample set has a corresponding first augmented image and a second augmented image. Step S10 is executed by the image preprocessing module 10.

[0065] Data augmentation is an image processing technique that includes methods such as random cropping, flipping, and grayscale conversion; image x i (i = 1, 2, ..., n). Two positive samples are obtained through data augmentation methods.

[0066] S20.a: Feature extraction is performed on the first enhanced image set to obtain a first image feature set. Step S20.a is performed by a first feature extraction module 20.a.

[0067] S20.b: Feature extraction is performed on the second enhanced image set to obtain a second image feature set. Step S20.b is performed by a second feature extraction module 20.b.

[0068] The two enhanced images will be passed through a convolutional neural network to extract their image features, where the formula for extracting image features is as follows:

[0069]

[0070] where the superscript j represents the two samples after data augmentation, and the function Φ(x; θ) represents the VGG model.

[0071] S30.a: Mapping and hash coding are performed on the first image feature set to obtain a first latent vector set, a first hash continuous vector set, and a first hash code set. Step S30.a is performed by a first feature processing module 30.a.

[0072] S30.b: Mapping and hash coding are performed on the second image feature set to obtain a second latent vector set, a second hash continuous vector set, and a second hash code set. Step S30.b is performed by a second feature processing module 30.b.

[0073] S30.c: A feature vector similarity matrix is constructed based on the first image feature set and the second image feature set. Step S30.c is performed by a feature vector similarity matrix construction module 30.c.

[0074] The hash model we apply is composed of three parts: VGG convolutional network (VGG), latent layer (Latent Layer), and hash layer (Hash Layer). The VGG convolutional network is used to extract image features. Then, through a latent layer, the image features are mapped to latent vectors. The continuous vectors in the hash layer are extracted, and then we use the hash layer to reduce the dimension of the image features and map them to hash codes.

[0075] The image features are mapped to latent vectors through the latent layer, where the formula for mapping is as follows:

[0076]

[0077] For the mapped latent feature vectors, the latent layer weight W z ∈R 512×4096 , the bias v z ∈R 512×1 .

[0078] S41: Calculate the cosine distance between each pair of hash continuous vectors in the first hash continuous vector set and the second hash continuous vector set, and compare it with a boundary threshold. If the cosine distance is less than the boundary threshold, calculate the contrast loss of the enhanced image according to the latent vectors corresponding to the two hash continuous vectors. Step S41 is performed by the contrast loss calculation module 41.

[0079] The contrast loss in the contrast learning is calculated by NT-Xent loss. NT-Xent loss is a variant of softmax, and the goal is to maximize the probability of the similarity of positive samples in the entire mini-batch, thereby guiding the model learning. The expression is shown in the following formula:

[0080]

[0081] Here, we use the cosine similarity to calculate the similarity of two feature vectors to improve the sample distance calculation accuracy. According to the cosine similarity calculation, τ is an adjustable temperature parameter. N is the number of images in a batch.

[0082] Finally, the average loss of all sample pairs is calculated. The expression is shown in the following formula.

[0083]

[0084] The loss of the first enhanced sample of the i-th image is calculated, The loss of the second enhanced sample of the i-th image is calculated.

[0085] For negative sample pairs The traditional contrast loss function will calculate the influence of all negative samples. With the training of the model, the negative samples will be gradually pushed away. This processing method will push some originally clustered samples away from the class center, resulting in over-optimization of negative samples, thereby reducing the performance of the model. During training, we control whether the negative sample continues to participate in model training through the threshold boundary limiting mechanism. When the distance of the negative sample pair is greater than the boundary threshold, it is considered that the negative sample has been pushed out of the clustering boundary of the current sample and does not need to be optimized. For negative sample pairs with a distance less than the boundary threshold, continue to push them away from the current sample class center until they are pushed outside the boundary. However, we do not directly use the hash code to calculate the Hamming distance, because it will introduce quantization error and reduce the accuracy of negative sample selection. Here we use the cosine distance of the hash layer's continuous vector as the sample distance. The improved calculation formula of the invention is as follows:

[0086]

[0087]

[0088] wherein represents a hash layer and the cosine distance of m is a boundary threshold value for controlling whether the negative sample participates in training, 1 indicates that the negative sample pair participates in training, 0 indicates that the negative sample pair does not participate in training.

[0089] S42.a: Constructing a hash code similarity matrix according to the first hash code set and the second hash code set. Step S42.a is executed by a hash code similarity matrix construction submodule 42.a.

[0090] S42.b: Calculating structural similarity loss according to the feature vector similarity matrix and the hash code similarity matrix. Step S42.b is executed by a structural similarity loss construction submodule 42.b.

[0091] The threshold boundary limiting mechanism we designed is highly dependent on the calculation accuracy of sample similarity, so in order to ensure that the loss function we designed can function normally, we use structural similarity loss to affect the model optimization effect. Structural similarity is constructed by constructing a feature vector similarity matrix and a hash code similarity matrix of the sample pair, and then minimizing the difference between the feature vector similarity matrix and the hash code similarity matrix of the sample pair, so that the hash code retains the structural similarity of the feature vector. Since the hash code retains the similarity of the feature vector, the cosine distance of the continuous vector of the hash layer can be used to more accurately represent the similarity of the sample. Therefore, we add a hash layer after the fully connected layer to use structural similarity to make the hash code retain the similarity of the feature vector.

[0092] The structural similarity of the feature vector is calculated using the cosine distance, as shown in the following formula.

[0093]

[0094] represents the similarity of the features and , is the feature vector of the i-th image in a batch. is the feature vector of the k-th image in the batch.

[0095] Calculate the structural similarity of the hash code, and set the binary code of all images with a given length L as B={b i},(i=1...N).

[0096]

[0097]

[0098]

[0099] representing the hash code and the similarity of is the hash code of the i-th image in the batch. is the hash code of the k-th image in the batch. In this paper, the sign function is used to map the feature vector to the hash code. The hash layer weight W h ∈R L×4096 , the bias v h ∈R L×1 . The superscript j represents different augmented samples.

[0100] S50: Take the contrast loss and the structural similarity loss as the total loss of the model, and update the network in the model according to the total loss until the model converges. Step S50 is performed by the network updating module 50.

[0101] The total loss L is as follows:

[0102]

[0103] where L c is the improved contrast loss, L n is the structural similarity loss, and a is a hyperparameter that controls the influence of L n loss. Since the main purpose of the structural similarity loss adopted is to maintain the consistency of the feature vector similarity and the hash code similarity, the hyperparameter a of the structural similarity is usually set to a small value.

[0104] In another preferred embodiment, the application provides a method for training a hash code generation model, comprising the steps of:

[0105] Step S43: Add a regularization term to the model, and update the total loss of the model. Step S43 is performed by the regularization adding module 43.

[0106] Considering that the binary hash code cannot be directly backpropagated, the application also includes adding a regularization term in the training process. Through the regularization term, the value of the continuous variable can be made as close to 1 or -1 as possible, so that the hash can be backpropagated for training. The regularization term formula is as follows:

[0107]

[0108] At this time, the total loss L is as follows:

[0109]

[0110] where β is a control L R Loss-affected hyperparameters.

[0111] The present application uses contrast learning to realize unsupervised learning, so that the model does not pay too much attention to pixel details, but can pay attention to abstract semantic information. At the same time, in order to solve the problem of sample over-optimization in contrast learning, the present application introduces a threshold in the contrast loss to limit the negative sample, thereby preventing sub-optimization of the model. Then, the structure similarity is combined to generate a hash code, and the structure similarity can make the hash code retain the similarity of the feature vector. Through the above method, the training of the unsupervised hash model is completed, and a trained unsupervised hash retrieval model is obtained for image retrieval, thereby improving the accuracy of retrieval.

[0112] Based on the same inventive concept as described above, the present application also provides an electronic device, which can be a server, a desktop computing device or a mobile computing device (for example, a laptop computer, a handheld computing device, a tablet computer, a netbook, etc.) and the like terminal device. The device includes one or more processors and a memory, wherein the processor is used to execute a program to realize the above-mentioned sentiment analysis method of fusing syntax information and feature interaction; the memory is used to store the computer program executable by the processor.

[0113] Based on the same inventive concept, the present application also provides a computer readable storage medium, which corresponds to the above-mentioned embodiment of the sentiment analysis method of fusing syntax information and feature interaction, and the computer readable storage medium has a computer program stored thereon, which is executed by a processor to realize the steps of the sentiment analysis method of fusing syntax information and feature interaction according to any one of the above-mentioned embodiments.

[0114] The present application can adopt the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. The computer usable storage medium includes permanent and non-permanent, removable and non-removable media, which can be realized by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0115] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, and the present application also intends to include these modifications and improvements.

Claims

1. A method for training an unsupervised hashing image retrieval model, characterized in that, The method comprises the following steps: An input image training sample set is input, and data augmentation is performed on images in the sample set to obtain a first enhanced image set and a second enhanced image set, wherein each image in the sample set has a corresponding first enhanced image and a second enhanced image; Feature extraction is performed on the first enhanced image set to obtain a first image feature set; Feature extraction is performed on the second enhanced image set to obtain a second image feature set; Mapping and hash coding are performed on the first image feature set to obtain a first latent vector set, a first hash continuous vector set and a first hash code set; Mapping and hash coding are performed on the second image feature set to obtain a second latent vector set, a second hash continuous vector set and a second hash code set; A feature vector similarity matrix is constructed according to the first image feature set and the second image feature set; Cosine distances between two hash continuous vectors in the first hash continuous vector set and the second hash continuous vector set are calculated, and compared with a boundary threshold value; if the cosine distance is less than the boundary threshold value, a contrast loss of the enhanced image is calculated according to the latent vectors corresponding to the two hash continuous vectors; A structural similarity loss is calculated according to the first hash code set and the second hash code set; The contrast loss and the structural similarity loss are taken as a total loss of the model, and the network in the model is updated according to the total loss until the model converges. 2.The method of claim 1, wherein, Cosine distances between two hash continuous vectors in the first hash continuous vector set and the second hash continuous vector set are calculated, and compared with a boundary threshold value; if the cosine distance is less than the boundary threshold value, a contrast loss of the enhanced image is calculated according to the latent vectors corresponding to the two hash continuous vectors, and the specific calculation formula is as follows: wherein represents a hash layer with a cosine distance, m is a boundary threshold value for controlling whether the negative sample participates in training, is 1 indicates that the negative sample pair participates in training, is 0 indicates that the negative sample pair does not participate in training. 3.The method of claim 2, wherein, A structural similarity loss is calculated according to the first hash code set and the second hash code set, specifically including: A hash code similarity matrix is constructed according to the first hash code set and the second hash code set; The structural similarity loss is calculated according to the feature vector similarity matrix and the hash code similarity matrix. 4.The method of claim 3, wherein, The structural similarity loss is calculated according to the feature vector similarity matrix and the hash code similarity matrix through the following formula: Let B = {b i ],(i = 1...N), be the binary encoding of all images of a given length L. represents a hash code and similarity of is a hash code of the i-th image in the batch is a hash code of the k-th image in the batch, the sign function is used herein to map the feature vector to the hash code, the hash layer weight W h ∈R L ×4096 , bias v h ∈R L×1, The superscript j represents different augmented samples. 5.The method of claim 4, wherein, The calculation formula of the total loss of the model is as follows: where L c is a modified contrastive loss, L n is a structural similarity loss, where a is a hyperparameter controlling the influence of L n loss. 6.The method of claim 5, wherein, Before taking the contrast loss and the structural similarity loss as the total loss of the model, a regularization term is added to the model to update the total loss of the model; wherein the calculation formula of the regularization term is as follows: The calculation formula of the total loss L is as follows: where β is a control L R Hyperparameters that affect loss impact.

7. An apparatus for training an unsupervised hashing image retrieval model, comprising: The method comprises the following steps: An image preprocessing module is used to input an image training sample set, and data augmentation is performed on images in the sample set to obtain a first enhanced image set and a second enhanced image set, wherein each image in the sample set has a corresponding first enhanced image and a second enhanced image; A first feature extraction module is used to perform feature extraction on the first enhanced image set to obtain a first image feature set; A second feature extraction module is used to perform feature extraction on the second enhanced image set to obtain a second image feature set; A first feature processing module is used to perform mapping and hash coding on the first image feature set to obtain a first latent vector set, a first hash continuous vector set and a first hash code set; The second feature processing module is configured to map and hash encode the second image feature set to obtain a second latent vector set, a second hash continuous vector set and a second hash code set; The feature vector similarity matrix construction module is configured to construct a feature vector similarity matrix according to the first image feature set and the second image feature set; The contrast loss calculation module is configured to calculate the cosine distance between two hash continuous vectors in the first hash continuous vector set and the second hash continuous vector set, and compare the cosine distance with a boundary threshold value, and if the cosine distance is less than the boundary threshold value, calculate the contrast loss of the enhanced image according to the latent vectors corresponding to the two hash continuous vectors; The structural similarity loss calculation module is configured to calculate a structural similarity loss according to the first hash code set and the second hash code set; The network updating module is configured to take the contrast loss and the structural similarity loss as a total loss of the model, and update the network in the model according to the total loss until the model converges. 8.The apparatus for training an unsupervised hashing image retrieval model of claim 7, wherein, The structural similarity loss calculation module comprises: The hash code similarity matrix construction submodule is configured to construct a hash code similarity matrix according to the first hash code set and the second hash code set; The structural similarity loss calculation submodule is configured to calculate a structural similarity loss according to the feature vector similarity matrix and the hash code similarity matrix. 9.The apparatus for training an unsupervised hashing image retrieval model of claim 8, wherein, Further comprising: The regularization adding module is configured to add a regularization term to the model to update the total loss of the model.

10. A computer device, comprising: The device comprises: At least one memory and at least one processor; The memory is configured to store one or more programs; When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of the training method of the unsupervised hash image retrieval model according to any one of claims 1 to 6.