A method of image processing, an electronic device, and a storage medium

CN116188978BActive Publication Date: 2026-10-13Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310093179.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-09
Publication Date
2026-10-13
Estimated Expiration
2043-02-09

AI Technical Summary

Technical Problem

[0003]其中,有监督的哈希方法需要大量的标签来学习与高级语义信号相一致的哈希码,其依赖于大量带有标签的图像样本,然而标记遥感图像往往是耗时、费力和昂贵的;无监督的哈希方法虽然不依赖图像标签,但其检索精度往往不能满足实际应用需求

Benefits of technology

[0009]第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116188978B_ABST
    Figure CN116188978B_ABST
Patent Text Reader

Abstract

The application discloses a method for image processing, an electronic device and a storage medium, wherein the method comprises: inputting a target feature vector corresponding to a target image into a target hash network, and outputting a target hash value corresponding to the target image; wherein the target hash network comprises a full connection layer, a hash layer and a classification layer, and the target hash network is obtained by training according to a labeled image dataset and an unlabeled image dataset corresponding to a target task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data processing technology, specifically relating to an image processing method, electronic device, and storage medium. Background Technology

[0002] Remote sensing image retrieval plays a crucial role in geolocation, remote sensing image scene understanding, and global big data observation and management. Related hash-based Approximate Nearest Neighbor (ANN) search methods are widely used in large-scale remote sensing image retrieval applications. The core idea of ​​hashing methods is to map high-dimensional remote sensing images into low-dimensional, compact binary codes while preserving semantic similarity. This ensures that similar images have similar codes in the Hamming space, allowing for rapid calculation of Hamming distance through simple bit operations, thus achieving efficient retrieval.

[0003] Supervised hashing methods require a large number of labels to learn hash codes consistent with high-level semantic signals, which relies on a large number of labeled image samples. However, labeling remote sensing images is often time-consuming, laborious, and expensive. Although unsupervised hashing methods do not rely on image labels, their retrieval accuracy often fails to meet the needs of practical applications. Summary of the Invention

[0004] The purpose of this application is to provide an image processing method, electronic device, and storage medium that can maintain high retrieval accuracy while reducing labeling costs in large-scale remote sensing image retrieval tasks.

[0005] To solve the above-mentioned technical problems, this application is implemented as follows:

[0006] In a first aspect, embodiments of this application provide an image processing method, the method comprising: inputting a target feature vector corresponding to a target image into a target hash network, and outputting a target hash value corresponding to the target image; wherein the target hash network includes a fully connected layer, a hash layer and a classification layer, and the target hash network is trained based on a labeled image dataset and an unlabeled image dataset corresponding to a target task.

[0007] Secondly, embodiments of this application provide an image processing apparatus, which includes: a processing module for inputting a target feature vector corresponding to a target image into a target hash network and outputting a target hash value corresponding to the target image; wherein the target hash network includes a fully connected layer, a hash layer and a classification layer, and the target hash network is trained based on a labeled image dataset and an unlabeled image dataset corresponding to a target task.

[0008] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0010] In this embodiment of the application, the target feature vector corresponding to the target image is input into the target hash network, and the target hash value corresponding to the target image is output. The target hash network includes a fully connected layer, a hash layer and a classification layer. The target hash network is trained based on the labeled image dataset and the unlabeled image dataset corresponding to the target task. It can maintain high retrieval accuracy in large-scale remote sensing image retrieval tasks while reducing label annotation costs. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart illustrating an image processing method provided in an embodiment of this application.

[0013] Figure 2 This is a schematic diagram of the structure of a deep hash network provided in an embodiment of this application.

[0014] Figure 3 This is a flowchart illustrating another image processing method provided in an embodiment of this application.

[0015] Figure 4 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application.

[0016] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0017] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0018] Figure 1 This illustration shows a flowchart of an image processing method provided in an embodiment of this application. This method can be executed by an electronic device, such as a terminal device, server device, or network device. In other words, the method can be executed by software or hardware installed on an electronic device. Figure 1 As shown, the method may include the following steps.

[0019] S101: Input the target feature vector corresponding to the target image into the target hash network, and output the target hash value corresponding to the target image.

[0020] The target hashing network includes a fully connected layer, a hashing layer, and a classification layer. This network is trained using labeled and unlabeled image datasets corresponding to the target task. For example, Figure 2 This illustration shows a schematic diagram of a target hashing network provided in an embodiment of this application. The target task includes tasks related to image processing, such as remote sensing image retrieval. Generally, remote sensing image retrieval has high requirements for accuracy and computational efficiency. Because labeling remote sensing images is often time-consuming, labor-intensive, and expensive, it avoids relying on a large number of image labels. However, in some complex remote sensing scenarios, although unsupervised hashing methods do not rely on image labels, their accuracy often fails to meet the needs of practical applications. This may be because related unsupervised hashing methods mainly rely on similarity reconstruction losses between images, failing to capture and utilize high-level semantic relationships between images.

[0021] This application provides an image processing method that trains a deep hashing network using a small amount of labeled image dataset and a large amount of unlabeled dataset to obtain the hash value of the target image for subsequent image retrieval tasks, thereby reducing the cost of label annotation while maintaining high retrieval accuracy.

[0022] This application provides an image processing method that inputs the target feature vector corresponding to the target image into a target hash network and outputs the target hash value corresponding to the target image. The target hash network includes a fully connected layer, a hash layer, and a classification layer. The target hash network is trained on labeled image datasets and unlabeled image datasets corresponding to the target task. It can maintain high retrieval accuracy in large-scale remote sensing image retrieval tasks while reducing labeling costs.

[0023] Figure 3 This illustration shows another schematic flowchart of an image processing method provided in an embodiment of this application. This method can be executed by an electronic device, such as a terminal device, server device, or network device. In other words, the method can be executed by software or hardware installed on the electronic device. Figure 3 As shown, the method may include the following steps.

[0024] S301: Obtain the class center feature vectors corresponding to each image category from the labeled image dataset.

[0025] In one implementation, step S301 includes: obtaining the feature vectors corresponding to each image in the labeled image dataset through a preset feature extractor; and determining the class center feature vectors corresponding to each image category in the labeled image dataset based on the feature vectors corresponding to each image.

[0026] Specifically, the preset feature extractor may be, for example, an image encoder of a Contrastive Language-Image Pre-Training (CLIP) model. The model weights can be obtained online or fine-tuned based on a Remote Sensing Image Classification Dataset (RSICD).

[0027] In one implementation, the class center feature vector of the m-th class in the labeled image dataset can be determined according to the following formula:

[0028]

[0029] Among them, z j It is one of the h labeled images belonging to the m-th class, j = 1, 2, ..., h. Indicated by z j The output of the feature extractor is the input.

[0030] S302: Determine the category probability vector corresponding to each image in the unlabeled image tagging dataset based on the class center feature vector corresponding to each image category.

[0031] Specifically, the unlabeled data x in the training set i The dimensionality is reduced to the corresponding feature vector f using the same feature extractor as described above. i Then, normalization is performed on the eigenvector f after normalization. i The class center feature vector C corresponding to each class m The cosine similarity between them is calculated to obtain a vector P of length N. i Finally, the softmax function is used for normalization to obtain the final class probability vector.

[0032] In one implementation, the image x can be determined according to the following formula. i The probability value corresponding to the m-th class:

[0033]

[0034] Among them, f i For image x i The feature vector obtained by the input feature extractor, C m Let C be the class center feature vector of the m-th class in the labeled image dataset. m T For c m The transpose of the labeled image dataset has N classes; based on image x i To determine the image x, we need to consider the probability values ​​of each class. i The corresponding class probability vector P i =[P i [1], P i [2], ..., P i [m],...,P i [N]].

[0035] In one implementation, the temperature coefficient from knowledge distillation can also be used for f. i With C m The cosine similarity between the models is smoothed to increase the robustness of the model, as shown in the following formula:

[0036]

[0037] S303: Determine the class similarity between each pair of images in the unlabeled image dataset based on the class probability vectors corresponding to each image.

[0038] In one implementation, the image x can be determined according to the following formula. i and image y i Category similarity between them:

[0039]

[0040] Among them, P i For image x i The corresponding class probability vector, P j For image y i The corresponding category probability vector.

[0041] As high-dimensional data, images present significant challenges in directly calculating their similarity. Existing unsupervised hashing methods based on similarity reconstruction directly construct similarity matrices using pairwise similarities between feature vectors obtained from feature extractors. This results in insufficiently compact hash codes with low discriminability. This step utilizes the cosine similarity between corresponding class probability vectors of images as the overall similarity between images, generating the final similarity matrix. Since class probability vectors represent the relationship between an image and its class centers, calculating image similarity using class probability vectors offers a global advantage.

[0042] S304: Train the target hash network based on the unlabeled image dataset and the class similarity between each pair of images in the unlabeled image dataset.

[0043] In one implementation, step S304 includes: inputting feature vectors corresponding to multiple images in the unlabeled image dataset into a target hash network to be trained, and outputting multiple hash values ​​corresponding to the multiple images; adjusting the parameters of the target hash network to be trained based on the pairwise similarity between the multiple hash values ​​and the class similarity between the corresponding multiple images, and determining the target hash network.

[0044] like Figure 2 The Deep Hash Neural Network (DHNN) shown is used to map the feature vectors extracted from images by a self-supervised model into a relatively concise binary hash code while keeping the similarity as unchanged as possible.

[0045] In one implementation, the DHNN can be optimized using a similarity consistency loss, i.e., the parameters of the target hash network to be trained are adjusted to determine the target hash network. For example, the similarity consistency loss between each pair of images can be determined according to the following formula:

[0046]

[0047]

[0048] in, Representing image xi The corresponding eigenvector f i The output of the hash layer obtained from the input target hash network, where W represents the parameter matrix of the target hash network, R is a preset value, and l is the length of the hash code.

[0049] Since it is not feasible to use backpropagation of deep neural networks to optimize binary hash codes, the binary constraints of hash codes can be relaxed, and tanh(R·) can be used to approximate the sign(·) function. The larger the value of R, the closer the output value is to 1 or -1, and the smaller the quantization error. Generally, based on experimental experience, R of 10 is more appropriate.

[0050] In one implementation, the method includes:

[0051] Based on the category probability values ​​of the multiple images, a second loss is determined for each image in the multiple images; based on the second loss, the parameters of the target hash network to be trained are adjusted to determine the target hash network.

[0052] For example, the image x can be determined using the following formula. i The corresponding second loss:

[0053]

[0054]

[0055] Among them, P i [j] represents the image x i The corresponding class probability value for class j. For image x i The corresponding eigenvector f i The output of the classification layer obtained from the target hash network is input, c i [j] is c i The j-th element represents the image x. i The probability that the target hash network is classified into the j-th class.

[0056] S305: Input the target feature vector corresponding to the target image into the target hash network, and output the target hash value corresponding to the target image.

[0057] In one implementation, this step can be trained using a mini-batch optimization method. K images are randomly selected in each batch, and class probability vectors and similarity matrices are generated using formulas (2) and (3). Then, guided by the loss functions represented by formulas (4) and (5), the model parameters are updated using the Root Mean Square Propagation (RMSProp) algorithm. Finally, the output of the trained DHNN network is binarized as shown in formula (6) to obtain the final binary hash vector B:

[0058]

[0059] Therefore, the image processing method provided in this application embodiment achieves high retrieval accuracy with only a small number of labeled samples, while the cost of manual labeling is low.

[0060] The image processing method provided in this application embodiment obtains the class center feature vectors corresponding to each image category from the labeled image dataset; determines the class probability vectors corresponding to each image in the unlabeled image dataset based on the class center feature vectors corresponding to each image category; determines the class similarity between each pair of images in the unlabeled image dataset based on the class probability vectors corresponding to each image; trains the target hash network based on the unlabeled image dataset and the class similarity between each pair of images in the unlabeled image dataset; inputs the target feature vector corresponding to the target image into the target hash network, and outputs the target hash value corresponding to the target image. This method can maintain high retrieval accuracy while reducing labeling costs in large-scale remote sensing image retrieval tasks.

[0061] Figure 4 This application provides a schematic diagram of the structure of an image processing apparatus according to an embodiment of the present application. Figure 4 As shown, the device 400 includes a processing module 410.

[0062] The processing module 410 is used to input the target feature vector corresponding to the target image into the target hash network and output the target hash value corresponding to the target image; wherein, the target hash network includes a fully connected layer, a hash layer and a classification layer, and the target hash network is trained based on the labeled image dataset and the unlabeled image dataset corresponding to the target task.

[0063] In one implementation, the apparatus 400 further includes: a preprocessing module, configured to: obtain class center feature vectors corresponding to each image category from the labeled image dataset; determine class probability vectors corresponding to each image in the unlabeled image dataset based on the class center feature vectors corresponding to each image category; determine the class similarity between each pair of images in the unlabeled image dataset based on the class probability vectors corresponding to each image; and a training module, configured to: train the target hash network based on the unlabeled image dataset and the class similarity between each pair of images in the unlabeled image dataset.

[0064] In one implementation, the preprocessing module is configured to: obtain feature vectors corresponding to each image in the labeled image dataset through a preset feature extractor; and determine class center feature vectors corresponding to each image category in the labeled image dataset based on the feature vectors corresponding to each image.

[0065] In one implementation, the preprocessing module is used to: obtain the feature vectors corresponding to each image in the unlabeled image tag dataset through a preset feature extractor; and determine the category probability vectors corresponding to each image based on the feature vectors corresponding to each image and the class center feature vectors corresponding to each image category.

[0066] In one implementation, the training module is configured to: input feature vectors corresponding to multiple images in the unlabeled image dataset into a target hash network to be trained, and output multiple hash values ​​corresponding to the multiple images; adjust the parameters of the target hash network to be trained based on the pairwise similarity between the multiple hash values ​​and the class similarity between the corresponding multiple images, and determine the target hash network.

[0067] In one implementation, the preprocessing module is configured to: determine the class center feature vector of the m-th class in the labeled image dataset according to the following formula:

[0068]

[0069] Among them, z j It is one of the h labeled images belonging to the m-th class, j = 1, 2, ..., h. Indicated by z j The output of the feature extractor is the input.

[0070] In one implementation, the preprocessing module is configured to: determine the image x according to the following formula. i The probability value corresponding to the m-th class:

[0071]

[0072] Among them, f i For image x i The feature vector obtained by the input feature extractor, C m Let C be the class center feature vector of the m-th class in the labeled image dataset. m T C m The transpose of the labeled image dataset has N classes; based on image x i To determine the image x, we need to consider the probability values ​​of each class. i The corresponding class probability vector P i =[P i [1], P i [2], ..., P i [m],...,P i [N]].

[0073] In one implementation, the preprocessing module is configured to: determine the image x according to the following formula. i and image y i Category similarity between them:

[0074]

[0075] Among them, P i For image x i The corresponding class probability vector, P j For image y i The corresponding category probability vector.

[0076] In one implementation, the training module is configured to: determine the pairwise similarity consistency loss between the plurality of images according to the following formula:

[0077]

[0078]

[0079] in, Representing image x i The corresponding eigenvector f i The output of the hash layer obtained by inputting the target hash network is given, where W represents the parameter matrix of the target hash network, R is a preset value, and l is the length of the hash code. Based on the similarity consistency loss between each pair of the multiple images, the parameters of the target hash network to be trained are adjusted to determine the target hash network.

[0080] In one implementation, the training module is configured to: determine a second loss for each of the plurality of images based on the category probability values ​​of each category corresponding to the plurality of images; and adjust the parameters of the target hash network to be trained based on the second loss to determine the target hash network.

[0081] In one implementation, the training module is configured to: determine the image x according to the following formula. i The corresponding second loss:

[0082]

[0083]

[0084] Among them, P i [j] represents the image x i The corresponding class probability value for class j. For image x i The corresponding eigenvector f i The output of the classification layer obtained from the target hash network is input, c i [j] is c i The j-th element represents the image x. i The probability that the target hash network is classified into the j-th class.

[0085] The image processing apparatus provided in this application can execute the image processing method described in at least one embodiment of the preceding method embodiments and achieve the same technical effect as the preceding method embodiments, which will not be repeated here.

[0086] Figure 5 The diagram illustrates the hardware structure of an electronic device implementing the embodiments of this application. Referring to the diagram, at the hardware level, the electronic device includes a processor and optionally, an internal bus, a network interface, and a memory. The memory may include RAM, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for other services.

[0087] The processor, network interface, and memory can be interconnected via an internal bus, which can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, only a single bidirectional arrow is used in this diagram, but this does not imply that there is only one bus or one type of bus.

[0088] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0089] The processor reads the corresponding computer program from non-volatile memory into memory and then runs it, forming a device for locating the target user at the logical level. The processor executes the program stored in memory and specifically performs each step of the image processing method described in at least one embodiment of the above-described method embodiments.

[0090] The methods disclosed in the embodiments shown in the flowcharts of this application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0091] The electronic device can also perform the image processing method described in at least one embodiment of the preceding method embodiments, and can achieve the same technical effect as the preceding method embodiments, which will not be repeated here.

[0092] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0093] This application also proposes a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the steps of the image processing method described in at least one embodiment of the above-described method embodiments.

[0094] The computer-readable storage medium includes read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, etc.

[0095] Furthermore, this application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, implement the steps of at least one embodiment of the above-described method embodiments.

[0096] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0097] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0098] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0099] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0100] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. An image processing method, characterized in that, The method includes: The feature vectors corresponding to each image in the labeled image dataset are obtained by using a preset feature extractor; Based on the feature vectors corresponding to each image, determine the class center feature vectors corresponding to each image category in the labeled image dataset, including: The class center feature vector of the m-th class in the labeled image dataset is determined according to the following formula: in, It belongs to class m. h One of the images that has been labeled. , Indicated by The output of the feature extractor is the input; Based on the class center feature vectors corresponding to each image category, determine the category probability vectors corresponding to each image in the unlabeled image tagging dataset; Based on the category probability vectors corresponding to each image, determine the pairwise category similarity between each image in the unlabeled image dataset; The target hashing network is trained based on the unlabeled image dataset and the class similarity between each pair of images in the unlabeled image dataset; Input the target feature vector corresponding to the target image into the target hash network, and output the target hash value corresponding to the target image; The target hashing network includes a fully connected layer, a hashing layer, and a classification layer. The target hashing network is trained on labeled image datasets and unlabeled image datasets corresponding to the target task.

2. The method according to claim 1, characterized in that, Based on the class center feature vectors corresponding to each image category, determine the category probability vectors corresponding to each image in the unlabeled image tag dataset: The feature vectors corresponding to each image in the unlabeled image dataset are obtained by using a preset feature extractor. Based on the feature vectors corresponding to each image and the class center feature vectors corresponding to each image category, the category probability vectors corresponding to each image are determined.

3. The method according to claim 2, characterized in that, The target hash network is trained based on the unlabeled image dataset and the class similarity between each pair of images in the unlabeled image dataset, including: Input the feature vectors corresponding to multiple images in the unlabeled image dataset into the target hash network to be trained, and output multiple hash values ​​corresponding to the multiple images; The parameters of the target hash network to be trained are adjusted based on the pairwise similarity between the multiple hash values ​​and the pairwise category similarity between the multiple images to determine the target hash network.

4. The method according to claim 3, characterized in that, Based on the feature vectors corresponding to each image and the class center feature vectors corresponding to each image category, the category probability vectors corresponding to each image are determined, including: Determine the image according to the following formula. The probability value corresponding to the m-th class: in, For image The feature vector obtained from the input feature extractor For the labeled image dataset, the first... The class center feature vector of a class. for The transpose of the labeled image dataset contains Each class; According to the image To determine the image, the probability values ​​of each class are used. Corresponding category probability vector .

5. The method according to claim 4, characterized in that, Based on the category probability vectors corresponding to each image, determine the pairwise category similarity between each image in the unlabeled image dataset, including: Determine the image according to the following formula. and images Category similarity between them: in, For image The corresponding class probability vector, For image The corresponding category probability vector.

6. The method according to claim 5, characterized in that, Based on the pairwise similarity between the plurality of hash values ​​and the pairwise category similarity between the corresponding plurality of images, the parameters of the target hash network to be trained are adjusted to determine the target hash network, including: The similarity consistency loss between each pair of the multiple images is determined according to the following formula: in, Representing an image Corresponding feature vector The output of the hash layer obtained from the target hash network is input. The parameter matrix represents the target hash network. As a preset value, The length of the hash code; Based on the similarity consistency loss between each pair of the multiple images, the parameters of the target hash network to be trained are adjusted to determine the target hash network.

7. The method according to claim 6, characterized in that, The method further includes: Based on the category probability values ​​corresponding to each category of the plurality of images, determine the second loss corresponding to each of the plurality of images; Based on the second loss, the parameters of the target hash network to be trained are adjusted to determine the target hash network.

8. The method according to claim 7, characterized in that, Based on the category probability values ​​corresponding to each category of the plurality of images, a second loss is determined for each image in the plurality of images, including: The image is determined according to the following formula. The corresponding second loss: in, Representing an image The corresponding class probability value for class j. For image Corresponding feature vector The output of the classification layer obtained from the target hash network is input. for The j-th element represents the image. The probability that the target hash network is classified into the j-th class.

9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method as described in any one of claims 1-8.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Unsupervised image hash retrieval method and system based on equivalent constraint clustering

    CN114969404A

  • Hash retrieval method for multi-label image

    CN115495607A