Target detection method, system and computer equipment
Through joint pre-training of the MoCo self-supervised learning framework with InfoNCE and Mixco losses, the problem of existing target detection methods relying on large supervised data sets and inapplicable visual representation features is solved, achieving efficient target detection performance improvement and generalization enhancement. .
Patent Information
- Application Number
- CN202210345786.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-31
AI Technical Summary
Existing object detection methods rely on large supervised data sets for labeling, which is expensive and time-consuming. Self-supervised algorithms such as contrastive learning have poor performance in downstream tasks, and visual representation features are difficult to meet the spatial positioning requirements of object detection.
The MoCo self-supervised learning framework is used, combined with the joint loss function of InfoNCE loss and Mixco loss for pre-training, and a generalized visual representation is generated through the framework of Query encoder and Key encoder.
The performance of the target detection task is improved. The generated visual representation is more suitable for the target detection task, has higher generalization ability and robustness, avoids data annotation and improves the detection effect.
Smart Images

Figure CN114648701B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection, and in particular to a target detection method, system and computer equipment. Background Art
[0002] Most object detectors, such as Faster RCNN and Mask RCNN, use the "pre-training + fine-tuning" approach. In the pre-training phase, object detectors need to rely on large supervised object detection datasets such as VOC and COCO datasets. Each object category in these large datasets has more than hundreds of annotated examples, and the object detection task requires dense image labeling, which makes the object detection task extremely expensive and time-consuming.
[0003] At present, self-supervised algorithms are usually used to avoid the problems caused by the above-mentioned labeling. Self-supervised algorithms aim to learn visual features from unlabeled data and then transfer the visual feature representation to the downstream target detection task. Contrastive learning is a mainstream learning paradigm of self-supervised learning. Specifically, it refers to learning similar representations or dissimilar representations from given similar sample pairs or dissimilar sample pairs, and using the contrastive learning framework to perform representation contrast learning. However, some recent studies have shown that the performance of visual representations in downstream target detection tasks is not positively correlated. In other words, a higher ImageNetTop-1 (the standard for image detection accuracy) accuracy does not necessarily guarantee higher target detection performance. There are two main reasons for the above phenomenon. The first reason is that most of the image recognition database Imagenet used for pre-training is single-target data (iconic-object). Single-target data is suitable for unsupervised model learning in a contrastive learning manner, but the fine-tuning datasets used in downstream tasks such as target detection are all multi-target image sets, which are not suitable for direct data enhancement contrastive learning; the second reason is that this visual representation feature uses a global pooling layer to generate vector embedding, which easily destroys the image space structure and loses local information, resulting in the inability to fully retain the original object target space, and cannot meet the target detector's sensitivity requirements for spatial positioning.
[0004] Of course, there are also methods to improve the performance of target detection tasks. One is to propose a self-supervised auxiliary task called instance localization for target detection tasks. By introducing this auxiliary task of instance localization, the location information of objects in the image can be modeled and learned while learning the instance discriminability representation. The second is to propose Mixco (Mix-up Contrast Learning), which performs a fusion (mix-up) operation on the input samples and calls the fused samples semi-positive samples because the samples before fusion are negative samples of each other. Then, contrast learning is performed to improve the visual representation ability of contrast learning. However, the self-supervised auxiliary task of instance localization cannot enhance the generalization of visual representation learning, resulting in the limited performance of pre-trained visual representation in downstream target detection tasks. Although Mixco can learn better visual representation features, it does not consider the unique structural characteristics of target detection, and the performance improvement of downstream target detection tasks is very limited.
[0005] In summary, there is still a need for a target detection method that does not require data annotation while improving the performance of target detection tasks. Summary of the invention
[0006] The purpose of the present invention is to provide a target detection method, system and computer equipment.
[0007] The technical solution of the present invention is: in a first aspect, the present invention provides a target detection method, the method comprising:
[0008] Inputting the first input image into a first encoder to obtain first output data and inputting the second input image into a second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder;
[0009] Calculate a first loss and a second loss based on the first output data and the second output data, the first loss is an information noise comparison estimation loss between the first encoder and the second encoder, and the second loss is a fusion comparison learning loss between the first encoder and the second encoder;
[0010] generating a joint loss function based on the first loss and the second loss;
[0011] Pre-training visual representation based on the joint loss joint function to obtain a target detection model;
[0012] Perform a target detection task based on the target detection model.
[0013] In a preferred embodiment, before inputting the first input image into the first encoder to obtain the first output data and inputting the second input image into the second encoder to obtain the second output data, the method further includes:
[0014] A first input image and a second input image are generated based on the image dataset.
[0015] In a preferred embodiment, the generating the first input image and the second input image based on the image data set includes:
[0016] Selecting M first image blocks, M first background images, N second image blocks, and N second background images from the image data set, where M and N are both natural numbers greater than 1;
[0017] Pasting the first image block and the first background image in a one-to-one correspondence to generate a first pasted image, and pasting the second image block and the second background image in a one-to-one correspondence to generate a second pasted image;
[0018] A first input image is generated based on the first paste image and a second input image is generated based on the second paste image.
[0019] In a preferred embodiment, the first encoder is a Query encoder, and the M first image blocks are image blocks of the same size;
[0020] Pasting the first image block and the first background image in a one-to-one correspondence to generate a first pasted image includes:
[0021] The first image blocks are pasted to the same position of the first background image in a one-to-one correspondence to generate a first pasted image with target position information.
[0022] In a preferred implementation, generating the first input image based on the first pasted image includes:
[0023] Performing a data enhancement operation on the first pasted image to obtain a first enhanced image;
[0024] The first enhanced image copy is saved and the copy is subjected to image fusion to generate a fused image, wherein the first input image includes the first enhanced image and the fused image.
[0025] In a preferred embodiment, the step of fusing the copies to generate a fused image includes:
[0026] The copies are fused in a convex combination to generate a fused image.
[0027] In a preferred implementation, the second encoder is a Key encoder, and the N second image blocks are image blocks of different sizes;
[0028] Pasting the second image block and the second background image in a one-to-one correspondence to generate the second pasted image includes:
[0029] The second image blocks are pasted to different positions of the second background image in a one-to-one correspondence to generate a second pasted image with target position information.
[0030] In a preferred implementation, generating the second input image based on the second pasted image includes:
[0031] A data enhancement operation is performed on the second pasted image to obtain a second enhanced image, and the second input image includes the second enhanced image.
[0032] In a second aspect, the present invention further provides a target detection system, the system comprising:
[0033] An acquisition module, configured to input the first input image into a first encoder to obtain first output data and input the second input image into a second encoder to obtain second output data;
[0034] A calculation module, configured to calculate a first loss and a second loss based on the first output data and the second output data, wherein the first loss is an information noise comparison estimation loss between the first encoder and the second encoder, and the second loss is a fusion comparison learning loss between the first encoder and the second encoder;
[0035] A first generating module, configured to generate a joint loss function based on the first loss and the second loss;
[0036] A pre-training module, used for pre-training visual representation based on the joint loss joint function to obtain a target detection model;
[0037] A detection module is used to perform target detection tasks based on the target detection model.
[0038] In a third aspect, the present invention provides a computer device, comprising:
[0039] one or more processors; and
[0040] A memory associated with the one or more processors, the memory being used to store program instructions, wherein when the program instructions are read and executed by the one or more processors, the program instructions execute any method according to the first aspect.
[0041] The advantages of the present invention are: providing a target detection method, system and computer device, the method comprising: inputting a first input image into a first encoder to obtain first output data and inputting a second input image into a second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder; calculating a first loss and a second loss based on the first output data and the second output data, the first loss is the information noise contrast estimation loss of the first encoder and the second encoder, and the second loss is the fusion contrast learning loss of the first encoder and the second encoder; generating a joint loss function based on the first loss and the second loss; pre-training visual representation based on the joint loss joint function to obtain a target detection model; performing a target detection task based on the target detection model; based on the MoCo self-supervised learning framework composed of the Query encoder and the Key encoder, calculating and obtaining a joint loss function composed of the InfoNCE loss and the Mixco loss for pre-training, thereby effectively improving the performance of the target detection task. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 Flowchart of the self-supervised auxiliary task framework for instance localization in the prior art;
[0044] Figure 2 A schematic diagram of Mixco, a fusion contrast learning method in the prior art;
[0045] Figure 3 This is a flow chart of the target detection method provided in the first embodiment of the present invention;
[0046] Figure 4 This is a flow chart of the target detection method provided by Embodiment 2 of the present invention;
[0047] Figure 5 A technical block diagram of a target detection method provided in Embodiment 2 of the present invention;
[0048] Figure 6 This is a structural diagram of a target detection system provided in Embodiment 3 of the present invention;
[0049] Figure 7 This is a diagram of the computer device architecture provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] As mentioned in the background technology, the current methods for improving the performance of target detection tasks include the self-supervised auxiliary task of instance localization. Figure 1 As shown in the figure, the InsLoc method (Instance localization method) uses the MoCo self-supervised framework to randomly paste the foreground target in different sizes on different background images to construct a pasted image with position information, and then uses the pasted image and the border position as the input of the MoCo (MoCo Momentum Contrast momentum contrast learning framework) network, and uses the border position information to extract the corresponding RoI (Region of Interest) features, and performs InfoNCE (Information Noise Contrastive Estimation) contrast learning on it. The foreground image block of the constructed image is an image block randomly selected from ImageNet. Directly using this image block as the input of contrast learning cannot enhance the generalization of visual representation learning. As a result, the performance of the pre-trained visual representation is limited in downstream target detection tasks. The second is fusion contrast learning Mixco (Mix-up Contrast Learning), refer to Figure 2 As shown in the figure, for different input views (A1, B1, C1, D1) of the Query encoder, two fusion operations are performed and then input to the network to obtain two corresponding feature representations, while for different input views (A2, B2, C2, D2) of the Key encoder, they are directly input to the network to obtain 4 corresponding feature representations. In the similarity learning stage of feature representation, the feature representation of the fused image is respectively learned by similarity measurement with the original two fused images. Although this fusion contrast learning can learn better visual representation features, it does not take into account the unique structural characteristics of target detection, and the performance improvement of downstream target detection tasks is very limited.
[0052] To solve the above problems, the present invention creatively proposes a target detection method, system and computer device. In the MoCo self-supervised learning framework composed of Query encoder and Key encoder, a joint loss function composed of InfoNCE loss and Mixco loss is calculated for pre-training, and the MoCo self-supervised learning framework is combined with instance positioning, which effectively improves the performance of the target detection task.
[0053] Embodiment 1: This embodiment introduces a target detection method, referring to Figure 3 As shown, the method includes:
[0054] S310, input the first input image into the first encoder to obtain first output data and input the second input image into the second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder.
[0055] S320, calculating a first loss and a second loss based on the first output data and the second output data, the first loss being the information noise contrast estimation loss between the first encoder and the second encoder, and the second loss being the fusion contrast learning loss between the first encoder and the second encoder.
[0056] S330. Generate a joint loss function based on the first loss and the second loss.
[0057] S340, pre-training the visual representation based on the joint loss joint function to obtain the target detection model.
[0058] S350: Execute a target detection task based on the target detection model.
[0059] The target detection method provided by this embodiment includes: inputting a first input image into a first encoder to obtain first output data and inputting a second input image into a second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder; calculating a first loss and a second loss based on the first output data and the second output data, the first loss is the information noise contrast estimation loss of the first encoder and the second encoder, namely, the InfoNCE loss, and the second loss is the fusion contrast learning loss of the first encoder and the second encoder, namely, the Mixco loss; generating a joint loss function based on the first loss and the second loss; pre-training visual representation based on the joint loss joint function; based on the MoCo self-supervised learning framework composed of the Query encoder and the Key encoder, calculating and obtaining a joint loss function composed of the InfoNCE loss and the Mixco loss for pre-training, thereby effectively improving the performance of the target detection task.
[0060] Example 2: Based on Example 1, this example introduces a more optimized target detection method, using the MoCo self-supervised learning framework to learn visual representations. The selected encoder network is Resnet-50-FPN, the negative sample queue size is 65536, and the ImageNet dataset is used as an example for analysis. Figure 4 As shown, the method includes:
[0061] S410 . Generate a first input image and a second input image based on a picture data set.
[0062] Exemplarily, in this embodiment, the image dataset uses the computer vision dataset ImageNet dataset. Of course, the image dataset can also be other image recognition databases, and the present invention is not limited to this. Only the ImageNet dataset is used as an example in this embodiment.
[0063] Preferably, this step includes:
[0064] S411. Select M first image blocks, M first background images, N second image blocks, and N second background images from the image data set, where M and N are both natural numbers greater than 1.
[0065] For example, refer to Figure 5 As shown, two first image blocks, two first background images, two second image blocks, and two second background images are randomly selected from the ImageNet data set. Due to the random selection, the first image blocks may be the same or different, the first background images may be the same or different, and the first image block and the second image block, the first background image and the second background image may be the same or different, which is not limited in this embodiment.
[0066] Preferably, the first image blocks have the same size and the second image blocks have different sizes.
[0067] S412 , pasting the first image block and the first background image in a one-to-one correspondence to generate a first pasted image, and pasting the second image block and the second background image in a one-to-one correspondence to generate a second pasted image.
[0068] Specifically, the first image blocks have the same size and are pasted one-to-one to the same position of the first background image, that is, one first image block is pasted on a first background image, and each first image block pasting position is located at the same position of the first background image, thereby generating a first pasted image with target position information.
[0069] The second image blocks are of different sizes, and are pasted one-to-one to different positions of the second background image, that is, one second image block is pasted onto a second background image, and each second image block pasting position is located at a different position of the second background image, thereby generating a second pasted image with target position information.
[0070] S413 , generating a first input image based on the first pasted image and generating a second input image based on the second pasted image.
[0071] Specifically, this step includes:
[0072] S4131. Perform a data enhancement operation on the first pasted image to obtain a first enhanced image.
[0073] Specifically, there are multiple methods for data enhancement operation. In this embodiment, a random inversion data enhancement operation is performed on the first pasted image.
[0074] S4132: Save a copy of the first enhanced image and perform image fusion on the copy to generate a fused image, where the first input image includes the first enhanced image and the fused image.
[0075] Preferably, the copies are fused in a convex combination manner to generate a fused image.
[0076] Specifically, image X i , X k is the first enhanced image, and the fused image is represented by X mixi,k As shown below:
[0077]
[0078] The first input image includes: the first enhanced image X i , X k , and the fused image X mixi,k .
[0079] S4133: Perform a data enhancement operation on the second pasted image to obtain a second enhanced image, where the second input image includes the second enhanced image.
[0080] ImageX i ′、X k ' is the second enhanced image.
[0081] S420, input the first input image into the first encoder to obtain first output data and input the second input image into the second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder.
[0082] Specifically, the MoCo self-supervised learning framework is used to learn image encoding. The first input image, the enhanced image Xi , X k , and the fused image X mixi,k Input the Query encoder and convert the second input image - the second enhanced image X i ′、X k ′Input into the Key encoder, the Query encoder branch and the Key encoder branch learn the feature representation of their respective input images. Respectively represent the output of the Query encoder, v′ i , v′ k Respectively represent the output of the Key encoder.
[0083] v i =f encoder (x i )
[0084] v k =f encoder (x k )
[0085]
[0086] v′ i =f encoder (x′ i )
[0087] v′ k =f encoder (x′ k )
[0088] S430, calculating a first loss and a second loss based on the first output data and the second output data, the first loss being an information noise contrast estimation loss between the first encoder and the second encoder, and the second loss being a fusion contrast learning loss between the first encoder and the second encoder.
[0089] Specifically, the information noise contrast estimation loss of the query encoder and the key encoder, namely the InfoNCE loss, is calculated, trying to make the spatial distance between the positive sample pairs as small as possible and the spatial distance between the positive sample pairs as large as possible.
[0090]
[0091] Calculate the fusion contrast learning loss, namely Mixco loss, which is similar to InfoNCE loss, so that the distance between the half-positive sample and the sample space before mixing is as close as possible. Where λ is the similarity hyperparameter.
[0092]
[0093] S440: Generate a joint loss function based on the first loss and the second loss.
[0094] Specifically, the loss constraint function of the entire network consists of two parts: InfoNCE loss and Mixco loss. This joint loss function is used as the training target of the MoCo framework to pre-train the visual representation. This joint loss function makes the visual representation learned in the pre-training stage more generalizable.
[0095] L total =L Contrast +L Mixco
[0096] S450, pre-training the visual representation based on the joint loss joint function to obtain the target detection model.
[0097] Specifically, the pre-trained weights are loaded into the Mask-RCNN detector with the help of the detectron2 framework for network fine-tuning and / or the target detection network performance is tested on the standard COCO dataset to obtain the target detection model.
[0098] S460: Execute a target detection task based on the target detection model.
[0099] The target detection method provided in this embodiment is based on the MoCo self-supervised learning framework, and the detection model is pre-trained in combination with instance positioning and image fusion to obtain a target detection model. The MoCo self-supervised learning framework adopts a momentum update method, that is, back propagation is performed on the query and momentum update is also performed on the key, which greatly narrows the gap in effect between the self-supervised model and the supervised model. Combined with instance positioning and image fusion, the pre-trained visual representation finally generated by this method can be more matched to the target detection task, and does not require data labeling while improving the performance of the target detection task. The generated visual representation is more generalized and robust, and takes into account the generalization and effectiveness of the visual feature representation. This method has important scientific significance and potential application value for improving research in related fields such as self-supervised visual representation, target detection, and semantic segmentation.
[0100] Embodiment 3: Corresponding to the above-mentioned embodiment 1 and embodiment 2, the following will be combined with Figure 6 , the target detection system provided by the present application is introduced. The system can be implemented by hardware or software, or by a combination of hardware and software, which is not limited by the present application.
[0101] In an example such as Figure 6 As shown, the present application provides a target detection system, the system comprising:
[0102] An acquisition module 610 is configured to input a first input image into a first encoder to obtain first output data and input a second input image into a second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder;
[0103] A calculation module 620, configured to calculate a first loss and a second loss based on the first output data and the second output data, wherein the first loss is an InfoNCE loss of the first encoder and the second encoder, and the second loss is a Mixco loss of the first encoder and the second encoder;
[0104] A first generating module 630, configured to generate a joint loss function based on the first loss and the second loss;
[0105] A pre-training module 640, configured to perform pre-training of visual representation based on the joint loss joint function to obtain a target detection model;
[0106] The detection module 650 is used to perform the target detection task based on the target detection model.
[0107] In a specific embodiment, the system further includes:
[0108] The second generating module 660 is used to generate a first input image and a second input image based on the picture data set before the acquiring module 610 inputs the first input image into the first encoder to acquire the first output data and inputs the second input image into the second encoder to acquire the second output data.
[0109] Preferably, the second generating module 660 includes:
[0110] A selection unit 661 is used to select M first image blocks, M first background images, N second image blocks and N second background images from the image data set, where M and N are both natural numbers greater than 1;
[0111] A pasting unit 662, configured to paste the first image block and the first background image in a one-to-one correspondence to generate a first pasted image, and paste the second image block and the second background image in a one-to-one correspondence to generate a second pasted image;
[0112] The generating unit 663 is configured to generate a first input image based on the first pasted image and generate a second input image based on the second pasted image.
[0113] More preferably, the M first image blocks are image blocks of the same size; and the pasting unit 662 includes:
[0114] The first pasting subunit 6621 is used to paste the first image blocks to the same position of the first background image in a one-to-one correspondence, and generate a first pasted image with target position information.
[0115] More preferably, the generating unit 663 includes:
[0116] A first enhancement subunit 6631 is used to perform a data enhancement operation on the first pasted image to obtain a first enhanced image;
[0117] The saving and fusion subunit 6632 is used to save the first enhanced image copy and perform image fusion on the copy to generate a fused image, wherein the first input image includes the first enhanced image and the fused image.
[0118] More preferably, the fusion subunit 6632 is saved to fuse the copies in a convex combination manner to generate a fused image.
[0119] Preferably, the N second image blocks are image blocks of different sizes; and the pasting unit 662 further includes:
[0120] The second pasting subunit 6622 is used to paste the second image blocks to different positions of the second background image in a one-to-one correspondence to generate a second pasted image with target position information;
[0121] More preferably, the generating unit 663 further includes:
[0122] The second enhancement subunit 6633 is used to perform a data enhancement operation on the second pasted image to obtain a second enhanced image, and the second input image includes the second enhanced image.
[0123] Embodiment 4: Corresponding to the above-mentioned embodiments 1 to 3, the following will be combined with Figure 7 , the computer device provided by the present application is introduced. In an example such as Figure 7 As shown, the present application provides a computer device, the computer device comprising:
[0124] one or more processors; and
[0125] A memory associated with the one or more processors, the memory being used to store program instructions, wherein when the program instructions are read and executed by the one or more processors, the following operations are performed:
[0126] Inputting the first input image into a first encoder to obtain first output data and inputting the second input image into a second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder;
[0127] Calculate a first loss and a second loss based on the first output data and the second output data, the first loss is an InfoNCE loss of the first encoder and the second encoder, and the second loss is a Mixco loss of the first encoder and the second encoder;
[0128] generating a joint loss function based on the first loss and the second loss;
[0129] Pre-training of visual representation is performed based on the joint loss joint function.
[0130] in, Figure 7 The computer device architecture is shown as an example, which may include a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, and a memory 720. The processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720 may be communicatively connected via a communication bus 730.
[0131] Among them, the processor 710 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided in this application.
[0132] The memory 720 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 720 can store an operating system 721 for controlling the operation of the computer device 700, and a basic input and output system (BIOS) 722 for controlling the low-level operation of the computer device 700. In addition, a web browser 723, a data storage management 724, and an icon font processing system 725, etc. can also be stored. The above-mentioned icon font processing system 725 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 720 and is called and executed by the processor 710.
[0133] The input / output interface 713 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0134] The network interface 714 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0135] The bus 730 comprises a pathway for transmitting information between the various components of the device (eg, the processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720).
[0136] In addition, the computer device 700 can also obtain information on specific collection conditions from the virtual resource object collection condition information database 741 for use in condition judgment, etc.
[0137] It should be noted that, although the above-mentioned computer device 700 only shows a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, a memory 720, a bus 730, etc., in the specific implementation process, the computer device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above-mentioned device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.
[0138] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a cloud server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0139] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system embodiment described above is merely schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0140] It should also be noted that the terms "first" and "second" in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0141] Of course, the above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any modifications made according to the spirit of the main technical solution of the present invention should be included in the protection scope of the present invention.
Claims
1. A target detection method, characterized in that: The method comprises: Inputting the first input image into a first encoder to obtain first output data and inputting the second input image into a second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder; Calculate a first loss and a second loss based on the first output data and the second output data, the first loss is an information noise comparison estimation loss between the first encoder and the second encoder, and the second loss is a fusion comparison learning loss between the first encoder and the second encoder; generating a joint loss function based on the first loss and the second loss; Pre-training visual representation based on the joint loss joint function to obtain a target detection model; Perform a target detection task based on the target detection model.
2. The target detection method according to claim 1, characterized in that: Before inputting the first input image into the first encoder to obtain the first output data and inputting the second input image into the second encoder to obtain the second output data, the method further includes: A first input image and a second input image are generated based on the image dataset.
3. The target detection method according to claim 2, characterized in that: Generating the first input image and the second input image based on the picture data set includes: Selecting M first image blocks, M first background images, N second image blocks, and N second background images from the image data set, where M and N are both natural numbers greater than 1; Pasting the first image block and the first background image in a one-to-one correspondence to generate a first pasted image, and pasting the second image block and the second background image in a one-to-one correspondence to generate a second pasted image; A first input image is generated based on the first paste image and a second input image is generated based on the second paste image.
4. The target detection method according to claim 3, characterized in that: The M first image blocks are image blocks of the same size; Pasting the first image block and the first background image in a one-to-one correspondence to generate a first pasted image includes: The first image blocks are pasted to the same position of the first background image in a one-to-one correspondence to generate a first pasted image with target position information.
5. The target detection method according to claim 4, characterized in that: Generating a first input image based on the first pasted image comprises: Performing a data enhancement operation on the first pasted image to obtain a first enhanced image; The first enhanced image copy is saved and the copy is subjected to image fusion to generate a fused image, wherein the first input image includes the first enhanced image and the fused image.
6. The target detection method according to claim 5, characterized in that: The fusing the copies to generate a fused image comprises: The copies are fused in a convex combination to generate a fused image.
7. The target detection method according to claim 3, characterized in that: The N second image blocks are image blocks of different sizes; Pasting the second image block and the second background image in a one-to-one correspondence to generate the second pasted image includes: The second image blocks are pasted to different positions of the second background image in a one-to-one correspondence to generate a second pasted image with target position information.
8. The target detection method according to claim 7, characterized in that: Generating a second input image based on the second pasted image comprises: A data enhancement operation is performed on the second pasted image to obtain a second enhanced image, and the second input image includes the second enhanced image.
9. A target detection system, characterized in that: The system comprises: An acquisition module, configured to input a first input image into a first encoder to obtain first output data and input a second input image into a second encoder to obtain second output data; the first encoder is a Query encoder, and the second encoder is a Key encoder; A calculation module, configured to calculate a first loss and a second loss based on the first output data and the second output data, wherein the first loss is an information noise comparison estimation loss between the first encoder and the second encoder, and the second loss is a fusion comparison learning loss between the first encoder and the second encoder; A first generating module, configured to generate a joint loss function based on the first loss and the second loss; A pre-training module, used for pre-training visual representation based on the joint loss joint function to obtain a target detection model; A detection module is used to perform target detection tasks based on the target detection model.
10. A computer device, characterized in that: include: one or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the method according to any one of claims 1-8.
Citation Information
Patent Citations
Data model generation method and device, data model calling method and device, equipment and storage medium
CN112800053A
Unsupervised feature point detection method and device
CN113095333A
