A fine-grained bird image retrieval method based on graph neural network and deep hashing

Through graph neural network and deep hashing technology, a bird image retrieval method is constructed, which solves the problems of low bird image retrieval efficiency, high storage, and low precision in the existing technology, and achieves high efficiency, low storage, and high-precision fine-grained Bird image recognition,for large-scale data sets.

CN114329031BActive Publication Date: 2024-09-24NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111521433.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2024-09-24
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

The existing technology has problems of low efficiency, high storage requirements and low accuracy in bird image retrieval. Especially in terms of fine-grained bird recognition in large-scale data sets, it is difficult to achieve low-cost, low-storage and high-efficiency recognition technology. .

Method used

A method based on graph neural network and deep hashing is used to extract features through the backbone network, generate attention maps, randomly discard and normalize them, construct local feature relationship graphs, generate semantic hash codes, and use Bayesian framework to optimize quantification losses and bit-balanced losses for efficient fine-grained bird image retrieval.

Benefits of technology

It achieves high-efficiency, low-storage, and high-precision fine-grained bird image retrieval, reducing storage overhead and improving retrieval speed in practical applications. Its performance is better than advanced general-purpose and fine-grained retrieval methods, and it reduces labor management costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114329031B
    Figure CN114329031B
Patent Text Reader

Abstract

The present invention discloses a fine-grained bird image retrieval method based on graph neural network and deep hashing, belonging to the field of fine-grained image retrieval. The present invention comprises the following steps: node representation based on local features, local feature enhancement, related component relationship mining based on graph convolution, semantic hash coding, and loss function. A comprehensive method based on graph neural network and deep hashing method is proposed, which is suitable for large-scale bird image retrieval and can realize fine-grained bird image retrieval with high efficiency, low storage and high precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of fine-grained image retrieval, and in particular relates to a fine-grained bird image retrieval method based on graph neural network and deep hashing. Background Art

[0002] At present, bird monitoring can be used as an important indicator for evaluating biodiversity and ecological environment in nature reserves and national wetland areas; bird monitoring affects farmers' economic income and the normal operation of airports in farmland and airport areas. In nature, there are many bird species. Therefore, bird experts hope to quickly and accurately retrieve the correct bird from a large-scale data set. Since bird image retrieval is different from general image retrieval, there are two characteristics between its database image and query image: (1) Small inter-class differences: The differences between birds are small, and the differences are often subtle. For example, the head or tail of a bird. (2) Large intra-class differences. Due to factors such as lighting and posture, different images of the same bird species are quite different. At present, bird retrieval is often performed by experts through manual identification, which is often expensive and prone to errors. Therefore, in the face of large-scale bird data sets, if computer vision technology can be used to achieve low-cost, low-storage, and high-efficiency fine-grained bird recognition technology, it will be of great significance to both the industrial and agricultural sectors.

[0003] In recent years, there have been precedents for fine-grained image retrieval in the field of computer vision. In the early days, Xie et al. calculated the similarity between images based on manual features. When performing retrieval, the general category to which the image belongs is first determined, and then a search is performed at a fine-grained level. With the development of convolutional neural networks, fine-grained retrieval methods based on deep learning have been proposed. These deep methods can be roughly divided into supervised methods and unsupervised methods. For unsupervised retrieval methods, SCDA et al. proposed a selective convolutional descriptor aggregation method, which first locates objects in fine-grained images and retains useful deep descriptors for fine-grained image retrieval. However, this method uses a pre-trained model as a fixed feature extractor, does not customize the network to learn the corresponding fine-grained features, and does not take into account the structural relationship between the fine-grained components to which they correspond for the extracted convolutional descriptors, so the retrieval accuracy is average.

[0004] In supervised methods, fine-grained image retrieval is defined as a deep metric learning problem. Zheng et al. proposed the CRL-WSL method, which is a unified framework for effectively learning distinguishing features and using learned salient regions to perform centralized ranking loss and segmentation on the target contour. Zheng et al. also proposed the DCL-NC method, which improved the CRL-WSL method by adding a normalized scale layer and decorrelation ranking loss, achieving higher retrieval accuracy. However, the encoding dimension of these two methods is 1024 dimensions, which is relatively high. In actual large-scale image retrieval, problems such as slow query speed and storage redundancy may be encountered. Therefore, using low-storage code bits to achieve high-efficiency and high-precision fine-grained image retrieval is the main issue of concern at present. Summary of the invention

[0005] The present invention provides a fine-grained bird image retrieval method based on deep hashing and graph neural network, which can realize fine-grained bird image retrieval with high efficiency, low storage and high precision.

[0006] In order to achieve the above technical objectives, the technical solution of the present invention is:

[0007] A fine-grained bird image retrieval method based on graph neural network and deep hashing includes the following steps:

[0008] Step 1: Send the image to the backbone network Resnet50 to obtain its features F∈R H×W×N , where H, W and N represent the height, width and number of channels of the feature respectively; the obtained feature map is converted into an attention map, and then the discriminative local features are extracted through the attention maps of different local areas;

[0009] Step 2: Generate an image after attention is discarded for the attention map generated in step 1;

[0010] Step 3: Build a graph using the component features extracted in step 2 to mine the relationship between components and obtain fusion features;

[0011] Step 4: The fusion features obtained in step 3 are passed through the hash layer to obtain the hash code;

[0012] Step 5: For the feature extraction and hash coding in the above steps, construct a loss function to make the network converge gradually.

[0013] In the above steps, in step 1, the convolution function f() is used to convert the feature map into an attention map. The calculation method of the attention map is shown in formula (1):

[0014]

[0015] Generate M attention maps for each image, Ak ∈R H×W Represented as the attention map corresponding to the k-th fine-grained component;

[0016] The M-part features of the local area are calculated by formula (2):

[0017] f k =g(A k ⊙F),k=1,2,…,M (2)

[0018] where f k represents the k-th local feature, ⊙ represents the element-wise multiplication of the feature map F and the k-th attention map, and g() is the global average pooling operation;

[0019] Step 2 specifically includes the following steps:

[0020] Step 2.1: Random Attention Map Selection

[0021] For the learned M spatial attention maps, a common phenomenon is that multiple attention maps may be concentrated in similar areas of the object, which will greatly suppress the diversity of discriminative features. We use a random drop strategy to randomly select an attention map A from the M attention maps. k , to force the network to search for other information-rich local areas;

[0022] Step 2.2: Normalize the selected attention map

[0023] Specifically, for each training image, we first randomly select an attention map A from A k In order to improve the convergence rate of the model, the minimum-maximum normalization is used to convert A k The value of is smoothed to the range of [0,1], as shown in formula (3).

[0024]

[0025] A k * represents the enhanced k-th attention map;

[0026] Step 2.3: Construct the discard mask

[0027] By setting a discard threshold T d , will be greater than T d ∈[0,1] is set to 0, and the values ​​of other elements are set to 1 to construct a discard mask M. d , as shown in formula (4):

[0028]

[0029] Among them Ak * (i, j) represents the element value of the kth local feature in the i-th row and j-th column, M d (i, j) represents the value of the discard mask at the corresponding position, and the threshold T d is set to 0.5;

[0030] Step 2.4: Get the attention-dropped image and corresponding features

[0031] With the discard mask M d and the original image, the new attention-dropped image X d It can be obtained by multiplying them, which will be sent into the network again and learn M new partial features f k d ,Through this set of approaches, the attention map is encouraged to propose other discriminative components, ,ultimately improving the accuracy of localization and the quality of features;

[0032] Step 3 specifically includes the following steps:

[0033] Step 3.1: Define the edge characteristics of the graph

[0034] Through step 2, we get M local discriminant features f1, f2, ... f M , construct a directed graph G = (V, E) to capture the contextual relationship between these discrete local features, given vertices V = {1, 2, ..., M} and edges The edge feature from the i-th vertex to the j-th vertex can be defined as:

[0035] e ij =h θ;σ (f i ,f i -f j ) (5)

[0036] h θ;σ () is an asymmetric edge function implemented by shared MLP, as shown in formula (6):

[0037] h θ;σ (f i ,f i -f j )=Relu(θ·f i +σ(f i -f j ) (6)

[0038] Where θ and σ represent the parameters of the network;

[0039] Step 3.2: Generate fusion features

[0040] As shown in formula (6), fi -f j The captured neighborhood information of different nodes can be combined with f i The captured global information is gradually combined. Similar to image convolution, the output of the i-th vertex can be obtained by performing a global maximum pooling operation on all edge features related to the i-th vertex, as shown in formula (7):

[0041]

[0042] Among them, f i r represents the fusion feature of the i-th vertex, GMP represents the global maximum pooling operation, and finally, the fusion feature f of all vertices r The features of the fine-grained objects are sent to the hash coding module for encoding. Step 4 specifically includes the following steps:

[0043] Step 4.1: Hash code generation

[0044] For M reconstructed context features f i r , the semantic hash coding module outputs a B-bit hash code, which can be calculated according to formula (8):

[0045] H i =tanh((W H ) T f i r +δ H ),i=1,2,…,M (8)

[0046] Among them, H i ∈R B Yes i r The output of the hashing layer, δ H ∈B and W H ∈R M×B They represent the bias and weight of the hash layer respectively, and tanh() represents the activation function, which can be described by formula (9):

[0047]

[0048] Step 4.2: Map real-valued hash codes to two-dimensional hash codes

[0049] According to formula (10), the final hash code can be obtained. Since the value range of tanh() is [-1, 1], if H i >>0,B i =1, otherwise B i= -1, because the gradient of sign() at non-zero points is zero, which will cause the gradient to disappear. This method only uses H when testing the test model. i Mapped to a two-dimensional hash code,

[0050] B i =sgn(H i ) (10);

[0051] Step 5 specifically includes the following steps:

[0052] 5.1: Center Loss

[0053] When learning discriminative features in step 1, each attention map A belonging to the same category is required k To be able to point to similar parts of the object, we first introduce a loss L ctr To learn each local discriminative feature f k The characteristic center c k , L ctr Penalizing the variance of features from the same part of different objects with the same class label can be expressed as formula (11):

[0054]

[0055] where c k Yes A k The feature centers of some of them can be initialized from zero and calculated by moving average c k =(1-μ)c k +μf k Here, μ controls c k The update rate, L ctr The loss is only applied to the original image:

[0056] 5.2: Classification Loss

[0057] Using cross entropy loss L ce To constrain the predicted category and the true image label Y * The distance between them, for M original local features f k , simply stack them together and then feed them into the SoftMax layer to predict its category probability Y ori , the loss can be calculated as:

[0058]

[0059] Similarly, the discarded features f of M are predicted respectively k d and the reconstructed context feature f of M k r The class probability Y drop and Yrecn , the total classification loss is given by L ori , L drop and L recn Composition, as shown in formula (13):

[0060] L cls =L ori (Y ori ,Y * )+L drop (Y drop ,Y * )+L recn (Y recn ,Y * ) (13)

[0061] 5.3: Hash loss

[0062] Previous deep hashing methods use Sigmoid functions to define probability functions. However, existing hashing methods usually lack the ability to concentrate related images in a small Hamming ball, so they may perform poorly for retrieval in Hamming space. Therefore, this method uses a Bayesian framework to optimize the quantization loss. This method uses the probability function as follows:

[0063]

[0064] Where γ is the scale parameter of the Cauchy distribution. When the Hamming distance is small, the function drops rapidly, causing similar points to be pulled into a small Hamming radius. The Hamming distance for a pair of binary hash codes hi and hj is:

[0065]

[0066] Where K represents the number of bits of the hash code, then the Cauchy quantization loss is derived as:

[0067]

[0068] In addition to reducing quantization error, this method also takes into account the bit-balanced property, which means that each bit of the hash code has about a 50% chance of being 1 or -1. In order to produce a more discriminative hash code, this method adds a bit-balanced penalty:

[0069]

[0070] Where H is a K-bit hash code. The purpose of bit-balanced loss is to generate a balanced hash code. Then, the hash loss L hash Given by formula (18):

[0071] L hash =L q +Lb (18)

[0072] 5.4: Total loss

[0073] Finally, the overall loss of this method is:

[0074] L=L ctr +L cls +L q +L b (19)

[0075] Beneficial effects: The present invention provides a fine-grained bird image retrieval method based on deep hashing and graph neural network, designs a global fine-grained feature aggregation module, which reconstructs distinguishing features by capturing contextual correlation based on K-nearest neighbor graph, can learn various discriminative parts of birds (such as bird head, wings, etc.), and establish a relationship graph between different parts, so as to construct a discriminative fusion feature; designs a semantic hash coding module, which generates semantically compact hash codes under the guidance of Cauchy quantization loss and bit balance loss, thereby reducing storage overhead and improving retrieval speed in practical applications. Practical applications show that this method has low storage overhead, and its performance is always better than the most advanced general retrieval method and fine-grained retrieval method, providing strong support for reducing human management costs in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 A flowchart of a retrieval method in an embodiment of the present invention;

[0077] Figure 2 A diagram of test results in an embodiment of the present invention. DETAILED DESCRIPTION

[0078] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments:

[0079] In this example, we take the bird dataset CUB200-2011 as an example. Figure 1 As shown, a fine-grained bird image retrieval method based on deep hashing and graph neural network includes the following steps:

[0080] Step 1: Data preparation

[0081] The proposed method was experimented on the bird fine-grained dataset CUB200-2011 and compared with other fine-grained retrieval methods. CUB200-2011 contains 200 bird species and 11788 images. 5994 of them are used for training and 5794 for testing. The proposed method uses the test images as the query set and the training images as the retrieval database for all images. All images are resized to 448*448 pixels before being fed into the network.

[0082] Step 2: Node representation based on local features

[0083] Step 2.1 Node representation based on local features

[0084] For image X, this method feeds it into the backbone network Resnet50 and selects the features of the conv5 layer as its features F∈R H×W×N , where H, W and N represent the height, width and number of channels of the feature respectively.

[0085] Step 2.2 Attention map generation

[0086] Generate M attention maps for each image, which is set to 32 in this example. k ∈R H×W It is represented as the attention map corresponding to the kth fine-grained component, which may correspond to the bird's wings or head. This method uses a 1×1 convolution function f() to convert the feature map into an attention map. The calculation method of the attention map is shown in formula (1).

[0087]

[0088] Step 2.3 Generate discriminative features

[0089] By having the attention maps of different local regions, discriminative local features are extracted from these parts. The M-part features corresponding to these local regions can be calculated by formula (2).

[0090] f k =g(A k ⊙F),k=1,2,…,M (2)

[0091] where f k represents the k-th local feature, ⊙ represents the element-wise multiplication of the feature map F and the k-th attention map, and g() is the global average pooling operation.

[0092] Step 3: Mining related component relationships based on graph convolution

[0093] Step 3.1 Random Attention Map Selection

[0094] This method uses a random drop strategy to randomly select an attention map A from M attention maps. k , to force the network to search for other information-rich local areas.

[0095] Step 3.2 Normalize the selected attention map

[0096] Specifically, for each training image, we first randomly select an attention map A from A kIn order to improve the convergence rate of the model, this method uses minimum-maximum normalization to convert A k The value of is smoothed to the range of [0,1], as shown in formula (3).

[0097]

[0098] Here, A k * represents the enhanced k-th attention map.

[0099] Step 3.3 Construct the discard mask

[0100] By setting a discard threshold T d , will be greater than T d ∈[0,1] is set to 0, and the values ​​of other elements are set to 1 to construct a discard mask M. d , as shown in formula (4):

[0101]

[0102] Among them A k * (i, j) represents the element value of the kth local feature in the i-th row and j-th column, M d (i, j) represents the value of the discard mask at the corresponding position. Here, the threshold T d is set to 0.5;

[0103] Step 3.4 Get the attention discarded image and corresponding features

[0104] With the discard mask M d and the original image, the new attention-dropped image X d It can be obtained by multiplying them, which will be sent into the network again and learn M new partial features.

[0105] Step 4: Mining related component relationships based on graph convolution

[0106] Step 4.1 Define the edge characteristics of the graph

[0107] Through step 3, we get M local discriminant features f1, f2, ... f M , this method constructs a directed graph G = (V, E) to capture the contextual relationship between these discrete local features. Given vertices V = {1, 2, ..., M} and edges The edge feature from the i-th vertex to the j-th vertex can be defined as:

[0108] e ij =h θ;σ (f i ,fi -f j ) (5)

[0109] h θ;σ () is an asymmetric edge function implemented by shared MLP, as shown in formula (6):

[0110] h θ;σ (f i ,f i -f j )=Relu(θ·f i +σ(f i -f j ) (6)

[0111] Where θ and σ represent the parameters of the network.

[0112] Step 4.2 Generate fusion features

[0113] As shown in formula (6), f i -f j The captured neighborhood information of different nodes can be combined with f i The captured global information is gradually combined. Similar to image convolution, the output of the i-th vertex can be obtained by performing a global maximum pooling operation on all edge features related to the i-th vertex, as shown in formula (7).

[0114]

[0115] Among them, f i r represents the fusion feature of the i-th vertex, GMP represents the global maximum pooling operation, and finally, the fusion feature f of all vertices r The features of fine-grained objects are fed into the hash coding module for encoding.

[0116] Step 5: Semantic Hash Coding

[0117] Step 5.1 Hash code generation

[0118] For M reconstructed context features f i r ,The semantic hash coding module outputs a B-bit hash code, which can be calculated according to formula (8).

[0119] H i =tanh((W H ) T f i r +δ H ),i=1,2,…,M (8)

[0120] Among them, H i∈R B Yes i r Output after hashing layer. H ∈B and W H ∈R M×B They represent the bias and weight of the hash layer respectively. tanh() represents the activation function, which can be described by formula (9).

[0121]

[0122] Step 5.2 Mapping real-valued hash codes to two-dimensional hash codes

[0123] According to formula (10), the final hash code can be obtained. Since the value range of tanh() is [-1,1], if H i >>0,B i =1, otherwise B i = -1. Because the gradient of sign() at non-zero points is zero, it will cause the gradient to disappear. This method only uses H when testing the test model. i Mapped to a two-dimensional hash code.

[0124] B i =sgn(H i ) (10)

[0125] Specifically, in step 5, for the feature extraction and hash coding in the above steps, a loss function is constructed to make the network converge gradually. It includes:

[0126] Step 6 Loss Function

[0127] 6.1 Center Loss

[0128] When learning discriminative features in step 2, each attention map A belonging to the same category is required k It can point to similar parts of the object. This method first introduces a loss L ctr To learn each local discriminative feature f k The characteristic center c k .L ctr Penalizing the variance of features from the same part of different objects with the same class label can be expressed as formula (11).

[0129]

[0130] where c k Yes A k The feature centers of some of them can be initialized from zero and calculated by moving average c k =(1-μ)c k +μf kHere, μ controls c k The update rate, L ctr The loss is only applied to the original image.

[0131] 6.2 Classification Loss

[0132] This method uses the cross entropy loss L ce To constrain the predicted category and the true image label Y * For M original local features f k , simply stack them together and then feed them into the SoftMax layer to predict its category probability Y ori , the loss can be calculated as:

[0133]

[0134] Similarly, this method also predicts the discarded features f of M respectively k d and the reconstructed context feature f of M k r The class probability Y drop and Y recn The total classification loss is given by L ori , L drop and L recn Composition, as shown in formula (13):

[0135] L cls =L ori (Y ori ,Y * )+L drop (Y drop ,Y * )+L recn (Y recn ,Y * ) (13)

[0136] 6.3 Hash Loss

[0137] Previous deep hashing methods use Sigmoid functions to define probability functions. However, existing hashing methods usually lack the ability to concentrate related images in a small Hamming ball, so they may perform poorly for retrieval in Hamming space. Therefore, this method uses a Bayesian framework to optimize the quantization loss. This method uses the probability function as follows:

[0138]

[0139] where γ is the scale parameter of the Cauchy distribution. When the Hamming distance is small, this function decreases rapidly, causing similar points to be pulled into a small Hamming radius. For a pair of binary hash codes h iand h j The Hamming distance of is:

[0140]

[0141] Where K is the number of bits of the hash code. Then, the Cauchy quantization loss is derived as:

[0142]

[0143] In addition to reducing quantization error, this method also takes into account the bit-balanced property, which means that each bit of the hash code has about a 50% chance of being 1 or -1. In order to produce a more discriminative hash code, this method adds a bit-balanced penalty:

[0144]

[0145] Where H is a K-bit hash code. The purpose of bit-balanced loss is to generate unbiased information hash codes. Then, the hash loss L hash Given by formula (18):

[0146] L hash =L q +L b (18)

[0147] 6.4 Total Loss

[0148] Finally, the overall loss of this method is:

[0149] L=L ctr +L cls +L q +L b (19)

[0150] 7 Bird fine-grained model training and testing

[0151] 7.1 Bird Dataset Training

[0152] This method is based on PyTorch implementation code, and the model is trained by using 2 RTX 2080ti GPUs to preprocess images of size 448×448. In all experiments, Resnet-50 is used as the backbone network to extract features, and the output of the Conv5 layer is selected as the feature map. For the generation of attention maps, the attention map is obtained by a 1×1 convolution kernel, the default M is 32, and the discard threshold T d is set to 0.5;

[0153] 7.2 Evaluation Metrics

[0154] This method uses the mean average precision (mAP) as the evaluation metric to provide a fair comparison with previous methods. This method calculates the retrieval accuracy as:

[0155]

[0156] Among them, n q N represents the number of samples in the query set, and n represents the number of samples returned. + Represents the number of positive samples among n returned samples, N + k Refers to the number of positive samples in the first k returned samples. If the kth image is a positive sample, then the value of pos(k) is 1, otherwise it will be 0.

[0157] 7.3 Model Testing

[0158] After testing all test samples, the method achieved 86.92% of the effect on 48-bit hash code. Figure 2 As shown in Figure 1, we selected two bird images, and the accuracy rates of the first 10 images returned by the search were 90% and 80% respectively. For birds with small differences, this method showed high-precision search results that met user expectations at 48 code positions.

[0159] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention is described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A fine-grained bird image retrieval method based on graph neural network and deep hashing, It is characterized in that The following steps are involved: Step 1: Send the image to the backbone network Resnet50 to get Its characteristic F∈R H×W×N , where H, W and N represent the height, width and number of channels of the feature respectively; the convolution function f() is used to convert the feature map into an attention map. The calculation method of the attention map is shown in formula (1): Then, the discriminative local features are extracted through the attention maps of different local areas, and M attention maps are generated for each image. k ∈R H×W It is represented as the attention map corresponding to the k-th fine-grained component; the M-part features of the local area are calculated by formula (2): f k =g(A k ⊙F),k=1,2,…,M(2) where f k represents the k-th local feature, ⊙ represents the element-wise multiplication of the feature map F and the k-th attention map, and g() is the global average pooling operation; Step 2: Generate an image after attention is discarded for the attention map generated in step 1, specifically including the following steps: Step 2.1: Random Attention Map Selection For the learned M spatial attention maps, a random discard strategy is performed to randomly select an attention map A from the M attention maps k , to force the network to search for other information-rich local areas; Step 2.2: Normalize the selected attention map For each training image, we first randomly select an attention map A from A. k In order to improve the convergence rate of the model, the minimum-maximum normalization is used to convert A k The value of is smoothed to the range of [0, 1], as shown in formula (3): A k * represents the enhanced k-th attention map; Step 2.3: Construct the discard mask By setting a discard threshold T d , will be greater than T d ∈[0, 1] is set to 0, and the values ​​of other elements are set to 1 to construct a discard mask M. d , as shown in formula (4): Among them A k * (i, j) represents the element value of the kth local feature in the i-th row and j-th column, M d (i, j) represents the value of the discard mask at the corresponding position, and the threshold T d is set to 0.5; Step 2.4: Get the attention-dropped image and corresponding features New attention-dropped image X d By discarding the mask M d It is multiplied by the original image and sent into the network again to learn M new partial features. Through this set of methods, the attention map is encouraged to propose other discriminative components, ultimately improving the accuracy of localization and the quality of features; Step 3: Build a graph using the component features extracted in step 2 to mine the relationship between components and obtain fusion features, which specifically includes the following steps: Step 3.1: Define the edge characteristics of the graph Through step 2, we get M local discriminant features f 1 , f 2 , ...f M , construct a directed graph G = (V, E) to capture the contextual relationship between these discrete local features, given vertices V = {1, 2, ..., M} and edges The edge feature from the i-th vertex to the j-th vertex can be defined as: e ij =h θ;σ (f i ,f i -f j ) (5) h θ;σ () is an asymmetric edge function implemented by shared MLP, as shown in formula (6): h θ;σ (f i ,f i -f j )=Relu(θ·f i +σ(f i -f j ) (6) Where θ and σ represent the parameters of the network; Step 3.2: Generate fusion features As shown in formula (6), f i -f j The captured neighborhood information of different nodes can be combined with f i The captured global information is gradually combined. Similar to image convolution, the output of the i-th vertex can be obtained by performing a global maximum pooling operation on all edge features related to the i-th vertex, as shown in formula (7): Among them, f i r represents the fusion feature of the i-th vertex, GMP represents the global maximum pooling operation, and finally the fusion feature f of all vertices r The features of the fine-grained objects are sent to the hash coding module for coding; Step 4, the fusion features obtained in step 3 are passed through the hash layer to obtain the hash code, which specifically includes the following steps: Step 4.1: Hash code generation For M reconstructed context features f i r , the semantic hash coding module outputs a B-bit hash code, which can be calculated according to formula (8): H i =tanh((W H ) T f i r +δ H ),i=1,2,…,M (8) Among them, H i ∈R B Yes i r The output of the hashing layer, δ H ∈B and W H ∈R M×B They represent the bias and weight of the hash layer respectively, and tanh() represents the activation function, which can be described by formula (9): Step 4.2: Map real-valued hash codes to two-dimensional hash codes According to formula (10), the final hash code can be obtained. Since the value range of tanh() is [-1, 1], if H i >>0,B i =1, otherwise B i = -1, because the gradient of sign() at non-zero points is zero, which will cause the gradient to disappear. This method only uses H when testing the test model. i Mapped to a two-dimensional hash code, B i =sgn(H i ) (10); Step 5: For the feature extraction and hash coding in the above steps, construct a loss function to make the network converge gradually.

2. The fine-grained bird image retrieval method based on graph neural network and deep hashing according to claim 1, It is characterized in that Step 5 Specific The following steps are involved: 5.1: Center Loss When learning discriminative features in step 1, each attention map A belonging to the same category is required k To be able to point to similar parts of the object, we first introduce a loss L ctr To learn each local discriminative feature f k The characteristic center c k , L ctr Penalize the variance of features from the same part of different objects with the same category label, expressed as formula (11): where c k Yes A k The partial feature centers are initialized from zero and passed through the moving average c k =(1-μ)c k +μf k Update, μ controls c k The update rate; 5.2: Classification Loss Using cross entropy loss L ce To constrain the predicted category and the true image label Y * The distance between them, for M original local features f k , stack them together, and then send them to the SoftMax layer to predict its category probability Y ori , the loss can be calculated as: Similarly, the discarded features f of M are predicted respectively k d and the reconstructed context feature f of M k r The class probability Y drop and Y recn , the total classification loss is given by L ori , L drop and L recn Composition, as shown in formula (13): L cls =L ori (AND ori ,AND * )+L drop (AND drop ,AND * )+L recn (AND recn ,AND * ) (13) 5.3: Hash loss Use the Bayesian framework to optimize the quantization loss, using the probability function as follows: Where γ is the scale parameter of the Cauchy distribution. When the Hamming distance is small, the function decreases rapidly, causing similar points to be pulled into a small Hamming radius. For a pair of binary hash codes h i and h j The Hamming distance of is: in, K represents the number of bits of the hash code, then the Cauchy quantization loss is derived as: To produce a more discriminative hash code, a bit balancing penalty is added: The purpose of bit-balanced loss is to generate balanced hash codes, so the hash loss L hash Given by formula (18): L hash =L q +L b (18) 5.4: Total loss The final overall loss is: L=L ctr +L cls +L q +L b (19) 3. The fine-grained bird image retrieval method based on graph neural network and deep hashing according to claim 2, It is characterized in that L ctr The loss is only applied to the original image.