A similarity map retrieval model training method and system and related devices

By introducing a combination of annotation information and loss function into the training of the similar graph retrieval model, the problems of large annotation workload and low training efficiency in the existing technology are solved, realizing efficient training of the similar graph retrieval model and improving the model's adaptability and accuracy.

CN117011637BActive Publication Date: 2025-12-23JINAN BOGUAN INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310641958.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-31
Publication Date
2025-12-23
Estimated Expiration
2043-05-31

AI Technical Summary

Technical Problem

Existing technologies require a large amount of manual annotation work when training similar graph retrieval models, and the training effect is not good. They cannot effectively cover all scenarios, resulting in cumbersome operation and low efficiency.

Method used

A similar graph retrieval model training method is adopted. By obtaining a training set containing labeled information, a high-dimensional feature matrix is ​​trained using a feature extraction network and a loss function to reduce the amount of labeling work. Furthermore, the model is trained by combining softmax and triplet loss functions to improve training efficiency.

Benefits of technology

It significantly reduces the workload of image annotation, improves the training efficiency and robustness of similar graph retrieval models, and can better adapt to different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117011637B_ABST
    Figure CN117011637B_ABST
Patent Text Reader

Abstract

The application provides a similar image retrieval model training method, comprising: obtaining a training set; inputting different picture small class pictures in the training set and corresponding enhanced pictures of each picture into a feature extraction network as input data to obtain high-dimensional features; training the high-dimensional features through a loss function to obtain gradients, correcting weight parameters in the high-dimensional feature extraction network by using the gradients to obtain a high-dimensional feature matrix; and using the high-dimensional feature matrix to calculate the similarity between similar pictures. The application only needs to perform simple and rapid labeling on image large classes, regards each picture in the large class as a small class, and does not need to perform targeted labeling on each picture, thereby reducing the labeling workload before picture training and improving the training efficiency of the similar image retrieval model. The application also provides a similar image retrieval model training system, a computer readable storage medium and an electronic device, which have the above beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image detection, in particular to a similar image retrieval model training method and system and related devices. BACKGROUND

[0002] Similar images refer to images that have a high degree of repetition in background or main content and appear to be very similar in semantics, for example, a car photographed from the front and a car photographed from a 45-degree angle. To some extent, these two images are similar images.

[0003] Currently, metric learning can be used to perform similar image retrieval model training, that is, a visual backbone network is used to extract N-dimensional features of an image, which represent the image. After extracting the N-dimensional features, the similarity between the images is determined by calculating the similarity between the N-dimensional features. During training, the Loss of metric learning such as Triplet Loss can be used for training, but the images need to be pre-labeled, and during training, the training degree cannot be adjusted according to different categories. For open set tasks such as similar image retrieval model training, it is difficult to cover all scene images. Not only is the training process tedious due to the large amount of labeling work, but the training effect is also not good. SUMMARY

[0004] The purpose of the present application is to provide a similar image retrieval model training method, a similar image retrieval model training system, a computer readable storage medium and an electronic device, which can reduce the labeling workload of images and improve the training efficiency.

[0005] To solve the above technical problems, the present application provides a similar image retrieval model training method, and the specific technical solutions are as follows:

[0006] Obtain a training set; wherein the images in the training set contain labeling information, each image corresponds to a small image category, and the labeling information contains a large category to which the image belongs and an image serial number;

[0007] Input different small image category images in the training set and the enhanced images corresponding to each image into a feature extraction network as input data to obtain high-dimensional features;

[0008] Train the high-dimensional features through a loss function to obtain gradients, use the gradients to correct the weight parameters in the high-dimensional feature extraction network, and obtain a high-dimensional feature matrix; the high-dimensional feature matrix is used to calculate the similarity between similar images.

[0009] Optionally, the obtaining of the training set comprises:

[0010] Multiple enhancement methods are randomly selected from the image enhancement set to enhance the image, resulting in multiple enhanced images. The original image and the enhanced images are used as a training set. The enhanced images belong to the same image subclass as the original image and share the annotation information.

[0011] Optionally, obtaining the gradient by training the high-dimensional features using a loss function includes:

[0012] For the aforementioned image subclass, the gradient is obtained by training using softmax and triplet loss as the first loss function;

[0013] For the category to which the image belongs, the gradient is obtained by training using softmax as the second loss function.

[0014] Optionally, for the major category to which the image belongs, the gradient obtained by training using softmax as the second loss function includes:

[0015] For images belonging to the same subcategory within the same major category, the training process sets the label value as the first label value.

[0016] For images belonging to different subcategories within the same major category, the training process sets the label value to a second label value; wherein, the first label value is greater than the second label value.

[0017] Optionally, before randomly selecting multiple enhancement methods from the image enhancement set to enhance the image, the method further includes:

[0018] Obtain the image enhancement set; the image enhancement set includes enhancement methods such as brightness adjustment, contrast adjustment, and image occlusion, or any combination of any number of such methods.

[0019] Optionally, the triplet loss formula is as follows:

[0020] Loss trip =max(||AP|| 2 -||AN|| 2 +α,0);

[0021] Where A represents the anchor sample, P represents a positive sample of the same class as the anchor sample, N represents a negative sample of a different class than the anchor sample, and α is a set threshold; wherein the distance between negative samples minus the distance between positive samples is greater than α.

[0022] This application also provides a similar graph retrieval model training system, including:

[0023] The training data acquisition module is configured to acquire a training set, wherein each picture in the training set contains annotation information, each picture corresponds to a picture subcategory, and the annotation information contains a picture category to which the picture belongs and a picture serial number.

[0024] The feature extraction module is configured to input different picture subcategory pictures in the training set and corresponding enhanced pictures of each picture as input data into a feature extraction network to obtain high-dimensional features.

[0025] The model training module is configured to train the high-dimensional features through a loss function to obtain gradients, correct weight parameters in the high-dimensional feature extraction network by using the gradients, and obtain a high-dimensional feature matrix, wherein the high-dimensional feature matrix is used to calculate the similarity between similar pictures.

[0026] Optionally, the training data acquisition module comprises:

[0027] The training data processing unit is configured to randomly select multiple enhancement methods from a picture enhancement set to enhance the picture to obtain multiple enhanced pictures, and use the picture and the enhanced pictures as the training set, wherein the enhanced pictures belong to the same picture subcategory as the picture and share the annotation information.

[0028] The application further provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the method.

[0029] The application further provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor invokes the computer program in the memory to implement the steps of the method.

[0030] The application provides a similar picture retrieval model training method, comprising: acquiring a training set, wherein each picture in the training set contains annotation information, each picture corresponds to a picture subcategory, and the annotation information contains a picture category to which the picture belongs and a picture serial number; inputting different picture subcategory pictures in the training set and corresponding enhanced pictures of each picture as input data into a feature extraction network to obtain high-dimensional features; training the high-dimensional features through a loss function to obtain gradients, correcting weight parameters in the high-dimensional feature extraction network by using the gradients, and obtaining a high-dimensional feature matrix, wherein the high-dimensional feature matrix is used to calculate the similarity between similar pictures.

[0031] The application only needs to perform simple and rapid annotation on image categories, and regards each picture in the category as a subcategory, without the need for targeted annotation on each picture, thereby greatly reducing the annotation workload before picture training and improving the training efficiency of the similar picture retrieval model training model.

[0032] The application further provides a similar image retrieval model training system, a computer readable storage medium and an electronic device, which have the above beneficial effects, and details are not repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.

[0034] Figure 1 A flowchart of a similar image retrieval model training method provided by the embodiments of the present application;

[0035] Figure 2 A structural schematic diagram of a similar image retrieval model training system provided by the embodiments of the present application. DETAILED DESCRIPTION

[0036] The present application aims to improve the training method, and the soft label, multi-label and other methods, improve the training process, and propose a new similar image retrieval model training method. While reducing the workload of picture calibration, the robustness of the similar image retrieval model to different scenes can be greatly improved.

[0037] To make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0038] Please refer to Figure 1 , Figure 1 A flowchart of a similar image retrieval model training method provided by the embodiments of the present application, the similar image retrieval model training method comprises:

[0039] S101: obtaining a training set; wherein the pictures in the training set contain annotation information, each picture corresponds to a picture sub-class, and the annotation information contains a large class to which the picture belongs and a picture serial number;

[0040] The step aims to obtain a picture training set that has been labeled. By default, the pictures in the training set have been labeled before the step is performed. When labeling, only the large category to which the picture belongs and the corresponding picture serial number need to be labeled. In fact, the picture serial number is used as the label information of the small category to which the picture belongs. Since by default each picture is a small category of picture, it is not necessary to make targeted label processing on the small category of picture.

[0041] In a specific application process of the step, the training set can be derived from a training database, that is, the training set can be obtained from the training database in each iteration training process to meet the current iteration training.

[0042] For pictures, only large category labels need to be labeled, that is, only the large category to which a picture belongs needs to be labeled, such as cat, dog, person, and tree. These large category labels have obvious targets and are faster to label. These large categories will be used as soft labels in subsequent training for auxiliary training.

[0043] In order to reduce the labeling workload and enhance the robustness, the idea of unsupervised contrast learning is introduced. Specifically, each picture is a specific small category. That is, different angle or different time pictures of a dog are treated as a specific small category as the number of pictures taken. In this way, there are as many small categories as training samples. For example, different position snapshots of the same object have the same large category label, but each picture is its own small category.

[0044] The present application performs two kinds of labeling of large categories and small categories for each picture. According to the two kinds of labeling, a new training method is proposed. For traditional classification tasks, if the Softmax function is used to calculate the loss, the probability of a picture to the correct class label should be 1, that is, the model learns 100% to determine a certain class, and the probability of other class labels is 0. However, in the present application, if different large category pictures are learned using 0 / 1 labels, for example, using 0 / 1 labels to learn people and cars, then different pictures belonging to the same large category cannot be distinguished and learned by 0 / 1 labels, otherwise it is difficult to learn the degree of differentiation.

[0045] The embodiments of the present application set the label value in the training process to 0.5 for two pictures in the same large category, i.e., for the large category to which the pictures belong, and means to learn with a label of 0.5, indicating that the guide model has a 0.5 probability of judging that the pictures in the same large category belong to the same category. The specific operation is as follows. For example, there are 100 training pictures, corresponding to 100 small categories. It is assumed that the 100 pictures are divided into 5 large categories. Each time the softmax calculation formula is performed, the label is converted into a Onehot form, i.e., into a 1*100 vector (100 is the number of categories). Each value in the vector represents the probability that the picture is judged to belong to the category. In a normal softmax 1*100 vector, only the category to which the picture belongs is 1, and the other categories are 0. In the present application, the value of the small category to which the picture belongs is set to 1, and the values of the pictures in the same large category are set to 0.5, and the values of the pictures in different large categories are set to 0. In this way, during training, the pictures in different large categories are more easily distinguished, the pictures in the same large category are less easily distinguished, and the pictures in the same small category are least easily distinguished. This can facilitate the model to better learn how to distinguish the similarity of pictures. The similarity of pictures in different large categories is very low, the similarity of pictures in the same large category is slightly high, and the similarity of pictures in the same small category is higher.

[0046] S102: input different picture small category pictures in the training set and the corresponding enhanced pictures of each picture into a feature extraction network as input data to obtain high-dimensional features;

[0047] S103: obtain a gradient by training the high-dimensional features through a loss function, correct the weight parameters in the high-dimensional feature extraction network using the gradient, and obtain a high-dimensional feature matrix; the high-dimensional feature matrix is used to calculate the similarity between similar pictures.

[0048] Step S102 aims to extract features from the pictures in the training set to obtain high-dimensional features. Step S103 aims to perform iterative training using a loss function. It should be noted that the process of obtaining a gradient by training the high-dimensional features through a loss function and correcting the weight parameters in the high-dimensional feature extraction network using the gradient can be iterated multiple times, such as several thousand times, several ten thousand times, or even several hundred thousand times, to obtain a final high-dimensional feature matrix extraction network.

[0049] Specifically, in the process of extracting high-dimensional features, multiple pictures in different picture small categories can form a batch, and it is necessary to ensure that there are a fixed number of pictures in each small category in the batch, which are input into the feature extraction network to obtain a high-dimensional feature matrix, such as an N*128-dimensional high-dimensional feature matrix (N is the number of pictures in the batch).

[0050] After obtaining the high-dimensional features, iterative training is needed. Different loss functions can be used for different trained objects. For example, for small classes of pictures, softmax and triplet loss can be used as the first loss function for training to obtain the gradient. For the large class to which the picture belongs, softmax can be used as the second loss function to obtain the gradient. In the training process, softmax and triplet can produce two gradients to update the weight parameters in the high-dimensional feature extraction network. Using only softmax as the second loss function will only produce one gradient for updating the weight parameters. After the set number of iterations is met, the final high-dimensional feature matrix, i.e., the final high-dimensional feature extraction network, is obtained. The set number of iterations is not limited here and can be set by those skilled in the art according to the application requirements of the similar image retrieval model. The similarity between similar pictures can be calculated using the high-dimensional feature matrix.

[0051] It should also be noted that whether two specific pictures are similar needs to be compared with a pre-set reference threshold value by calculating the similarity of the high-dimensional feature matrix. In different scenarios, the threshold value can be different, i.e., whether two pictures are similar should be set as a similarity evaluation standard by referring to the specific use scenario.

[0052] The embodiment of the present application only needs to perform simple and fast labeling on the large class of images, and each picture in the large class is regarded as a small class, without the need for targeted labeling of each picture, greatly reducing the labeling workload before picture training and improving the training efficiency of the similar image retrieval model training model.

[0053] On the basis of the above embodiment, as a preferred embodiment, in order to avoid that each picture subclass has only one picture, which is not conducive to the learning of similar pictures by the classification task, and is not convenient for using the triplet loss to improve the model effect. When obtaining the training set, the pictures in the training set can be preprocessed. Specifically, a plurality of enhancement methods can be randomly selected from the picture enhancement set to enhance the pictures, and a plurality of enhanced pictures can be obtained. The pictures and the enhanced pictures belong to the same picture subclass and share the label information. When collecting a picture of a certain subclass during training, the collected picture of the subclass is randomly enhanced. The enhanced picture and the unenhanced picture belong to the same subclass. Specifically, 40 pictures are collected in each batch during training, and different enhancements are performed on the 40 pictures. The number of enhanced pictures can be determined according to the size of the graphics card. For example, when 200 pictures can be trained at most once, each picture is combined with four different random enhancements, which will generate 160 pictures, and the original 40 pictures form the current training batch. In this way, each subclass has 5 pictures. Of course, in this embodiment, the picture enhancement set is not limited, and an existing picture enhancement set can be obtained in advance. The enhancement methods included in the picture enhancement set include one or any number of combinations of brightness adjustment, contrast adjustment, picture occlusion, image inversion, and noise addition, or other spatial-based image enhancement algorithms or frequency-based image enhancement algorithms. The embodiment uses random enhancement to introduce a small class sample cluster, enriches the samples, effectively increases the judgment effect of the model, and does not introduce new labeling requirements. Different training methods can be used for large and small class labels on this basis to achieve more scientific training.

[0054] Since the similar picture retrieval model training is an open set task, the traditional classification method cannot be used in the scene not in the training set. Therefore, as a preferred embodiment, a feature layer is introduced before the classification layer in the training process of the embodiment of the application to represent the features of the picture. With the feature layer, only the feature similarity of two pictures needs to be calculated in actual use to obtain the similarity of the two pictures, and then different thresholds are set according to different use scenarios to determine whether the two pictures are similar pictures.

[0055] Taking 5 pictures per subclass as an example, and each picture is expressed by a feature layer. At this time, a triplet loss can be introduced to further improve the model effect. Finally, a softmax+triplet loss function combination is used in actual training.

[0056] The triplet loss formula is as follows:

[0057] Losstrip=max(||A-P||2-||A-N||2+α,0)

[0058] Where A represents the anchor sample, P represents a positive sample of the same class as the anchor sample, N represents a negative sample of a different class from the anchor sample, and α is a set threshold requiring that the distance between negative samples minus the distance between positive samples is greater than α. For this invention, each image has two labels. Here, the minor class label is used to calculate the triplet loss, which generates two gradients. Because different major classes are easily learned to distinguish, triplet loss is not needed; softmax is used as the second loss function, and the label value during training is set, generating one gradient. Subsequently, the weights are updated through gradient backpropagation based on the loss calculated by the loss function, thereby optimizing and updating the model.

[0059] During training, for two images belonging to the same major image category, different label values ​​can be assigned based on whether they belong to the same subcategory. Images belonging to different major image categories have a label value of 0. Images belonging to both the same major and subcategory can be trained using the first label value, while images belonging to the same major but different subcategories can be trained using the second label value. The specific values ​​of the first and second label values ​​are not limited, only that the first label value is greater than the second label value. In practical applications, to improve image training performance, a larger difference between the first and second label values ​​can be used.

[0060] In one feasible implementation, a label value of at least 0.5 can be assigned to two images within the same image category. Thus, when training the image category, the model learns that images within the same category have a probability of at least 0.5 of being classified as belonging to the same category. This means the probability of an image belonging to a particular image category is at least 0.5, which is significantly higher than the probability of it belonging to other image categories. For images belonging to different image categories, the model learns to distinguish them more effectively.

[0061] This embodiment proposes a feature-based similarity graph retrieval model training method, which can be applied to open-set similarity graph usage scenarios, avoiding the standard difference problem that exists when manually defining similarity graphs. Furthermore, combined with the above embodiment, it not only employs random augmentation to enrich class samples but also introduces triplet loss, along with Softmax using different training strategies, to conduct strongly and weakly supervised training, making the training process more scientific.

[0062] The following describes a similar graph retrieval model training system provided in the embodiments of this application. The similar graph retrieval model training system described below can be referred to in correspondence with the similar graph retrieval model training method described above.

[0063] See Figure 2 ,Figure 2 A similar picture retrieval model training system structure schematic diagram is provided in the embodiments of the present application, and a similar picture retrieval model training system is also provided, comprising:

[0064] A training data acquisition module is configured to acquire a training set; wherein the pictures in the training set contain annotation information, each of the pictures corresponds to a picture subcategory, and the annotation information contains a large category to which the pictures belong and a picture serial number;

[0065] A feature extraction module is configured to input different picture subcategory pictures in the training set and enhanced pictures corresponding to each of the pictures as input data into a feature extraction network to obtain high-dimensional features;

[0066] A model training module is configured to train the high-dimensional features through a loss function to obtain gradients, correct weight parameters in the high-dimensional feature extraction network by using the gradients, and obtain a high-dimensional feature matrix; the high-dimensional feature matrix is used to calculate the similarity between similar pictures.

[0067] Based on the above embodiments, as a preferred embodiment, the training data acquisition module comprises:

[0068] A training data processing unit is configured to randomly select multiple enhancement methods from a picture enhancement set to enhance the pictures, obtain multiple enhanced pictures, and use the pictures and the enhanced pictures as a training set; wherein the enhanced pictures belong to the same picture subcategory as the pictures and share the annotation information. Based on the above embodiments, as a preferred embodiment, further comprising:

[0069] A training module is configured to use softmax and a ternary loss as a first loss function to train the picture subcategory to obtain gradients; and use softmax as a second loss function to train the large category to which the pictures belong to obtain gradients.

[0070] Based on the above embodiments, as a preferred embodiment, the training module comprises:

[0071] A label setting module is configured to set a label value as a first label value for the pictures in the same picture subcategory in the same large category during the training process; and set a label value as a second label value for the pictures in different picture subcategories in the same large category during the training process; wherein the first label value is greater than the second label value.

[0072] Based on the above embodiments, as a preferred embodiment, further comprising:

[0073] The collection obtaining module is configured to obtain the picture enhancement collection, and the picture enhancement collection includes one or any combination of a plurality of kinds of enhancement modes, such as brightness adjustment, contrast adjustment, and picture occlusion.

[0074] The application further provides a computer readable storage medium, which has a computer program stored thereon, and the computer program can implement the steps provided by the above-mentioned embodiments when executed. The storage medium can include a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage media that can store program codes.

[0075] The application further provides an electronic device, which can include a memory and a processor, the memory has a computer program stored therein, and the processor can implement the steps provided by the above-mentioned embodiments when calling the computer program in the memory. Of course, the electronic device can further include various network interfaces, power supplies and other components.

[0076] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the system provided by the embodiments, since it corresponds to the method provided by the embodiments, the description is relatively simple, and the related parts can be referred to the method part.

[0077] The principles and implementation manners of the application are described by using specific examples in the present disclosure, and the above embodiment descriptions are only used to help understand the method and core idea of the application. It should be noted that, for those skilled in the art, without departing from the principles of the application, some improvements and modifications can be made to the application, and these improvements and modifications also fall within the protection scope of the claims of the application.

[0078] It should be further noted that, in the present specification, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.

Claims

1. A training method for a similar graph retrieval model, characterized in that, include: Obtain a training set; wherein the images in the training set contain annotation information, each image corresponds to an image subclass, the annotation information includes the major class to which the image belongs and the image sequence number, the image sequence number serves as the annotation information of the subclass to which the image belongs; The different image subclasses in the training set and the corresponding enhanced images of each image are used as input data to the feature extraction network to obtain high-dimensional features; The high-dimensional features are trained using a loss function to obtain gradients, and the gradients are used to correct the weight parameters in the high-dimensional feature extraction network to obtain a high-dimensional feature matrix; the high-dimensional feature matrix is ​​used to calculate the similarity between similar images. The acquisition of the training set includes: Multiple enhancement methods are randomly selected from the image enhancement set to enhance the image, resulting in multiple enhanced images. The original image and the enhanced images are used as a training set. The enhanced images belong to the same image subclass as the original image and share the annotation information.

2. The similarity graph retrieval model training method according to claim 1, characterized in that, The gradient obtained by training the high-dimensional features using a loss function includes: For the aforementioned image subclass, the gradient is obtained by training using softmax and triplet loss as the first loss function; For the category to which the image belongs, the gradient is obtained by training using softmax as the second loss function.

3. The similarity graph retrieval model training method according to claim 2, characterized in that, For the category to which the image belongs, the gradient obtained by training using softmax as the second loss function includes: For images belonging to the same subcategory within the same major category, the training process sets the label value as the first label value. For images belonging to different subcategories within the same major category, the training process sets the label value to a second label value; wherein, the first label value is greater than the second label value.

4. The similarity graph retrieval model training method according to claim 1, characterized in that, Before randomly selecting multiple enhancement methods from the image enhancement set to enhance the image, the process also includes: Obtain the image enhancement set; the image enhancement set includes enhancement methods such as brightness adjustment, contrast adjustment, and image occlusion, or any combination of any number of such methods.

5. The similarity graph retrieval model training method according to claim 2, characterized in that, The triplet loss formula is as follows: ; Where A represents the anchor sample, P represents a positive sample of the same class as the anchor sample, and N represents a negative sample of a different class than the anchor sample. The threshold is set; wherein the distance between negative samples minus the distance between positive samples is greater than... .

6. A training system for a similar graph retrieval model, characterized in that, include: The training data acquisition module is used to acquire the training set; wherein, the images in the training set contain annotation information, each image corresponds to an image subclass, the annotation information includes the major class to which the image belongs and the image number, the image number serves as the annotation information of the subclass to which the image belongs; The feature extraction module is used to input different image subclasses in the training set and the corresponding enhanced images of each image into the feature extraction network to obtain high-dimensional features; The model training module is used to train the high-dimensional features using a loss function to obtain gradients, and then uses the gradients to correct the weight parameters in the high-dimensional feature extraction network to obtain a high-dimensional feature matrix; the high-dimensional feature matrix is ​​used to calculate the similarity between similar images. The training data acquisition module includes: The training data processing unit is used to randomly select multiple enhancement methods from the image enhancement set to enhance the image, obtain multiple enhanced images, and use the image and the enhanced images as a training set; wherein the enhanced images and the image belong to the same image subclass and share the annotation information.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the similar graph retrieval model training method as described in any one of claims 1-5.

8. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor, when calling the computer program in the memory, implements the steps of the similar graph retrieval model training method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Deep hash-based image retrieval method, device and terminal equipment

    CN110532417A

  • Truck picture re-identification method based on double-layer attention network

    CN115035476A