Training method, detection device, and storage medium

The training method for open-set object detection employs a visual prompt feature pool and contrastive loss to optimize model performance, addressing high training costs and resource demands, achieving efficient and accurate detection.

JP2026185806APending Publication Date: 2026-11-27FUJITSU LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2026077915
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-15
Filing Date
2026-05-07
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Conventional open-set object detection methods require large batch sizes and significant computational resources, leading to high training costs and inefficiencies due to the need for extensive display memory and multiple GPUs, making them impractical for many applications.

Method used

A training method that utilizes a visual prompt feature pool and contrastive loss to optimize model performance, allowing for smaller batch sizes and reduced hardware requirements, while improving detection accuracy through iterative training with a visual prompt feature pool and contrastive loss calculation.

Benefits of technology

The method reduces training costs and time by utilizing a visual prompt feature pool and contrastive loss, enabling efficient training with smaller batch sizes and enhancing model performance for open-set object detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026185806000001_ABST
    Figure 2026185806000001_ABST
Patent Text Reader

Abstract

The present invention provides a training method for training a model that performs open-set object detection, a detection device, and a storage medium. [Solution] The method includes the steps of determining the class and position of an object in a sample detection image of an iterative training epoch based on a plurality of visual prompt sample images for an iterative training epoch; updating a visual prompt feature pool based on a prompt feature extraction module and a plurality of visual prompt sample images; determining a total loss based on the visual prompt feature pool, the visual prompt features of the plurality of visual prompt sample images, the determined class and position; and updating a model based on the total loss, wherein the total loss includes a contrast loss determined based on the visual prompt features of the plurality of visual prompt sample images and features selected from the visual prompt feature pool.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure generally relates to computer vision, and more particularly, to a training method for training a model for performing open-set object detection based on visual prompts, a detection apparatus, and a computer-readable non-transitory storage medium storing a program. BACKGROUND ART

[0002] With the development of computer science and artificial intelligence, it has become increasingly common and effective to use computers to execute artificial intelligence models based on neural networks to implement information processing. Computer vision is an important application field of artificial intelligence models.

[0003] One application direction of computer vision technology is object detection (also referred to as object detection), that is, identifying (identifying) the class and position of an object in an image.

[0004] Object detection can be roughly divided into closed-set object detection and open-set object detection. Among them, open-set object detection is replacing closed-set object detection due to the great advantage of not requiring repeated training. Typically, in open-set object detection, text prompts or visual prompts can be used to indicate the object target to be detected.

[0005] Figure 1 is a block diagram showing an example configuration of Model M0 for conventional visual prompt open set object detection, where the inputs of the model shown are the input data used in the training phase. Model M0 employs a Transformer-based architecture. The inputs of Model M0 include a visual prompt sample image set "{pIm[i]|i∈[iStart,iEnd]}" (also abbreviated as {pIm[i]}, where i is a natural number) and a sample detection image dIm. The output of Model M0 is a detection result dR, which includes the object class obC and location obP in the detection image. Model M0 includes a prompt feature extraction module extM1 for extracting the visual prompt feature pF1[i] from the visual prompt sample image, a detection feature extraction module extM3 for extracting the image feature F0 from the sample detection image, and a class location determination module cpM. The detection feature extraction module extM3 includes a backbone network BkB and an encoder EnC. The backbone network BkB outputs an initial image feature Fin based on the detection image. The class location module cpM includes a decoder DeC, a class recognition module CdM, and a location recognition module PdM. The prompt feature extraction module extM1 inputs the visual prompt feature set {pF1[i]} to the class location module cpM as the label content query input cQ. The input to the class location module cpM further includes a general query matrix gMx, which is the general query input gQ. Before actually deploying the model M0, iterative training is required to tune the model's parameters to obtain a model with satisfactory performance. Typically, a single iterative training epoch includes the model determining the detection result for a sample detection image, determining the loss based on the detection result, and tuning the model's parameters based on the loss. The number of sample detection images input to a single iterative training epoch is usually multiple. For simplicity, only an example of sample detection images is shown in Figure 1.During the detection phase, the input to model M0 includes, for example, the image to be detected (also called the "detection image") and a visual prompt image.

[0006] In the process of training an open-set object detection model, a large amount of training data and computational resources are required to give the model strong open-set object detection capabilities (e.g., good detection accuracy). With current technology, a sufficiently large batch size of training images (the number of sample detection images input into a single iterative training epoch) is one of the important factors for training success. Achieving training with a large "batch size" requires a large amount of display memory resources, for example, 64 GPUs with 48GB each participating in computations simultaneously. In many cases, this is not feasible due to the high training cost. [Overview of the Initiative] [Problems that the invention aims to solve]

[0007] The following is a brief overview of this disclosure to provide a basic understanding of its nature. This brief overview is not intended to be an exhaustive summary of the disclosure, nor to intentionally identify any key points or important parts of the disclosure, nor to intentionally limit the scope of the disclosure. Rather, it is intended simply to provide a simplified conceptual explanation as a prelude to the more detailed explanation that follows.

[0008] The inventors of this invention studied a training process for training a model to perform open-set object detection based on visual prompts, and have proposed this invention by improving upon conventional training methods. [Means for solving the problem]

[0009] One aspect of the present disclosure provides a training method for training a model for performing open-set object detection based on visual prompts, the method comprising: determining the class and location of an object in a sample detection image of the current iterative training epoch based on a plurality of visual prompt sample images for the current iterative training epoch; updating a visual prompt feature pool based on a prompt feature extraction module of the model and the plurality of visual prompt sample images; determining a total loss based on the visual prompt feature pool, the visual prompt features of the plurality of visual prompt sample images and the determined class and location; and updating the model based on the total loss, wherein the total loss includes a contrast loss determined based on the visual prompt features of the plurality of visual prompt sample images and features selected from the visual prompt feature pool.

[0010] Another aspect of the present disclosure provides a detection device for performing open-set object detection based on a visual prompt, the detection device comprising: a memory storing instructions; and at least one processor connected to the memory and configured to execute the instructions to detect objects in an image using a model trained by the training method described above.

[0011] Another aspect of this disclosure provides an object detection method for detecting objects in an image using a model trained by the above-described training method.

[0012] Another aspect of the present disclosure provides a computer-readable non-temporary storage medium on which a program is stored, wherein when the program is executed by the computer, the computer causes the computer to execute the training method or object detection method described above.

[0013] The advantageous effects of the methods, apparatus and storage media of this disclosure include at least one of the following advantageous effects: reduced training costs and improved object detection performance. [Brief explanation of the drawing]

[0014] To facilitate understanding of the above and other purposes, features, and advantages of this disclosure, embodiments of this disclosure will be described below with reference to the drawings. The drawings are solely for illustrating the principles of this disclosure. It is not necessary to depict the size and relative position of each part according to scale in the drawings. The same reference numerals may indicate the same features. [Figure 1] This block diagram shows an example of a model configuration for conventional open-set object detection. [Figure 2] This flowchart shows an example of a training method for training a model to perform open-set object detection based on a visual prompt according to one embodiment of the present disclosure. [Figure 3] This block diagram shows an example of the configuration of a training device for training a model according to one embodiment of the present disclosure. [Figure 4] This is a schematic diagram illustrating the interaction between modules in a training method according to one embodiment of the present disclosure. [Figure 5] This is a block diagram showing an example of a class positioning module according to one embodiment of the present disclosure. [Figure 6] A block diagram showing an example of an object detection device according to one embodiment of the present disclosure. [Figure 7] A block diagram showing an example of an information processing device according to one embodiment of the present disclosure. [Modes for carrying out the invention]

[0015] The following describes exemplary embodiments of the present disclosure with reference to the drawings. For convenience of explanation, not all features of actual embodiments are shown in the specification. A person skilled in the art may make certain decisions to implement the embodiments, and these decisions may be modified depending on the embodiment.

[0016] For clarity regarding this disclosure, the drawings show only the constituent elements and / or processing steps of the apparatus closely related to this disclosure, and details unrelated to this disclosure have been omitted.

[0017] This disclosure is not limited to the embodiments described, as the following description is based on reference to the accompanying drawings. Where feasible, embodiments may be combined, features of different embodiments may be substituted or utilized, or one or more features may be omitted in a single embodiment.

[0018] Computer program code for performing operations on each aspect of the exemplary embodiments disclosed herein may be written in any combination of one or more programming languages, which include object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the C programming language or similar programming languages.

[0019] The method of this disclosure may be implemented by a circuit having a corresponding functional configuration, which includes a circuit for a processor.

[0020] One aspect of the present disclosure relates to a training method for training a model M for performing open-set object detection based on visual prompts. This training method corresponds to the training device TD according to the present invention. This method may be implemented by a computer. By introducing a visual prompt feature pool for calculating contrastive loss and contrastive loss, this method improves the training method for the existing model M, reduces training costs, increases training speed, and improves model performance. This model M is a neural network model. This neural network model adjusts network parameters and optimizes performance through iterative training for multiple epochs (multiple times). This model may be applied in fields such as autonomous driving, smart security, smart sales, robotics, image and video content understanding, and medical image analysis, for example.

[0021] Hereinafter, the method will be described by way of example with reference to FIGS. 2 and 3.

[0022] FIG. 2 is a flowchart illustrating an example of a training method 200 for training a model M for performing open-set object detection based on visual prompts according to an embodiment of the present disclosure. In one example, the training method 200 is implemented by a computer executing a respective computer program. FIG. 3 is a block diagram illustrating an example of a configuration of a training device 300 for training a model M according to an embodiment of the present disclosure. Here, components other than the prompt feature extraction module extM1 of the model M are not shown. The training device 300 includes a calling module CallM for invoking the model M, a feature pool update module UpdPb for updating the visual prompt feature pool pB, a total loss calculation module CalLt for calculating the total loss Lt, and an update module UpdM for updating the model M.

[0023] In step Op201, Model M determines the detection result, i.e., the class and position of the object in the sample detection image for the current iterative training epoch, based on multiple visual prompt sample images for the current iterative training epoch. This step may be performed by the calling module CallM. An example of Model M is Model M0 in Figure 1.

[0024] A visual prompt sample image can be represented as pIm[i], and a set of multiple visual prompt sample images can be represented as "{pIm[i]|i∈[iStart,iEnd]}" (also abbreviated as {pIm[i]}), where i is a natural number. For example, the number of visual prompt images is 5. All visual prompt sample images are labeled. The labeling includes the object class of the object in the image (e.g., "assault rifle") and the corresponding object position (e.g., the coordinates of the top-left and bottom-right corners of the bounding box of the object "assault rifle" in the image). For example, each prompt image contains a single object, and the object class in each prompt image is different.

[0025] The sample detection image, i.e., the input image to be detected and input to the model during training, can be represented as dIm. The sample detection image is also labeled. The label includes the object class of the object in the image (e.g., "assault rifle") and the corresponding object position (e.g., the coordinates of the top-left and bottom-right corners of the bounding box of the object "assault rifle" in the image). The dIm of the sample detection image may contain, for example, one or more objects, and the object classes of the multiple objects may be different.

[0026] The detection results include the class obC of object Ob in the sample detection image dIm and the position obP of object Ob in the sample detection image dIm. In one example, the calling module CallM stores obC, obP, and the visual prompt features of multiple visual prompt sample images generated by model M.

[0027] In step Op203, the visual prompt feature pool pB is updated based on the model's prompt feature extraction module extM1 and multiple visual prompt sample images. This step may also be performed by the feature pool update module UpdPb. The visual prompt feature pool pB is used to store the visual prompt features generated during the training process. The visual prompt feature pool pB updates some of its features for the prompt sample images input in the current iterative training epoch. The visual prompt features of the set of visual prompt sample images pIm[i] determined by the prompt feature extraction module extM1 are described as "visual prompt features pF1[i]". The corresponding set of visual prompt features of multiple sets of visual prompt sample images {pIm[i]} determined by the prompt feature extraction module extM1 can be represented as {pF1[i]}.

[0028] In step Op205, the total loss Lt is determined based on the visual prompt feature pool pB, the visual prompt features of multiple visual prompt sample images, and the determined class and position. This step may be performed by the total loss calculation module CalLt. The total loss Lt includes the contrast loss Lcon, which is determined based on the visual prompt features of multiple visual prompt sample images and features selected from the visual prompt feature pool.

[0029] In step Op207, the model M is updated based on the total loss Lt. This step is performed by the update module UpdM. Updating the model M involves adjusting the model parameters (including weight parameters), i.e., optimizing the model. The model parameters include the parameters of each module of the model. This step may also include, for example, adjusting the model parameters by gradient descent based on the total loss, which is determined based on the determined class obC and location obP and the labeled content of the detected image (this is part of the total loss). Alternatively, the model M may be updated by backpropagation based on the total loss.

[0030] The training method of this disclosure can utilize a total loss optimization model that includes the contrast loss by providing a visual prompt feature pool pB for storing prompt features. Therefore, a model with satisfactory performance can be trained more quickly, even when the batch size of training images in a single iterative training epoch is small. A smaller batch size of training images means that fewer hardware resources (GPUs) are used during training, reducing training costs and lowering the hardware threshold for training the model. The introduction of contrast loss can overcome the problem in conventional training methods where semantic information is learned only between each class in a single iterative training epoch. In this invention, each iterative training epoch may refer to the semantic information of all classes.

[0031] The following provides a more illustrative description of the training method 200 with reference to Figures 4 and 5. Figure 4 is a schematic diagram showing the interaction between modules in a training method according to one embodiment of the present disclosure. Figure 4 shows the modules constituting an exemplary training device TD4 of the training device TD according to the present invention, where "TD4." is used to indicate that the related module / component belongs to training device TD4, and "M." is used to indicate that the related module / component belongs to model M. Figure 5 is a block diagram showing an example of a class position determination module cpM according to one embodiment of the present disclosure. Note that the training device of the present disclosure does not need to include all of the modules / components of training device TD4 shown in Figure 4.

[0032] As shown in Figure 4, Model M includes a prompt feature extraction module extM1 that extracts the visual prompt feature pF1[i] from the visual prompt sample image pIm[i], a detection feature extraction module extM3 that extracts the image feature F0 from the sample detection image dIm, and a class location determination module cpM. Based on the image feature F0, a label content query feature set {cF[q]} containing multiple visual prompt features in the visual prompt feature set {pF1[i]} (i.e., multiple corresponding visual prompt features extracted by module extM1 from multiple visual prompt sample images of the current iterative training epoch), and a general query matrix gMx, cpM determines the class obC and location obP of an object in the sample detection image dIm, and expresses this as the "determination result," i.e., the detection result dR(obC,obP). That is, the label content query feature set {cF[q]} is taken as the label content query input cQ, and the general query matrix gMx is taken as the general query input gQ. In one example, the detection feature extraction module extM3 includes a backbone network BkB and an encoder EnC. The backbone network BkB extracts features from the sample detection image dIm as initial image features Fin. To improve Fin, the encoder EnC encodes the initial image features Fin to obtain image features F0. The prompt feature extraction module extM1 includes a backbone network for extracting features pF1in[i] from the entire image pIm[i] and an output feature generation module. The output feature generation module extracts features from pF2in[i] as a visual prompt feature set pF1[i] using labeled visual prompt location information (i.e., object locations) of the image.

[0033] In one embodiment, the training apparatus includes a shadowing prompt feature extraction module extM2 that provides shadowing visual prompt features similar to the prompt feature extraction module extM1 of the model. Specifically, the step of updating the visual prompt feature pool includes determining a shadowing visual prompt feature set {pF2[i]} by extracting visual prompt features from multiple visual prompt sample images using the shadowing prompt feature extraction module extM2, which was initialized as a copy of the prompt feature extraction module extM1 of the model M before the first iterative training epoch; and updating the visual prompt feature pool by replacing a corresponding number of visual prompt features in the visual prompt feature pool pB with multiple visual prompt features in the shadowing visual prompt feature set, each corresponding to an object of the same class. The training method further includes updating the weight parameter θ' of the shadowing prompt feature extraction module extM2 by a momentum update scheme based on the weight parameter θ of the updated prompt feature extraction module of the model. The feature pool update module UpdPb of the training apparatus TD4 includes the shadowing prompt feature extraction module extM2 and the pool update module UpdB. The shadowing prompt feature extraction module extM2 extracts the visual prompt features of the visual prompt sample image as shadowing visual prompt features. Accordingly, the visual prompt features of the visual prompt sample image extracted by the prompt feature extraction module extM1 may be referred to as "original visual prompt features". The pool update module UpdB updates the visual prompt feature pool pB based on the shadowing visual prompt features. The training device TD4 further includes a feature extraction update module UpdExtM2 that updates the weight parameter θ' of the shadowing prompt feature extraction module extM2 using a momentum update scheme based on the weight parameter θ of the updated model's prompt feature extraction module.The update module UpdM provides the weight parameter θ to the feature extraction update module UpdExtM2 to update the weight parameter θ'.

[0034] The momentum update method is the update method shown in the following formula.

[0035] mθ'+(1-m)θ→θ' (1) Here, m is the momentum coefficient, and m ∈ [0,1). The introduction of contrast loss can optimize the prompt feature extraction module extM1, improve the extracted visual prompt features, and enable detection results to have better accuracy.

[0036] The visual prompt feature pool is initialized before the first iterative training epoch to an all-zero tensor of size [C,N,D], where C is the number of object classes in the training dataset (e.g., C=365), N is the number of visual prompt features to be stored in the feature pool, set for each object class (e.g., N=300, i.e., the feature pool has 300 memory locations where 300 visual prompt features are configured for each object class), and D is the number of dimensions of the visual prompt features in the first visual prompt feature set {pF1[i]} (e.g., D=256). For example, all sample images in the training dataset contain objects of a total of 365 classes, and the feature pool pB consists of 300 visual prompt features for each object class C[c], and each visual prompt feature can be represented as pF2[c][n].

[0037] In each iterative training epoch, the feature pool pB is updated by overwriting one existing old shadowing visual prompt feature of object class C[c] in the feature pool pB with one new shadowing visual prompt feature of newly generated object class C[c]. Here, the old shadowing visual prompt feature is selected from N features of object class C[c] in the feature pool, and the selection method is not particularly defined; they may be selected sequentially or randomly, but preferably each feature has an opportunity to be overwritten. For example, if five shadowing visual prompt features corresponding to one object class are generated in the current iterative training epoch, the five old shadowing visual prompt features corresponding to the five corresponding object classes in the feature pool are replaced with these five generated shadowing visual prompt features. In one embodiment, when the pool update module UpdB updates the visual prompt feature pool pB, it assigns a pointer to each object class N indicating the visual prompt feature to be replaced from among the N visual prompt features of that object class, so as to replace the features in the order of the features in the visual prompt feature pool. For example, if the prompt image of the current iterative training epoch contains an object of object class C

[0125] , and extM2 has extracted the shadowing visual prompt feature pF20 corresponding to object class C

[0125] , and the pointer to object class C

[0125] points to the feature pF2

[0125]

[32] to be replaced, then the pool update module UpdB replaces feature pF2

[0125]

[32] in feature pool pB with pF20 and updates the pointer to point to the next feature pF2

[0125]

[33] . If the feature to be replaced is pF2

[0125] [N] (i.e., the last feature in the object class feature sequence), the pointer is updated to point to the first feature pF2

[0125] [1] in the object class feature sequence.Preferably, during the update, the extracted shadowing visual prompt features may be used to randomly replace one of the N object class features of the corresponding object class in the visual prompt feature pool.

[0038] The size of the general query matrix gMx is [N,D], and each matrix element is determined by gradually adjusting it during the training process.

[0039] As shown in Figure 5, in one embodiment of the present disclosure, the class location determination module cpM includes a decoder DeC, a class recognition module CdM, and a location recognition module PdM. The decoder DeC includes a first decoder DeC1 and a second decoder DeC2. The first decoder DeC1 generates a first matrix Mat1 based on image features F0 and a label content query feature set {cF[q]}. The second decoder DeC2 generates a second matrix Mat2 based on image features F0 and a general query matrix gMX. The location recognition module PdM generates a candidate object frame set {Box[b]} for the sample detection image based on the second matrix Mat2. The class recognition module CdM determines a similarity matrix Sim based on the first matrix Mat1 and the second matrix Mat2, determines the class obC of the object in the sample detection image based on the similarity matrix Sim, and determines the position obP of the object in the sample detection image based on the similarity matrix and the candidate object frame set. The similarity matrix Sim is determined by matrix multiplication. For example, class obC is the object class of the label content query feature corresponding to the maximum similarity matrix element in the similarity matrix Sim. Position obP is the position of the candidate object frame corresponding to the maximum similarity matrix element in the similarity matrix Sim.

[0040] To ensure training stability, it is preferable to update the weighting parameters of the shadowing feature extraction module with smaller amplitudes. In one example, m∈[0.90,0.99]. In another example, m∈[0.95,0.99].

[0041] Returning to Figure 4, the total loss calculated by the total loss calculation module CalLt includes the class loss Lcat and the position loss Lpos, which are determined based on the determination result dR of the class position determination module.

[0042] The update module UpdM updates model M using backpropagation based on the total loss.

[0043] An increase in the discriminability of visual prompt features between different classes leads to a decrease in classification difficulty, which is detrimental to the optimization of model parameters. To improve the class discrimination ability of the model, the training apparatus of the present invention further includes a selection module that selects hard negative samples, for example. In one embodiment, to improve the performance of the model, the training apparatus TD4 further includes a selection module SelHS. For each visual prompt feature pF1[i] in the visual prompt feature set {pF1[i]}, the selection module SelHS selects a hard negative sample feature from the visual prompt feature pool pB whose similarity to the visual prompt feature is greater than a predetermined threshold sTh (e.g., 0.7), thereby determining the hard negative sample feature set {pF2h[j]}. Here, the corresponding object class of the hard negative sample feature pF2h[j] is different from the corresponding object class of the visual prompt feature, and the label content query feature set {cF[q]} further includes hard negative sample features in the hard negative sample feature set. Here, the similarity may be cosine similarity.

[0044] The total loss calculated by the total loss calculation module CalLt in Figure 4 includes the contrast loss Lcon, the class loss Lcat, and the position loss Lpos. The calculation of the contrast loss requires positive and negative samples. In one embodiment, calculating the contrast loss involves, for each visual prompt feature pF1[i], randomly selecting p features (e.g., p=32) of the same class from the visual prompt feature pool pB, calculating the average value in p dimensions to use as the positive sample for calculating the contrast loss. The negative sample for the visual prompt feature is q samples of other classes randomly selected from the visual prompt feature pool. q may be set to a larger value, e.g., 65536. Alternatively, the contrast loss may be implemented using InfoNce Loss. Such a design can improve the accuracy of visual prompt open set object detection by increasing the similarity of visual prompt features of the same class and increasing the diversity of visual prompt features between different classes.

[0045] A trained model M may be used for open-set object detection. One aspect of this disclosure relates to an object detection method. This method includes a model trained using the above-described training method detecting objects in an image. In one example, in detection, the input to the model includes an image to be detected and a prompt image relating to a prompt class. This image may come from one of the fields of autonomous driving, smart security, smart sales, robotics, image and video content understanding, or medical image analysis.

[0046] One aspect of this disclosure provides a detection device for performing open-set object detection based on visual prompts. Figure 6 is a block diagram showing an example of an object detection device 600 according to one embodiment of this disclosure. The detection device includes a memory 601 storing instructions Inst, and at least one processor 603 connected to the memory 601. The at least one processor 603 is configured to execute the instructions to detect objects in an image using a model trained by the training method described above. If the instructions are replaced with instructions that implement the training method described above, the object detection device becomes the training device of this disclosure.

[0047] This disclosure further provides a computer-readable non-temporary storage medium on which a program is stored. When the program is executed by a computer, the computer is made to execute the training method or object detection method of the present invention.

[0048] One aspect of this disclosure further provides an information processing device.

[0049] Figure 7 is a block diagram showing an example of an information processing device 700 according to one embodiment of the present disclosure. In Figure 7, the central processing unit (CPU) 701 executes various processes using a program stored in the read-only memory (ROM) 702 or a program loaded from the storage unit 708 into the random access memory (RAM) 703. The RAM 703 stores data necessary for the CPU 701 to execute various processes as needed.

[0050] The CPU 701, ROM 702, and RAM 703 are connected to each other via bus 704. The input / output interface 705 is also connected to bus 704.

[0051] The input unit 706 (including keyboard, mouse, etc.), output unit 707 (including display, e.g., cathode ray tube (CRT), liquid crystal display (LCD), etc., and speaker, etc.), storage unit 708 (including, e.g., hard disk), and communication unit 709 (including network interface card, e.g., LAN card, modem, etc.) are connected to the input / output interface 705. The communication unit 709 performs communication processing via a network, e.g., the internet, local area network, mobile network, or a combination thereof.

[0052] If necessary, the driver 710 may be connected to the input / output interface 705. The removable medium 711 is, for example, a magnetic disk, optical disk, magneto-optical disk, or semiconductor memory, which is set up in the driver 710 as necessary, and the computer program read from it is installed in the storage unit 708 as necessary.

[0053] The CPU 701 may execute a program corresponding to the training method of this disclosure or a program corresponding to the object detection method of this disclosure.

[0054] The inventors tested a model trained using the training method of the present invention and obtained the test effects shown in Table 1. Here, the cross-over union IoU is a standard metric for object detection tasks. The datasets used in the test were the open-source object detection datasets COCO (large in scale) and O365 (small in scale). As shown in Table 1, the model trained using the training method of this disclosure performs better than existing open-set object detection models, and in particular, performs better on large datasets.

[0055] [Table 1] According to the training method of this disclosure, the performance of an open-set object detection model can be improved and training costs and training time costs can be reduced by introducing a visual prompt feature pool and contrast loss to calculate the contrast loss.

[0056] As described above, this disclosure explains the principle of object detection. However, the effects of this disclosure are not necessarily limited to those described above, and in addition to or instead of the effects described in the paragraphs above, any of the effects shown herein can be obtained or other effects can be understood from this specification.

[0057] While the above describes specific embodiments of the present disclosure, those skilled in the art can make various modifications (combining or substituting features of each embodiment), improvements, or equivalents to the present disclosure within the gist and scope of the appended claims. Such modifications, improvements, or equivalents are within the scope of the present disclosure. For example, shelves in space may be replaced with other obstacles that block the passage of the target.

[0058] The terms "includes" and "have" mean the presence of the features, elements, steps, or members described herein, but do not exclude the presence or addition of any other features, elements, steps, or members.

[0059] Furthermore, the methods of each embodiment of the present invention are not limited to being performed in the order of time described in the specification or shown in the drawings, but may be performed in other order of time, or in parallel or independently. Accordingly, the order of execution of the methods described herein does not limit the technical scope of the present invention. (Note) Furthermore, this disclosure includes, but is not limited to, the following aspects. (Note 1) A training method for training a model to perform open set object detection based on visual prompts, The model includes the steps of determining the class and position of an object in a sample detection image of the current iterative training epoch based on multiple visual prompt sample images for the current iterative training epoch, The steps include updating the visual prompt feature pool based on the prompt feature extraction module of the model and the plurality of visual prompt sample images, The steps include determining the total loss based on the visual prompt feature pool, the visual prompt features of the plurality of visual prompt sample images, and the determined class and position, The step of updating the model based on the total loss is included, A training method wherein the total loss includes a contrast loss determined based on the visual prompt features of the plurality of visual prompt sample images and features selected from the visual prompt feature pool. (Note 2) The step of updating the aforementioned visual prompt feature pool is: The shadowing visual prompt feature set is determined by extracting the visual prompt features of the multiple visual prompt sample images using a shadowing prompt feature extraction module initialized as a copy of the prompt feature extraction module of the model before the first iterative training epoch, The process includes updating the visual prompt feature pool by replacing a corresponding number of visual prompt features in the visual prompt feature pool with multiple visual prompt features in the shadowing visual prompt feature set, each of which corresponds to an object of the same class. The training method described in Appendix 1 further comprises the step of updating the weight parameters of the shadowing prompt feature extraction module by a momentum update scheme based on the weight parameters of the prompt feature extraction module of the updated model. (Note 3) The momentum update method is, mθ'+(1-m)θ→θ' This is the update method shown, Here, m is the momentum coefficient, m∈[0,1) and θ is a weight parameter of the prompt feature extraction module of the updated model, The training method described in Appendix 2, wherein θ' is a weight parameter of the shadowing prompt feature extraction module. (Note 4) The aforementioned visual prompt feature pool is initialized to an all-zero tensor of size [C,N,D] before the first iterative training epoch. C is the number of object classes in the training dataset. N is the number of visual prompt features stored in the visual prompt feature pool, which is set for each object class. The training method described in Appendix 1, wherein D is the number of dimensions of the visual prompt features of the plurality of visual prompt sample images. (Note 5) The training method described in Appendix 4, wherein when updating the visual prompt feature pool, each object class of the visual prompt feature pool is configured with a pointer indicating the visual prompt feature to be replaced from among the N visual prompt features of the object class, so as to replace features in the order of the features in the visual prompt feature pool. (Note 6) The step of determining the class and position of an object in the sample detection image of the current iterative training epoch is: The visual prompt feature set is determined by extracting the visual prompt features of the plurality of visual prompt sample images using the prompt feature extraction module of the aforementioned model. The detection feature extraction module of the aforementioned model extracts image features from the sample detection image, The training method according to Appendix 2, comprising determining the class and position of an object in the sample detection image based on the image features, a label content query feature set including a plurality of visual prompt features in the visual prompt feature set, and the general query matrix of the model, using the class position determination module of the model. (Note 7) The detection feature extraction module includes a backbone network and an encoder. The backbone network extracts features from the sample detection image as initial image features, The training method described in Appendix 6, wherein the encoder encodes the initial image features to obtain the image features. (Note 8) The class position determination module includes a decoder, a class recognition module, and a position recognition module. The decoder includes a first decoder and a second decoder, The first decoder generates a first matrix based on the image features and the label content query feature set, The second decoder generates a second matrix based on the image features and the general query matrix, The position recognition module generates a set of candidate object frames for the sample detection image based on the second matrix, The training method according to Appendix 6, wherein the class recognition module determines a similarity matrix based on the first matrix and the second matrix, determines the class of an object in the sample detection image based on the similarity matrix, and determines the position of a target in the sample detection image based on the similarity matrix and the candidate object frame set. (Note 9) The training method described in Appendix 3, where m ∈ [0.90, 0.99]. (Note 10) The training method according to Appendix 1, wherein the total loss includes the class loss and position loss determined based on the determination result of the class position determination module. (Note 11) The training method according to Appendix 1, wherein the step of updating the model based on the total loss includes updating the model by backpropagation based on the total loss. (Note 12) The method further includes, for each visual prompt feature in the set of visual prompt features, selecting a hard negative sample feature from the visual prompt feature pool whose similarity to the visual prompt feature is greater than a predetermined threshold, and determining a set of hard negative sample features. The object class corresponding to the hard negative sample feature differs from the object class corresponding to the visual prompt feature, The training method according to Appendix 6, wherein the label content query feature set further includes hard negative sample features in the hard negative sample feature set. (Note 13) The aforementioned comparison loss is the InfoNce Loss comparison loss, as described in Appendix 1 of the training method. (Note 14) The training method described in Appendix 12, wherein the predetermined threshold is within the range of 0.6 to 0.8. (Note 15) The aforementioned model is a model based on the Transformer architecture, and the training method is as described in Appendix 1. (Note 16) The training method described in Appendix 3, where m ∈ [0.95, 0.99]. (Note 17) The training method described in Appendix 2, wherein when updating the visual prompt feature pool, one of the features of the corresponding class in the visual prompt feature pool is randomly replaced with one of the features of the shadowing visual prompt feature set. (Note 18) The training method described in Appendix 6, wherein the step of updating the model includes updating the general query matrix. (Note 19) A detection device for performing open set object detection based on a visual prompt, The memory where the instructions are stored, A detection device comprising: at least one processor connected to the memory and configured to execute the instructions for detecting objects in an image using a model trained by the training method described in Appendix 1. (Note 20) A computer-readable non-temporary storage medium on which a program is stored, wherein when the program is executed by the computer, the computer is instructed to execute a training method for training a model for performing open set object detection based on visual prompts, and the training method is The model includes the steps of determining the class and position of an object in a sample detection image of the current iterative training epoch based on multiple visual prompt sample images for the current iterative training epoch, The steps include updating the visual prompt feature pool based on the prompt feature extraction module of the model and the plurality of visual prompt sample images, The steps include determining the total loss based on the visual prompt feature pool, the visual prompt features of the plurality of visual prompt sample images, and the determined class and position, The step of updating the model based on the total loss is included, A storage medium wherein the total loss includes a contrast loss determined based on the visual prompt features of the plurality of visual prompt sample images and features selected from the visual prompt feature pool.

Claims

1. A training method for training a model to perform open set object detection based on visual prompts, The model includes the steps of determining the class and position of an object in a sample detection image of the current iterative training epoch based on multiple visual prompt sample images for the current iterative training epoch, The steps include updating the visual prompt feature pool based on the prompt feature extraction module of the model and the plurality of visual prompt sample images, The steps include determining the total loss based on the visual prompt feature pool, the visual prompt features of the plurality of visual prompt sample images, and the determined class and position, The step of updating the model based on the total loss is included, A training method wherein the total loss includes a contrast loss determined based on the visual prompt features of the plurality of visual prompt sample images and features selected from the visual prompt feature pool.

2. The step of updating the aforementioned visual prompt feature pool is: The shadowing visual prompt feature set is determined by extracting visual prompt features from the multiple visual prompt sample images using a shadowing prompt feature extraction module initialized as a copy of the prompt feature extraction module of the model prior to the first iterative training epoch, The process includes updating the visual prompt feature pool by replacing a corresponding number of visual prompt features in the visual prompt feature pool with multiple visual prompt features in the shadowing visual prompt feature set, each of which corresponds to an object of the same class. The training method according to claim 1, further comprising the step of updating the weight parameters of the shadowing prompt feature extraction module by a momentum update scheme based on the weight parameters of the prompt feature extraction module of the updated model.

3. The momentum update method is, mθ'+(1-m)θ→θ' This is the update method shown, Here, m is the momentum coefficient, m ∈ [0, 1), θ is a weight parameter of the prompt feature extraction module of the updated model, The training method according to claim 2, wherein θ' is a weight parameter of the shadowing prompt feature extraction module.

4. The step of determining the class and position of an object in the sample detection image of the current iterative training epoch is: The visual prompt feature set is determined by extracting the visual prompt features of the plurality of visual prompt sample images using the prompt feature extraction module of the aforementioned model. The detection feature extraction module of the aforementioned model extracts image features from the sample detection image, The training method according to claim 2, comprising determining the class and position of an object in the sample detection image based on the image features, a label content query feature set including a plurality of visual prompt features in the visual prompt feature set, and the general query matrix of the model, using the class position determination module of the model.

5. The method further includes, for each visual prompt feature in the set of visual prompt features, selecting a hard negative sample feature from the visual prompt feature pool whose similarity to the visual prompt feature is greater than a predetermined threshold, and determining a set of hard negative sample features. The object class corresponding to the hard negative sample feature differs from the object class corresponding to the visual prompt feature, The training method according to claim 4, wherein the label content query feature set further comprises hard negative sample features in the hard negative sample feature set.

6. The detection feature extraction module includes a backbone network and an encoder. The backbone network extracts features from the sample detection image as initial image features, The training method according to claim 4, wherein the encoder encodes the initial image features to obtain the image features.

7. The aforementioned visual prompt feature pool is initialized to an all-zero tensor of size [C, N, D] before the first iterative training epoch. C is the number of object classes in the training dataset, N is the number of visual prompt features stored in the visual prompt feature pool, which is set for each object class. The training method according to claim 1, wherein D is the number of dimensions of the visual prompt features of the plurality of visual prompt sample images.

8. The training method according to claim 7, wherein, when updating the visual prompt feature pool, each object class of the visual prompt feature pool is configured to have a pointer indicating the visual prompt feature to be replaced from among the N visual prompt features of the object class, so as to replace features in the order of the features in the visual prompt feature pool.

9. A detection device for performing open set object detection based on a visual prompt, The memory where the instructions are stored, A detection device comprising: at least one processor connected to the memory and configured to execute the instructions for detecting an object in an image using a model trained by the training method described in claim 1.

10. A computer-readable non-temporary storage medium on which a program is stored, wherein when the program is executed by the computer, the computer is instructed to execute a training method for training a model for performing open set object detection based on visual prompts, and the training method is The model includes the steps of determining the class and position of an object in a sample detection image of the current iterative training epoch based on multiple visual prompt sample images for the current iterative training epoch, The steps include updating the visual prompt feature pool based on the prompt feature extraction module of the model and the plurality of visual prompt sample images, The steps include determining the total loss based on the visual prompt feature pool, the visual prompt features of the plurality of visual prompt sample images, and the determined class and position, The step of updating the model based on the total loss is included, A storage medium wherein the total loss includes a contrast loss determined based on the visual prompt features of the plurality of visual prompt sample images and features selected from the visual prompt feature pool.