Target detection method, target detection model training method, device and equipment

CN117011539BActive Publication Date: 2026-10-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211347037.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-31
Publication Date
2026-10-27
Estimated Expiration
2042-10-31

AI Technical Summary

Technical Problem

[0004]相关技术中,样本聚合方式单一,目标检测模型提取特征的稳定性较差,目标检测的准确性较低

Benefits of technology

[0065]通过聚合类别相互独立的样本查询图像和样本辅助图像各自的特征,可以建立不同类别之间的关联关系,提升样本聚合的多样性和全面性;基于聚合后的特征和样本间差异信息对目标检测模型进行训练,可以使得目标检测模型学习跨类别的通用特征,提升了目标检测模型提取特征的稳定性和准确性,从而整体提升目标检测模型在应用侧进行目标检测的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117011539B_ABST
    Figure CN117011539B_ABST
Patent Text Reader

Abstract

The application discloses a target detection method, a training method and device of a target detection model, and belongs to the technical field of computers. The method comprises the following steps: acquiring a query image; inputting the query image into a trained target detection model to perform target detection, and obtaining an object detection result corresponding to the query image. The embodiments of the application can be applied to various scenes such as cloud technology, artificial intelligence, intelligent transportation and auxiliary driving. The technical scheme provided by the embodiments of the application can establish the association relationship between different categories by aggregating the respective features of the sample query images and the sample auxiliary images which are independent of each other, and can improve the diversity and comprehensiveness of sample aggregation; and the target detection model can be trained based on the aggregated features and sample difference information, so that the target detection model can learn the general features across categories, and the stability and accuracy of feature extraction of the target detection model are improved, thereby improving the accuracy of target detection of the target detection model on the application side.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a target detection method, a training method for a target detection model, an apparatus, and a device. Background Technology

[0002] With the development of computer technology and artificial intelligence, object detection, one of the main technologies in artificial intelligence, has been widely used in various fields. Object detection technology is used to locate objects in an image and provide their category information.

[0003] In related technologies, object detection models are typically trained on training datasets with a large amount of labeled data. During training, sample images corresponding to the same labeled category in the training dataset are aggregated together, allowing the model to learn the features corresponding to each category, and then achieve object detection by referring to the features of different categories.

[0004] Among related technologies, the sample aggregation method is singular, the stability of the feature extraction of the target detection model is poor, and the accuracy of target detection is low. Summary of the Invention

[0005] This application provides a target detection method, a target detection model training method, an apparatus, and a device, which can not only improve the diversity and comprehensiveness of sample aggregation, but also improve the stability and accuracy of feature extraction by the target detection model, thereby improving the overall accuracy of target detection.

[0006] According to one aspect of the embodiments of this application, a target detection method is provided, the method comprising:

[0007] Retrieve the query image;

[0008] The query image is input into a trained object detection model for object detection to obtain the object detection result corresponding to the query image;

[0009] The target detection model is a machine learning model trained based on the first aggregated feature between sample images and the sample difference information. The sample images include a sample query image and a sample auxiliary image. The first aggregated feature is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other.

[0010] According to one aspect of the embodiments of this application, a method for training an object detection model is provided, the method comprising:

[0011] Obtain a sample query image, a sample auxiliary image, and sample difference information. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other.

[0012] The sample query image and the sample auxiliary image are input into the initial target detection model to obtain the object detection result corresponding to the sample query image; wherein, the object detection result is the result detected based on the first aggregated feature, which is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively;

[0013] The object detection results and the sample difference information are compared to obtain the first model loss information;

[0014] Based on the loss information of the first model, the parameters of the initial target detection model are adjusted to obtain a trained target detection model.

[0015] According to one aspect of the embodiments of this application, a target detection apparatus is provided, the apparatus comprising:

[0016] The image acquisition module is used to acquire the query image;

[0017] The object detection module is used to input the query image into a trained object detection model for object detection and obtain the object detection result corresponding to the query image;

[0018] The target detection model is a machine learning model trained based on the first aggregated feature between sample images and the sample difference information. The sample images include a sample query image and a sample auxiliary image. The first aggregated feature is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other.

[0019] In some possible designs, the target detection model includes a feature extractor, a feature aggregation module, and a detection network, wherein the target detection module includes:

[0020] The feature extraction submodule is used to input the query image into the feature extractor for feature extraction processing to obtain query image features;

[0021] The auxiliary feature acquisition submodule is used to acquire auxiliary image features corresponding to preset object categories;

[0022] The feature aggregation submodule is used to input the query image features and the auxiliary image features into the feature aggregation module for feature aggregation processing to obtain the second aggregated feature;

[0023] The object detection submodule is used to input the second aggregated feature into the detection network for detection processing to obtain the object detection result.

[0024] In some possible designs, the feature aggregation module includes a feature encoder, and the feature aggregation submodule includes:

[0025] The feature distribution determination unit is used to input the auxiliary image features into the feature encoder for feature distribution prediction processing to obtain feature distribution information corresponding to the preset object category;

[0026] A variational feature sampling unit is used to sample and process the feature distribution information to obtain variational features;

[0027] The feature aggregation unit is used to aggregate the query image features and the variational features to obtain the second aggregated feature.

[0028] In some possible designs, the image acquisition module is also used to acquire multiple auxiliary images corresponding to a preset object category;

[0029] The feature extraction submodule is further configured to input multiple auxiliary images into the feature extractor for feature extraction processing to obtain image features corresponding to each of the multiple auxiliary images;

[0030] The auxiliary feature acquisition submodule is specifically used to perform fusion processing on the image features corresponding to each of the multiple auxiliary images to obtain the auxiliary image features.

[0031] According to one aspect of the embodiments of this application, a training apparatus for an object detection model is provided, the apparatus comprising:

[0032] The sample acquisition module is used to acquire a sample query image, a sample auxiliary image, and sample difference information. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other.

[0033] The sample detection module is used to input the sample query image and the sample auxiliary image into an initial target detection model to obtain the object detection result corresponding to the sample query image; wherein, the object detection result is the result detected based on a first aggregated feature, which is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively;

[0034] The loss information determination module is used to compare the object detection results with the sample difference information to obtain the first model loss information;

[0035] The parameter adjustment module is used to adjust the parameters of the initial target detection model based on the loss information of the first model, so as to obtain a trained target detection model.

[0036] In some possible designs, the initial target detection model includes a feature extractor, a feature aggregation module, and a detection network, wherein the sample detection module includes:

[0037] The sample feature extraction submodule is used to input the sample query image and the sample auxiliary image into the feature extractor for feature extraction processing, so as to obtain the query sample features corresponding to the sample query image and the auxiliary sample features corresponding to the sample auxiliary image;

[0038] The sample feature aggregation submodule is used to input the query sample features and the auxiliary sample features into the feature aggregation module for feature aggregation processing to obtain the first aggregated feature;

[0039] The sample object detection submodule is used to input the first aggregated features into the detection network for detection processing to obtain the object detection result.

[0040] In some possible designs, the feature aggregation module includes a feature encoder, and the sample feature aggregation submodule includes:

[0041] The sample feature distribution determination unit is used to input the auxiliary sample features into the feature encoder for feature distribution prediction processing to obtain the first feature distribution information corresponding to the auxiliary sample features;

[0042] A sample variational feature sampling unit is used to sample and process the first feature distribution information to obtain auxiliary sample variational features;

[0043] The sample feature aggregation unit is used to aggregate the query sample features and the auxiliary sample variational features to obtain the first aggregated feature.

[0044] In some possible designs, the device further includes:

[0045] The feature distribution acquisition module is used to acquire second feature distribution information, wherein the second feature distribution information characterizes the second feature distribution corresponding to the auxiliary sample variational features;

[0046] The loss information determination module is further configured to compare the second feature distribution information with the first feature distribution information to obtain the second model loss information;

[0047] The parameter adjustment module is specifically used to adjust the parameters of the initial target detection model based on the fusion loss information to obtain the target detection model. The fusion loss information includes the first model loss information and the second model loss information.

[0048] In some possible designs, the feature aggregation module further includes a feature decoder, and the device further includes:

[0049] The feature reconstruction module is used to input the variational features of the auxiliary samples into the feature decoder for feature reconstruction processing to obtain the reconstructed features corresponding to the auxiliary sample features;

[0050] The category prediction module is used to perform classification processing based on the reconstructed features to obtain the predicted category corresponding to the sample auxiliary image;

[0051] The label acquisition module is used to acquire the label category corresponding to the sample auxiliary image;

[0052] The loss information determination module is further configured to compare the predicted category with the label category to obtain third model loss information;

[0053] The parameter adjustment module is specifically used to adjust the parameters of the initial target detection model based on the fusion loss information to obtain the target detection model. The fusion loss information includes the first model loss information and the third model loss information.

[0054] In some possible designs, the device further includes:

[0055] The feature distance determination module is used to determine the feature distance between the reconstructed features and the auxiliary sample features;

[0056] The loss information determination module is further configured to determine fourth model loss information based on the feature distance, and the fusion loss information further includes the fourth model loss information.

[0057] In some possible designs, the sample query image is a sample image in the training dataset corresponding to a first category, where the first category refers to a label category with a sample number less than or equal to a first quantity threshold; the sample auxiliary image is a sample image in the training dataset corresponding to a second category, where the second category refers to a label category with a sample number greater than a second quantity threshold, where the second quantity threshold is greater than or equal to the first quantity threshold.

[0058] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the above-described target detection method.

[0059] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the above-described training method for the target detection model.

[0060] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored in the storage medium, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the above-described target detection method.

[0061] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored in the storage medium, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the above-described training method for the target detection model.

[0062] According to one aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform an action to implement the above-described target detection method.

[0063] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform a training method for the above-described target detection model.

[0064] The technical solution provided in this application can bring the following beneficial effects:

[0065] By aggregating the features of independent sample query images and sample auxiliary images, relationships between different categories can be established, enhancing the diversity and comprehensiveness of sample aggregation. Training the object detection model based on the aggregated features and the differences between samples allows the model to learn cross-category general features, improving the stability and accuracy of feature extraction and thus enhancing the overall accuracy of object detection in application scenarios. Attached Figure Description

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

[0067] Figure 1 This is a schematic diagram of an application runtime environment provided in one embodiment of this application;

[0068] Figure 2 This is a flowchart of a training method for an object detection model provided in one embodiment of this application. Figure 1 ;

[0069] Figure 3 This is a flowchart of a training method for an object detection model provided in one embodiment of this application. Figure 2 ;

[0070] Figure 4 This is a flowchart of a training method for an object detection model provided in one embodiment of this application. Figure 3 ;

[0071] Figure 5 An exemplary diagram illustrates the network framework of an object detection model;

[0072] Figure 6 An exemplary diagram comparing feature aggregation methods is shown;

[0073] Figure 7 An example is shown showing the confusion matrix diagrams corresponding to different feature aggregation methods;

[0074] Figure 8 Examples are shown of auxiliary feature visualization images corresponding to different feature aggregation methods;

[0075] Figure 9 This is a flowchart of a target detection method provided in one embodiment of this application. Figure 1 ;

[0076] Figure 10This is a flowchart of a target detection method provided in one embodiment of this application. Figure 2 ;

[0077] Figure 11 This is a flowchart of a target detection method provided in one embodiment of this application. Figure 3 ;

[0078] Figure 12 An example diagram of an object detection result is shown;

[0079] Figure 13 This is a block diagram of a target detection device provided in one embodiment of this application;

[0080] Figure 14 This is a block diagram of a training apparatus for an object detection model provided in one embodiment of this application;

[0081] Figure 15 This is a structural block diagram of a computer device provided in one embodiment of this application. Figure 1 ;

[0082] Figure 16 This is a structural block diagram of a computer device provided in one embodiment of this application. Figure 2 . Detailed Implementation

[0083] The embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving. The target detection method and target detection model training method provided in the embodiments of this application involve artificial intelligence technology, which will be briefly described below to facilitate understanding by those skilled in the art.

[0084] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0085] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0086] Computer vision (CV) is a science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes in recognizing and measuring targets, and further processes images to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), and common biometric recognition technologies such as facial recognition and fingerprint recognition.

[0087] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0088] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0089] Please refer to Figure 1 This diagram illustrates an application runtime environment provided in one embodiment of this application. The application runtime environment may include: terminal 10 and server 20.

[0090] Terminal 10 includes, but is not limited to, electronic devices such as mobile phones, computers, smart voice interaction devices, smart home appliances, in-vehicle terminals, aircraft, game consoles, e-book readers, multimedia playback devices, and wearable devices. Application clients can be installed on terminal 10.

[0091] In this embodiment, the application described above can be any application capable of image processing. Optionally, the application includes, but is not limited to, search applications, intelligent transportation applications, map applications, navigation applications, camera applications, social applications, interactive entertainment applications, browser applications, virtual reality (VR) applications, augmented reality (AR) applications, etc., and this embodiment does not limit this. Furthermore, the target objects detected in the image will differ for different applications, which can be pre-configured according to actual needs, and this embodiment does not limit this. Optionally, the terminal 10 runs a client of the aforementioned application.

[0092] Server 20 provides background services to clients of applications in terminal 10. For example, server 20 can be a background server for the aforementioned applications. Server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, server 20 can simultaneously provide background services to applications in multiple terminals 10.

[0093] Optionally, terminal 10 and server 20 can communicate with each other via network 30. Terminal 10 and server 20 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0094] Please refer to Figure 2 It illustrates the flow of a training method for an object detection model provided in one embodiment of this application. Figure 1 This method can be applied to computer devices, which refer to electronic devices with data computing and processing capabilities. For example, the entity executing each step can be... Figure 1 The application runtime environment shown is a terminal 10 or a server 20. The method may include the following steps (210-240).

[0095] Step 210: Obtain the sample query image, sample auxiliary image, and sample difference information.

[0096] Optionally, the above-mentioned sample query image is a sample image in the training dataset corresponding to the first category, where the first category refers to a label category whose sample number is less than or equal to a first quantity threshold.

[0097] Optionally, the aforementioned auxiliary sample image is a sample image in the training dataset corresponding to the second category, where the second category refers to a label category with a sample count greater than a second quantity threshold. The second quantity threshold is greater than or equal to the first quantity threshold.

[0098] In one possible implementation, the first category can be novel classes, and the second category can be base classes. A novel class refers to a class to which only a small number of labeled target objects belong in the training dataset, while a base class refers to a class to which a large number of labeled target objects belong in the training dataset. The union of the base classes and novel classes constitutes all the classes in a training dataset. The definitions of "small number" and "large number" can be set with reference to the actual labeling situation in the training dataset. Values ​​less than or equal to the first threshold are considered small, and values ​​greater than the second threshold are considered large.

[0099] In one possible implementation, the training dataset is constructed as follows: (1) Using the publicly available PASCALVOC (a name of an object detection dataset) and MS COCO (Common Objects in Context) object detection datasets, a portion of the categories in these two datasets are classified as basic categories, and another portion as novel categories; the test set containing all categories is used as test data. (2) 15 object categories from the PASCAL VOC dataset are randomly selected as basic categories, and another 5 categories are selected as novel categories. Similarly, 60 categories from the COCO dataset are randomly selected as basic categories, and another 20 categories are selected as novel categories.

[0100] Optionally, the object categories corresponding to the sample query image and the sample auxiliary image are independent of each other. This means that in subsequent feature aggregation, the aggregation method is class-agnostic aggregation (CAA).

[0101] In CAA (Content Aggregation Allocation), each query feature can be aggregated with auxiliary features of any category. For region of interest features of class i∈C... (i.e., query features) and a set of auxiliary features {S} j} j∈c CAA randomly selects category j * Corresponding auxiliary features With query features Aggregation, to obtain aggregated features Formula (1) is as follows:

[0102]

[0103] Where m represents the region of interest identifier in the query image, and C represents the category set. This indicates aggregation. Aggregated features can be used in subsequent detection. Input to detection network F D Output classification scores And it still uses the label of class i for supervision.

[0104] This category-independent aggregation method can establish strong relationships between different categories. Under this method, the query sample features corresponding to the query image can be aggregated with the auxiliary sample features corresponding to the auxiliary images of any category. As a result, the model can learn general features across categories, which helps the model quickly transfer features from basic categories to object recognition and detection of novel categories.

[0105] Optionally, the aforementioned sample difference information characterizes the label category difference between the sample query image and the sample auxiliary image. In a specific implementation, the sample difference information can be determined based on the label categories corresponding to the sample query image and the sample auxiliary image, respectively. For example, each category has a corresponding category identifier. The annotation data corresponding to the sample query image includes the category identifier corresponding to the object in the sample query image, that is, it characterizes the label category corresponding to the sample query image; similarly, the annotation data corresponding to the sample auxiliary image includes the category identifier corresponding to the object in the sample auxiliary image, that is, it characterizes the label category corresponding to the sample auxiliary image. By comparing the two identifiers, the aforementioned sample difference information can be obtained.

[0106] Step 220: Input the sample query image and the sample auxiliary image into the initial target detection model to obtain the object detection result corresponding to the sample query image.

[0107] The object detection result is the result detected based on the first aggregated feature, which is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively.

[0108] Optionally, the initial object detection model described above is a few-shot object detection model to be trained. Few-shot object detection refers to a model trained on a basic category with a large amount of labeled data, which, through certain methods, can be quickly transferred to the recognition of novel categories with only a small number of samples, thereby maximizing the recognition performance of novel categories.

[0109] Optionally, the initial object detection model described above can be trained using meta-learning. Meta-learning is a learning paradigm that mimics the ability of organisms to quickly learn new, unseen things by utilizing previously existing knowledge. The goal of meta-learning is to leverage learned information to quickly adapt to new, unlearned tasks.

[0110] In an exemplary embodiment, such as Figure 3 As shown, step 220 above may include the following steps (221-223), Figure 3 The flowchart of a training method for an object detection model provided in one embodiment of this application is shown. Figure 2 .

[0111] Step 221: Input the sample query image and the sample auxiliary image into the feature extractor for feature extraction processing to obtain the query sample features corresponding to the sample query image and the auxiliary sample features corresponding to the sample auxiliary image.

[0112] The aforementioned query sample features and auxiliary sample features can be the deep feature maps or feature vectors obtained by passing the query image and the auxiliary image through their respective feature encoding networks (such as ResNet (Residual Network)). Query sample features can be the deep feature map or feature vector obtained by passing the query image through the corresponding feature encoding network. Auxiliary sample features can be the deep feature map or feature vector obtained by passing the auxiliary image through the corresponding feature encoding network.

[0113] Optionally, the feature extractor described above is based on the Faster R-CNN (Faster Region Convolutional Neural Network) model. The Faster R-CNN model is a two-stage object detection network model. Optionally, the feature extractor (such as the Faster R-CNN model) includes a backbone network, a Region Proposal Network (RPN), and a RoI Head (Region of Interest Head) network.

[0114] The Region Generation Network (RON) is used to filter out bounding boxes that may contain target objects. The RoI Head is used to trim the candidate bounding boxes obtained in the RPN stage (RoI Align, or Region of Interest Align), and outputs the regression and classification predictions of the candidate bounding boxes through several fully connected (FC) layers. Specifically, RoI Align trims the candidate bounding boxes with higher scores found by the RPN according to an appropriate ratio.

[0115] The feature map described above is obtained by convolving the input image with a filter. New feature maps can be generated by convolving the feature map with a filter.

[0116] Optionally, the aforementioned query sample features or auxiliary sample features are region features. Query sample features can be region features corresponding to candidate boxes determined based on the query image, and auxiliary sample features can be region features corresponding to candidate boxes determined based on the auxiliary image. Region features refer to the deep features obtained after mapping through RoI Align and a fully connected layer, which are used for subsequent classification and regression of the targets they contain.

[0117] Step 222: Input the query sample features and auxiliary sample features into the feature aggregation module for feature aggregation processing to obtain the first aggregated feature.

[0118] Optionally, the above object detection model is a few-shot object detection model based on variational feature encoding; correspondingly, the above feature aggregation module is a variational feature aggregation (VFA) module. Optionally, the goal of variational feature aggregation is to transform the sample auxiliary features into a class distribution and sample variational features from the class distribution for feature aggregation.

[0119] In an exemplary embodiment, such as Figure 4 As shown, step 222 above may include the following steps (2221-2223), Figure 4 The flowchart of a training method for an object detection model provided in one embodiment of this application is shown. Figure 3 .

[0120] Step 2221: Input the auxiliary sample features into the feature encoder for feature distribution prediction processing to obtain the first feature distribution information corresponding to the auxiliary sample features.

[0121] Optionally, the aforementioned first feature distribution information includes parameter data corresponding to the feature distribution parameters. Optionally, the feature distribution parameters include μ and σ. μ is the location parameter of the distribution, representing the location of the central tendency; σ is the shape parameter of the distribution, representing the dispersion of the data distribution. The larger σ is, the more dispersed the data distribution; the smaller σ is, the more concentrated the data distribution.

[0122] Optionally, the aforementioned feature encoder is a relatively lightweight encoder, which can be used with F... enc The feature encoder can optionally contain one linear layer and two parallel linear layers, producing μ and σ respectively. By default, the model maintains the same dimensions for all layers.

[0123] The aforementioned feature encoder can be a variational autoencoder (VAE). After the auxiliary sample features are input into the VAE, the VAE can construct a feature distribution based on these features. This feature distribution corresponds to the feature distribution of the auxiliary sample categories. The auxiliary sample categories are the label categories corresponding to the auxiliary images of the samples. The VFA constructs a Gaussian distribution for each category using the VAE and estimates the parameters of the distribution using the VAE.

[0124] Step 2222: Sample the first feature distribution information to obtain auxiliary sample variational features.

[0125] VFA can sample robust class-level auxiliary features from the determined feature distribution, namely the aforementioned auxiliary sample variational features.

[0126] Step 2223: Aggregate the query sample features and the auxiliary sample variational features to obtain the first aggregated feature.

[0127] VFA follows the class-independent approach of CAA, aggregating query feature Q with variational feature z. In one example, given query feature Q of class i... i Auxiliary features S of class j j VFA first approximates the class distribution. And sample variational features z from them j =μ j +σ j from Then they are aggregated together using the following formula (2):

[0128]

[0129] Where ⊙ represents channel multiplication, and sig is an abbreviation for sigmoid (activation) operation. Indicates aggregation, This indicates aggregation features.

[0130] The technical solution provided in this application learns a feature distribution for each category and samples variational features from this feature distribution for feature aggregation. In this way, the model can learn a more robust feature representation with only a small number of samples, thereby improving the performance of target detection with few samples.

[0131] In one example, such as Figure 5As shown, this example illustrates a schematic diagram of the network framework of an object detection model. Optionally, the above object detection model is a few-shot object detection model based on meta-learning. Optionally, the object detection model uses ResNet50 as the backbone network, Meta R-CNN (Meta Region Convolutional Neural Network) as the baseline network, and adds class-independent aggregation and variational feature aggregation modules on top of it. In some scenarios, a vision transformer-based backbone network can also be used to further improve the robustness of the model.

[0132] The object detection model has two sets of inputs: a query image 51 and a set of auxiliary images 52. The query image 51 and a set of auxiliary images 52 are then input into two parallel feature extractors (F...). Q )53 and Feature Extractor (F S After step 54, query feature 55 and auxiliary feature 56 are obtained. Then, the query feature (Q) 55 and auxiliary feature (S) 56 are aggregated by the feature aggregation module 57, and the object detection model can output the final prediction result based on the aggregated features.

[0133] Feature aggregation is crucial for few-shot object detection based on meta-learning. One possible implementation uses Class-Specific Aggregation (CSA) to aggregate features of the same class. With CSA, for each training iteration, the model selects an auxiliary feature of the same class as the query feature for aggregation. However, CSA has the following problems: 1) CSA cannot fully utilize the relationships between classes. 2) The learned features are relatively unrobust. Especially when data is scarce, the performance of the object detection model is highly correlated with the quality of the support set; if the learned features are not robust, the performance of the object detection model will be severely affected.

[0134] In another possible implementation, category-independent aggregation (CAA) is used to establish strong relationships between categories, thus addressing the problems inherent in the CSA approach. In CAA, query features can be aggregated with auxiliary features from any category. This approach is more realistic; although auxiliary features and query features belong to different categories, they share many similarities. Aggregating only features from the same category would ignore similarities between different categories. By aggregating features from any category, the model can learn general cross-category features, facilitating rapid transfer to the recognition of new categories.

[0135] In one example, such as Figure 6 As shown, it illustrates a schematic diagram comparing feature aggregation methods. Among them, Figure 6 The left side shows the feature aggregation process under the CSA method. If the category of the sample query image 61 is "dog", then the category of the set of sample auxiliary images 62 aggregated with the sample query image 61 is also "dog". Figure 6 The left side shows the feature aggregation process under CAA. The category of the sample query image 61 is "dog", and the category of the set of sample auxiliary images 63 aggregated with the sample query image 61 can be any category, such as "cat".

[0136] Furthermore, based on the aforementioned CAA, the feature aggregation module 57 employs variational feature aggregation to aggregate the query feature 55 and auxiliary feature 56. In variational feature aggregation, the auxiliary features are transformed into a distribution of categories. Specifically, the feature aggregation module 57 includes a variational autoencoder (F... enc 571, a Gaussian distribution (N(μ, σ)) is established for each category by a variational autoencoder 571, and the parameters μ and σ of this distribution are determined. μ is the location parameter of the distribution, characterizing the location of the central tendency; σ is the shape parameter of the distribution, characterizing the dispersion of the data distribution. A larger σ indicates a more dispersed data distribution, while a smaller σ indicates a more concentrated data distribution. By determining the parameters of the above distribution, the VFA-based feature aggregation module 57 can sample robust category-level auxiliary variational features (Z) 58 from this distribution. Finally, the auxiliary variational features 58 are combined with the query features 55 and input into the detection network (F). D )59, which can produce more robust and bias-free prediction results.

[0137] Step 223: Input the first aggregated feature into the detection network for detection processing to obtain the object detection result.

[0138] Optionally, the detection network can be a classification network. After the first aggregated feature is input into the detection network, the classification score corresponding to the sample query image can be output. The object detection result includes the classification score corresponding to the sample query image. The classification score represents the similarity between the sample query image and the sample auxiliary image.

[0139] The technical solution provided in this application, by aggregating query sample features and auxiliary sample features that are independent of each other, enables the object detection model to learn the correlation between different categories during training, thereby improving object detection performance.

[0140] Step 230: Compare the object detection results with the sample difference information to obtain the first model loss information.

[0141] The classification scores described above characterize the similarity between the query image and the auxiliary image, while the sample difference information characterizes the label category differences between the query image and the auxiliary image. For query images and auxiliary images belonging to the same category, the model training objective is to output a higher classification score; for query images and auxiliary images belonging to different categories, the model training objective is also to output a higher classification score.

[0142] The first model loss information, determined by comparing the object detection results and sample difference information, can characterize the model's classification and detection error. This first model loss information can be the model's classification loss information, including the classification loss value. A larger classification loss value indicates a larger model classification and detection error, requiring further iterative training to reduce the model's classification loss.

[0143] like Figure 5 As shown, the detection network (F) D After outputting the object detection results, the classification loss (L) can be determined. cls ), which is the loss information of the first model mentioned above.

[0144] Step 240: Based on the loss information of the first model, the parameters of the initial target detection model are adjusted to obtain the trained target detection model.

[0145] Optionally, before training, the backbone network ResNet in the feature extractor of the initial object detection model is initialized with ImageNet pre-trained parameters, while the rest of the initial object detection model can use randomly initialized parameters.

[0146] On the model training side, stochastic gradient descent (SGD) can be used to solve for the convolutional template parameters w and bias parameters b of the neural network model. In each iteration, the prediction error (i.e., model loss information) is calculated and backpropagated to the convolutional neural network model to calculate the gradient and update the parameters of the convolutional neural network model.

[0147] In one possible implementation, the model is trained using 8 GPUs with SGD as the gradient optimizer. The batch size is set to 16 images, with two images per GPU.

[0148] Optionally, the training of the initial object detection model described above includes two stages. The first stage is base class training, which trains a general detector, i.e., the feature extractor in the initial object detection model, on the base classes. The learning rate for the first stage is set to 0.02. The second stage is a few-sample fine-tuning stage, which trains only on a few samples, and the learning rate for the second stage is set to 0.001.

[0149] In an exemplary embodiment, the loss information corresponding to the target detection model includes, in addition to the aforementioned first model loss information, second model loss information; correspondingly, as... Figure 4 As shown, after step 2221 above, the following steps (301-302) are also included.

[0150] Step 301: Obtain the second feature distribution information.

[0151] The second feature distribution information represents the second feature distribution corresponding to the variational features of the auxiliary samples. The second feature distribution can be the true posterior distribution corresponding to the variational features of the auxiliary samples.

[0152] Step 302: Compare the second feature distribution information with the first feature distribution information to obtain the second model loss information.

[0153] The aforementioned second model loss information refers to the feature distribution loss between the second feature distribution and the first feature distribution.

[0154] VFA assumes that the auxiliary sample variational feature z is generated from its corresponding prior distribution p(z), and the auxiliary sample feature S is generated from the conditional distribution p(S|z). Since this process is hidden and the auxiliary sample variational feature z is unknown, VFA uses variational inference to model the posterior distribution, i.e., to generate the first feature distribution determined by the aforementioned first feature distribution information.

[0155] More specifically, VFA approximates the true posterior distribution p(z|S) by minimizing the Kullback-Leibler (KL) divergence using another modeled distribution q(z|S), i.e., the first feature distribution mentioned above, as shown in Equation (3):

[0156]

[0157] At this point, the above formula (3) is similar to the following evidence lower bound (ELBO), as shown in formula (4):

[0158]

[0159] Here we assume that the prior distribution of z is a centrally located isotropic multivariate Gaussian distribution. Let the predicted posterior distribution q(z|S), i.e. the first feature distribution mentioned above, be a multivariate Gaussian distribution with diagonal covariance: The parameters μ and σ can be obtained from the feature encoder F. enc :μ,σ=F enc (S) is implemented. Then, the variational feature z = μ + σ·∈ is obtained through a reparameterization technique, where...

[0160] The first term of ELBO can be simplified to the reconstruction loss L. rec The subsequent determined loss information for the fourth model can be the reconstruction loss L. rec Optionally, the reconstruction loss L rec L2 distance (Euclidean distance) is defined as the distance between auxiliary sample features S and reconstructed features S′. Optionally, the reconstruction loss L is determined. rec Formula (5) is as follows:

[0161] L rec =||SS′||=||SF dec (z)|| Formula (5)

[0162] Where F dec This indicates a feature decoder.

[0163] Regarding the second term of ELBO, VFA directly minimizes the KL divergence between q(z|S) and p(z), ensuring that the auxiliary sample variational feature z follows a normal distribution. Optionally, the feature distribution loss between the second and first feature distributions is the KL divergence between the first feature distribution q(z|S) and the prior distribution p(z) corresponding to the auxiliary sample variational feature, i.e., D. KL (q(z∣S)||p(z)).

[0164] like Figure 5 As shown, after the variational autoencoder 571 outputs the parameters μ and σ of the feature distribution, the feature distribution loss (L) can be determined. KL This refers to the loss information of the second model mentioned above.

[0165] By optimizing L rec and L KL With these two objectives, VFA can transform the auxiliary sample features S into the first feature distribution. Then you can start from Variational features z of auxiliary samples from medium sampling.

[0166] After determining the loss information of the second model mentioned above, accordingly, such as Figure 4 As shown, step 240 above can be replaced by step 241 below.

[0167] Step 241: Based on the fusion loss information, the parameters of the initial target detection model are adjusted to obtain the target detection model.

[0168] Optionally, the fused loss information includes the first model loss information and the second model loss information.

[0169] Optionally, the above-mentioned first model loss information and second model loss information can be fused, for example, by adding them together or by weighted addition, to obtain the above-mentioned fused loss information.

[0170] By introducing the aforementioned second model loss information as a constraint, the model can learn a more accurate class-level feature distribution based on a small amount of labeled data during training. This improves the accuracy and stability of feature extraction within the object detection model, helps enhance the accuracy of object detection, and reduces the model's dependence on the amount of labeled data during training.

[0171] In an exemplary embodiment, the feature aggregation module further includes a feature decoder, and the aforementioned fusion loss information also includes third model loss information. Accordingly, as... Figure 4 As shown, after step 2222 above, the following steps (303-306) are also included.

[0172] Step 303: Input the variational features of the auxiliary samples into the feature decoder for feature reconstruction processing to obtain the reconstructed features corresponding to the auxiliary sample features.

[0173] VFA also introduces a feature decoder F. dec Optionally, F dec It consists of two linear layers to generate the reconstructed feature S′. Although optimizing L... rec and L KL These are the two objectives, but the auxiliary sample variational features z still lack classification information, and VFA will result in a consistency loss L. cons That is, the third model loss described below is applied to reconstruct feature S′.

[0174] In one possible implementation, a balance between accuracy and speed is achieved by adjusting the parameters of the feature encoder and feature decoder in the VFA.

[0175] Step 304: Perform classification processing based on the reconstructed features to obtain the predicted category corresponding to the sample auxiliary image.

[0176] By inputting the reconstructed features into a linear classifier, the predicted category corresponding to the sample auxiliary image predicted based on the reconstructed features can be obtained.

[0177] Step 305: Obtain the label category corresponding to the sample auxiliary image.

[0178] The label category corresponding to the above sample auxiliary image is the true category corresponding to the sample auxiliary image.

[0179] Step 306: Compare the predicted category with the label category to obtain the loss information of the third model.

[0180] By comparing the differences between the predicted categories and the label categories, the loss information of the third model can be obtained.

[0181] Optionally, the loss information of the third model mentioned above is the consistency loss L between the predicted category and the label category. cons Specifically, the consistency loss mentioned above is the cross-entropy loss between the reconstructed feature S′ and the label category c, and is determined by formula (6) as follows:

[0182]

[0183] in, L represents the linear classifier corresponding to the reconstructed feature S′. CE It is the cross-entropy loss between reconstructing feature S′ and label category c. L cons The introduction of auxiliary sample features (S) allows the model to transform the learned feature distribution into a distribution specific to a particular class. i Used to estimate the parameterized distribution of class i This allows the auxiliary sample variational feature z to retain classification information.

[0184] By introducing the aforementioned third model loss information to constrain the variational features, the model can learn a more accurate class-level feature distribution through feature reconstruction and retain classification information in the variational features, thereby improving the accuracy of feature extraction within the object detection model and ultimately enhancing the accuracy of object detection in applications.

[0185] In an exemplary embodiment, the aforementioned fusion loss information further includes fourth model loss information. Accordingly, as... Figure 4 As shown, after step 303 above, the following steps (307-308) are also included.

[0186] Step 307: Determine the feature distance between the reconstructed features and the auxiliary sample features.

[0187] Optionally, the feature distance mentioned above is the L2 distance (Euclidean distance) between the reconstructed features and the auxiliary sample features.

[0188] Step 308: Determine the loss information of the fourth model based on the feature distance.

[0189] The fourth model loss information can be the reconstruction loss L between the reconstructed features and the auxiliary sample features. rec Optionally, the aforementioned Euclidean distance can be defined as the aforementioned reconstruction loss L. rec .

[0190] like Figure 5 As shown, after generating auxiliary variational feature 58, the auxiliary variational feature 58 is input into the feature decoder (F). dec )572 outputs the reconstruction feature (S')510, and the reconstruction loss (L) can be determined based on the reconstruction feature 510. rec ) and cross-entropy loss (L consAmong them, reconstruction loss (L) rec This refers to the loss information of the fourth model mentioned above, namely the cross-entropy loss (L). cons This refers to the loss information of the third model mentioned above.

[0191] By introducing fourth model loss information to constrain the reconstructed features, the model can learn a more accurate class-level feature distribution, thereby extracting more accurate variational features, which helps improve the accuracy of target detection in the application side of the model.

[0192] Accordingly, based on the first model loss information, the second model loss information, the third model loss information, and the fourth model loss information, the fusion loss information can be determined, and then the initial target detection model can be trained end-to-end based on the fusion loss information.

[0193] Optionally, the above fusion loss can be the fusion loss L, which is specifically determined by the following formula (7):

[0194] L = L rpn +L reg +L cls +L cons +L rec +αL KL Formula (7)

[0195] Among them, L rpn It is the total loss of RPN, L reg It is regression loss, L cls It is classification loss, L cons It is a consistency loss, L rec It is a reconstruction loss, L KL It is the feature distribution loss, and α is the weight coefficient.

[0196] Based on the fusion loss information mentioned above, after adjusting the parameters of the initial target detection model, if the fusion loss information of the adjusted target detection model meets the conditions, such as the fusion loss being less than a preset threshold, the training can be terminated. The target detection model after the training is terminated is the trained target detection model.

[0197] In addition, the trained object detection model can be tested using a test dataset to verify its effectiveness. Some test results are listed below.

[0198] In one example, such as Figure 7 As shown, it exemplifies the confusion matrix diagram corresponding to different feature aggregation methods. Figure 7 The data shows the inter-class identification data for CSA, CAA, and VFA, demonstrating that CAA and VFA can effectively reduce inter-class confusion and increase intra-class compactness.

[0199] In another example, such as Figure 8 As shown, this example illustrates the visualization of auxiliary features corresponding to different feature aggregation methods. Image 81 shows the distribution of auxiliary features in the feature space under the CSA method, image 82 shows the distribution of auxiliary features in the feature space under the CAA method, and image 83 shows the distribution of auxiliary features in the feature space under the VFA method. Comparing these three images, it is clear that the features obtained under the CAA and VFA methods are more dispersed, meaning they are better able to represent the general features across categories.

[0200] In summary, the technical solution provided in this application can establish the association between different categories by aggregating the features of independent sample query images and sample auxiliary images, thereby improving the diversity and comprehensiveness of sample aggregation. By training the target detection model based on the aggregated features and the difference information between samples, the target detection model can learn cross-category general features, improving the stability and accuracy of feature extraction by the target detection model, and thus improving the overall accuracy of the target detection model in target detection on the application side.

[0201] Especially in scenarios involving few-sample object detection, the number of targets in few-sample categories is small, and they vary greatly in pose, viewpoint, and background, resulting in unstable features. Identifying new categories with only a limited amount of labeled data is particularly challenging. The technical solution provided in this application proposes a category-independent feature aggregation (CAA) method, which can aggregate query features and supporting features from any category. This category-independent aggregation method establishes closer class relationships between different classes and incentivizes the model to learn class-general features, enabling the model to quickly transfer features from the base category to the novel category. Under this configuration, the object detection model achieves high detection accuracy on both the base and novel categories, while reducing confusion between the novel and base categories. This can also be seen from… Figure 7 This can be seen from the text.

[0202] Secondly, the technical solution provided in this application performs variational feature aggregation (VFA) on top of CAA, which transforms sample-level auxiliary features into more robust category-level variational features. For each category, the model learns a feature distribution during training and samples variational features from the distribution for feature aggregation. In this way, the model can learn a relatively complete feature space distribution of novel categories with only a few samples, obtaining more robust feature representations, thereby improving the performance of target detection with few samples and increasing model training efficiency.

[0203] In summary, the technical solution provided in this application accelerates model training and testing while reducing computational resource consumption by adjusting the aggregation method between query features and auxiliary features and optimizing the detector's basic code. The trained object detection model can be used in image-related content understanding and other detection-related applications. It not only reduces the model's reliance on large amounts of annotation but also improves the model's recognition performance in scenarios with few samples, giving the model the ability to rapidly expand. Furthermore, the object detection model can be trained and tested end-to-end without complex training and post-processing stages, making it easy to deploy and use.

[0204] Please refer to Figure 9 It illustrates the flow of a target detection method provided in one embodiment of this application. Figure 1 This method can be applied to computer devices, which refer to electronic devices with data computing and processing capabilities. For example, the entity executing each step can be... Figure 1 The application runtime environment shown is a terminal 10 or a server 20. The method may include the following steps (910-920).

[0205] Step 910: Obtain the query image.

[0206] The query image mentioned above is the input image to be detected. This application does not limit the source of the query image. The query image can be an image uploaded via the network, an image captured by the device's camera, or an image stored in the device's memory.

[0207] In the scenario of few-shot object detection, the query image and the support image mentioned above are two input images for few-shot object detection based on meta-learning. The support image is used to assist in the identification of target objects in the query image. Optionally, the support image is fused with the query image in a certain way (by class-independent aggregation), and the fused features are used to identify target objects of a specific category (the category corresponding to the support image).

[0208] Step 920: Input the query image into the trained object detection model to perform object detection and obtain the object detection result corresponding to the query image.

[0209] The object detection model is a machine learning model trained based on the first aggregated feature between sample images and the sample difference information. The sample images include the sample query image and the sample auxiliary image. The first aggregated feature is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively. The sample difference information represents the difference in label categories between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other.

[0210] The trained target detection model described above is a target detection model trained using the training method provided in the above training method implementation examples.

[0211] In an exemplary embodiment, the above-described target detection model includes a feature extractor, a feature aggregation module, and a detection network; correspondingly, as... Figure 10 As shown, step 920 above may include the following steps (921-924). Figure 10 The flowchart of a target detection method provided in one embodiment of this application is shown. Figure 2 .

[0212] Step 921: Input the query image into the feature extractor for feature extraction processing to obtain the query image features.

[0213] The feature extraction process described above is consistent with that on the training side. The RPN predicts bounding boxes in the query image, then extracts the image features of the regions corresponding to the predicted bounding boxes, and uses these features as the query image features.

[0214] Step 922: Obtain auxiliary image features corresponding to the preset object category.

[0215] The aforementioned preset object categories refer to multiple preset object categories, and the aforementioned object detection model can detect these multiple preset object categories.

[0216] The auxiliary image features corresponding to each object category can be the average features of all auxiliary images under that object category.

[0217] Optionally, the aforementioned auxiliary image features can be predetermined and do not require real-time calculation.

[0218] In an exemplary embodiment, such as Figure 10 As shown, step 922 above may include the following steps (9221 to 9223).

[0219] Step 9221: Obtain multiple auxiliary images corresponding to the preset object categories.

[0220] The multiple auxiliary images corresponding to the aforementioned preset object categories refer to multiple auxiliary images of the target object that includes the preset object category.

[0221] Step 9222: Input multiple auxiliary images into the feature extractor for feature extraction processing to obtain the image features corresponding to each of the multiple auxiliary images.

[0222] Optionally, feature extraction processing can be performed on the regions of the target objects corresponding to the aforementioned preset object categories in multiple auxiliary images, thereby obtaining multiple image features corresponding to the preset object categories.

[0223] Step 9223: Perform image feature fusion processing on the image features corresponding to each of the multiple auxiliary images to obtain auxiliary image features.

[0224] By averaging the above multiple image features, auxiliary image features for the preset image category can be obtained.

[0225] The technical solution provided in this application embodiment can obtain class-level auxiliary features by fusing multiple auxiliary features of each category. In this way, when performing feature aggregation, only the query features and class-level auxiliary features need to be aggregated, which effectively improves the efficiency of feature aggregation and target detection.

[0226] Step 923: Input the query image features and auxiliary image features into the feature aggregation module for feature aggregation processing to obtain the second aggregated features.

[0227] By performing feature aggregation processing on the query image features and the auxiliary image features corresponding to each object category, the second aggregated features corresponding to each object category can be obtained.

[0228] In an exemplary embodiment, the feature aggregation module described above includes a feature encoder; correspondingly, as... Figure 11 As shown, step 923 above may include the following steps (9231-9233), Figure 11 The flowchart of a target detection method provided in one embodiment of this application is shown. Figure 3 .

[0229] Step 9231: Input the auxiliary image features into the feature encoder for feature distribution prediction processing to obtain the feature distribution information corresponding to the preset object category.

[0230] The feature encoder described above can output parameter data of the feature distribution corresponding to the preset object category, and the feature distribution corresponding to the preset object category can be determined based on the parameter data.

[0231] Step 9232: Sample the feature distribution information to obtain variational features.

[0232] For example, averaging the K auxiliary features (i.e., image features) of category j into an average auxiliary feature. In the middle, estimate the distribution corresponding to category j. The parameters are used to generate the variational feature z.

[0233] Step 9233: Aggregate the query image features and variational features to obtain the second aggregated feature.

[0234] The technical solution provided in this application aggregates features through variational feature aggregation, which can convert auxiliary features into more robust category-level variational features. This effectively improves the performance of the object detection model for detecting objects with few samples.

[0235] Step 924: Input the second aggregated feature into the detection network for detection processing to obtain the object detection result.

[0236] Optionally, the second aggregated features corresponding to each object category are input into the detection network for detection processing to obtain the detection score of the query image corresponding to each object category. The detection score corresponding to each object category represents the probability that the target object in the query image belongs to that object category.

[0237] By comparing different detection scores, the object category corresponding to the query image can be determined. Optionally, the object category corresponding to the highest detection score is determined as the object category corresponding to the predicted bounding box in the query image, and this predicted bounding box can be used as the location of the target object.

[0238] The technical solution provided in this application embodiment can accurately detect the correspondence between the query image and the preset category by aggregating query features and auxiliary features of preset categories, thereby obtaining object detection results and effectively improving the efficiency and accuracy of target detection.

[0239] In one example, such as Figure 12 As shown, it exemplifies a schematic diagram of an object detection result. Figure 12 The diagram shows some of the detection results for the images. Figure 12 After object detection is performed on each image, the object detection model labels the bounding box of the target object in each image, and also labels the corresponding category and probability of the target object. Figure 12 As can be seen from the detection results corresponding to each image shown, the technical solution provided in this application embodiment can achieve good target detection results.

[0240] In summary, the technical solution provided in this application can establish the association between different categories by aggregating the features of independent sample query images and sample auxiliary images, thereby improving the diversity and comprehensiveness of sample aggregation. By training the target detection model based on the aggregated features and the difference information between samples, the target detection model can learn cross-category general features, improving the stability and accuracy of feature extraction by the target detection model, and thus improving the overall accuracy of the target detection model in target detection on the application side.

[0241] The following are embodiments of the apparatus of this application, which can be used to execute embodiments of the method of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method of this application.

[0242] Please refer to Figure 13 This diagram illustrates a block diagram of a target detection apparatus according to an embodiment of this application. The apparatus has the function of implementing the above-described target detection method; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus can be a computer device or can be installed within a computer device. The apparatus 1300 may include:

[0243] Image acquisition module 1310 is used to acquire the query image;

[0244] The object detection module 1320 is used to input the query image into a trained object detection model for object detection and obtain the object detection result corresponding to the query image;

[0245] The target detection model is a machine learning model trained based on the first aggregated feature between sample images and the sample difference information. The sample images include a sample query image and a sample auxiliary image. The first aggregated feature is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other.

[0246] In some possible designs, the target detection model includes a feature extractor, a feature aggregation module, and a detection network. The target detection module 1320 includes:

[0247] The feature extraction submodule is used to input the query image into the feature extractor for feature extraction processing to obtain the query image features;

[0248] The auxiliary feature acquisition submodule is used to acquire auxiliary image features corresponding to preset object categories;

[0249] The feature aggregation submodule is used to input the query image features and the auxiliary image features into the feature aggregation module for feature aggregation processing to obtain the second aggregated feature;

[0250] The object detection submodule is used to input the second aggregated feature into the detection network for detection processing to obtain the object detection result.

[0251] In some possible designs, the feature aggregation module includes a feature encoder, and the feature aggregation submodule includes:

[0252] The feature distribution determination unit is used to input the auxiliary image features into the feature encoder for feature distribution prediction processing to obtain feature distribution information corresponding to the preset object category;

[0253] A variational feature sampling unit is used to sample and process the feature distribution information to obtain variational features;

[0254] The feature aggregation unit is used to aggregate the query image features and the variational features to obtain the second aggregated feature.

[0255] In some possible designs, the image acquisition module 1310 is also used to acquire multiple auxiliary images corresponding to a preset object category;

[0256] The feature extraction submodule is further configured to input multiple auxiliary images into the feature extractor for feature extraction processing to obtain image features corresponding to each of the multiple auxiliary images;

[0257] The auxiliary feature acquisition submodule is specifically used to perform fusion processing on the image features corresponding to each of the multiple auxiliary images to obtain the auxiliary image features.

[0258] In summary, the technical solution provided in this application can establish the association between different categories by aggregating the features of independent sample query images and sample auxiliary images, thereby improving the diversity and comprehensiveness of sample aggregation. By training the target detection model based on the aggregated features and the difference information between samples, the target detection model can learn cross-category general features, improving the stability and accuracy of feature extraction by the target detection model, and thus improving the overall accuracy of the target detection model in target detection on the application side.

[0259] Please refer to Figure 14This diagram illustrates a block diagram of a training apparatus for an object detection model according to an embodiment of this application. The apparatus has the function of implementing the training method for the object detection model described above; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus can be a computer device or can be installed within a computer device. The apparatus 1400 may include:

[0260] The sample acquisition module 1410 is used to acquire a sample query image, a sample auxiliary image, and sample difference information. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other.

[0261] The sample detection module 1420 is used to input the sample query image and the sample auxiliary image into an initial target detection model to obtain the object detection result corresponding to the sample query image; wherein, the object detection result is the result detected based on a first aggregated feature, which is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively;

[0262] The loss information determination module 1430 is used to compare the object detection result with the sample difference information to obtain the first model loss information;

[0263] The parameter adjustment module 1440 is used to adjust the parameters of the initial target detection model based on the first model loss information to obtain a trained target detection model.

[0264] In some possible designs, the initial target detection model includes a feature extractor, a feature aggregation module, and a detection network, and the sample detection module 1420 includes:

[0265] The sample feature extraction submodule is used to input the sample query image and the sample auxiliary image into the feature extractor for feature extraction processing, so as to obtain the query sample features corresponding to the sample query image and the auxiliary sample features corresponding to the sample auxiliary image;

[0266] The sample feature aggregation submodule is used to input the query sample features and the auxiliary sample features into the feature aggregation module for feature aggregation processing to obtain the first aggregated feature;

[0267] The sample object detection submodule is used to input the first aggregated features into the detection network for detection processing to obtain the object detection result.

[0268] In some possible designs, the feature aggregation module includes a feature encoder, and the sample feature aggregation submodule includes:

[0269] The sample feature distribution determination unit is used to input the auxiliary sample features into the feature encoder for feature distribution prediction processing to obtain the first feature distribution information corresponding to the auxiliary sample features;

[0270] A sample variational feature sampling unit is used to sample and process the first feature distribution information to obtain auxiliary sample variational features;

[0271] The sample feature aggregation unit is used to aggregate the query sample features and the auxiliary sample variational features to obtain the first aggregated feature.

[0272] In some possible designs, the device 1400 further includes:

[0273] The feature distribution acquisition module is used to acquire second feature distribution information, wherein the second feature distribution information characterizes the second feature distribution corresponding to the auxiliary sample variational features;

[0274] The loss information determination module 1430 is further configured to compare the second feature distribution information with the first feature distribution information to obtain the second model loss information;

[0275] The parameter adjustment module 1440 is specifically used to perform parameter adjustment processing on the initial target detection model based on the fusion loss information to obtain the target detection model. The fusion loss information includes the first model loss information and the second model loss information.

[0276] In some possible designs, the feature aggregation module further includes a feature decoder, and the device 1400 further includes:

[0277] The feature reconstruction module is used to input the variational features of the auxiliary samples into the feature decoder for feature reconstruction processing to obtain the reconstructed features corresponding to the auxiliary sample features;

[0278] The category prediction module is used to perform classification processing based on the reconstructed features to obtain the predicted category corresponding to the sample auxiliary image;

[0279] The label acquisition module is used to acquire the label category corresponding to the sample auxiliary image;

[0280] The loss information determination module 1430 is further configured to compare the predicted category with the label category to obtain third model loss information;

[0281] The parameter adjustment module 1440 is specifically used to perform parameter adjustment processing on the initial target detection model based on the fusion loss information to obtain the target detection model. The fusion loss information includes the first model loss information and the third model loss information.

[0282] In some possible designs, the device 1400 further includes:

[0283] The feature distance determination module is used to determine the feature distance between the reconstructed features and the auxiliary sample features;

[0284] The loss information determination module 1430 is further configured to determine fourth model loss information based on the feature distance, and the fusion loss information further includes the fourth model loss information.

[0285] In some possible designs, the sample query image is a sample image in the training dataset corresponding to a first category, where the first category refers to a label category with a sample number less than or equal to a first quantity threshold; the sample auxiliary image is a sample image in the training dataset corresponding to a second category, where the second category refers to a label category with a sample number greater than a second quantity threshold, where the second quantity threshold is greater than or equal to the first quantity threshold.

[0286] In summary, the technical solution provided in this application can establish the association between different categories by aggregating the features of independent sample query images and sample auxiliary images, thereby improving the diversity and comprehensiveness of sample aggregation. By training the target detection model based on the aggregated features and the difference information between samples, the target detection model can learn cross-category general features, improving the stability and accuracy of feature extraction by the target detection model, and thus improving the overall accuracy of the target detection model in target detection on the application side.

[0287] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0288] Please refer to Figure 15 It illustrates the structural block of a computer device provided in one embodiment of this application. Figure 1 The computer device can be a terminal. This computer device is used to implement the target detection method or the target detection model training method provided in the above embodiments. Specifically:

[0289] Typically, computer device 1500 includes a processor 1501 and a memory 1502.

[0290] Processor 1501 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1501 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1501 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1501 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1501 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0291] Memory 1502 may include one or more computer-readable storage media, which may be non-transitory. Memory 1502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 1502 is used to store at least one instruction, at least one program, code set, or instruction set, which is configured to be executed by one or more processors to implement the above-described target detection method or target detection model training method.

[0292] In some embodiments, the computer device 1500 may also optionally include: a peripheral device interface 1503 and at least one peripheral device. The processor 1501, memory 1502, and peripheral device interface 1503 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1503 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 1504, a touch display screen 1505, a camera assembly 1506, an audio circuit 1507, a positioning assembly 1508, and a power supply 1509.

[0293] Those skilled in the art will understand that Figure 15The structure shown does not constitute a limitation on the computer device 1500, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0294] Please refer to Figure 16 It illustrates the structural block of a computer device provided in one embodiment of this application. Figure 2 The computer device can be a server used to execute the aforementioned object detection methods or training methods for object detection models. Specifically:

[0295] Computer device 1600 includes a central processing unit (CPU) 1601, a system memory 1604 including random access memory (RAM) 1602 and read-only memory (ROM) 1603, and a system bus 1605 connecting the system memory 1604 and the CPU 1601. Computer device 1600 also includes a basic input / output system (I / O system) 1606 that facilitates information transfer between various devices within the computer, and a mass storage device 1607 for storing the operating system 1613, application programs 1614, and other program modules 1615.

[0296] The basic input / output system 1606 includes a display 1608 for displaying information and an input device 1609 for user input, such as a mouse or keyboard. Both the display 1608 and the input device 1609 are connected to the central processing unit 1601 via an input / output controller 1610 connected to the system bus 1605. The basic input / output system 1606 may also include the input / output controller 1610 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1610 also provides output to a display screen, printer, or other types of output devices.

[0297] Mass storage device 1607 is connected to central processing unit 1601 via a mass storage controller (not shown) connected to system bus 1605. Mass storage device 1607 and its associated computer-readable media provide non-volatile storage for computer device 1600. That is, mass storage device 1607 may include computer-readable media (not shown) such as hard disk or CD-ROM (Compact Disc Read-Only Memory) drive.

[0298] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The system memory 1604 and mass storage device 1607 described above can be collectively referred to as memory.

[0299] According to various embodiments of this application, the computer device 1600 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1600 can be connected to the network 1612 via the network interface unit 1611 connected to the system bus 1605, or the network interface unit 1611 can be used to connect to other types of networks or remote computer systems (not shown).

[0300] The memory also includes a computer program stored in the memory and configured to be executed by one or more processors to implement the above-described target detection method or target detection model training method.

[0301] In an exemplary embodiment, a computer-readable storage medium is also provided, the storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set, when executed by a processor, implements the target detection method described above.

[0302] In an exemplary embodiment, a computer-readable storage medium is also provided, the storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set, when executed by a processor, implements the above-described training method for the target detection model.

[0303] Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0304] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the target detection method described above.

[0305] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the training method for the target detection model described above.

[0306] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0307] In addition, in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0308] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A target detection method, characterized in that, The method includes: Retrieve the query image; The query image is input into a trained object detection model for object detection to obtain the object detection result corresponding to the query image; The target detection model is a machine learning model trained based on the first aggregated feature between sample images and sample difference information. The sample images include a sample query image and a sample auxiliary image. The first aggregated feature is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other. The target detection model includes a feature extractor, a feature encoder, and a detection network. The step of inputting the query image into the trained target detection model for target detection to obtain the object detection result corresponding to the query image includes: The query image is input into the feature extractor for feature extraction processing to obtain the query image features; Obtain auxiliary image features corresponding to preset object categories; The auxiliary image features are input into the feature encoder for feature distribution prediction processing to obtain the feature distribution information corresponding to the preset object category; The feature distribution information is sampled and processed to obtain variational features; The query image features are aggregated with the variational features to obtain a second aggregated feature; The second aggregated feature is input into the detection network for detection processing to obtain the object detection result.

2. The method according to claim 1, characterized in that, The step of obtaining auxiliary image features corresponding to a preset object category includes: Obtain multiple auxiliary images corresponding to a preset object category; The multiple auxiliary images are input into the feature extractor for feature extraction processing to obtain the image features corresponding to each of the multiple auxiliary images; The image features corresponding to each of the multiple auxiliary images are fused to obtain the auxiliary image features.

3. A training method for an object detection model, characterized in that, The method includes: Obtain a sample query image, a sample auxiliary image, and sample difference information. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other. The sample query image and the sample auxiliary image are input into the initial target detection model to obtain the object detection result corresponding to the sample query image; wherein, the object detection result is the result detected based on the first aggregated feature, which is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively; The object detection results and the sample difference information are compared to obtain the first model loss information; Based on the loss information of the first model, the parameters of the initial target detection model are adjusted to obtain a trained target detection model. The initial target detection model includes a feature extractor, a feature aggregation module, and a detection network. The feature aggregation module includes a feature encoder. The step of inputting the sample query image and the sample auxiliary image into the initial target detection model to obtain the object detection result corresponding to the sample query image includes: The sample query image and the sample auxiliary image are input into the feature extractor for feature extraction processing to obtain the query sample features corresponding to the sample query image and the auxiliary sample features corresponding to the sample auxiliary image; The auxiliary sample features are input into the feature encoder for feature distribution prediction processing to obtain the first feature distribution information corresponding to the auxiliary sample features; The first feature distribution information is sampled and processed to obtain auxiliary sample variational features; The query sample features and the auxiliary sample variational features are aggregated to obtain the first aggregated feature; The first aggregated feature is input into the detection network for detection processing to obtain the object detection result.

4. The method according to claim 3, characterized in that, The method further includes: Obtain second feature distribution information, wherein the second feature distribution information characterizes the second feature distribution corresponding to the auxiliary sample variational features; The second feature distribution information is compared with the first feature distribution information to obtain the second model loss information; The step of adjusting the parameters of the initial target detection model based on the first model loss information to obtain a trained target detection model includes: The initial target detection model is adjusted based on the fusion loss information to obtain the target detection model. The fusion loss information includes the first model loss information and the second model loss information.

5. The method according to claim 3, characterized in that, The feature aggregation module further includes a feature decoder. After sampling the first feature distribution information to obtain auxiliary sample variational features, the module further includes: The auxiliary sample variational features are input into the feature decoder for feature reconstruction processing to obtain the reconstructed features corresponding to the auxiliary sample features; Based on the reconstructed features, a classification process is performed to obtain the predicted category corresponding to the sample auxiliary image; Obtain the label category corresponding to the sample auxiliary image; The predicted category is compared with the label category to obtain the loss information of the third model; The step of adjusting the parameters of the initial target detection model based on the first model loss information to obtain a trained target detection model includes: The initial target detection model is adjusted based on the fusion loss information to obtain the target detection model. The fusion loss information includes the first model loss information and the third model loss information.

6. The method according to claim 5, characterized in that, After inputting the auxiliary sample variational features into the feature decoder for feature reconstruction processing to obtain the reconstructed features corresponding to the auxiliary sample features, the method further includes: Determine the feature distance between the reconstructed features and the auxiliary sample features; Based on the feature distance, the fourth model loss information is determined, and the fusion loss information also includes the fourth model loss information.

7. The method according to any one of claims 3 to 6, characterized in that, The sample query image is a sample image in the training dataset corresponding to a first category, where the first category refers to a label category with a sample number less than or equal to a first quantity threshold; the sample auxiliary image is a sample image in the training dataset corresponding to a second category, where the second category refers to a label category with a sample number greater than a second quantity threshold, where the second quantity threshold is greater than or equal to the first quantity threshold.

8. A target detection device, characterized in that, The device includes: The image acquisition module is used to acquire the query image; The object detection module is used to input the query image into a trained object detection model for object detection and obtain the object detection result corresponding to the query image; The target detection model is a machine learning model trained based on the first aggregated feature between sample images and sample difference information. The sample images include a sample query image and a sample auxiliary image. The first aggregated feature is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other. The target detection model includes a feature extractor, a feature encoder, and a detection network. The step of inputting the query image into the trained target detection model for target detection to obtain the object detection result corresponding to the query image includes: The query image is input into the feature extractor for feature extraction processing to obtain the query image features; Obtain auxiliary image features corresponding to preset object categories; The auxiliary image features are input into the feature encoder for feature distribution prediction processing to obtain the feature distribution information corresponding to the preset object category; The feature distribution information is sampled and processed to obtain variational features; The query image features are aggregated with the variational features to obtain a second aggregated feature; The second aggregated feature is input into the detection network for detection processing to obtain the object detection result.

9. The apparatus according to claim 8, characterized in that, The image acquisition module is also used to acquire multiple auxiliary images corresponding to a preset object category; the target detection module includes a feature extraction submodule and an auxiliary feature acquisition submodule. The feature extraction submodule is further configured to input multiple auxiliary images into the feature extractor for feature extraction processing to obtain image features corresponding to each of the multiple auxiliary images; The auxiliary feature acquisition submodule is specifically used to perform fusion processing on the image features corresponding to each of the multiple auxiliary images to obtain the auxiliary image features.

10. A training device for an object detection model, characterized in that, The device includes: The sample acquisition module is used to acquire a sample query image, a sample auxiliary image, and sample difference information. The sample difference information represents the label category difference between the sample query image and the sample auxiliary image. The object categories corresponding to the sample query image and the sample auxiliary image are independent of each other. The sample detection module is used to input the sample query image and the sample auxiliary image into an initial target detection model to obtain the object detection result corresponding to the sample query image; wherein, the object detection result is the result detected based on a first aggregated feature, which is obtained by aggregating the features corresponding to the sample query image and the sample auxiliary image respectively; The loss information determination module is used to compare the object detection results with the sample difference information to obtain the first model loss information; The parameter adjustment module is used to adjust the parameters of the initial target detection model based on the loss information of the first model to obtain a trained target detection model. The initial target detection model includes a feature extractor, a feature aggregation module, and a detection network. The feature aggregation module includes a feature encoder. The step of inputting the sample query image and the sample auxiliary image into the initial target detection model to obtain the object detection result corresponding to the sample query image includes: The sample query image and the sample auxiliary image are input into the feature extractor for feature extraction processing to obtain the query sample features corresponding to the sample query image and the auxiliary sample features corresponding to the sample auxiliary image; The auxiliary sample features are input into the feature encoder for feature distribution prediction processing to obtain the first feature distribution information corresponding to the auxiliary sample features; The first feature distribution information is sampled and processed to obtain auxiliary sample variational features; The query sample features and the auxiliary sample variational features are aggregated to obtain the first aggregated feature; The first aggregated feature is input into the detection network for detection processing to obtain the object detection result.

11. The apparatus according to claim 10, characterized in that, The device further includes: The feature distribution acquisition module is used to acquire second feature distribution information, wherein the second feature distribution information characterizes the second feature distribution corresponding to the auxiliary sample variational features; The loss information determination module is further configured to compare the second feature distribution information with the first feature distribution information to obtain the second model loss information; The parameter adjustment module is specifically used to adjust the parameters of the initial target detection model based on the fusion loss information to obtain the target detection model. The fusion loss information includes the first model loss information and the second model loss information.

12. The apparatus according to claim 10, characterized in that, The feature aggregation module further includes a feature decoder, and the device further includes: The feature reconstruction module is used to input the variational features of the auxiliary samples into the feature decoder for feature reconstruction processing to obtain the reconstructed features corresponding to the auxiliary sample features; The category prediction module is used to perform classification processing based on the reconstructed features to obtain the predicted category corresponding to the sample auxiliary image; The label acquisition module is used to acquire the label category corresponding to the sample auxiliary image; The loss information determination module is further configured to compare the predicted category with the label category to obtain third model loss information; The parameter adjustment module is specifically used to adjust the parameters of the initial target detection model based on the fusion loss information to obtain the target detection model. The fusion loss information includes the first model loss information and the third model loss information.

13. The apparatus according to claim 12, characterized in that, The device further includes: The feature distance determination module is used to determine the feature distance between the reconstructed features and the auxiliary sample features; The loss information determination module is further configured to determine fourth model loss information based on the feature distance, and the fusion loss information further includes the fourth model loss information.

14. The apparatus according to any one of claims 10 to 13, characterized in that, The sample query image is a sample image in the training dataset corresponding to a first category, where the first category refers to a label category with a sample number less than or equal to a first quantity threshold; the sample auxiliary image is a sample image in the training dataset corresponding to a second category, where the second category refers to a label category with a sample number greater than a second quantity threshold, where the second quantity threshold is greater than or equal to the first quantity threshold.

15. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the target detection method as described in claim 1 or 2, or the target detection model training method as described in any one of claims 3 to 7.

16. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the target detection method as described in claim 1 or 2, or the training method for the target detection model as described in any one of claims 3 to 7.

17. A computer program product comprising computer instructions stored in a computer-readable storage medium; a processor of a computer device reading the computer instructions from the computer-readable storage medium, the processor executing the computer instructions to cause the computer device to perform the target detection method of claim 1 or 2, or the training method of the target detection model of any one of claims 3 to 7.

Citation Information

Patent Citations

  • Image recognition model migration method and device, equipment and storage medium

    CN112801236A

  • Image processing method and device based on artificial intelligence, and electronic equipment

    CN113821667A