An image retrieval method, apparatus, device, storage medium and program product

CN123030775APending Publication Date: 2026-11-03CHINA MOBILE GRP GUANGDONG CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611219130.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing technologies lack sufficient accuracy in detecting small targets in video surveillance scenarios, making it difficult to achieve automated acquisition and efficient screening of image data for specific targets, especially when there is a lot of background noise, making them susceptible to interference.

Method used

By segmenting the target video stream into target regions, using a multimodal pre-trained model to encode the features of the target region sub-images, generating image semantic feature vectors, and constructing a feature database, the image retrieval results are optimized by combining multimodal query vectors for matching retrieval and iterative updates.

Benefits of technology

It significantly improves the detection accuracy and retrieval signal-to-noise ratio of small targets, realizes the automated collection and efficient screening of specific targets, and improves the data processing efficiency in video surveillance scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030775A_ABST
    Figure CN123030775A_ABST
Patent Text Reader

Abstract

The application discloses an image retrieval method, device and equipment, a storage medium and a program product, and relates to the technical field of image retrieval. The method comprises the following steps: performing target region segmentation on images in a target video stream, performing feature coding on target region subgraphs obtained through the segmentation by using an image encoder of a multi-modal pre-training model, and generating an image semantic feature vector; constructing metadata of the corresponding target region subgraphs according to the image semantic feature vector, and writing the metadata into a feature database; performing feature coding on multi-modal query information input by a user by using the multi-modal pre-training model, and generating a multi-modal query vector; performing matching retrieval in the feature database by using the multi-modal query vector, iteratively updating the retrieved target images, and obtaining an image retrieval result; and the application can improve the detection accuracy of specific targets, especially small targets, in a video monitoring scene, and meet the demand for automatic collection and efficient screening of picture data of specific targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to an image retrieval method, apparatus, device, storage medium, and program product. Background Technology

[0002] In the context of AI (Artificial Intelligence) video surveillance and video network scenarios, it is necessary to collect and filter image data of specific targets (especially small targets) from massive surveillance video streams. Existing solutions mainly use whole images for multimodal image retrieval, such as directly extracting global visual features from a single frame of the surveillance footage and matching them with text prompt features to achieve image data collection and filtering.

[0003] Existing image data acquisition and filtering schemes are easily affected by background noise in video surveillance scenarios with small or multiple targets. They cannot effectively handle the problems of weak features of small targets and high background noise, resulting in insufficient detection accuracy of small targets in video surveillance scenarios. This makes it difficult to meet the needs of automated acquisition and efficient filtering of image data of specific targets (especially small targets) in video surveillance scenarios. Summary of the Invention

[0004] To address the problems existing in the prior art, embodiments of the present invention provide an image retrieval method, apparatus, device, storage medium, and program product, which can effectively improve the detection accuracy of specific targets (especially small targets) in video surveillance scenarios and meet the needs of automated acquisition and efficient screening of image data of specific targets (especially small targets) in video surveillance scenarios.

[0005] In a first aspect, embodiments of the present invention provide an image retrieval method, including: The images in the target video stream are segmented into target regions to obtain several target region sub-images; The image encoder of the multimodal pre-trained model encodes the features of each target region sub-image to generate the corresponding target region sub-image image semantic feature vector; Metadata of the corresponding target region sub-image is constructed based on the image semantic feature vector, and a feature database is constructed based on the metadata of each target region sub-image; The multimodal query information input by the user is feature-encoded using the multimodal pre-trained model to generate a multimodal query vector; The multimodal query vector is used to perform matching and retrieval in the feature database, and the retrieved target image is iteratively updated to obtain the image retrieval result.

[0006] As an improvement to the above scheme, target region segmentation is performed on the images in the target video stream to obtain several target region sub-images, including: The target video stream is extracted from frames at a preset frame interval to obtain several frames of images; Target detection is performed on each frame of the image to filter out target images with potential target regions; The non-potential target regions in the target image are masked, and the potential target regions are cropped by edge expansion to obtain the corresponding target region sub-images.

[0007] As an improvement to the above scheme, a multimodal pre-trained model is used to encode the features of each of the target region sub-images, generating image semantic feature vectors for the corresponding target region sub-images, including: All the target region sub-images are normalized in size to obtain target region sub-images of uniform size; The target region sub-images with uniform size are input into the image encoder of the multimodal pre-trained model for feature encoding to obtain the feature vectors of each target region sub-image; The feature vectors are convolved, compressed, and enhanced to obtain the image semantic feature vectors of the corresponding target region sub-images.

[0008] As an improvement to the above scheme, the multimodal query information input by the user is feature-encoded using the multimodal pre-trained model to generate a multimodal query vector, including: The query text in the multimodal query information is semantically encoded by the text encoder of the multimodal pre-trained model to obtain the query text feature vector; The image encoder of the multimodal pre-trained model performs semantic encoding on the case images in the multimodal query information to obtain the query image feature vector; wherein, the case images contain the target object to be queried; The query text feature vector and the query image feature vector are fused according to the preset modal weights to obtain the multimodal query vector.

[0009] As an improvement to the above scheme, the multimodal query vector is used to perform matching and retrieval in the feature database, and the retrieved target image is iteratively updated to obtain image retrieval results, including: Calculate the similarity between the multimodal query vector and each image semantic feature vector in the feature database, sort each image semantic feature vector from high to low similarity, and select the target images corresponding to the top-ranked image semantic feature vectors. The selected target images are labeled so that target images containing target regions are labeled as positive samples; The modal weight parameters are adaptively adjusted based on the multimodal query vector and the image semantic feature vector corresponding to the positive sample. Based on the adjusted modal weights, the multimodal query vectors are re-fused for matching and retrieval until the preset iteration termination condition is met, thus obtaining the image retrieval results.

[0010] As an improvement to the above scheme, the modal weight parameters are adaptively adjusted based on the multimodal query vector and the image semantic feature vector corresponding to the positive sample, including: The text modality contribution is calculated based on the query text feature vector in the multimodal query vector and the image semantic feature vector corresponding to the positive sample. The image modality contribution is calculated based on the query image feature vector in the multimodal query vector and the image semantic feature vector corresponding to the positive sample. Based on the text modality contribution and the image modality contribution, the text modality weight and the image modality weight in the modality weight parameters are adaptively adjusted.

[0011] Secondly, embodiments of the present invention provide an image retrieval device, comprising: The image segmentation module is used to segment the target region of the image in the target video stream to obtain several target region sub-images; The image encoding module is used to encode the features of each of the target region sub-images using an image encoder based on a multimodal pre-trained model, thereby generating the image semantic feature vector of the corresponding target region sub-image. The feature database construction module is used to construct metadata of the corresponding target region sub-image based on the image semantic feature vector, and to construct the feature database based on the metadata of each target region sub-image; The query vector generation module is used to perform feature encoding on the multimodal query information input by the user through the multimodal pre-trained model to generate a multimodal query vector; The multimodal image retrieval module is used to perform matching retrieval in the feature database using the multimodal query vector, and to iteratively update the retrieved target images to obtain image retrieval results.

[0012] Thirdly, embodiments of the present invention provide an image retrieval device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the image retrieval method as described in any one of the first aspects.

[0013] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to perform the image retrieval method as described in any one of the first aspects.

[0014] Fifthly, embodiments of the present invention provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the image retrieval method as described in any one of the first aspects.

[0015] Compared to existing technologies, the image retrieval method, apparatus, device, storage medium, and program product provided in this invention segment an image in a target video stream to obtain several target region sub-images. Then, an image encoder using a multimodal pre-trained model encodes the features of each target region sub-image to generate an image semantic feature vector for that sub-image. Metadata for the corresponding target region sub-image is constructed based on the image semantic feature vectors, and a feature database is built based on the metadata of each target region sub-image. Subsequently, the multimodal query information input by the user is feature-encoded using the multimodal pre-trained model to generate a multimodal query vector. This multimodal query vector is then used for matching and retrieval in the feature database, and the retrieved target images are iteratively updated to obtain image retrieval results. This invention identifies and segments target region sub-images in an image, and performs feature encoding only on these target region sub-images. This effectively solves the problem that small targets have weak feature signals in the whole image and are easily submerged by background noise, significantly improving the expressive power of small target features and the retrieval signal-to-noise ratio. Subsequently, the introduction of feature matching retrieval and iterative update mechanisms can optimize image retrieval results, effectively improving the detection accuracy of specific targets (especially small targets) in video surveillance scenarios, and meeting the needs of automated acquisition and efficient screening of image data of specific targets (especially small targets) in video surveillance scenarios. Attached Figure Description

[0016] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart of an image retrieval method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of multimodal query vector generation provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the iterative search provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of image acquisition and filtering for a specific target provided in an embodiment of the present invention; Figure 5This is an overall flowchart of small target search optimization based on multimodal feature fusion provided in the embodiments of the present invention; Figure 6 This is a structural block diagram of an image retrieval device provided in an embodiment of the present invention; Figure 7 This is a structural block diagram of an image retrieval device provided in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] It is understood that the various numerical designations used in the embodiments of this invention are merely for descriptive convenience and are not intended to limit the scope of this application. The order of the process numbers does not imply the order of execution; the execution order of each process should be determined by its function and internal logic.

[0020] In embodiments of the invention, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, without necessarily requiring or implying any such actual relationship or order between these entities or operations. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element. The term "a plurality or several" refers to two or more.

[0021] See Figure 1 , Figure 1 This is a flowchart of an image retrieval method provided in an embodiment of the present invention. The image retrieval method specifically includes: S11: Perform target region segmentation on the images in the target video stream to obtain several target region sub-images; S12: The image encoder of the multimodal pre-trained model performs feature encoding on each of the target region sub-images to generate the corresponding target region sub-image image semantic feature vector; S13: Construct metadata for the corresponding target region sub-image based on the image semantic feature vector, and build a feature database based on the metadata of each target region sub-image; The metadata of the target region sub-graph includes the image semantic feature vector of the target region sub-graph and the basic information of the image frame; the basic information of the image frame includes, but is not limited to: the frame identifier, frame size, frame source, and frame storage path of the target image to which the target region sub-graph belongs; Based on the image semantic feature vector and the corresponding image frame basic information, the metadata of the corresponding target region sub-image is constructed, and the metadata is written into the vector database to complete the construction of the feature database.

[0022] S14: The multimodal query information input by the user is feature-encoded using the multimodal pre-trained model to generate a multimodal query vector; S15: The multimodal query vector is used to perform matching and retrieval in the feature database, and the retrieved target image is iteratively updated to obtain the image retrieval result.

[0023] It should be noted that the embodiments of the present invention can be executed by terminal devices such as servers and computers. The overall process mainly includes two stages: The first stage is database construction. The image encoder of the multimodal pre-trained model extracts features from the target region sub-images of the image regions containing at least one potential target region, such as not wearing a chef's uniform, not wearing a chef's hat, or not wearing a safety helmet, segmented from the target video stream. The extracted image semantic feature vectors are written into a vector database to construct a region-level feature database that supports multimodal query and dynamic optimization. The second stage is the query stage. Users can use text prompts and / or a few example images containing the target object as multimodal query information. After multimodal encoding by the image encoder of the multimodal pre-trained model and the encoder in this paper, a multimodal query vector is generated. Then, similarity matching retrieval and iterative updates of the retrieval results are performed in the feature database constructed above, thereby obtaining a set of target images containing specific targets and obtaining the final image retrieval results.

[0024] This invention identifies and segments target region sub-images in an image, and performs feature encoding only on these target region sub-images. This effectively solves the problem that small targets have weak feature signals in the whole image and are easily submerged by background noise, significantly improving the expressive power of small target features and the retrieval signal-to-noise ratio. Subsequently, the introduction of feature matching retrieval and iterative update mechanisms can optimize image retrieval results, effectively improving the detection accuracy of specific targets, especially small targets, in video surveillance scenarios. It can significantly improve the data acquisition and filtering performance for specific targets, such as small targets or dense multi-target targets, meeting the needs of automated acquisition and efficient filtering of image data of specific targets, especially small targets, in video surveillance scenarios.

[0025] In one optional embodiment, target region segmentation is performed on the images in the target video stream to obtain several target region sub-images, including: The target video stream is extracted from frames at a preset frame interval to obtain several frames of images; Target detection is performed on each frame of the image to filter out target images with potential target regions; The non-potential target regions in the target image are masked, and the potential target regions are cropped by edge expansion to obtain the corresponding target region sub-images.

[0026] For example, after inputting surveillance video from a video network platform as the target video stream into the system, the system extracts frames at preset frame intervals. Specifically, during the frame extraction process, frames can be extracted and stored in the database at fixed time intervals. For example, the extraction interval could be 1 second to avoid excessively short intervals that could lead to too many duplicate images and create greater storage pressure, while also avoiding excessively long intervals that could miss some target frames. During the frame extraction process, the image size of the extracted images can be changed, and the image quality can be reduced to further ensure storage efficiency and accelerate subsequent feature extraction operations.

[0027] When configuring the frame extraction task for the target video stream in the system, at least the following information should be included: video source, output path, frame extraction interval, save image quality, and scaling ratio. Here, the video source indicates the source of the extracted frames, which can be a video file or a video stream. The output path indicates the location where the extracted frames are saved. The frame extraction interval indicates how often a frame is sampled. The save image quality indicates the compression level specified when saving the extracted frames as JPG images, with a value ranging from 0 to 100; a higher value indicates higher image quality. The scaling ratio indicates the scaling ratio of the screenshot resolution; for example, 0.5 means the resolution is halved. The specific frame extraction steps are as follows: (1) Initialize output directory: Check if the specified output path exists. If it does not exist, the directory corresponding to the output path will be created automatically.

[0028] (2) Load video and get attributes: Use the video processing module to read the input video source, i.e. the target video stream, and get the video frame rate (fps) information.

[0029] (3) Frame-by-frame processing and sampling: Traverse each frame of the target video stream and start the cumulative frame count counter. The system calculates the actual sampling frame interval (i.e., the interval between two adjacent frames (unit: number of frames)) based on the set frame extraction time interval (unit: seconds) and the video frame rate, where frame interval = frame rate × frame extraction time interval. When the cumulative frame count reaches an integer multiple of the frame interval, this frame is extracted, and the following operations are performed: Adjust the size of the current frame image according to the set scaling ratio; Generate the output image, i.e., the filename of the extracted image, in the format: frame_current frame_sampling interval.jpg; Save the processed image to the output path at the specified image saving quality (JPEG format, 0–100).

[0030] (4) Processing ends: The frame extraction process terminates after all frames of the target video six have been processed.

[0031] After completing the frame extraction process of the target video stream, a pre-trained target detection model, such as the YOLO target detector, is used to quickly scan each extracted frame to identify and locate all potential target regions (bounding boxes) in the image. This allows subsequent feature extraction to focus on the target itself, avoiding the background noise of the entire image from drowning out the features of small targets. Images with potential target regions are considered as target images, and each potential target region in the target image is segmented and cropped into an independent target region sub-image (Region of Interest, ROI). Images in which no potential target regions are detected are directly discarded.

[0032] Furthermore, this embodiment of the invention adds two core modules to the YOLO target detector: (1) Small target feature enhancement branch: In the YOLO feature pyramid, a 3×3 depthwise separable convolutional submodule is added to the high-resolution feature layer where small targets are located to enhance the edge and texture details of small targets, improving the feature quality by 10%. Detection confidence of small targets at the 10-pixel level; (2) ROI Precise Cropping and Adaptation Module: To prevent small target areas from being covered by background pixels, the module executes the cropping rule of "target edge outward by 5 pixels + non-target area mask" on the detected potential target areas to ensure that the target area sub-image completely contains the details of the small target.

[0033] The specific feature extraction process of the YOLO object detector is as follows: After inputting the extracted frames of the image, YOLO's feature pyramid outputs a multi-scale feature map; The small target enhancement branch enhances the details of the high-resolution multi-scale feature map output above, and identifies and locates potential target regions; ROI clipping is performed on the identified potential target regions; if no target region is detected, the frame is discarded.

[0034] In this embodiment of the invention, for a 2-hour surveillance video in the video network platform, 7200 images are obtained by extracting one frame per second. When constructing the feature database, the processing time for each image is only about 0.65 seconds. In the query phase, it only takes 0.2 seconds to obtain 200 images containing specific targets at once. This can significantly improve the video data processing efficiency and target query response speed of the video network platform, and realize the efficient storage of massive surveillance data and second-level target backtracking.

[0035] In this embodiment of the invention, an improved target detection model is introduced to pre-segment the target region of the frame-sliced ​​image. Feature extraction and library construction are performed only on the segmented target region sub-images. The target detection model includes a small target feature enhancement branch and a precise ROI cropping and adaptation module, which solves the problem of low feature signal-to-noise ratio of small targets in the whole image, avoids background noise interference, and improves the accuracy and efficiency of small target detection.

[0036] In one optional embodiment, an image encoder using a multimodal pre-trained model performs feature encoding on each of the target region sub-images to generate an image semantic feature vector for the corresponding target region sub-image, including: All the target region sub-images are normalized in size to obtain target region sub-images of uniform size; The target region sub-images with uniform size are input into the image encoder of the multimodal pre-trained model for feature encoding to obtain the feature vectors of each target region sub-image; The feature vectors are convolved, compressed, and enhanced to obtain the image semantic feature vectors of the corresponding target region sub-images.

[0037] To enable efficient searching and retrieval based on image content, it is crucial to construct a comprehensive feature database for all the extracted target image frames. The metadata of the frames (i.e., the metadata of the target image and the corresponding target region sub-image) is defined in the table below.

[0038]

[0039] The feature field stores the feature embedding of the frame, i.e., the image semantic feature vector. Users can find the most similar frame based on the KNN algorithm by giving a query vector.

[0040] Among them, the KNN (K-Nearest Neighbors) algorithm calculates the distance between the query vector and the semantic feature vector of the image in the feature database as a similarity metric to determine whether the semantic representations of two vectors are similar. Common calculation methods include Euclidean distance, cosine similarity, and dot product, etc., which are not limited in this embodiment of the invention. For example, cosine similarity is used to calculate the distance between two vectors to measure the similarity of semantic features and improve the robustness to the perception of scale changes of feature vectors.

[0041] The name and source_id fields identify the frame source file name, i.e., the video source, and the frame save path, i.e., the output path, respectively. The frame source file can be found in the query results based on these two fields.

[0042] The id and source_id fields are the frame identifier and frame source identifier, respectively, which are the identifiers of the video source.

[0043] In this embodiment of the invention, a multimodal pre-trained model, such as CLIP (Contrastive Language-Image Pre-training, ImageEncoder of the Contrastive Language-Image Pre-training Model), is selected as the feature extractor of the target region sub-image obtained by the above frame extraction.

[0044] Understandably, the CLIP model is a powerful multimodal matching model. Its ImageEncoder part employs the ViT (Vision Transformer) architecture, which effectively extracts semantically rich feature representations from images. For example, the ImageEncoder uses ViT-B / 32 as its backbone network, which generates 512-dimensional feature vectors. These feature vectors effectively represent the semantic information of the image. ViT-B / 32 is a basic scale variant of the Vision Transformer, where "B" corresponds to the model structure configuration, and "32" indicates that the input image is divided into 32×32 pixel image blocks. The specific process for extracting semantic feature vectors from the image is as follows: (1) Image segmentation and embedding: The input image, such as the target region sub-image, is adjusted to a fixed resolution of 224×224 pixels. The image is segmented into 32×32 pixel image patches, resulting in (224 / 32)×(224 / 32)=7×7=49 image patches. Each image patch is linearly mapped to a 512-dimensional embedding space to obtain the corresponding image patch embedding vector. (2) Add positional encoding: Add learnable positional encoding to the image patch embedding to preserve the spatial positional information of the image patch; (3) Transformer encoding: The image patch with position encoding is embedded into the 12-layer Transformer encoder, and the global semantic association between the image patch is captured through the self-attention mechanism; (4) Generate feature vector: Take the “CLS token” (classification term, i.e. the global representation token preset by the model) output by the Transformer encoder, and obtain a 512-dimensional feature vector after linear layer mapping, i.e. the image semantic feature vector, which can effectively represent the semantic information of the image.

[0045] If the feature value of each channel is represented by a 4-byte floating-point number, the information of any image can be compressed to 2KB, significantly reducing storage requirements compared to the original image. When constructing the feature database, it is also necessary to store some contextual information for each image. By combining the "id" and "source_id" fields in each record, the complete path of the image in the storage system can be easily located, thus facilitating the acquisition of the original image, i.e., the target image, obtained by extracting frames from the target video stream. To aid in filtering specific frames, this embodiment of the invention also adds information such as frame size as part of the metadata. This can help us exclude images that may be unsuitable as training data due to quality issues such as blurriness or excessively small size in certain situations.

[0046] In the algorithm for constructing the feature database, all target region sub-images (ROIs) under the previously output frame extraction path are traversed. For each target region sub-image, CLIP's ImageEncoder is used to extract its image semantic feature vector. This ensures that the extracted feature vectors are highly focused on the semantic information of the small target itself, such as the texture of the chef's uniform and the shape of the safety helmet, rather than the irrelevant background of the whole image, which significantly improves the signal-to-noise ratio and representation ability of the small target features.

[0047] For example, CLIP's ImageEncoder performs input adaptation and feature enhancement for target region sub-images. A "ROI size normalization module" is added before the ImageEncoder to uniformly scale target region sub-images of different sizes to 128×128 pixels, adapting to small target inputs and avoiding feature distortion. A "small target feature refinement layer" is added after the ImageEncoder, compressing redundant dimensions through 1×1 convolutions to enhance target semantic features, such as the brim texture of a chef's hat or the markings on a safety helmet. This is achieved through the target region sub-image. Size normalization module CLIP's ImageEncoder Small Target Feature Refinement Layer Output a 512-dimensional image semantic feature vector (ROI Features) specific to the target region sub-image. This feature vector only represents the semantics of the small target itself, without background noise from the whole image, and can accurately match the features of the small target during subsequent retrieval.

[0048] Simultaneously, it records metadata such as the frame save path, frame size, source video, target's position coordinates (x, y, w, h) in the original frame (optional), and target category confidence (optional). This metadata, along with the obtained image semantic feature vector, is stored in a vector database, such as Faiss, ElsaticSearch, or MongoDB, to construct a feature database for the target video stream. When performing image search, the database can be directly queried for the record most similar to a given query vector, quickly locating the corresponding original target image.

[0049] Unlike feature databases for the entire image, this embodiment of the invention constructs a feature database for a target region sub-image. It stores only the semantic features of specific target regions in the image, which provides a foundation for subsequent accurate retrieval of small and multiple targets. At the same time, it can quickly respond to multimodal query requests and support similarity search of large-scale image data, thereby improving image retrieval performance.

[0050] In other embodiments, the feature database can be constructed directly using the target image obtained by frame extraction. For the specific process, please refer to the feature database construction process of the target region sub-image described above. The difference is that it is not necessary to segment the target region sub-image from the target image, which will not be repeated here.

[0051] In this embodiment of the invention, the CLIP model constructs a regional feature database by extracting the image semantic feature vectors of the target region sub-image and their corresponding detailed metadata. Unlike the whole-image feature database of the prior art, it supports targeted retrieval of specific small target regions, forming a regional database that supports precise retrieval.

[0052] In one alternative embodiment, the multimodal query information input by the user is feature-encoded using the multimodal pre-trained model to generate a multimodal query vector, including: The query text in the multimodal query information is semantically encoded by the text encoder of the multimodal pre-trained model to obtain the query text feature vector; The image encoder of the multimodal pre-trained model performs semantic encoding on the case images in the multimodal query information to obtain the query image feature vector; wherein, the case images contain the target object to be queried; The query text feature vector and the query image feature vector are fused according to the preset modal weights to obtain the multimodal query vector.

[0053] In this embodiment of the invention, after constructing the feature database, the K most similar image semantic feature vectors to the query vector can be found using the KNN algorithm. These query vectors can be constructed from a rich set of example images or generated from query text, such as concise text prompts. Based on the metadata corresponding to the K image semantic feature vectors of the query results, relevant information about the original image can be extracted, and the original image file can be obtained, thus yielding the image retrieval results.

[0054] The query vector significantly impacts the quality of query results, and the purpose of a query is to find the target image most similar to the query vector from the feature database. Based on the CLIP training process, it aligns the features of text descriptions and images, meaning the representations of both modalities reside in the same feature space. Therefore, when constructing query vectors, it's possible to follow a dual approach, considering both text and image perspectives. Figure 2 As shown, it specifically includes: Query vector based on query text: Users need to describe the appearance features of the target in simple and straightforward language as query text. The query text contains at least one prompt word describing the appearance features of the target. The query text is input into the text encoder of the CLIP model to obtain a 512-dimensional query text feature vector in a unified feature space.

[0055] Furthermore, users can also set the weights of multiple prompt words. When using multiple prompt words to describe the search target, the feature vectors of the prompt words output by TextEncoder can be weighted and summed in the corresponding dimensions according to the set weights to obtain the final query text feature vector.

[0056] Structure: Multi-prompt input layer CLIP's TextEncoder layer Configurable weighted summation layer; Connection relationship: Multiple prompts describing the appearance features of the retrieved target, such as "personnel not wearing white kitchen uniforms" and "unqualified employees not wearing kitchen uniforms according to standards", are input into TextEncoder in parallel, outputting multiple 512-dimensional query text feature vectors, which are then fed into a weighted summation layer. This weighted summation layer supports manual configuration of weights / adaptive adjustment during iteration, and is weighted and fused into a final 512-dimensional query text feature vector. Query vectors based on case images: Similar to query text, one or more case images containing the target to be retrieved are also required. The case images will be encoded by the CLIP model's ImageEncoder to obtain a 512-dimensional query image feature vector.

[0057] Similarly, users can set weights for multiple example images. The feature vectors of the example images output by ImageEncoder are weighted and summed according to the set weights to obtain the final feature vector of the query image.

[0058] It should be noted that when the user does not specify the weight of multiple prompt words or case images, each prompt word or case image will have the same weight by default.

[0059] Structure: Multi-case image input layer CLIP's ImageEncoder layer Sample confidence weighted layer; Connection relationship: Multiple case images, such as images of people without hats, are input into ImageEncoder in parallel with positive samples during the iteration process. The output is multiple 512-dimensional query image feature vectors. Sample confidence weighting layer assigns weights based on the matching confidence of previous search results. For example, the higher the matching confidence, the higher the weight assigned. These are then merged into a single 512-dimensional final query image feature vector.

[0060] For example, the user inputs the prompt "person not wearing a chef's hat" + a small target case image of a person not wearing a hat; The prompt "person not wearing a chef's hat" is input into CLIP's TextEncoder, which outputs a 512-dimensional query text feature vector T. A small target case image of a person not wearing a hat is input into CLIP's ImageEncoder, and the output is a 512-dimensional query image feature vector I; Dynamic weight fusion: Set the initial weights to: text modality weights Image modality weights Generate the final multimodal query vector. ,in, .

[0061] Modality weights (including text modality) Image modality (This can be dynamically adjusted; see below for details.)

[0062] The resulting multimodal query is accessed through a hierarchical index interface of the feature database constructed above, such as Faiss-IVF-PQ. First, candidate vector clusters are located through coarse clustering, and then fine similarity matching is performed within the clusters. The retrieval process can utilize the modal weights optimized in the previous iteration.

[0063] Specifically, since the feature database constructed above is usually very large, in order to improve search efficiency, the feature database of the approximate KNN algorithm can be used as a search engine to retrieve the target image corresponding to the top K similar image semantic feature vectors in the feature database based on the multimodal feature vectors.

[0064] The search includes the following parameters: `candidates`, which is the number of nearest neighbors to use during the search, typically less than 10,000; and `limit`, which is the number of neighbors to return, less than `candidates`. Cosine similarity is used to measure neighbor distance. Since CLIP-encoded features are already regularized, the dot product of vectors can also be used directly for calculation.

[0065] Let A be the multimodal query vector and B be the semantic feature vector of an image in the feature database. Their cosine similarity is: (1); Since the feature vectors A and B output by CLIP have already been regularized, the cosine distance can be directly written in dot product form: (2); Understandably, the K-Nearest Neighbors algorithm is one of the most commonly used nearest neighbor search algorithms. Given a set of points F and a target point q in a feature space M, it searches for the point in F that is closest to q. In this method, the distance specifically refers to the cosine distance mentioned earlier.

[0066] The KNN algorithm can be used to determine The top K largest semantic feature vectors of the images are used as query results, and the corresponding target images are found based on the metadata of the top K image semantic feature vectors.

[0067] The embodiments of this invention employ CLIP-encoded single-frame independent features, which are non-average frame features. Furthermore, the CLIP output features have been pre-regularized using L2. Therefore, the cosine similarity calculation is equivalently replaced by a vector dot product operation, as shown in the calculation formula: By avoiding the calculation of square roots and modulo lengths, the retrieval speed can be improved by about 30%. At the same time, by combining the hierarchical indexing strategy of vector databases, such as Faiss-IVF-PQ, candidate vector clusters are first located through coarse clustering, and then fine dot product similarity matching is performed within the clusters. This can reduce the retrieval latency of a million-frame feature database from 100ms to 20ms, achieving dual optimization of features and computational logic.

[0068] Specifically, the multimodal query vector is used to perform matching and retrieval in the feature database, and the retrieved target image is iteratively updated to obtain image retrieval results, including: Calculate the similarity between the multimodal query vector and each image semantic feature vector in the feature database, sort each image semantic feature vector from high to low similarity, and select the target images corresponding to the top-ranked image semantic feature vectors. The selected target images are labeled so that target images containing target regions are labeled as positive samples; The modal weight parameters are adaptively adjusted based on the multimodal query vector and the image semantic feature vector corresponding to the positive sample. Based on the adjusted modal weights, the multimodal query vectors are re-fused for matching and retrieval until the preset iteration termination condition is met, thus obtaining the image retrieval results.

[0069] Specifically, based on the multimodal query vector and the image semantic feature vector corresponding to the positive sample, the modality weight parameters are adaptively adjusted, including: The text modality contribution is calculated based on the query text feature vector in the multimodal query vector and the image semantic feature vector corresponding to the positive sample. The image modality contribution is calculated based on the query image feature vector in the multimodal query vector and the image semantic feature vector corresponding to the positive sample. Based on the text modality contribution and the image modality contribution, the text modality weight and the image modality weight in the modality weight parameters are adaptively adjusted.

[0070] To further optimize search performance, this invention employs an iterative search strategy. The query results of each search are used as part of a set of example images. These example images are used to construct a new multimodal query vector, and the search is performed again based on this multimodal query vector. In this way, the multimodal query vector more closely approximates the image domain in the current feature database, thereby dynamically optimizing the accuracy and relevance of the search. More importantly, this iterative process allows the system to automatically learn and adjust feature weights based on user filtering results, such as positive and negative sample feedback, forming a closed-loop optimization mechanism. Figures 3 to 5 As shown, the specific iterative search process is as follows: Initial search: Based on the initial query text / case image input, a weighted fusion is performed to obtain an initial multimodal query vector, and the top K target images with high similarity are selected as candidate images; Positive and negative sample labeling: Positive samples, such as images containing the target "not wearing a chef's uniform", are filtered from candidate images, while negative samples, i.e., images that do not contain the target, are filtered. At the same time, the matching confidence of positive samples is calculated. The matching confidence of positive samples is based on similarity ranking. The higher the similarity, the higher the matching confidence of the corresponding positive sample. Search vector update: Positive samples are used as new case images and input together with the initial case images into CLIP's ImageEncoder for feature vector extraction and weighted summation. In the sample confidence weighting layer, the weight of positive samples with high matching confidence is increased, such as increasing the weight of the top 20% of positive samples from the default 0.1 to 0.3. The newly fused query image feature vector is then weighted and fused with the query text feature vector to obtain the updated multimodal query vector. Iterative retrieval: The updated multimodal query vector is used to search the feature database again. The process of similarity filtering-multimodal query vector-retrieval is repeated until the iteration termination condition is met. If the accuracy is up to standard, the target image selected in the last round can be output to obtain the final image retrieval result.

[0071] For example, in the monitoring and acquisition of chef uniform detection, the first query uses two images as case images to search for 20 candidate images. Only 55% of these candidate images contain the target, such as images of someone not wearing a chef's uniform. The images containing the target are manually selected from the first query results and used as case images for the second iteration. This second iteration searches 40 images, revealing 37 images containing the detected target, improving accuracy from 55% to 92.5%. In the third iteration, the positive samples obtained from the previous search, such as the two images from the first query, are used as input to search 100 images. The number of images containing the target increases to 95, improving accuracy to 95%. This iterative optimization mechanism significantly reduces the cost of manual screening and achieves a continuous improvement in screening accuracy, an effect that static retrieval methods cannot achieve.

[0072] This invention embodiment uses "retrieval results" Weight update The closed loop of the "new query vector" can continuously optimize retrieval accuracy. Based on the quality of the current retrieval results, such as the user's positive / negative sample labeling of the selected images and the performance of target region features in the results, the system automatically calculates and dynamically adjusts the weights of different feature dimensions or different modalities. The optimized weights are fed back to the multimodal query stage in real time to optimize the generation of the next query vector, forming a closed-loop learning optimization mechanism that continuously improves retrieval accuracy. For example, if the "chef's uniform texture" feature proves to be more effective in multiple iterations, its weight will be automatically increased. The specific process is as follows: Based on the images returned by the initial multimodal query vector, perform sample labeling and label these images. For example, those that meet the requirements, such as those that are not wearing a chef's hat, are labeled as "positive samples," while those that do not meet the requirements, such as those that are actually wearing a chef's hat, are labeled as "negative samples." The "matching contribution" of different query modalities is calculated. For example, the initial multimodal query vector is generated using two modalities: "text hints, such as 'not wearing a chef's hat' + case image". Now, the ability of each modality to find positive samples needs to be calculated. The contribution of the text modality is obtained by calculating the average similarity between the "query text feature vector corresponding to the text hint" and the feature vectors of all positive samples. The contribution of the image modality is obtained by calculating the average similarity between the "query image feature vector corresponding to the case image" and the feature vectors of all positive samples.

[0073] Modal weights are adjusted based on contribution. If the text modality contributes more, meaning it helps find more positive samples, its weight is increased by a set step size; conversely, its weight is decreased by a set step size. The same applies to the image modality. Image modality + text modality = 1.

[0074] Using the adjusted new image and text modalities, the features of text and images are re-fused to generate a more accurate multimodal query vector. This vector is then used in the multimodal query process to retrieve data from the feature database, thus completing the retrieval process. Label Adjusting weights The closed-loop retrieval process improves the accuracy of query results with each iteration. As shown in the chef uniform detection case in the document, this closed-loop feedback learning process increases the accuracy from 55% to 95% iteratively. This significantly reduces the cost of manual screening and achieves continuous and automated improvement in retrieval accuracy. It is particularly important for handling concurrent scenarios with massive video streams because it can quickly converge to a high-quality dataset and reduce unnecessary computation.

[0075] This invention utilizes the YOLO model for region pre-segmentation, accurately segmenting target regions (ROIs). CLIP feature encoding is then applied only to these ROI sub-images. This cascaded design of "target localization + region feature focusing" effectively addresses the core problem of weak feature signals and susceptibility to background noise in small targets within the overall image, significantly improving the expressive power of small target features and the retrieval signal-to-noise ratio. Furthermore, building upon the YOLO model's region pre-segmentation and CLIP encoding of sub-image ROIs to extract refined semantic features, a dynamic weight adjustment closed-loop mechanism based on user feedback is introduced. These three elements work synergistically to solve the core challenges of effective feature extraction and low retrieval accuracy in small target detection, significantly improving data acquisition efficiency and quality. It is particularly suitable for the concurrent processing of large video streams in security monitoring and can be widely applied to similar "human-attribute" detection tasks in video network platforms, demonstrating strong versatility. Examples include detecting chef's hats, uniforms, and masks in smart kitchens; safety ropes and helmets in smart construction sites; and detecting smoking and mobile phone use in behavior recognition. This invention can play an excellent role in all these applications.

[0076] This invention defines query vectors through multimodal queries. Users can initiate queries through intuitive text descriptions or a few images, while the system automatically learns more accurate query representations through iterative optimization. This combination provides powerful user interactivity and system self-learning capabilities. Simultaneously, the constructed feature database containing precise target location information supports not only content-based retrieval but also precise queries for specific small target regions. This database can be reused for different detection tasks simply by defining new queries. Compared to existing methods that rely on auxiliary models to re-infer and filter the entire video library for each new task, this invention significantly saves computational resources and time costs through the reuse of a region-level feature database. Based on the approximate K-nearest neighbor algorithm, the top K feature vectors most similar to the multimodal query vector are queried from the constructed region-level feature database, improving query targeting. An iterative search strategy updates the query results, forming a search closed-loop optimization, achieving automated and continuous improvement in retrieval accuracy, significantly reducing manual screening costs, and solving the problem of static retrieval's inability to adaptively optimize in existing technologies.

[0077] See Figure 6 , Figure 6 This is a structural block diagram of an image retrieval device provided in an embodiment of the present invention. The image retrieval device includes: Image segmentation module 11 is used to segment the target region of the image in the target video stream to obtain several target region sub-images; Image encoding module 12 is used to perform feature encoding on each of the target region sub-images using an image encoder based on a multimodal pre-trained model, and generate image semantic feature vectors for the corresponding target region sub-images; The feature database construction module 13 is used to construct metadata of the corresponding target region sub-image based on the image semantic feature vector, and to construct a feature database based on the metadata of each target region sub-image; The query vector generation module 14 is used to perform feature encoding on the multimodal query information input by the user through the multimodal pre-trained model to generate a multimodal query vector; The multimodal image retrieval module 15 is used to perform matching retrieval in the feature database using the multimodal query vector, and to iteratively update the retrieved target image to obtain the image retrieval result.

[0078] In one optional embodiment, the image segmentation module 11 includes: A frame extraction unit is used to extract frames from the target video stream according to a preset frame interval to obtain several frames of images. The target detection unit is used to perform target detection on each frame of the image and filter out target images with potential target regions. The cropping unit is used to mask the non-potential target regions in the target image and to crop the potential target regions by expanding their edges, so as to obtain the corresponding target region sub-image.

[0079] In one optional embodiment, the image encoding module 12 includes: The size normalization unit is used to normalize the size of all the target region sub-images to obtain target region sub-images of uniform size; The feature encoding unit is used to input the target region sub-images of uniform size into the image encoder of the multimodal pre-trained model for feature encoding, so as to obtain the feature vectors of each target region sub-image; The compression and enhancement unit is used to perform convolutional compression and enhancement on the feature vector to obtain the image semantic feature vector of the corresponding target region sub-image.

[0080] In an optional embodiment, the query vector generation module 14 includes: The text semantic encoding unit is used to perform semantic encoding on the query text in the multimodal query information through the text encoder of the multimodal pre-trained model to obtain the query text feature vector; The image semantic encoding unit is used to perform semantic encoding on the case images in the multimodal query information through the image encoder of the multimodal pre-trained model to obtain the query image feature vector; wherein, the case images contain the target object to be queried; The feature weighted fusion unit is used to fuse the query text feature vector and the query image feature vector according to the preset modal weights to obtain the multimodal query vector.

[0081] In one optional embodiment, the multimodal image retrieval module 15 includes: The similarity matching unit is used to calculate the similarity between the multimodal query vector and each image semantic feature vector in the feature database, and sort each image semantic feature vector in descending order of similarity, and select the target images corresponding to several of the top-ranked image semantic feature vectors. The sample annotation unit is used to annotate the selected target images so that target images containing target regions are labeled as positive samples. The weight adjustment unit is used to adaptively adjust the modal weight parameters according to the multimodal query vector and the image semantic feature vector corresponding to the positive sample; The retrieval update unit is used to re-integrate the multimodal query vectors according to the adjusted modal weights for matching retrieval until the preset iteration termination condition is met, and then obtain the image retrieval result.

[0082] In one optional embodiment, the modality weight parameters are adaptively adjusted based on the multimodal query vector and the image semantic feature vector corresponding to the positive sample, including: The text contribution calculation subunit is used to calculate the text modality contribution based on the query text feature vector in the multimodal query vector and the image semantic feature vector corresponding to the positive sample. The image contribution calculation subunit is used to calculate the image modality contribution based on the query image feature vector in the multimodal query vector and the image semantic feature vector corresponding to the positive sample. The modality weight adjustment subunit is used to adaptively adjust the text modality weight and image modality weight in the modality weight parameters based on the text modality contribution and the image modality contribution.

[0083] It should be noted that the working process of each module in the image retrieval device described in the embodiments of the present invention can refer to the working process of the image retrieval method described in the above embodiments, and the technical effect achieved is the same as that of the image retrieval method described in the above embodiments, so it will not be repeated here.

[0084] See Figure 7 , Figure 7 This is a structural block diagram of an image retrieval device provided in an embodiment of the present invention. The image retrieval device includes a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the above-described image retrieval method embodiments, such as steps S11 to S15.

[0085] For example, the computer program may be divided into one or more modules or units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules or units may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the image retrieval device.

[0086] The image retrieval device may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of an image retrieval device and does not constitute a limitation on the device. It may include more or fewer components than illustrated, or combine certain components, or use different components. For example, the image retrieval device may also include input / output devices, network access devices, buses, etc.

[0087] The processor 21 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 21 is the control center of the image retrieval device, connecting all parts of the image retrieval device via various interfaces and lines.

[0088] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the image retrieval device by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0089] If the modules or units integrated into the image retrieval device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0090] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0091] The above description represents the preferred embodiments of the present invention. It should be noted that, for those skilled in the art, various improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. An image retrieval method, characterized in that, include: The images in the target video stream are segmented into target regions to obtain several target region sub-images; The image encoder of the multimodal pre-trained model encodes the features of each target region sub-image to generate the corresponding target region sub-image image semantic feature vector; Metadata of the corresponding target region sub-image is constructed based on the image semantic feature vector, and a feature database is constructed based on the metadata of each target region sub-image; The multimodal query information input by the user is feature-encoded using the multimodal pre-trained model to generate a multimodal query vector; The multimodal query vector is used to perform matching and retrieval in the feature database, and the retrieved target image is iteratively updated to obtain the image retrieval result.

2. The image retrieval method as described in claim 1, characterized in that, The target video stream is segmented into target regions to obtain several target region sub-images, including: The target video stream is extracted from frames at a preset frame interval to obtain several frames of images; Target detection is performed on each frame of the image to filter out target images with potential target regions; The non-potential target regions in the target image are masked, and the potential target regions are cropped by edge expansion to obtain the corresponding target region sub-images.

3. The image retrieval method as described in claim 1, characterized in that, The image encoder of the multimodal pre-trained model encodes the features of each of the target region sub-images to generate the corresponding image semantic feature vectors of the target region sub-images, including: All the target region sub-images are normalized in size to obtain target region sub-images of uniform size; The target region sub-images with uniform size are input into the image encoder of the multimodal pre-trained model for feature encoding to obtain the feature vectors of each target region sub-image; The feature vectors are convolved, compressed, and enhanced to obtain the image semantic feature vectors of the corresponding target region sub-images.

4. The image retrieval method as described in claim 1, characterized in that, The multimodal query information input by the user is feature-encoded using the multimodal pre-trained model to generate a multimodal query vector, including: The query text in the multimodal query information is semantically encoded by the text encoder of the multimodal pre-trained model to obtain the query text feature vector; The image encoder of the multimodal pre-trained model performs semantic encoding on the case images in the multimodal query information to obtain the query image feature vector; wherein, the case images contain the target object to be queried; The query text feature vector and the query image feature vector are fused according to the preset modality weight parameters to obtain the multimodal query vector.

5. The image retrieval method as described in claim 4, characterized in that, The multimodal query vector is used to perform matching and retrieval in the feature database, and the retrieved target image is iteratively updated to obtain image retrieval results, including: Calculate the similarity between the multimodal query vector and each image semantic feature vector in the feature database, sort each image semantic feature vector from high to low similarity, and select the target images corresponding to the top-ranked image semantic feature vectors. The selected target images are labeled so that target images containing target regions are labeled as positive samples; The modal weight parameters are adaptively adjusted based on the multimodal query vector and the image semantic feature vector corresponding to the positive sample. Based on the adjusted modal weights, the multimodal query vectors are re-fused for matching and retrieval until the preset iteration termination condition is met, thus obtaining the image retrieval results.

6. The image retrieval method as described in claim 5, characterized in that, Based on the multimodal query vector and the image semantic feature vector corresponding to the positive sample, the modality weight parameters are adaptively adjusted, including: The text modality contribution is calculated based on the query text feature vector in the multimodal query vector and the image semantic feature vector corresponding to the positive sample. The image modality contribution is calculated based on the query image feature vector in the multimodal query vector and the image semantic feature vector corresponding to the positive sample. Based on the text modality contribution and the image modality contribution, the text modality weight and the image modality weight in the modality weight parameters are adaptively adjusted.

7. An image retrieval device, characterized in that, include: The image segmentation module is used to segment the target region of the image in the target video stream to obtain several target region sub-images; The image encoding module is used to encode the features of each of the target region sub-images using an image encoder based on a multimodal pre-trained model, thereby generating the image semantic feature vector of the corresponding target region sub-image. The feature database construction module is used to construct metadata of the corresponding target region sub-image based on the image semantic feature vector, and to construct the feature database based on the metadata of each target region sub-image; The query vector generation module is used to perform feature encoding on the multimodal query information input by the user through the multimodal pre-trained model to generate a multimodal query vector; The multimodal image retrieval module is used to perform matching retrieval in the feature database using the multimodal query vector, and to iteratively update the retrieved target images to obtain image retrieval results.

8. An image retrieval device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the image retrieval method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the image retrieval method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the image retrieval method according to any one of claims 1 to 6.