Cross-modal zero sample hash method for fine-grained attribute comparison and fusion
By introducing a fine-grained attribute comparison and fusion method into zero-shot hashing technology, visual attributes and image features are used to optimize hash coding, which solves the problem of local representations being ignored and complex relationships not being captured, and achieving more accurate identification of unknown classes. Prediction and greater scalability.
Patent Information
- Application Number
- CN202410768556.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-01
AI Technical Summary
When existing zero-shot hashing technology processes unknown category images, local representation is ignored, resulting in reduced transferability of the hashing algorithm, and the continuous value information of visual attributes fails to effectively capture complex pairwise relationships. Existing methods Global optimization cannot be achieved, especially in big data scenarios where it is difficult to handle the explosive growth of image data.
A cross-modal zero-shot hashing method (COMAE) for fine-grained attribute contrast fusion is proposed. Visual attribute features are extracted through image encoders, attribute prototype networks and hyperspherical losses are introduced, and visual attributes, image features and class labels are combined. Optimize attribute regression loss and class consistency constraints to achieve higher inter-class separation and compression variation, and improve the generalization ability of hash coding.
It achieves faster training speed and more accurate label prediction results, can handle large data sets, improves the ability to identify unknown classes, has stable performance and high scalability, surpassing existing zero-shot hashing methods.
Smart Images

Figure CN118736236A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information retrieval technology, and relates to a cross-modal zero-shot hash retrieval technology, and specifically to a cross-modal zero-shot hash method for fine-grained attribute comparison and fusion. Background Art
[0002] Image hashing technology has attracted widespread attention due to its high efficiency in multimedia retrieval, content-based image and document search. Specifically, hashing can map high-dimensional data into compact binary codes for efficient search in binary Hamming space, resulting in shorter retrieval time and less computational overhead.
[0003] In the era of big data, the explosive growth of network images has brought about some new concepts, and traditional hashing algorithms cannot generalize unknown data to new categories that they have never observed. Recently, researchers have focused on Zero-Shot Hashing (ZSH). Visual attributes are ubiquitous in popular image datasets, which describe the discriminative visual attributes of objects shared between different classes. Due to its strong recognition representation ability in out-of-distribution samples, it is widely used to capture the similarities of known and unknown concepts in Zero-Shot Learning (ZSL) tasks. In contrast, visual attributes in ZSH tasks have been rarely explored.
[0004] Although considerable success has been achieved in leveraging visual attributes to establish connections between visual attributes, image features, class labels, and binary hash codes, there are still pressing limitations. First, local image representations have been shown to be crucial for zero-shot learning tasks, as local features exhibit more effective transferability between known and unknown classes. However, existing works have ignored local representations in deep hashing tasks, which lowers the upper bound of the transferability of hashing algorithms. Second, existing works mainly focus on learning individual image representations, optimizing each instance independently. Compared with binary one-hot class encoding, each dimension of visual attributes is a continuous value containing richer and more detailed distance-related information. Such information has rich properties that happen to capture complex pairwise relationships, but they are largely ignored by popular methods. Finally, existing works usually adopt a multi-task learning framework to use attribute labels and class labels independently, ignoring the complex relationship between attribute labels and class labels. Specifically, two images may belong to the same class but have different attributes, for example, two images with the "bird" class may have different attributes of "black legs" and "yellow legs"; similarly, instances with different classes may also show shared similar attributes, for example, two images with the "bird" and "horse" classes may have the same "black legs" attribute. Existing methods may not be able to reach the global optimum, so joint optimization needs to be performed to achieve the overall optimum of the two tasks.
[0005] In this context, it becomes crucial to conduct a comprehensive property exploration of zero-shot hashing technology and develop a cross-modal zero-shot hashing method for fine-grained attribute contrast fusion. Summary of the invention
[0006] In view of the problems existing in the prior art, the purpose of the present invention is to provide a cross-modal zero-shot hashing method for fine-grained attribute contrast fusion (hereinafter referred to as COMAE), which is a weakly supervised representation learning framework that combines visual attributes, image features, class labels and binary hash coding to obtain more accurate label predictions for unknown classes.
[0007] The method of the present invention comprises: firstly, using an image encoder to extract features of the visual attributes of an image to obtain a visual representation matrix; by using an attribute prototype network (i.e., an image encoder) to capture fine-grained details and unique local features of the image, calculating and optimizing the attribute regression loss We construct positive and negative examples for each image based on the numerical differences of the attributes, and formulate an attribute-level contrastive representation objective by comprehensively considering the contextual information of the attributes through contrastive learning. Introducing class consistency constraints To encourage images to have the highest compatibility scores with their corresponding attribute vectors; Based on the improved representation-derived hashing network, a hypersphere loss is introduced To achieve greater inter-class separation and compress inter-class variation; and Parameters are updated and the model is optimized to obtain the predicted labels of unknown class images. The present invention can be applied in scenarios with a large number of unknown labels, more effectively combining learning hash coding, image representation and visual attributes, promoting the improvement of generalization ability, and obtaining better prediction results.
[0008] The technical solution of the present invention is:
[0009] A cross-modal zero-shot hashing method for fine-grained attribute contrast fusion, the steps of which include:
[0010] 1) For a set of N images Label and get the corresponding label matrix The K-dimensional labeled class-level attribute vector matrix A = {a i}; where y i is the i-th image x in the image set X i Corresponding labels; for the known class Y in the label matrix Y s and unknown class Y u ,satisfy C represents the total number of categories; a i For image x i Corresponding K-dimensional class-level attribute vector; According to the labeling results, a training sample set S = {x, y, a|x∈X, y∈Y s , a∈A}; H, W, O represent the length, width and number of channels of the image respectively;
[0011] 2) Using the training sample set S to train the hash model; the training method is:
[0012] 21) Using an image encoder to extract features from each image x in the image set X, and obtaining a visual attribute feature f(x) of the image x;
[0013] 22) For each attribute, establish an attribute prototype and a similarity graph to obtain the attribute prototype set p k Represents the attribute prototype of the kth attribute, M k is the similarity graph of the kth attribute; through the attribute prototype p k Calculate the similarity graph M k The maximum value among predicts the score of the kth attribute of the image x. And calculate in, f i,j(x) represents the image representation at the spatial position (i, j) of image x, Θ(·) is a nonlinear network; Represents the attributes of each attribute on the i-th image
[0014] The sum of the scores, represents the coordinates of the maximum value in Mk;
[0015] 23) For the pth image in the image set X, construct a positive example about the dth dimension attribute for the pth image based on the attribute difference of the dth dimension attribute and negative examples Get sample set And set the attribute level comparison characterization target Where τ is the temperature parameter, is the sum of the attribute scores of each attribute on the p-th image, For example The sum of the attribute scores of each attribute vector on the qth image in , Negative example The sum of the attribute scores of each attribute vector on the t-th image attribute in , where D is the total number of image attribute dimensions;
[0016] 24) Use global average pooling to learn the global discriminant feature g(x) of each image x in the image set X; use parameter W to perform linear layer mapping on g(x) and map g(x) into the class representation space; calculate the dot product between g(x) and each class representation to generate class logic, and then cross entropy loss
[0017] 25) Replace the last fully connected layer in the image encoder with a fully connected hash layer, perform feature extraction on the image x, and binarize the visual attribute features obtained to generate a binary hash code b i ; and use hyperspherical loss To optimize fully connected hashing layers with large angle boundaries between classes;
[0018] 26) According to the total loss function Optimizing the hash model; wherein λ1, λ2 and λ3 are hyperparameters;
[0019] 3) For an image to be identified, it is input into the trained hash model to predict the hash tag of the corresponding image.
[0020] Furthermore, in is an integer controlling the size of the corner margin, where m ≥ 1,
[0021] Furthermore, the binary hash code b is generated by using sign(·) to perform a binarization process i .
[0022] Furthermore, the K-dimensional class-level attribute vector is constructed according to the set K attribute features, and each attribute feature is a one-dimensional element in the K-dimensional class-level attribute vector.
[0023] A server, characterized in that it comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing each step in the above method.
[0024] A computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the above method when executed by a processor.
[0025] The advantages and positive effects of the present invention are as follows:
[0026] This paper conducts a comprehensive property exploration of zero-shot hashing technology and develops a cross-modal zero-shot hashing method for fine-grained attribute contrast fusion. It is a weakly supervised representation learning framework that combines visual attributes, image features, class labels and binary hash coding to obtain more accurate label predictions for unknown classes, and has the following advantages:
[0027] (1) The present invention has faster training speed and more accurate label prediction results;
[0028] (2) The method of the present invention can process large data sets and address the challenges brought by the explosive growth of image data;
[0029] (3) The present invention outperforms the existing best methods in scenarios with a large number of unseen label classes and can be used to verify the effectiveness of attribute-based hashing;
[0030] (4) The present invention can effectively learn data representation in the representation learning process and has powerful data representation capabilities;
[0031] (5) The performance of the present invention remains relatively stable as the number of Hama coding bits increases;
[0032] (6) In practical application scenarios, the method of the present invention can achieve high scalability and stability without losing accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is the COMAE model framework diagram.
[0034] Figure 2 It is the overall flow chart of the present invention.
[0035] Figure 3 t-SNE visualization of hash codes on unseen classes for testing;
[0036] (a) COMAE, (b) HashNet, (c) Jmlh, (d) OrthoCos. DETAILED DESCRIPTION
[0037] The present invention is further described in detail below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention but not to limit the scope of the present invention.
[0038] In order to solve the above problems, the present invention conducts a comprehensive exploration of zero-shot hashing technology and proposes a cross-modal zero-shot hashing method for fine-grained attribute contrast fusion, hereinafter referred to as COMAE. The framework of COMAE consists of three modules: feature extraction module, feature processing module and supervision module. 1. The feature extraction module uses an image encoder to extract features of the visual attributes of the image and obtain a visual representation matrix. 2. The feature processing module consists of four key components: (1) Based on point-by-point attribute consistency, the image representation and attribute representation are described, and the attribute regression loss is used. As supervision, it aims to capture local features and visual attributes that are usually shared between known and unknown classes; (2) pairwise attribute exploration is performed based on pairwise attribute consistency. Positive and negative examples are constructed for each image according to the numerical difference of the attribute. The contextual information of the attribute is comprehensively considered through contrastive learning to characterize the target at the attribute level. as supervision; (3) based on class attribute exploration, extract higher-level relationships between images and attributes to encourage images and their corresponding attribute vectors to have the highest compatibility score, and introduce class consistency constraints L classwise As supervision; (4) Based on the improved representation-derived hashing network, hypersphere loss is introduced To achieve greater inter-class separation and compress inter-class variation. 3. The supervision module jointly optimizes the model by defining an overall objective function that balances the four losses corresponding to the four components of the feature processing module, more effectively combining learning hash codes, image representations, and visual attributes, and promoting the improvement of generalization ability by considering the relationships and dependencies between different classes during the learning process.
[0039] The method flow is as follows Figure 2 As shown, the specific steps include:
[0040] 1. Problem Definition
[0041] Using Collections represents N images, H, W, O represent the length, width and number of channels of the image respectively (the number of channels is usually 3, representing the three channels of the three primary colors RGB), xi represents the i-th image. is the label matrix corresponding to the N images in the set X, C represents the total number of categories (category represents the classification of the image), y i is the image x i The corresponding label. The class is divided into known classes Y s and unknown class Y u , and satisfy |Y s |∪|Y u |=|C|,|Y s |∩ make represents the class-level attribute vector annotated with K dimensions. The goal is to use a training sample set consisting of labeled images and attributes of the seen categories, i.e. S = {x, y, a|x∈X, y∈Y s , a∈A} to learn a hash model where b i represents the learned L-bit binary hash code. During the test, the attribute vector of the unknown class is also known. In the present invention, zero-shot hashing focuses on predicting hash tags from images of unknown classes, i.e., X→Y u .
[0042] 2. Feature extraction module:
[0043] The feature extraction module uses an image encoder to transform the visual attributes of the image x in the set X (such as Figure 1 The blue crown, red beak, black eyes, yellow legs, etc. shown in the figure are extracted to obtain the representation matrix
[0044] 3. Feature processing module
[0045] Step 1: Describing image representation and attribute representation based on point-by-point attribute consistency
[0046] Local image representations have been shown to be effective in terms of transferability between known and unknown classes. To more cleverly describe image and attribute representations, the present invention first performs point-wise consistency constraints with attribute regression loss as supervision. In recent years, prototype learning is considered to be more robust in dealing with open set recognition, out-of-distribution samples, and small sample learning. Therefore, the present invention introduces a prototype module that aims to capture local features and visual attributes that are usually shared between known and unknown classes.
[0047] make Represents the image representation at the spatial position (i, j) of image x in set X, which encodes the information of the local image region. The present invention learns a set of attribute prototypes And predict attributes based on local visual features, where p k Represents the prototype of the kth attribute. Figure 1As shown, p1 and p2 correspond to the prototypes of "black eyes" and "red beak" respectively. For each attribute (such as blue crown, red beak, yellow legs, black eyes, etc.), the present invention generates a similarity graph Each property is represented by a property prototype p k The nonlinear network Θ(·) between each local feature is calculated. In order to associate each visual attribute with its closest local feature and allow the network to effectively locate the attribute, the present invention takes the similarity map M k The maximum value among them is used to obtain the predicted score of the kth attribute.
[0048]
[0049] The visual attribute vector supervises the learning of attribute prototypes. The present invention only uses the visual attributes in the dataset as supervisory signals. In other words, no manual annotation associations between local features and visual attributes are given during training. The present invention regards the attribute prediction task as a regression problem and minimizes the true value a of the attribute of the i-th image. i and predicted attribute scores The mean square error (MSE) between Represents the summary of the predicted scores of each attribute on the i-th image. By optimizing the following regression loss and enforcing the use of local features to encode semantic attributes, the locality of image representation is improved and the quality of hash codes is further improved.
[0050]
[0051] In addition, we want to constrain the similarity graph so that it is concentrated in its peak area rather than scattered to other locations. Therefore, we k Apply the following compactness regularizer on
[0052]
[0053] when Indicates M k It forces the attribute prototype type to be similar to only a small number of local features, resulting in a compact similarity graph. Then becomes
[0054] Step 2: Pairwise attribute exploration based on pairwise attribute consistency
[0055] In order to make full use of limited and critical information, the present invention conducts paired attribute exploration to describe the contextual relationship of continuous-valued attributes. Recent studies have shown that contrastive learning can enhance the discriminative ability of feature representation and establish meaningful connections between known classes and unknown classes. Therefore, the present invention uses contrastive learning for paired constraints. First, construct a positive sample set of the pth image. And the d-th dimension negative sample set of all attributes Specifically, given the attribute of the pth image, represented as a p , construct the positive set of the p-th image as follows:
[0056]
[0057] Where ∈ is a hyperparameter, which is set after multiple experimental learning. Considering the huge number of negative samples, which will bring high complexity, we randomly sample e negative samples for the pth image. Finally, we get the sample set (The negative sample set here It does not include all negative samples, but rather e negative samples downsampled from all negative samples). Afterwards, the present invention formulates the attribute-level contrast embedding target as follows:
[0058]
[0059] Where τ>0 is the temperature parameter, is the sum of the attribute scores of each attribute on the p-th image, For example The sum of the attribute scores of each attribute vector on the qth image in , Negative example The sum of the attribute scores of each attribute vector on the t-th image attribute in , where D is the total number of image attribute dimensions.
[0060] Step 3: Exploring and extracting higher-level relationships between images and attributes based on class attributes
[0061] Class attribute exploration aims to use image attributes to improve classification performance. Compared with point-by-point and pair-wise exploration, it focuses on higher-level relationships between images and attributes. For high-level image representation, the present invention uses global average pooling on the input image to learn global discriminant features. Then, use the parameter A linear layer maps the visual feature g(x) into the class representation (e.g., feature) space, i.e., g(x i ) T W. Calculate the projected visual feature a i and the dot product between each class representation to produce the class logic, i.e. g(x i ) T W.ai , and then a cross entropy loss is performed according to Formula 6 to encourage images to have the highest compatibility scores with their corresponding attribute vectors
[0062]
[0063] The attribute representation and image representation are jointly optimized to achieve an overall optimization guided by the class label. T is the transpose operation of the matrix. Note that the attribute prototypes are shared between different classes and encourage the transfer of knowledge from known classes to unknown classes, thus producing better image representations for zero-shot learning.
[0064] Step 4: Derive the hash network based on the improved representation
[0065] After the above three consistency constraints, the image representation can contain more comprehensive attributes and class relationships. In this step, the present invention derives a hash network based on the improved representation. The hash network of the present invention is represented as H(·). Given an input image representation as Where f(·) represents the pre-trained image encoder. First, replace the last fully connected layer in f(·) with a fully connected hash (FCH) layer, and generate a binary hash code by using sign() for binarization.
[0066]
[0067] Where W h,w,o is a learnable transformation matrix that sets the representation learned by the last fully connected layer to d dimensions.
[0068] In order to compress intra-class hash codes with strong constraints, we use hyperspherical loss to optimize the FCH layer with large angular boundaries between classes. It is defined as
[0069]
[0070] in is an integer controlling the size of the corner margin, where m ≥ 1, Compared with general hashing methods, it can achieve greater inter-class separation and better compress inter-class variations.
[0071] 4. Supervised Learning
[0072] The present invention jointly optimizes the model by defining an overall objective function that balances the four losses corresponding to the four components of the feature processing module, more effectively combining the learning of hash coding, image representation and visual attributes, and promoting the improvement of generalization ability by considering the relationship and dependency between different classes in the learning process. The goal of the COMAE learning process is to minimize the objective function, which is defined as follows:
[0073]
[0074] Where λ1, λ2, and λ3 are hyperparameters. Since the derivative of sign(·) is not differentiable at zero, the parameters of the hash network cannot be updated by the standard back-propagation algorithm. We use tanh() to approximate the result of sign(·). In this way, it can be optimized by the mini-batch standard stochastic gradient descent (SGD) method.
[0075] 5. Model Evaluation
[0076] The mean precision (mAP) and area under the curve (AUC) of the precision-recall curve are used to evaluate the search results. The present invention reports the results of the first 5000 samples and all retrieved samples, namely mAP@5000 and mAP@all.
[0077] 6. Online detection and identification
[0078] For an image to be identified, it is input into the trained hash model to predict the hash tag of the corresponding image. Specific embodiments
[0080] 1. Dataset Overview
[0081] To evaluate the performance of COMAE, extensive experiments are conducted on three popular zero-shot hashing datasets, namely AWA2, CUB, and SUN. Table 1 summarizes the details of these three real-world datasets.
[0082] Table 1 Summary of zero-shot hashing datasets
[0083] Dataset Number of categories Ratio of known / unknown categories Sample size Number of attributes AWA2 50 40 / 10 37322 85 CUB 200 150 / 50 11788 312 SUN 717 645 / 72 14340 102
[0084] 2. Comparison method
[0085] (1) Image hashing method:
[0086] Supervised image hashing methods, namely HashNet, GreedyHash, JMLH, ADSH, CSQ, DPN, OrthoCos;
[0087] Unsupervised image hashing methods, namely BiHalf, TBH, CIBHash.
[0088] (2) Zero-sample hashing method:
[0089] ASZH uses category labels to learn hash functions from seen training data to generate binary codes for unseen data. SitNet and OPZH use semantic vectors to find semantic embedding space to transfer knowledge. AH transfers knowledge by building relationships and image features.
[0090] 3. Experimental environment and parameter settings
[0091] All competing methods were tested using their default hyperparameter configurations. For fair comparison, the image feature extractor of the comparison method was replaced by ResNet101. The training epoch was set to 10 and the batchsize was set to 64. COMAE used Adam as the optimizer with the weight decay set to 0.0005 and the learning rate set to 0.0001. λ1, λ2, and λ3 in Formula 9 were set to 10, 1, and 10, respectively. To ensure that the experimental data are statistically significant, the experimental results are the average of 10 runs of each method.
[0092] 4. Evaluation indicators
[0093] The mean Average Precision (mAP) and Area Under Curve (AUC) of the precision-recall curve are used to evaluate the search results. The present invention reports the results of the first 5000 samples and all retrieved samples, namely mAP@5000 and mAP@all.
[0094] 5. Experimental results analysis
[0095] (1) Here, we compare the model performance of COMAE with 14 competing methods (HashNet, GreedyHash, JMLH, ADSH, CSQ, DPN, OrthoCos, BiHalf, TBH, CIBHash, ASZH, SitNet, OPZH and AH), and conduct experiments on 3 real datasets respectively. The experimental results are as follows:
[0096] Table 2 Experimental results of mAP@5000 on three popular ZSH datasets
[0097]
[0098] The above experimental results, Table 2 shows the test results of COMAE and all competing methods on the datasets AWA2, CUB and SUN, with hash code lengths of 24, 48, 64 and 128. Please note that the source code of ASZH, SitNet, AH and OPZH is not available, so we used the results in the paper "Zero-Shot Hashing via Asymmetric Ratio Similarity Matrix" (Shi et al. 2022, and the experimental setting of Table 2 is the same as that of the paper "Zero-Shot Hashing via Asymmetric Ratio Similarity Matrix" in the experiment. In general, the following conclusions are drawn: a) Compared with the general deep hashing model, the zero-shot hashing model shows superior performance; b) The COMAE proposed in this invention surpasses all existing zero-shot hashing methods in all bit lengths; c) As the number of bits increases, the performance of COMAE remains relatively stable; d) Compared with the attribute-based zero-shot hashing method AH, the present invention obtains better performance, which helps to verify the correctness and effectiveness of the motivation proposed in this invention.
[0099] (2) In order to verify the performance of the COMAE model, we use hash coding visualization to observe it in a more intuitive way. The results are as follows: Figure 3 As shown. We first embed the 64-bit length hash code into a low-dimensional space, and then use t-SNE to map the low-dimensional hash code to a two-dimensional space. We found that a) HashNet and OrthoCos performed poorly and could not distinguish unseen classes; b) Although JMLH achieved good results, it still faced challenges such as large overlaps between classes and blurred boundaries (classes represented by green and purple); c) Compared with other comparison methods, the COMAE of the present invention achieved the best performance because the generated hash codes are easier to distinguish. This shows that COMAE can effectively classify images belonging to unseen categories. In the figure, the 10 colors represent 10 different unknown classes in the AWA2 dataset.
[0100] Although the specific embodiments of the present invention are disclosed for the purpose of illustration, the purpose is to help understand the content of the present invention and implement it accordingly, those skilled in the art will understand that various substitutions, changes and modifications are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the content disclosed in the best embodiment, and the scope of the present invention is subject to the scope defined in the claims.
Claims
1. A cross-modal zero-shot hashing method for fine-grained attribute contrast fusion, the steps of which include: 1) For a set of N images Label and get the corresponding label matrix The K-dimensional labeled class-level attribute vector matrix A = {a i }; where y i is the i-th image x in the image set X i Corresponding labels; for known classes Y in the label matrix Y s and unknown class Y u ,satisfy C represents the total number of categories; a i For image x i The corresponding K-dimensional class-level attribute vector; according to the labeling results, a training sample set S = {x, y, a|x∈X, y∈Y s ,a∈A}; H, W, O represent the length, width and number of channels of the image respectively; 2) Using the training sample set S to train the hash model; the training method is: 21) Using an image encoder to extract features from each image x in the image set X, and obtaining a visual attribute feature f(x) of the image x; 22) For each attribute, establish an attribute prototype and a similarity graph to obtain the attribute prototype set p k represents the attribute prototype of the kth attribute, M k is the similarity graph of the kth attribute; through the attribute prototype p k Calculate the similarity graph M k The maximum value among predicts the score of the kth attribute of the image x. And calculate in, f i,j (x) represents the image representation at the spatial position (i, j) of image x, Θ(·) is a nonlinear network; represents the sum of the attribute scores of each attribute on the i-th image, Indicates M k The coordinates of the maximum value in ; 23) For the pth image in the image set X, construct a positive example about the dth dimension attribute for the pth image based on the attribute difference of the dth dimension attribute and negative examples Get sample set And set the attribute level comparison characterization target Where τ is the temperature parameter, is the sum of the attribute scores of each attribute on the p-th image, For example The sum of the attribute scores of each attribute vector on the qth image in , Negative example The sum of the attribute scores of each attribute vector on the t-th image attribute in , where D is the total number of image attribute dimensions; 24) Use global average pooling to learn the global discriminant feature g(x) of each image x in the image set X; use parameter W to perform linear layer mapping on g(x) and map g(x) into the class representation space; calculate the dot product between g(x) and each class representation to generate class logic, and then cross entropy loss 25) Replace the last fully connected layer in the image encoder with a fully connected hash layer, perform feature extraction on the image x, and binarize the visual attribute features obtained to generate a binary hash code b i ; and use hyperspherical loss To optimize fully connected hashing layers with large angle boundaries between classes; 26) According to the total loss function Optimizing the hash model; wherein λ1, λ2 and λ3 are hyperparameters; 3) For an image to be identified, it is input into the trained hash model to predict the hash tag of the corresponding image.
2. The method according to claim 1, characterized in that in 2k is an integer that controls the size of the corner margin, where m ≥ 1, 3. According to the method of claim 1, using sign(·) to perform a binarization process to generate a binary hash code b i .
4. The method according to claim 1, characterized in that: The K-dimensional class-level attribute vector is constructed according to the set K attribute features, and each attribute feature is a one-dimensional element in the K-dimensional class-level attribute vector.
5. A server, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing each step in the method according to any one of claims 1 to 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
