Image feature indexing method and apparatus, device, and medium

WO2026166147A1PCT designated stage Publication Date: 2026-08-13PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-08-13

Smart Images

  • Figure CN2025136468_13082026_PF_FP_ABST
    Figure CN2025136468_13082026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical fields of artificial intelligence and digital treatment, and discloses an image feature indexing method and apparatus, a device, and a medium. For the technical problem of low identification precision of a repeated target, global and local features are extracted by means of data augmentation, mask reconstruction, and contrastive learning, and a high-precision image feature index database is constructed, thereby implementing efficient retrieval and repetition determination of similar images. The present application can be applied to scenarios such as financial claim settlement and medical image comparison.
Need to check novelty before this filing date? Find Prior Art

Description

Image feature indexing methods, apparatus, devices and media

[0001] This application claims priority to Chinese Patent Application No. 202510141898.2, filed on February 8, 2025, entitled “Image Feature Indexing Method, Apparatus, Device and Medium”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the fields of artificial intelligence and digital medical technology, and in particular to an image feature indexing method, apparatus, device and storage medium. Background Technology

[0003] In the healthcare and financial sectors, the application scenarios for image retrieval technology are gradually increasing. However, traditional technologies still have many shortcomings in handling the recognition of highly similar targets. In the healthcare field, the retrieval and analysis of medical images requires dealing with a large amount of complex and diverse image data. These images often exhibit differences due to variations in shooting angle, lighting conditions, and imaging equipment, making it difficult for existing retrieval technologies to accurately extract the core features of lesion areas. Furthermore, the inventors recognized that medical images often contain a large amount of irrelevant background information, making it difficult for existing global feature extraction methods to focus on lesion areas, resulting in inaccurate retrieval results easily influenced by background interference. At the same time, insufficient local feature extraction makes it difficult to identify subtle lesion features, affecting the accurate diagnosis of diseases.

[0004] In the financial sector, image retrieval technology is primarily used for identity verification and fraud prevention. For example, in livestock insurance, insurance companies need to verify the identity of insured animals through images to prevent duplicate insurance claims and insurance fraud. However, existing image retrieval technologies struggle to adapt to the uncontrollable image acquisition conditions in financial scenarios. For instance, animal images uploaded by different policyholders may vary in angle, resolution, and lighting conditions, resulting in low accuracy for image retrieval systems in practical applications. Furthermore, individuals of the same breed may exhibit highly similar physical characteristics, making it difficult for traditional retrieval methods to effectively distinguish these individual differences, leading to frequent false positives or false negatives.

[0005] Existing image retrieval technologies mainly include global feature retrieval methods and local feature retrieval methods. Global feature retrieval methods extract overall image features for similarity comparison, but their recognition performance significantly decreases when dealing with images with foreground occlusion or complex backgrounds. Furthermore, this method ignores key local details in the image, making it difficult to accurately distinguish highly similar target individuals. While local feature retrieval methods can identify detailed features in an image, they lack the ability to understand the semantics of the overall image, and are prone to recognition errors when multiple similar local regions exist within the image. Summary of the Invention

[0006] The main objective of this application is to provide an image feature indexing method, apparatus, device, and storage medium, which aims to solve the technical problem that traditional techniques are difficult to effectively distinguish highly similar image targets in the identification of repeated targets, especially when the foreground is occluded or the image is partially modified, resulting in a high false detection rate and false negative rate.

[0007] To achieve the above objectives, this application provides an image feature indexing method, comprising:

[0008] Obtain the original image dataset, perform data augmentation on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image;

[0009] All enhanced images generated from the same original image are labeled as similar images, and enhanced images generated from different original images are labeled as dissimilar images;

[0010] A portion of the image region in each enhanced image is masked, and the masked image is then input into the coding network.

[0011] The masked image region is reconstructed through the coding network to generate a corresponding reconstructed image, which retains the similarity or dissimilarity markers of the enhanced image.

[0012] Image feature representations are extracted from the reconstructed image using an encoding network;

[0013] The contrastive learning module reduces the differences between image feature representations for reconstructed images labeled as similar, and increases the differences between image feature representations for reconstructed images labeled as dissimilar.

[0014] Based on the processed image feature representation, an image feature index library is constructed.

[0015] Furthermore, to achieve the above objectives, this application provides an image feature indexing device, comprising:

[0016] The image labeling module is used to label all enhanced images generated from the same original image as similar images, and to label enhanced images generated from different original images as dissimilar images;

[0017] The masking module is used to mask a portion of the image region of each enhanced image and input the masked image into the encoding network.

[0018] The image reconstruction module is used to reconstruct the masked image region through the coding network and generate a corresponding reconstructed image, wherein the reconstructed image retains the similarity or dissimilarity markers of the enhanced image;

[0019] The feature extraction module is used to extract image feature representations from the reconstructed image through an encoding network;

[0020] The contrastive learning module is used to reduce the differences between image feature representations of reconstructed images labeled as similar, and to increase the differences between image feature representations of reconstructed images labeled as dissimilar.

[0021] The feature indexing module is used to build an image feature index library based on the processed image feature representation.

[0022] Furthermore, to achieve the above objectives, this application also provides a computer device, the computer device including a memory, a processor, and an image feature indexing program stored in the memory and executable on the processor, wherein the image feature indexing program, when executed by the processor, implements the following steps of the image feature indexing method as described above:

[0023] Obtain the original image dataset, perform data augmentation on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image;

[0024] All enhanced images generated from the same original image are labeled as similar images, and enhanced images generated from different original images are labeled as dissimilar images;

[0025] A portion of the image region in each enhanced image is masked, and the masked image is then input into the coding network.

[0026] The masked image region is reconstructed through the coding network to generate a corresponding reconstructed image, which retains the similarity or dissimilarity markers of the enhanced image.

[0027] Image feature representations are extracted from the reconstructed image using an encoding network;

[0028] The contrastive learning module reduces the differences between image feature representations for reconstructed images labeled as similar, and increases the differences between image feature representations for reconstructed images labeled as dissimilar.

[0029] Based on the processed image feature representation, an image feature index library is constructed.

[0030] Furthermore, to achieve the above objectives, this application also provides a non-volatile computer-readable storage medium storing an image feature indexing program, which, when executed by a processor, implements the steps of the image feature indexing method described above.

[0031] Beneficial Effects: This application relates to the fields of artificial intelligence and digital medical technology, and discloses an image feature indexing method, including: acquiring the original image dataset and performing data augmentation operations, marking the augmented images as similar or dissimilar images; masking the augmented images and inputting them into an encoding network to generate reconstructed images; extracting image feature representations from the reconstructed images, optimizing the feature differences between similar and dissimilar images through contrastive learning; and constructing an image feature index library based on the processed image feature representations to achieve the retrieval and recognition of duplicate target images. This application can accurately identify duplicate target images by comprehensively extracting global and local features of the image. It reduces the dependence on manually labeled data through self-supervised learning, improving the robustness and generalization ability of image feature representations. The contrastive learning module optimizes the differences in image features, improving the system's recognition accuracy for similar and dissimilar images. It can effectively solve the problem of identifying duplicate target images, significantly reducing the false detection rate and false negative rate, and improving the accuracy and real-time performance of the retrieval system. Attached Figure Description

[0032] The present application will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:

[0033] Figure 1 is a schematic diagram of an application environment for an image feature indexing method according to an embodiment of this application;

[0034] Figure 2 is a flowchart illustrating an embodiment of the image feature indexing method of this application;

[0035] Figure 3 is a schematic diagram of the functional modules of a preferred embodiment of the image feature indexing device of this application;

[0036] Figure 4 is a structural schematic diagram of a computer device according to an embodiment of this application;

[0037] Figure 5 is another structural schematic diagram of a computer device according to one embodiment of this application. Detailed Implementation

[0038] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0039] The image feature indexing method provided in this application embodiment can be applied in the application environment shown in Figure 1, where the user terminal communicates with the server via a network. The server can obtain the original image dataset from the user terminal and perform data augmentation operations, marking the augmented images as similar or dissimilar images; the augmented images are masked and input into an encoding network to generate reconstructed images; image feature representations are extracted from the reconstructed images, and the feature differences between similar and dissimilar images are optimized through contrastive learning; an image feature index library is constructed based on the processed image feature representations to achieve the retrieval and recognition of duplicate target images. This application can accurately identify duplicate target images by comprehensively extracting global and local features of the image. It reduces the dependence on manually labeled data through self-supervised learning, improving the robustness and generalization ability of image feature representations. The contrastive learning module optimizes the differences in image features, improving the system's recognition accuracy for similar and dissimilar images. It can effectively solve the problem of identifying duplicate target images, significantly reducing the false detection rate and false negative rate, and improving the accuracy and real-time performance of the retrieval system. The user terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The following detailed description uses specific embodiments to illustrate this application.

[0040] Please refer to Figure 2, which is a flowchart illustrating an embodiment of the image feature indexing method provided in this application. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0041] As shown in Figure 2, the image feature indexing method proposed in this application includes the following steps:

[0042] S10, Obtain the original image dataset, perform data augmentation operation on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image;

[0043] In this embodiment, the raw image dataset refers to a collection of multiple unprocessed images used for subsequent data augmentation and model training. This dataset can contain images from different sources, such as photos taken with different devices, image files in different formats, or historical image data extracted from a database. The content of this image data can include facial images, animal images, medical images, etc., depending on the specific application scenario. In scenarios involving repetitive target recognition, the raw image dataset serves as the foundational data, containing images of the objects to be identified.

[0044] There are several ways to obtain raw image datasets, including extracting image data from external databases via API interfaces, importing image data via file uploads, or directly loading image data from existing image resource libraries. In practical applications, attention must be paid to image format compatibility, image clarity requirements, and the compliance of data sources when acquiring data. For example, in aquaculture insurance scenarios, images of animals taken by farmers can be uploaded via a mobile application and used as part of the raw image dataset.

[0045] Data augmentation refers to the process of applying various transformations or perturbations to the original image to generate multiple versions of the image, thereby expanding the scale of the dataset and improving the model's generalization ability. Data augmentation can simulate the effects of different shooting conditions or image transformations without changing the semantics of the image, helping the model better adapt to complex scenes. Common data augmentation operations include image cropping, rotation, flipping, brightness adjustment, and noise addition.

[0046] When applying data augmentation to each original image, two strategies can be used: random augmentation and fixed augmentation. Random augmentation involves randomly selecting multiple augmentation methods and randomly setting augmentation parameters to generate multiple different versions of the image. For example, randomly cropping a portion of the original image, or randomly adjusting the brightness and contrast of the image. Fixed augmentation, on the other hand, applies a consistent transformation to each image according to a preset augmentation strategy, such as rotating each image by 90 degrees or mirroring it.

[0047] Data augmentation generates multiple augmented images from each original image. These augmented images are versions of the original image under different transformation conditions. The augmented images retain the semantic information of the original image but exhibit differences at the pixel level. These differences can include variations in image brightness, contrast, rotation angle, and cropping position.

[0048] To generate multiple augmented images, batch processing can be used, where each original image is input into the data augmentation module and multiple augmented images are output. For example, rotating, adding noise, and adjusting the brightness of the original image A generates augmented images A1, A2, and A3. These augmented images can be stored in a file system or database, or they can be directly passed as input data to the subsequent model training process. In practice, loop processing or parallel processing is typically used to improve the efficiency of data augmentation, ensuring that a large number of augmented images are generated in a short time.

[0049] By augmenting the original image dataset, a large number of image data with different transformation effects can be generated without changing the semantic information of the original images. This effectively expands the training dataset and improves the model's generalization ability. Compared to training methods that rely solely on the original images, this approach effectively addresses image recognition problems under different shooting conditions, significantly improving the accuracy of recognizing highly similar image targets while reducing false positive and false negative rates.

[0050] S20, mark all enhanced images generated from the same original image as similar images, and mark enhanced images generated from different original images as dissimilar images;

[0051] In this embodiment, multiple images generated from the same original image after data augmentation may exhibit different visual feature changes, such as differences in brightness, rotation angle, and cropping position. However, these augmented images still originate from the same object and are therefore labeled as similar images. The labeling process for similar images helps the model learn the feature consistency of the same object under different transformation conditions, thereby improving the model's ability to recognize the same target and enhancing its robustness to images captured under different shooting conditions.

[0052] During implementation, a unique identifier (ID) can be automatically generated for each original image using the data augmentation module, and all augmented images generated from that original image can be uniformly labeled as similar images. For example, augmented images A1, A2, and A3 generated from the original image A are all assigned the same identifier ID_A and stored in a set of similar images. This labeling process can be managed through the label field in the database or implemented using the input labels during model training.

[0053] Different original images may represent different objects, and images generated after data augmentation may also exhibit similar visual features, but these images essentially belong to different objects. Therefore, augmented images generated from different original images need to be labeled as dissimilar images to help the model learn how to distinguish feature differences between different targets. The labeling process of dissimilar images can effectively improve the accuracy of the model when handling differential recognition between similar objects.

[0054] In practical applications, enhanced images of different original images can be labeled as dissimilar images by generating a unique identifier for each original image and ensuring that the identifiers are different for different original images. For example, enhanced images A1, A2, B1, and B2 are generated from original image A and original image B, respectively, where A1 and B1 are labeled as dissimilar images. This labeling process is usually achieved by constructing positive and negative sample pairs. During model training, positive sample pairs (similar images) and negative sample pairs (dissimilar images) are input to guide the model in optimizing the accuracy of feature extraction.

[0055] By labeling similar and dissimilar images, the model is effectively guided to learn how to distinguish between different images of the same object and images of different objects, thus improving its recognition ability when faced with highly similar targets. It can automatically generate positive and negative labels for training samples, reducing reliance on manually labeled data and improving the model's robustness and generalization ability under different acquisition and transformation conditions.

[0056] S30, perform masking processing on a portion of the image region of each enhanced image, and input the masked image into the coding network;

[0057] In this embodiment, masking refers to covering a portion of the image, replacing the pixel values ​​in these areas with fixed or random values, thereby simulating scenarios where image information is missing. The purpose of masking is to enable the model to learn how to accurately extract effective features even when the image is incomplete or partially missing. This approach improves the model's robustness, allowing it to maintain high recognition accuracy even when faced with image occlusion, damage, or incompleteness in real-world scenarios.

[0058] The masked area can be determined using a randomly generated mask template, which identifies the region in the image that needs to be masked. The mask ratio is usually a fixed preset ratio or a randomly selected dynamic ratio, such as masking 20% ​​to 60% of the image. The masked region can be a continuous block (such as a randomly cropped area) or a non-contiguous block (such as multiple small masking blocks).

[0059] A mask template is randomly generated to determine the regions in the image that need to be masked. This mask template is then applied to the specified regions of each enhanced image, replacing the pixel values ​​of these regions with zero values, random noise values, or other fixed values. Masking can be implemented using image processing tools or frameworks such as OpenCV, Pillow, and TensorFlow. In practical applications, the size and position of the mask region can be adjusted for different image types and task requirements. For example, in animal recognition tasks, masking can be applied to the head or body, allowing the model to learn to recognize the target even when different parts are occluded.

[0060] The image after masking contains both masked and unmasked regions. These regions need to be input into an encoding network to extract feature representations. The encoding network is typically a deep learning-based neural network, such as a convolutional neural network (CNN) or a Transformer network, used to convert the image into feature vectors. These feature vectors can represent the overall semantics and local details of the image, providing foundational data for subsequent reconstruction learning and feature comparison.

[0061] The masked image is input into the input layer of the encoding network. The encoding network divides the image into blocks (such as a sequence of image blocks). Layer by layer, the encoding network extracts global and local features of the image, generating a feature vector representation. In practical applications, suitable encoding network structures can be selected, such as ResNet, EfficientNet, and ViT (Vision Transformer), adjusting the network's depth and width according to the task complexity and feature extraction requirements.

[0062] By partially masking the enhanced image, the model effectively simulates information loss and occlusion scenarios encountered during actual image acquisition, improving its ability to recognize incomplete images. Simultaneously, by inputting the masked image into the encoding network for feature extraction, the model can focus more on the unmasked areas, thereby enhancing its ability to extract effective features. This reduces the model's reliance on irrelevant background information, improving its recognition accuracy and robustness in complex environments.

[0063] S40, the masked image region is reconstructed through the coding network to generate a corresponding reconstructed image, wherein the reconstructed image retains the similarity or dissimilarity markers of the enhanced image;

[0064] In this embodiment, reconstruction processing refers to the model supplementing information in the masked areas of the image, enabling the masked parts to be regenerated into near-realistic content through the model's learning process. During image reconstruction, the encoding network infers the features of the masked areas based on information from the unmasked image areas and generates a reconstructed feature to fill in the missing parts.

[0065] The core purpose of reconstruction processing is to enable the model to learn how to infer missing information when image information is incomplete, thereby improving the model's recognition ability and robustness when faced with partially occluded or missing images. This reconstruction technique is crucial for solving the problem of recognizing incomplete images in real-world scenarios.

[0066] The input image after masking is fed into the encoding network; the encoding network analyzes the unmasked areas of the image through layer-by-layer feature extraction and mapping; the encoding network completes the features of the masked areas based on the extracted global and local features to generate reconstructed features; the reconstructed features are filled into the masked areas to generate the reconstructed image.

[0067] A reconstructed image is an image that has been completed by using an encoding network to reconstruct the masked region. The reconstructed image includes not only the original uncovered portion but also the reconstructed portion generated by the model. These reconstructed images can be used for subsequent contrastive learning and image feature indexing, helping the model to further optimize the image's feature representation.

[0068] The reconstructed features generated by the encoding network are fused with the undisturbed parts of the original image. The generated reconstructed image needs to undergo consistency verification to ensure that the features of the reconstructed region are consistent with the undisturbed parts of the original image. The reconstructed image can be used as input for model training to help the model learn how to complete partially occluded images in different scenarios.

[0069] During data augmentation and masking, each image is assigned a similarity or dissimilarity label to distinguish between different images of the same object and images of different objects. The reconstructed image inherits the labeling information from the augmented image to ensure the model can correctly identify similar and dissimilar images in the contrastive learning module, thereby optimizing the accuracy of feature extraction and recognition.

[0070] During the image reconstruction process, the labeling information of the input image is inherited; during the model's comparative learning phase, the labeling information is used to distinguish between sets of similar and dissimilar images; the retention of labeling information can be managed through the label field of the database or the input labels of the model.

[0071] By reconstructing and learning from masked image regions, the model can accurately infer the features of missing regions even when some information is missing or the image is incomplete, thereby improving the accuracy of image recognition. The reconstructed image retains the similarity or dissimilarity markers of the original image, ensuring that the model correctly optimizes the differences in image features during the contrastive learning process, thus effectively improving the model's recognition accuracy and robustness in repetitive target recognition tasks.

[0072] S50, extract image feature representations from the reconstructed image through an encoding network;

[0073] In this embodiment, image feature representation refers to converting the visual information of an image into feature vectors that the model can understand and process. The reconstructed image is input into an encoding network, which converts the global information (overall structure) and local information (detailed features) in the image into feature representations. These feature representations help the model quickly and accurately match similar images or distinguish different images in tasks such as image retrieval, object recognition, and duplicate object determination.

[0074] The reconstructed image is input into the encoding network; the encoding network segments the reconstructed image into a sequence of image patches, and converts each image patch into a feature vector; global feature representations are extracted to represent the overall structural information of the image; local feature representations are extracted to capture the detailed features of the image; global and local features are fused to generate an image feature representation that contains both overall and detailed information.

[0075] By extracting features from reconstructed images, the model can obtain complete feature representations from incomplete or partially occluded images, improving the model's accuracy and robustness in tasks such as image retrieval and repetitive target recognition. It can simultaneously capture both overall image features and local details, effectively solving the recognition challenge when image information is incomplete in complex environments or under acquisition conditions.

[0076] S60, through the contrastive learning module, reduces the differences between image feature representations for reconstructed images labeled as similar images, and increases the differences between image feature representations for reconstructed images labeled as dissimilar images;

[0077] In this embodiment, during the image data enhancement, masking process, and coding network reconstruction, the labeling information (similar or dissimilar labels) of each image is transmitted throughout the entire data stream and to the reconstructed image.

[0078] Similar images: Multiple enhanced images generated from the same original image are labeled as similar images.

[0079] Dissimilar images: Enhanced images generated from different original images are labeled as dissimilar images.

[0080] During reconstruction, the model completes the masked areas of the image, but the unmasked areas still retain the main visual features of the enhanced image. Therefore, the reconstructed image can directly inherit the labels of the enhanced image without needing to be relabeled.

[0081] In the image data augmentation stage, corresponding similar or dissimilar labels are generated for each image; in the reconstruction stage, the reconstructed image completes the masked areas through an encoding network while retaining the information of the unmasked areas; the generated reconstructed image inherits the labels of the original augmented image and is used as input data in the subsequent contrastive learning module.

[0082] Contrastive learning is an unsupervised learning method based on comparing feature similarities and differences. Its core objective is:

[0083] For similar images, the model needs to minimize the differences in their feature representations to make them closer in the feature space;

[0084] For dissimilar images, the model needs to maximize the difference in their feature representations so that they are further apart in the feature space.

[0085] For each reconstructed image, feature extraction is performed to generate global feature vectors and local feature vectors; for reconstructed images labeled as similar images, the cosine similarity between them is calculated; for reconstructed images labeled as dissimilar images, the cosine similarity between them is also calculated.

[0086] For similar images, the model reduces the difference in feature representations by minimizing the cosine distance loss function; for dissimilar images, the model increases the difference in feature representations by maximizing the cosine distance loss function.

[0087] For similar images (i.e. enhanced images generated from the same original image), the goal of the model is to make the feature representations of these images as similar as possible, thereby improving the model's clustering ability and making it easier for the model to better identify different images of the same object.

[0088] For each group of similar images, the cosine similarity between them is calculated; a loss function (such as InfoNCE Loss) is used to minimize the difference in feature representations of these images; during training, the model automatically adjusts the parameters so that the feature representations of similar images are closer in the feature space.

[0089] For dissimilar images (i.e. enhanced images generated from different original images), the goal of the model is to make the feature representations of these images as different as possible, thereby improving the model's discriminative ability and making it easier for the model to better identify images of different objects.

[0090] For each pair of dissimilar images, the cosine similarity between them is calculated; a loss function is used to maximize the difference in feature representations of these images; during training, the model automatically adjusts the parameters so that the feature representations of dissimilar images are further apart in the feature space.

[0091] By comparing and optimizing similar and dissimilar images, the model's feature discrimination ability is effectively improved. By reducing feature differences in similar images and increasing feature differences in dissimilar images, the model can better cluster similar objects and accurately distinguish between different objects. This enables more precise handling of complex image scenes and improves the model's accuracy and robustness in repetitive target recognition tasks.

[0092] S70. Based on the processed image feature representation, construct an image feature index library.

[0093] In this embodiment, the image feature index is a data structure used to store and manage image feature representations. By building the index, efficient image retrieval, duplicate target recognition, and similarity comparison operations can be achieved. The image feature representations extracted by the encoding network are stored in the index. The construction process of the index includes not only the storage of feature data but also the optimization of the index structure to support subsequent fast retrieval and comparison.

[0094] The core objective of building an image feature index is to improve the efficiency and accuracy of image retrieval, especially in scenarios with large-scale datasets, where the index can quickly locate a set of images similar to the target image.

[0095] The image feature representations extracted and processed by the encoding network are stored, and the feature vector of each image is associated with its image identifier (such as ID or file name) to ensure that the original image can be quickly located during retrieval.

[0096] A unique image identifier is generated for each reconstructed image; global and local feature vectors of the image are extracted; each feature vector is associated with its corresponding image identifier and stored in an index.

[0097] When storing image feature representations in an index, the data structure of the index needs to be optimized to ensure rapid location and similarity comparison during subsequent retrieval.

[0098] Choose a suitable index structure (such as inverted index, KD tree, ANN index, etc.) to improve retrieval efficiency; bucket, sort and cluster the feature data in the index to reduce the computational overhead during retrieval; dynamically update the index, and maintain and optimize the index in real time as new image feature representations are added.

[0099] The key goal of building an index is to achieve fast retrieval and similarity comparison. By choosing an appropriate index structure, it is possible to quickly find images in large-scale datasets that are closest in feature representation to the target image.

[0100] Inverted indexes are used to store feature vectors in blocks to improve retrieval speed; algorithms such as Locality Sensitive Hash (LSH) are used to bucket the index to support fast similarity comparison; and the feature representations in the index are deduplicated and denoised to remove redundant or abnormal feature vectors.

[0101] By constructing an image feature index library, rapid retrieval and similarity comparison can be achieved in large-scale image datasets, effectively improving the model's ability to identify duplicate targets and image retrieval efficiency. This significantly reduces computational overhead and improves the system's response speed in real-time scenarios. Furthermore, the dynamic update mechanism of the index library ensures that the system always maintains the latest feature data, thereby improving recognition accuracy and robustness.

[0102] This application relates to the fields of artificial intelligence and digital medical technology, and discloses an image feature indexing method, including: acquiring an original image dataset and performing data augmentation operations, labeling the augmented images as similar or dissimilar images; masking the augmented images and inputting them into an encoding network to generate reconstructed images; extracting image feature representations from the reconstructed images, optimizing the feature differences between similar and dissimilar images through contrastive learning; and constructing an image feature index library based on the processed image feature representations to achieve the retrieval and recognition of duplicate target images. This application can accurately identify duplicate target images by comprehensively extracting global and local features of the image. It reduces reliance on manually labeled data through self-supervised learning, improving the robustness and generalization ability of image feature representations. The contrastive learning module optimizes the differences in image features, improving the system's accuracy in recognizing similar and dissimilar images.

[0103] In one embodiment, S10 above includes:

[0104] S101, Obtain the original image dataset from the image data source, wherein the original image dataset contains multiple images;

[0105] S102, perform image resizing, format conversion and / or color space standardization on each original image in the original image dataset;

[0106] S103, based on a preset enhancement strategy, randomly select multiple data enhancement methods for each original image, including cropping, rotation, flipping, adjusting brightness, and adding noise;

[0107] S104, apply multiple selected data augmentation methods to each original image to generate multiple augmented images with different feature changes.

[0108] In this embodiment, the image data source is the foundation for constructing the image dataset, and typically comes from a local database, cloud storage, real-time acquisition devices, or third-party image services. The original image dataset needs to contain multiple images, which serve as the raw input for the system to perform image enhancement and subsequent processing.

[0109] Image data sources can be internal image repositories of insurance companies, medical imaging systems in hospitals, or images captured by real-time imaging devices. The system acquires images in batches from the data sources and generates a unique image identifier for each image for subsequent data association and management. The transmission of image data must ensure data integrity and security; encrypted transmission protocols can be used to prevent data leakage.

[0110] Preprocessing operations aim to improve the quality and consistency of image data, providing standardized input for subsequent data augmentation and feature extraction. Preprocessing operations include image resizing, format conversion, and color space normalization.

[0111] Adjusting image size: Unifying images of different resolutions to a fixed size reduces performance fluctuations in the model due to differences in image size.

[0112] Format conversion: Converts image formats to standardized image formats (such as JPEG, PNG, etc.) to ensure image compatibility across different systems.

[0113] Color space standardization: Converting the color space of an image to RGB or grayscale to eliminate color differences caused by different acquisition devices.

[0114] Data augmentation aims to enrich the training samples of a model, thereby improving its generalization ability and robustness. Based on preset augmentation strategies, the system randomly selects multiple augmentation methods for each original image, including cropping, rotation, flipping, brightness adjustment, and noise addition.

[0115] Cropping: Randomly crop a region of an image to simulate different shooting angles or field of view.

[0116] Rotation: Randomly rotate the image by a certain angle to simulate a change in the image's orientation.

[0117] Flip: Flip the image horizontally or vertically to enhance the model's ability to recognize symmetrical images.

[0118] Adjust brightness: Randomly adjust the brightness of the image to simulate different lighting conditions.

[0119] Add noise: Add Gaussian noise or salt and pepper noise to the image to enhance the model's noise resistance.

[0120] By applying various data augmentation methods, multiple augmented images can be generated from each original image. These augmented images have different feature changes, thereby improving the model's adaptability to different scenes and different acquisition conditions.

[0121] Combination of multiple enhancement methods: The system applies a combination of multiple enhancement methods to each original image based on a random enhancement strategy.

[0122] Enhanced image storage and management: The generated enhanced images are stored in association with the identifiers of the original images to ensure that the source of each enhanced image is traceable.

[0123] Validation of enhanced images: The quality of the generated enhanced images is validated to ensure that they meet the expected feature change effects.

[0124] This embodiment generates multiple enhanced images with different feature changes through data augmentation operations, effectively improving the model's adaptability to different scenarios and acquisition conditions, and enhancing the model's generalization ability and robustness.

[0125] In one embodiment, S30 includes:

[0126] S301, Based on a preset mask region ratio, a mask template is randomly generated, and the mask template is used to identify the mask region in the enhanced image;

[0127] S302, the mask template is applied to each enhanced image to mask the mask area identified by the mask template in each enhanced image, thereby generating an image after mask masking.

[0128] S303, the image after the masking process is input into the encoding network.

[0129] In this embodiment, the input enhanced image is masked. By covering part of the image area, the encoding network is forced to infer the masked area during the learning process, thereby improving the model's ability to reconstruct the image and extract features.

[0130] A mask template is a binary matrix used to identify regions in an image that need to be masked. In the mask template, 1 represents a region that needs to be masked, and 0 represents an uncovered region. The process of generating the mask template needs to consider the proportion of the masked region, that is, what percentage of the total pixels in the image will be randomly masked. By randomly generating mask templates, different degrees of image loss can be simulated, allowing the model to learn under different masking conditions.

[0131] A preset mask ratio range is defined, for example, 40% to 70%. A random generation algorithm is used to generate a mask template that conforms to the preset ratio. The mask template can be generated based on image segmentation, randomly selecting several regions for masking, or using a random dot matrix method to mask several pixels of the image.

[0132] After generating the mask template, it needs to be applied to each enhanced image one by one. The masking process is achieved by setting the corresponding pixel values ​​of the image to zero or replacing them with random noise values. The image after masking will have some missing information, which is then used to train the model's reconstruction capabilities.

[0133] The pixel matrix of each enhanced image is read, and the generated mask template is used to perform pixel-by-pixel operations on the image's pixel matrix. For regions marked as 1 in the mask template, the corresponding pixel values ​​of the image are replaced with zero values ​​or random noise values. For regions marked as 0 in the mask template, the original pixel values ​​of the image are left unchanged. A masked image containing occlusion information is generated to ensure that pixel information in certain regions is effectively masked.

[0134] After the masking process is completed, the generated image is fed into an encoding network for feature extraction and reconstruction learning. The goal of the encoding network is to learn the features of the uncovered image regions to infer the content of the masked regions, thereby improving reconstruction capabilities.

[0135] The masked image is formatted according to the model's input requirements, including image resizing and batch normalization. This formatting is then fed into the input layer of the encoding network to begin feature extraction and reconstruction learning. Feature vectors are extracted from the network's intermediate layers and used to generate the reconstructed image through the network's output layer, completing the image reconstruction and feature representation learning process.

[0136] This embodiment improves the model's reconstruction and feature extraction capabilities by masking a portion of the enhanced image and then inputting the masked image into the encoding network. By simulating information loss, the model can infer the content of the masked area during the learning process, thereby enhancing its recognition accuracy and robustness in situations of image loss or occlusion.

[0137] In one embodiment, S40 includes:

[0138] S401, the image after masking includes a masked image region and an unmasked image region, and the encoding network extracts a feature vector containing information about the masked region from the image after masking.

[0139] S402, the feature vector is reconstructed and learned through the coding network to generate reconstructed features for filling in the masked image region;

[0140] S403, the reconstructed features are fused with the unmasked image region to generate a reconstructed image and inherit the similarity or dissimilarity markers of the corresponding enhanced image.

[0141] In this embodiment, an encoding network is used to extract features and learn reconstruction from the input masked image to generate a reconstructed image. The reconstructed image not only contains information about the uncovered areas of the original image, but also infers the content of the masked areas through reconstructed features. Furthermore, the reconstructed image needs to inherit the similarity or dissimilarity labels of the original enhanced image to ensure that the model can accurately identify the relationship between similar and dissimilar images in subsequent comparisons.

[0142] The image after masking is an image in which some regions are obscured. After receiving this image, the encoding network needs to extract features from the unmasked areas and feature vectors containing information about the masked areas. These feature vectors help the model infer the content of the masked areas, thereby improving the model's reconstruction ability.

[0143] The encoding network decomposes the input masked image into multiple image patches and extracts the feature vector for each patch. The feature vectors of the uncovered image patches are mainly used to learn the overall features of the image; the feature vectors of the masked image patches are used to infer missing information. When extracting feature vectors, the encoding network can employ a self-attention mechanism to better capture contextual information in the image and improve the accuracy of reconstruction.

[0144] The encoding network learns to reconstruct the occluded image region by studying the extracted feature vectors. This reconstruction learning process is similar to the decoding stage of an autoencoder; the network learns the features of the uncovered regions to make reasonable inferences and reconstructions about the content of the occluded areas.

[0145] The extracted feature vectors are nonlinearly mapped to generate reconstructed features. These reconstructed features need to match the texture, color, and shape of the original image to ensure seamless integration between the generated reconstructed region and other areas of the original image. The encoding network can employ adversarial training or loss function optimization to improve the realism and accuracy of the reconstructed features.

[0146] After generating the reconstructed features, these features need to be fused with the undisturbed image regions to generate the final reconstructed image. This reconstructed image retains the similarity or dissimilarity markers of the enhanced image to ensure that subsequent contrastive learning can accurately identify the similarity relationships between images.

[0147] Image patches in the unmasked areas are directly copied, and the reconstructed features are then filled into the masked image patches. Image stitching and fusion algorithms are used to ensure smooth edge transitions in the reconstructed image and avoid obvious stitching artifacts. After generating the reconstructed image, similar or dissimilar labels from the original enhanced image are inherited to ensure label consistency.

[0148] This embodiment effectively enhances the model's reconstruction capabilities by reconstructing the obscured image region, enabling the model to generate complete image feature representations even when processing images with partially missing or damaged information. This improves the model's ability to recover missing information and enhances its robustness; it also achieves high-accuracy feature extraction even when images are partially damaged or missing; in scenarios such as medical imaging and insurance claims, it helps identify blurred or missing image features, thereby improving the effectiveness of image retrieval and comparison.

[0149] In one embodiment, the above S50 includes:

[0150] S501, The reconstructed image is input into the coding network, and the reconstructed image is processed by the coding network to generate an image block sequence;

[0151] S502, in the coding network, the image patch sequence is converted into a feature vector sequence, and local feature vectors and global feature vectors are extracted from the feature vector sequence;

[0152] S503, the local feature vector and the global feature vector are fused to generate an image feature representation that includes overall information and local details.

[0153] In this embodiment, the reconstructed image is input into an encoding network, which performs image block processing, feature extraction, and feature fusion on the image, ultimately generating an image feature representation containing overall information and local details. The extracted image feature representation is used for image retrieval, comparison, and duplicate target recognition.

[0154] After the reconstructed image is input into the encoding network, the network performs image block processing. The purpose of image block processing is to divide a large image into multiple smaller blocks so that the encoding network can extract image features block by block, thereby capturing detailed information and local changes.

[0155] The encoding network receives the input reconstructed image and divides it into fixed-size image blocks. For example, the image may be divided into 16×16 blocks, each containing a certain number of pixels. Image block division can be non-overlapping, meaning there is no overlap between blocks, or it can use a sliding window approach, where adjacent blocks partially overlap. The sequence of image blocks is used for subsequent feature extraction, ensuring that the encoding network can comprehensively capture the local details of the image.

[0156] Image patch sequences are the input data for encoding networks. The network converts each image patch into a feature vector, thus constructing a sequence of feature vectors. The local feature vectors extracted by the network are used to represent local details of the image, while the global feature vectors are used to represent the overall information of the image.

[0157] The intermediate layers of the encoding network convert each image patch into a fixed-length feature vector, forming a sequence of feature vectors. Local feature vectors capture detailed features of the image patch, such as texture, edges, and color distribution. Global feature vectors are generated through the network's CLS (classification) labeling or pooling operations, representing the semantic information of the entire image. During feature extraction, the encoding network models the contextual information of each image patch to ensure that the extracted feature vectors accurately reflect the content of the image.

[0158] To improve the completeness and expressiveness of image feature representation, local and global feature vectors need to be fused. The fused image feature representation can simultaneously contain the overall information and local details of the image, thereby improving the accuracy of image retrieval and comparison.

[0159] The local and global feature vectors are concatenated or weighted and fused to generate the final image feature representation. The fusion process can employ attention mechanisms or weighted averaging mechanisms to ensure that the fused feature representation balances overall information and local details. The fused image feature representation is used for image retrieval and comparison, ensuring the system can quickly identify similar or duplicate images.

[0160] This embodiment effectively enhances the model's feature extraction capabilities by extracting image feature representations from the reconstructed image, ensuring that the model can simultaneously capture overall information and local details. It improves the completeness and expressiveness of image feature representations; enhances the system's image recognition and comparison capabilities under different shooting conditions and scenarios; and effectively supports large-scale image retrieval and repetitive image recognition, making it applicable to fields such as finance, insurance, and healthcare.

[0161] In one embodiment, S60 includes:

[0162] S601, based on the similarity or dissimilarity labels of the reconstructed images, divide the reconstructed images into a set of similar images and a set of dissimilarity images;

[0163] S602, through the comparison learning module, cosine similarity analysis is performed on the image feature representations in the similar image set and the dissimilar image set;

[0164] S603, for image feature representations in a set of similar images, the differences between image feature representations are reduced by minimizing the cosine similarity analysis results;

[0165] S604, for image feature representations in a set of dissimilar images, increases the difference between image feature representations by maximizing the cosine similarity analysis results.

[0166] In this embodiment, a contrastive learning module performs similarity analysis and optimization on the feature representations of the reconstructed images, thereby reducing feature differences between similar images and increasing feature differences between dissimilar images. The core method is to use cosine similarity analysis to compare the directional consistency of image feature representations, thus optimizing the model's classification and discrimination capabilities.

[0167] The reconstructed images inherit corresponding similarity or dissimilarity labels during generation. Therefore, the contrastive learning module can divide the reconstructed images into sets of similar and dissimilarity images based on these labels. The purpose of this division is to implement different optimization strategies for the image feature representations of different sets.

[0168] Similar image set: A reconstructed image containing all augmented images generated from the same original image.

[0169] Dissimilar image set: Contains reconstructed images generated from different original images.

[0170] By traversing the similarity or dissimilarity markers of the reconstructed images, the reconstructed images are automatically classified into corresponding sets. To improve processing efficiency, a batch partitioning strategy can be adopted to partition multiple reconstructed images into sets at once.

[0171] Cosine similarity is a commonly used metric to measure the directional consistency between two feature vectors, calculated as the cosine of the angle between the feature vectors. In the contrastive learning module, cosine similarity analysis is used to compare the feature representations of similar and dissimilar image sets, thereby assessing the degree of similarity between the images.

[0172] Extract the feature vector of each image and calculate the cosine similarity between two feature vectors. For each pair of image feature representations in the set of similar images, calculate the positive cosine similarity; for each pair of image feature representations in the set of dissimilar images, calculate the negative cosine similarity.

[0173] The analysis results are optimized using the loss function in the contrastive learning module to ensure that the model can accurately distinguish between similar and dissimilar images.

[0174] In a set of similar images, the goal is to generate reconstructed images from the same original image that have more similar feature representations. By minimizing the cosine similarity analysis results, the model can reduce feature differences between images of the same category, thereby improving the model's clustering ability.

[0175] For each pair of image feature representations in the similar image set, cosine similarity is calculated. By minimizing the loss function, the feature representations of similar images are made closer together. The Infonce loss function or contrastive loss function is used to ensure that the angle between feature vectors of images of the same category is close to zero. The model parameters are continuously updated using a gradient descent optimization algorithm to minimize feature differences.

[0176] In a set of dissimilar images, the goal is to make the reconstructed images generated from different original images have greater feature differences. By maximizing the results of cosine similarity analysis, the model can distinguish between different categories of images, thus improving the model's classification ability.

[0177] For each pair of image feature representations in the dissimilar image set, cosine similarity is calculated. The loss function is maximized to make the feature representations of dissimilar images more distinct. A contrastive loss function or a triplet loss function is used to ensure that the angle between the feature vectors of images from different categories is as close to 90 degrees as possible. The model's discriminative ability is further improved through adversarial training or data augmentation.

[0178] This embodiment optimizes the feature representation of the reconstructed image through a contrastive learning module, enabling the model to effectively distinguish between similar and dissimilar images. This improves the model's classification and discrimination capabilities, effectively reducing misclassification of similar images; it also enhances the model's robustness when processing large-scale image datasets, improving the accuracy of image retrieval and comparison.

[0179] In one embodiment, after S70 above, the following is also included:

[0180] S801, perform a similarity comparison between the feature representation of the target image and each image feature representation in the image feature index library to generate a similarity comparison result set;

[0181] S802, based on the similarity values ​​in the similarity comparison result set, candidate image feature representations with similarity values ​​higher than a preset threshold are selected from the image feature index library, and the candidate images corresponding to the candidate image feature representations are determined;

[0182] S803, perform a duplicate target judgment on the candidate image and the target image to determine whether the candidate image is an image that is duplicated with the target image.

[0183] In this embodiment, after image feature extraction and processing are completed, these image feature representations need to be organized into an index for rapid retrieval and comparison. The core objective of building an image feature index is to improve the efficiency and accuracy of image retrieval. Through the index, image feature representations similar to the target image can be quickly located.

[0184] The image feature index uses a structured storage format, associating the feature vector of each image with its corresponding image identifier. The index can utilize KD-trees, LSH (Locality Sensitive Hash), or vector databases to accelerate retrieval and improve comparison speed. The index construction process includes feature normalization, denoising, and feature clustering to ensure the consistency and robustness of the feature data within the index.

[0185] When a new target image needs to be retrieved, the system extracts the feature representation of the target image and compares it with each feature representation in the image feature index library for similarity. The similarity comparison result is used to measure the degree of similarity between the target image and the images in the library, generating a similarity comparison result set.

[0186] The feature representation of the target image is extracted and normalized. Cosine similarity, Euclidean distance, or Manhattan distance are used as similarity calculation methods to compare the feature representation of the target image with each feature representation in the index. A similarity comparison result set is generated, recording the similarity value between each image in the index and the target image, and sorted according to the similarity value.

[0187] To improve retrieval efficiency, the system filters image feature representations with similarity values ​​higher than a preset threshold from the similarity comparison result set, and uses the images corresponding to these feature representations as candidate images. The candidate image set is the basis for further judging duplicate targets, which can effectively reduce the amount of computation in subsequent comparisons.

[0188] Set a similarity threshold, selecting a reasonable threshold range (e.g., 0.8 or 0.9) based on the actual application scenario. Iterate through the similarity comparison result set, filtering out image feature representations with similarity values ​​higher than the threshold. Determine the image identifiers corresponding to the candidate image feature representations, generating a candidate image set for subsequent duplicate target detection.

[0189] After generating a set of candidate images, the system performs a more in-depth comparison between the candidate images and the target images to determine whether these images belong to the same repeating target. This process typically employs more sophisticated similarity calculation methods, such as feature matching or local feature analysis, to ensure that the identification results of repeating targets are accurate and reliable.

[0190] For each candidate image, a detailed feature comparison is performed with the target image. Methods such as **SIFT (Scale Invariant Feature Transform)** and **ORB (Organic Pointer Matching)** are used to match local features. The coverage or overlap of the local feature matches is calculated to determine whether the two images belong to the same target. The association information of duplicate target images is recorded, including the identifier of the duplicate images, similarity values, and the number of matched features, for subsequent analysis and processing.

[0191] Through the steps described above, this embodiment enables the system to efficiently construct an image feature index library and utilize this library for rapid image retrieval and comparison. This improves the efficiency and accuracy of image retrieval, quickly filtering out candidate image sets; reduces computational load and storage costs; and optimizes the system's retrieval performance by setting a similarity threshold.

[0192] In one embodiment, an image feature indexing device is provided, which corresponds one-to-one with the image feature indexing method in the above embodiments. Referring to Figure 3, Figure 3 is a functional module diagram of a preferred embodiment of the image feature indexing device of this application. The device includes a data augmentation module 10, an image labeling module 20, a mask processing module 30, an image reconstruction module 40, a feature extraction module 50, a contrast learning module 60, and a feature indexing module 70. Detailed descriptions of each functional module are as follows:

[0193] Data augmentation module 10 is used to acquire the original image dataset, perform data augmentation operation on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image;

[0194] Image labeling module 20 is used to label all enhanced images generated from the same original image as similar images, and to label enhanced images generated from different original images as dissimilar images;

[0195] The masking module 30 is used to perform masking processing on a portion of the image region of each enhanced image, and input the masked image into the encoding network;

[0196] The image reconstruction module 40 is used to reconstruct the masked image region through the coding network and generate a corresponding reconstructed image, wherein the reconstructed image retains the similarity or dissimilarity markers of the enhanced image;

[0197] Feature extraction module 50 is used to extract image feature representations from the reconstructed image through an encoding network;

[0198] The contrast learning module 60 is used to reduce the differences between image feature representations of reconstructed images labeled as similar images, and to increase the differences between image feature representations of reconstructed images labeled as dissimilar images.

[0199] The feature index module 70 is used to construct an image feature index library based on the processed image feature representation.

[0200] For specific limitations regarding the image feature indexing device, please refer to the foregoing limitations on the image feature indexing method, which will not be repeated here. Each module in the aforementioned image feature indexing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the operations corresponding to each module.

[0201] In one embodiment, a computer device is provided, which can be a server, and its internal structure diagram is shown in Figure 4. The computer device includes a processor, memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external user terminals via a network connection. When the computer program is executed by the processor, it implements the functions or steps of an image feature indexing method on the server side.

[0202] In one embodiment, a computer device is provided, which can be a user terminal, and its internal structure diagram can be as shown in Figure 5. The computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of an image feature indexing method on the user terminal side.

[0203] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0204] Obtain the original image dataset, perform data augmentation on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image;

[0205] All enhanced images generated from the same original image are labeled as similar images, and enhanced images generated from different original images are labeled as dissimilar images;

[0206] A portion of the image region in each enhanced image is masked, and the masked image is then input into the coding network.

[0207] The masked image region is reconstructed through the coding network to generate a corresponding reconstructed image, which retains the similarity or dissimilarity markers of the enhanced image.

[0208] Image feature representations are extracted from the reconstructed image using an encoding network;

[0209] The contrastive learning module reduces the differences between image feature representations for reconstructed images labeled as similar, and increases the differences between image feature representations for reconstructed images labeled as dissimilar.

[0210] Based on the processed image feature representation, an image feature index library is constructed.

[0211] In one embodiment, a non-volatile computer-readable storage medium is provided, which may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, it performs the following steps:

[0212] Obtain the original image dataset, perform data augmentation on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image;

[0213] All enhanced images generated from the same original image are labeled as similar images, and enhanced images generated from different original images are labeled as dissimilar images;

[0214] A portion of the image region in each enhanced image is masked, and the masked image is then input into the coding network.

[0215] The masked image region is reconstructed through the coding network to generate a corresponding reconstructed image, which retains the similarity or dissimilarity markers of the enhanced image.

[0216] Image feature representations are extracted from the reconstructed image using an encoding network;

[0217] The contrastive learning module reduces the differences between image feature representations for reconstructed images labeled as similar, and increases the differences between image feature representations for reconstructed images labeled as dissimilar.

[0218] Based on the processed image feature representation, an image feature index library is constructed.

[0219] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and user side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0220] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0221] It should be noted that any software tools or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application is authorized (with the knowledge and consent) by the relevant parties or fully authorized by all parties, and the executing entity may obtain it through various public, legal, and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with the relevant laws and regulations of the relevant countries and regions, and do not violate public order and good morals.

Claims

1. An image feature indexing method, wherein, Includes the following steps: Obtain the original image dataset, perform data augmentation on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image; All enhanced images generated from the same original image are labeled as similar images, and enhanced images generated from different original images are labeled as dissimilar images; A portion of the image region in each enhanced image is masked, and the masked image is then input into the coding network. The masked image region is reconstructed through the coding network to generate a corresponding reconstructed image, which retains the similarity or dissimilarity markers of the enhanced image. Image feature representations are extracted from the reconstructed image using an encoding network; The contrastive learning module reduces the differences between image feature representations for reconstructed images labeled as similar, and increases the differences between image feature representations for reconstructed images labeled as dissimilar. Based on the processed image feature representation, an image feature index library is constructed.

2. The image feature indexing method as described in claim 1, wherein, Obtain the original image dataset, perform data augmentation on each original image in the dataset, and generate multiple augmented images corresponding to each original image, including: Obtain the original image dataset from the image data source, the original image dataset containing multiple images; Each original image in the original image dataset undergoes image resizing, format conversion, and / or color space standardization. Based on a preset enhancement strategy, multiple data enhancement methods are randomly selected for each original image. These data enhancement methods include cropping, rotation, flipping, adjusting brightness, and adding noise. Multiple data augmentation methods are applied to each original image to generate multiple augmented images with different feature changes.

3. The image feature indexing method as described in claim 1, wherein, A portion of the image region in each enhanced image is masked, and the masked image is then input into the coding network, including: Based on a preset mask region ratio, a mask template is randomly generated, and the mask template is used to identify the mask region in the enhanced image; The mask template is applied to each enhanced image to mask the masked area identified by the mask template in each enhanced image, thereby generating a masked image. The image after the masking process is input into the encoding network.

4. The image feature indexing method as described in claim 3, wherein, The mask template is applied to each enhanced image to mask the masked region identified by the mask template in each enhanced image, generating a masked image, including: Read each enhanced image to obtain the corresponding pixel matrix; Perform a pixel-by-pixel correspondence operation between the mask template and the pixel matrix; For the mask region determined after calculation and identified as the first value in the mask template, the pixel value at the corresponding position in the pixel matrix is ​​replaced with the specified value; For the non-mask region determined after calculation and identified as the second value in the mask template, the pixel value at the corresponding position in the pixel matrix remains unchanged; Based on the pixel matrix after all pixel value replacement and preservation operations are completed, an image with masking is generated.

5. The image feature indexing method as described in claim 1, wherein, The masked image region is reconstructed using the encoding network to generate a corresponding reconstructed image. The reconstructed image retains the similarity or dissimilarity markers from the enhanced image, including: The image after masking includes masked image regions and unmasked image regions. The coding network extracts feature vectors containing information about the masked regions from the image after masking. The feature vector is reconstructed and learned through the encoding network to generate reconstructed features for filling in the masked image region; The reconstructed features are fused with the unmasked image region to generate a reconstructed image that inherits the similarity or dissimilarity markers of the corresponding enhanced image.

6. The image feature indexing method as described in claim 5, wherein, The encoding network extracts feature vectors containing information about the masked regions from the image after the masking process, including: The image after the masking process is divided into multiple image blocks; The encoding network is used to extract features from each image block to obtain an initial feature vector for each image block. The initial feature vectors corresponding to the multiple image blocks are combined into a feature vector sequence; The feature vector sequence is input into the self-attention layer of the encoding network. By determining the attention weights among all feature vectors in the sequence, global context modeling is performed to capture the contextual association between the feature vectors corresponding to the uncovered region and the feature vectors corresponding to the covered region. Based on the output of the self-attention layer, a feature vector containing information about the masked region is obtained.

7. The image feature indexing method as described in claim 5, wherein, The feature vector is reconstructed and learned through the encoding network to generate reconstructed features for filling in the masked image region, including: The feature vector is nonlinearly mapped through the encoding network to obtain a high-dimensional feature representation. Based on the high-dimensional feature representation, upsampling or deconvolution operations are performed through the decoding layer of the encoding network to generate reconstructed features that match the texture, color, and shape of the enhanced image.

8. The image feature indexing method as described in claim 1, wherein, Extracting image feature representations from the reconstructed image using an encoding network includes: The reconstructed image is input into an encoding network, which performs image block processing on the reconstructed image to generate an image block sequence. In the coding network, the image patch sequence is converted into a feature vector sequence, and local feature vectors and global feature vectors are extracted from the feature vector sequence; The local and global feature vectors are fused to generate an image feature representation that includes both overall information and local details.

9. The image feature indexing method as described in claim 8, wherein, In the encoding network, the image patch sequence is converted into a feature vector sequence, and local and global feature vectors are extracted from the feature vector sequence, including: Each image block is converted into a fixed-length feature vector through the intermediate layer of the coding network, generating a sequence of feature vectors; The feature vectors corresponding to each image patch in the feature vector sequence are used as local feature vectors representing the detailed features of the image patch; The feature vector sequence is input into the global feature extraction module of the encoding network, and a global feature vector representing the semantic information of the entire image is generated by performing a global pooling operation on the feature vector sequence.

10. The image feature indexing method as described in claim 1, wherein, Through the contrastive learning module, the differences between image feature representations are reduced for reconstructed images labeled as similar, and the differences between image feature representations are increased for reconstructed images labeled as dissimilar, including: Based on the similarity or dissimilarity labels of the reconstructed images, the reconstructed images are divided into a set of similar images and a set of dissimilarity images; The cosine similarity analysis is performed on the image feature representations in the similar image set and the dissimilar image set through the contrast learning module; For image feature representations in a set of similar images, the differences between image feature representations are reduced by minimizing the cosine similarity analysis results; For image feature representations in a set of dissimilar images, the difference between image feature representations is increased by maximizing the cosine similarity analysis results.

11. The image feature indexing method as described in claim 10, wherein, For image feature representations in a set of similar images, the differences between image feature representations are reduced by minimizing the cosine similarity analysis results, including: The loss value is determined based on the cosine similarity analysis results between image feature representations in the similar image set using either the contrastive loss function or the InfoNCE loss function. Based on the loss value, the model parameters of the encoding network are updated using the gradient descent optimization algorithm; By iteratively updating the model parameters, the angle between the image feature vectors in the similar image set converges to zero, thereby reducing the feature differences.

12. The image feature indexing method as described in claim 1, wherein, After constructing the image feature index library based on the processed image feature representation, the following steps are also included: The feature representation of the target image is compared with the feature representation of each image in the image feature index library to generate a similarity comparison result set; Based on the similarity values ​​in the similarity comparison result set, candidate image feature representations with similarity values ​​higher than a preset threshold are selected from the image feature index library, and the candidate images corresponding to the candidate image feature representations are determined. The candidate image and the target image are compared to determine whether the candidate image is a duplicate of the target image.

13. An image feature indexing device, wherein, The image feature indexing device includes: The data augmentation module is used to acquire the original image dataset, perform data augmentation operations on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image. The image labeling module is used to label all enhanced images generated from the same original image as similar images, and to label enhanced images generated from different original images as dissimilar images; The masking module is used to mask a portion of the image region of each enhanced image and input the masked image into the encoding network. The image reconstruction module is used to reconstruct the masked image region through the coding network and generate a corresponding reconstructed image, wherein the reconstructed image retains the similarity or dissimilarity markers of the enhanced image; The feature extraction module is used to extract image feature representations from the reconstructed image through an encoding network; The contrastive learning module is used to reduce the differences between image feature representations of reconstructed images labeled as similar, and to increase the differences between image feature representations of reconstructed images labeled as dissimilar. The feature indexing module is used to build an image feature index library based on the processed image feature representation.

14. A computer device, wherein, The computer device includes a memory, a processor, and an image feature indexing program stored in the memory and executable on the processor. When the image feature indexing program is executed by the processor, it implements the following steps of the image feature indexing method: Obtain the original image dataset, perform data augmentation on each original image in the original image dataset, and generate multiple augmented images corresponding to each original image; All enhanced images generated from the same original image are labeled as similar images, and enhanced images generated from different original images are labeled as dissimilar images; A portion of the image region in each enhanced image is masked, and the masked image is then input into the coding network. The masked image region is reconstructed through the coding network to generate a corresponding reconstructed image, which retains the similarity or dissimilarity markers of the enhanced image. Image feature representations are extracted from the reconstructed image using an encoding network; The contrastive learning module reduces the differences between image feature representations for reconstructed images labeled as similar, and increases the differences between image feature representations for reconstructed images labeled as dissimilar. Based on the processed image feature representation, an image feature index library is constructed.

15. The computer device as claimed in claim 14, wherein, Obtain the original image dataset, perform data augmentation on each original image in the dataset, and generate multiple augmented images corresponding to each original image, including: Obtain the original image dataset from the image data source, the original image dataset containing multiple images; Each original image in the original image dataset undergoes image resizing, format conversion, and / or color space standardization. Based on a preset enhancement strategy, multiple data enhancement methods are randomly selected for each original image. These data enhancement methods include cropping, rotation, flipping, adjusting brightness, and adding noise. Multiple data augmentation methods are applied to each original image to generate multiple augmented images with different feature changes.

16. The computer device as claimed in claim 14, wherein, A portion of the image region in each enhanced image is masked, and the masked image is then input into the coding network, including: Based on a preset mask region ratio, a mask template is randomly generated, and the mask template is used to identify the mask region in the enhanced image; The mask template is applied to each enhanced image to mask the masked area identified by the mask template in each enhanced image, thereby generating a masked image. The image after the masking process is input into the encoding network.

17. The computer device as claimed in claim 14, wherein, The masked image region is reconstructed using the encoding network to generate a corresponding reconstructed image. The reconstructed image retains the similarity or dissimilarity markers from the enhanced image, including: The image after masking includes masked image regions and unmasked image regions. The coding network extracts feature vectors containing information about the masked regions from the image after masking. The feature vector is reconstructed and learned through the encoding network to generate reconstructed features for filling in the masked image region; The reconstructed features are fused with the unmasked image region to generate a reconstructed image that inherits the similarity or dissimilarity markers of the corresponding enhanced image.

18. The computer device as claimed in claim 14, wherein, Extracting image feature representations from the reconstructed image using an encoding network includes: The reconstructed image is input into an encoding network, which performs image block processing on the reconstructed image to generate an image block sequence. In the coding network, the image patch sequence is converted into a feature vector sequence, and local feature vectors and global feature vectors are extracted from the feature vector sequence; The local and global feature vectors are fused to generate an image feature representation that includes both overall information and local details.

19. The computer device as claimed in claim 14, wherein, Through the contrastive learning module, the differences between image feature representations are reduced for reconstructed images labeled as similar, and the differences between image feature representations are increased for reconstructed images labeled as dissimilar, including: Based on the similarity or dissimilarity labels of the reconstructed images, the reconstructed images are divided into a set of similar images and a set of dissimilarity images; The cosine similarity analysis is performed on the image feature representations in the similar image set and the dissimilar image set through the contrast learning module; For image feature representations in a set of similar images, the differences between image feature representations are reduced by minimizing the cosine similarity analysis results; For image feature representations in a set of dissimilar images, the difference between image feature representations is increased by maximizing the cosine similarity analysis results.

20. A non-volatile computer-readable storage medium, wherein, The storage medium stores an image feature indexing program, which, when executed by a processor, implements the steps of the image feature indexing method as described in any one of claims 1-12.