A training method of a small sample detection model and a related device

By comparing and learning class samples under the condition of domain similarity and iteratively training the network, the problem of low detection accuracy in small sample scenarios is solved, and higher target detection accuracy is achieved.

CN116977782BActive Publication Date: 2026-02-13CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310833524.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2026-02-13
Estimated Expiration
2043-07-07

AI Technical Summary

Technical Problem

In small sample scenarios, existing target detection models suffer from low detection accuracy due to the large gap between the distribution of real data and pre-training sample data, and it is difficult to collect labels for real data, making it difficult to achieve accurate target detection.

Method used

By comparing and learning, real-class samples and pre-trained samples are generated to meet the preset domain similarity conditions. Based on these samples, the first and second networks of the initial few-shot detection model are trained in multiple rounds to generate the target few-shot detection model.

Benefits of technology

It improves the data distribution similarity between real samples and pre-trained samples, thereby improving the accuracy of target detection in small sample scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116977782B_ABST
    Figure CN116977782B_ABST
Patent Text Reader

Abstract

The application discloses a small sample detection model training method and related device, and relates to the technical field of target detection. In the application, comparative learning is performed on real samples and pre-training samples related to a small sample scene, class real samples satisfying a preset domain similarity condition with the pre-training samples are obtained, and class pre-training samples satisfying a domain similarity condition with the real samples are obtained, and then the first network and the second network contained in an initial small sample detection model to be trained are subjected to multi-round iterative training based on the class real samples and the class pre-training samples, so as to obtain a target small sample detection model. In this way, the data distribution similarity between the real samples and the pre-training samples is improved to some extent, and the accuracy of target detection is improved through the trained small sample detection model when target detection is performed on the small sample scene.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of target detection, and particularly relates to a training method of a small sample detection model and a related device. BACKGROUND

[0002] With the rapid development of target detection technology, a target detection model based on deep learning can currently realize target detection and recognition in a small sample scene. It should be noted that the amount of real data in the small sample scene is small, and it is also difficult to be collected and labeled when used for target detection and recognition.

[0003] For example, in a kitchen restaurant scene, in order to meet safety standards, it is usually necessary to detect whether a chef wears a mask and a chef's hat. Referring to FIG. 1, after an image containing a chef (i.e., real data) is collected, the image can be input into a detection network, so as to realize labeling and detection and recognition of the image and obtain a corresponding output result, and then it is determined whether the chef wears a mask and a chef's hat according to the output result. Figure 1

[0004] However, even if the detection network uses pre-training sample data that is labeled and has a sufficient amount of data, the distribution gap between the real data and the pre-training sample data is too large, that is, the two belong to different domain data, so that the target cannot be accurately detected according to the pre-training sample data.

[0005] Therefore, when the target is detected in the small sample scene by using the above method, the accuracy of the target detection is low. SUMMARY

[0006] The embodiments of the present application provide a training method of a small sample detection model and a related device, so as to improve the accuracy of target detection by using a trained small sample detection model when the target is detected in a small sample scene.

[0007] In a first aspect, the embodiments of the present application provide a training method of a small sample detection model, and the method comprises the following steps.

[0008] Comparative learning is performed on real samples and pre-training samples corresponding to a small sample scene respectively to generate real sample-like samples and pre-training sample-like samples; wherein the real sample-like samples and the pre-training sample-like samples satisfy a preset domain similarity condition, and the pre-training sample-like samples satisfy the domain similarity condition with the real samples.

[0009] Based on the real sample-like samples and the pre-training sample-like samples, a first network and a second network contained in an initial small sample detection model to be trained are trained in multiple rounds of iterations to obtain a target small sample detection model; wherein the first network is used for prediction of the real samples, and the second network is used for prediction of the pre-training sample-like samples. ​

[0010] In a second aspect, the embodiments of the present application also provide a device for training a small sample detection model, the device comprising:

[0011] a sample generation module configured to perform contrastive learning on real samples and pre-training samples corresponding to a small sample scene respectively, to generate pseudo-real samples and pseudo-pre-training samples; wherein the pseudo-real samples and the pseudo-pre-training samples satisfy a preset domain similarity condition, and the pseudo-pre-training samples satisfy the domain similarity condition with the real samples;

[0012] a model training module configured to perform multi-round iterative training on a first network and a second network included in an initial small sample detection model to be trained based on the pseudo-real samples and the pseudo-pre-training samples, to obtain a target small sample detection model; wherein the first network is configured to predict the real samples, and the second network is configured to predict the pseudo-pre-training samples.

[0013] In an optional embodiment, when performing contrastive learning on real samples and pre-training samples corresponding to a small sample scene respectively to generate pseudo-real samples and pseudo-pre-training samples, the sample generation module is specifically configured to:

[0014] perform feature extraction on the real samples and the pre-training samples respectively, to obtain data distribution features of the real samples and data distribution features of the pre-training samples;

[0015] generate the pseudo-pre-training samples based on the data distribution features of the real samples and the pre-training samples, and generate the pseudo-real samples based on the data distribution features of the pre-training samples and the real samples.

[0016] In an optional embodiment, when performing multi-round iterative training on a first network and a second network included in an initial small sample detection model to be trained based on pseudo-real samples and pseudo-pre-training samples, the model training module is specifically configured to:

[0017] in a round of iterative training on the first network and the second network included in the initial small sample detection model, the following operations are performed:

[0018] obtain pseudo-real sample detection results, pre-training sample detection results and real sample prediction results based on the first network, and obtain pseudo-pre-training sample prediction results based on the second network;

[0019] obtain an L2 distance loss value based on the pseudo-real sample detection results and the pre-training sample detection results, and obtain a KL divergence loss value based on the real sample prediction results and the pseudo-pre-training sample prediction results;

[0020] adjust network parameters of the first network based on the L2 distance loss value, and adjust network parameters of the second network based on the adjusted network parameters of the first network.

[0021] In an optional embodiment, when the L2 distance loss value is obtained based on the class real sample detection result and the pre-training sample detection result, the model training module is specifically configured to:

[0022] obtain a class real sample detection loss value based on the difference between the sample category label of the class real sample and the class real sample detection result, and obtain a pre-training sample detection loss value based on the sample category label of the pre-training sample and the pre-training sample detection result;

[0023] obtain the L2 distance loss value based on the class real sample detection loss value and the pre-training sample detection loss value.

[0024] In an optional embodiment, when the network parameters of the second network are adjusted based on the adjusted network parameters of the first network, the model training module is specifically configured to:

[0025] obtain the historical network parameters of the first network at a previous historical time point adjacent to the adjusted network parameters;

[0026] adjust the network parameters of the second network based on the adjusted network parameters and the historical network parameters, and the parameter weight proportions corresponding to the adjusted network parameters and the historical network parameters, respectively.

[0027] In an optional embodiment, when the network parameters of the second network are adjusted based on the adjusted network parameters of the first network, the model training module is specifically configured to:

[0028] obtain the historical network parameters of the first network at a plurality of historical time points within a historical time range adjacent to the adjusted network parameters;

[0029] determine the parameter weight proportions corresponding to the obtained plurality of historical network parameters and the adjusted network parameters, respectively, based on the time arrangement order of the plurality of historical time points;

[0030] adjust the network parameters of the second network based on the plurality of historical network parameters and the adjusted network parameters, and the obtained parameter weight proportions.

[0031] In an optional embodiment, after the target small sample detection model is obtained by performing multi-round iterative training on the first network and the second network included in the initial small sample detection model to be trained based on the class real sample and the class pre-training sample, the model training module is further configured to:

[0032] obtain small sample scene data containing a target object collected by a data acquisition device in a small sample scene;

[0033] The target small sample detection model comprises a first network, and a behavior discrimination result of a target object in a small sample scene is obtained based on a behavior feature of the target object, wherein the behavior discrimination result indicates whether the behavior of the target object meets a behavior requirement set for the small sample scene.

[0034] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the training method of the small sample detection model of the first aspect.

[0035] In a fourth aspect, the present application provides a computer readable storage medium comprising program code, and when the program code is run on an electronic device, the program code is used to make the electronic device execute the steps of the training method of the small sample detection model of the first aspect.

[0036] In a fifth aspect, the present application provides a computer program product, which, when invoked by a computer, causes the computer to execute the steps of the training method of the small sample detection model of the first aspect.

[0037] The present application has the following beneficial effects:

[0038] In the training method of the small sample detection model provided in the embodiments of the present application, comparative learning is performed on real samples and pre-training samples related to a small sample scene respectively, to obtain real sample-like samples that meet a preset domain similarity condition with the pre-training samples, and pre-training sample-like samples that meet the domain similarity condition with the real samples, and then the first network and the second network included in the initial small sample detection model to be trained are trained in multiple rounds based on the real sample-like samples and the pre-training sample-like samples, to obtain a target small sample detection model. In this way, the data distribution similarity between the real samples and the pre-training samples is improved to some extent, so that the accuracy of target detection is improved by the trained small sample detection model when target detection is performed on a small sample scene.

[0039] In addition, other features and advantages of the present application will be described in the following description, and some will become apparent from the description, or will be understood from the practice of the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings. In the drawings:

[0041] Figure 1 A traditional application scenario diagram of a mask chef hat detection provided by the embodiment of the present application;

[0042] Figure 2 An optional system architecture diagram applicable to the embodiment of the present application;

[0043] Figure 3 An implementation flow diagram of a small sample detection model training method provided by the embodiment of the present application;

[0044] Figure 4 A logic diagram of a real sample and pre-training sample contrast learning provided by the embodiment of the present application;

[0045] Figure 5 An implementation flow diagram of a method for iteratively training a first network and a second network contained in an initial small sample detection model provided by the embodiment of the present application;

[0046] Figure 6 A training logic diagram of a small sample detection model provided by the embodiment of the present application;

[0047] Figure 7 An application scenario diagram of a target detection for a small sample scene provided by the embodiment of the present application;

[0048] Figure 8 A logic diagram based on Figure 3 provided by the embodiment of the present application;

[0049] Figure 9 A structure diagram of a small sample detection model training device provided by the embodiment of the present application;

[0050] Figure 10 A structure diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments described in the present application document, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the technical solutions of the present application.

[0052] It should be noted that in the description of the present application, "multiple" is understood as "at least two". The association relationship of "and / or" describing the associated objects means that there can be three relationships, for example, A and / or B can represent the three cases of A existing alone, A and B existing together, and B existing alone. A is connected with B, which can represent two cases: A is directly connected with B and A is connected with B through C. In addition, in the description of the present application, "first", "second", and the like are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order.

[0053] In addition, in the technical solutions of the present application, the collection, transmission, use, etc. of data all comply with the requirements of relevant national laws and regulations.

[0054] The following explains and describes some technical terms in the embodiments of the present application, so as to facilitate understanding by those skilled in the art.

[0055] (1) Distance metric: a rule in mathematics used to measure the distance along a curve and the angle between curves in some space, containing the curvature information of the space where the curve is located; for example, common distance metrics include Euclidean distance, block distance, chessboard distance, etc.

[0056] (2) L2 loss function: also known as L2 loss function, which can also be referred to as Mean Square Error (MSE) loss function, which is a commonly used regression loss function, which represents the sum of squared residuals or the sum of squared Euclidean distances, i.e. the sum of squared differences between target variables and predicted values; it should be noted that in this paper, in order to facilitate the description, the loss value of the L2 loss function is referred to as the L2 distance loss value.

[0057] (3) KL divergence (Kullback-Leibler Divergence): also known as relative entropy, which is an index for measuring the difference between two probability distributions, so the KL divergence loss function is a measure of minimization between two probability distributions, which can be used to measure the difference between two distributions, and also can be used to measure the accuracy and reliability of the model, i.e. to determine whether the model accurately maps the input data to the output data.

[0058] (4) Cross-domain: refers to that there is a large domain difference between different data sets, which can also be understood as there is a significant domain difference; exemplary, taking the uniform resource locator (URL) as an example to explain the cross-domain, the URL is composed of protocol, domain name, port and path, if the protocol, domain name and port of two URLs are all the same, it means that the two URLs are homologous; otherwise, as long as any one of the protocol, domain name and port is different, it can be determined that the two URLs are cross-domain.

[0059] (5) URL: is the uniform resource locator of global wide area network or World Wide Web (Web), which can also be called network address, therefore, on the Web, every information resource has a uniform and on-line address.

[0060] (6) Contrastive learning: a machine learning technique that learns the general characteristics of a data set without labels by training the model which data points are similar or different.

[0061] Further, based on the above explanations of the terms and related terms, the design idea of the embodiments of the present application is briefly introduced as follows:

[0062] With the rapid development of artificial intelligence, machine vision and target detection technologies, the current target detection model based on deep learning can realize target detection and recognition in small sample scenarios.

[0063] Exemplary, taking the small sample scenario as the kitchen restaurant scenario, in order to meet the safety standards, it is usually necessary to judge whether the chef wears a mask and a chef's hat, it should be noted that through the mask and chef's hat detection function, the operation error of the kitchen restaurant can be detected as soon as possible; and intelligent detection and early warning can not only improve the management efficiency, but also reduce the cost of work supervision, thereby effectively avoiding the problems of low efficiency and high cost of artificial inspection.

[0064] In the related art, as shown in Figure 1 After the image containing the chef (i.e. real data) is collected, the image can be input into the detection network, so as to realize the labeling and detection recognition of the image and obtain the corresponding output result, and then according to the output result, it is judged whether the chef wears a mask and a chef's hat.

[0065] However, even if the network uses the above target detection method, the pre-training sample data is labeled and the data quantity is sufficient, but the distribution gap between the real data and the pre-training sample data is too large, that is, the data belongs to different domains, so that the target detection cannot be accurately detected according to the pre-training sample data; and usually the collection label of real data is also difficult, so the detection accuracy is greatly limited.

[0066] Therefore, in order to improve the accuracy of target detection by training a small sample detection model in a small sample scene, in the embodiments of the present application, a small sample detection model training method is proposed, which specifically includes: respectively performing contrast learning on real samples and pre-training samples corresponding to a small sample scene to generate real sample-like and pre-training sample-like, wherein the real sample-like and pre-training sample-like satisfy a preset domain similarity condition, and the pre-training sample-like and the real sample satisfy the domain similarity condition, so as to perform multi-round iterative training on a first network and a second network contained in an initial small sample detection model to be trained based on the real sample-like and the pre-training sample-like, and obtain a target small sample detection model, wherein the first network is used for real sample prediction, and the second network is used for pre-training sample-like prediction.

[0067] In particular, the preferred embodiments of the present application are described below in conjunction with the accompanying drawings of the specification, it should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0068] Referring to Figure 2 As shown in the figure, it is a system architecture schematic diagram suitable for the embodiments of the present application, which includes a target terminal 201 and a server 202. The target terminal 201 and the server 202 can exchange information through a communication network, wherein the communication network adopts a communication mode which can include a wireless communication mode and a wired communication mode.

[0069] For example, the target terminal 201 can access the network through cellular mobile communication technology and communicate with the server 202, wherein the cellular mobile communication technology includes, for example, the fifth generation mobile communication (5th Generation Mobile Networks, 5G) technology.

[0070] Optionally, the target terminal 201 can access the network through a short-range wireless communication mode and communicate with the server 202, wherein the short-range wireless communication mode includes, for example, wireless fidelity (Wireless Fidelity, Wi-Fi) technology.

[0071] The number of communication devices involved in the system architecture is not limited in the embodiments of the present application. For example, there can be more target terminals, or no target terminal, or other network devices such as Figure 2 As shown, only the target terminal 201 and the server 202 are taken as examples for description, and the following briefly introduces each device and its respective function.

[0072] The target terminal 201 is a device that can provide voice and / or data connectivity to a user, and can be a device supporting wired and / or wireless connection mode.

[0073] For example, the target terminal 201 includes but is not limited to a mobile phone, a tablet computer, a notebook computer, a palm computer, a mobile Internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal device in industrial control, a wireless terminal device in unmanned driving, a wireless terminal device in smart grid, a wireless terminal device in transportation safety, a wireless terminal device in smart city, or a wireless terminal device in smart home, etc.

[0074] In addition, the target terminal 201 can be installed with a related client, which can be software such as an application (APP), a browser, a short video software, etc., or a webpage, an applet, etc. In the embodiments of the present application, the target terminal 201 can send the real sample corresponding to the small sample scene and the pre-training sample, and the small sample scene data collected by the data collection device (not shown) containing the target object in the small sample scene, etc. to the server 202, so as to perform subsequent small sample detection model training and target detection, etc. Figure 2 In the embodiments of the present application, the type of data collection device is not limited, i.e., the data collection device can be an image collection device (such as a camera), a video collection device (such as a video camera), or other data collection devices.

[0075] The server 202 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms; it should be noted that in the embodiments of the present application, the server 202 is deployed with a trained small sample detection model, i.e., a target small sample detection model, for detection of target objects or behavior discrimination results; and can support training of an initial small sample detection model to be trained.

[0076] It is worth noting that in the embodiments of the present application, the server 202 is used to perform contrastive learning on real samples and pre-training samples corresponding to a small sample scene respectively, to generate pseudo-real samples and pseudo-pre-training samples, and then based on the pseudo-real samples and the pseudo-pre-training samples, to perform multi-round iterative training on the first network and the second network included in the initial small sample detection model to be trained, to obtain the target small sample detection model, so as to improve the accuracy of target detection through the target small sample detection model when performing target detection on the small sample scene.

[0077] The training method of the small sample detection model provided by the exemplary embodiments of the present application will be described below in combination with the above-mentioned system architecture and in reference to the accompanying drawings. It should be noted that the above-mentioned system architecture is only shown for the purpose of facilitating understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect.

[0078] Referring to Figure 3 As shown in FIG. 6, which is an implementation flowchart of a training method of a small sample detection model provided by an embodiment of the present application, the execution subject is taken as an example of a server, and the specific implementation process of the method is as follows:

[0079] S301: Perform contrastive learning on real samples and pre-training samples corresponding to a small sample scene respectively, to generate pseudo-real samples and pseudo-pre-training samples.

[0080] The pseudo-real samples and the pre-training samples satisfy a preset domain similarity condition, and the pseudo-pre-training samples and the real samples satisfy the domain similarity condition; it should be noted that the preset domain similarity condition represents that the data (probability) distribution similarity between the corresponding two samples is very high, i.e., the gap of the data distribution is very small.

[0081] In addition, in the embodiments of the present application, the real samples, the pre-training samples, the pseudo-real samples, and the pseudo-pre-training samples all include multiple sample data, i.e., are a set of a certain amount of data samples.

[0082] In addition, the above small sample scene is usually a scene with a small amount of real data. For example, the small sample scene includes, but is not limited to, a kitchen restaurant, a swimming pool, a library, and the like.

[0083] In an optional implementation, when step S301 is performed, the server respectively extracts features of the real sample and the pre-training sample, obtains data distribution features of the real sample and data distribution features of the pre-training sample, generates the pre-training sample-like sample based on the data distribution features of the real sample and the pre-training sample, and generates the real sample-like sample based on the data distribution features of the pre-training sample and the real sample.

[0084] It can be found that the real sample-like sample learns the data distribution of the real sample based on the pre-training sample, and the pre-training sample-like sample learns the data distribution of the pre-training sample based on the real sample. That is, by comparing the data distribution of the real sample and the pre-training sample, the pre-training sample-like sample data and the real sample-like sample data can be prepared, and the similarity between the data distribution of the real sample and the pre-training sample is improved to a certain extent.

[0085] For example, referring to FIG. 1, Figure 4 As shown in FIG. 1, after the server compares and learns the data distribution of the two kinds of data (the real sample and the pre-training sample), the pre-training sample I pre is generated based on the pre-training sample I real -like by the contrast learning network 1, and the real sample I real is generated based on the real sample I pre-like by the contrast learning network 2.

[0086] S302: Based on the real sample-like sample and the pre-training sample-like sample, the first network and the second network included in the initial small sample detection model to be trained are trained in multiple rounds of iterations to obtain a target small sample detection model.

[0087] The first network is used for prediction of the real sample, and the second network is used for prediction of the pre-training sample-like sample.

[0088] It should be noted that the first network and the second network can be the same inspection network, which is used for cooperative training of the above four kinds of data (i.e., the real sample, the pre-training sample, the real sample-like sample, and the pre-training sample-like sample).

[0089] In an optional implementation, referring to FIG. 1, Figure 5As shown, the server performs the following operations in a round of iterative training process on the first network and the second network contained in the initial small sample detection model:

[0090] S501: Based on the first network, obtain the pseudo-real sample detection result, the pre-training sample detection result and the real sample prediction result, and based on the second network, obtain the pseudo-pre-training sample prediction result.

[0091] For example, when performing step S501, the server can input the pseudo-real sample I pre and the pre-training sample I real -like The pseudo-real sample detection result and the pre-training sample detection result output by network 1 (the first network) can be obtained by inputting the pseudo-real sample I real into network 1 (the first network), and the real sample prediction result P real output by network 1 (the first network) can be obtained by inputting the real sample I pre-like into network 1 (the first network).

[0092] Similarly, the server can input the pseudo-pre-training sample I pre-like into network 2 (the second network), and the pseudo-pre-training sample prediction result P pre-like output by network 2 (the second network) can be obtained.

[0093] S502: Based on the pseudo-real sample detection result and the pre-training sample detection result, obtain an L2 distance loss value, and based on the real sample prediction result and the pseudo-pre-training sample prediction result, obtain a KL divergence loss value.

[0094] The L2 distance loss value represents the square of the difference between the pseudo-real sample detection loss value and the pre-training sample detection loss value, and the KL divergence loss value represents the difference between the data (probability) distribution of the real sample prediction result and the data (probability) distribution of the pseudo-pre-training sample prediction result.

[0095] In an optional implementation, when performing step S502, the server can obtain the pseudo-real sample detection loss value based on the difference between the sample category label of the pseudo-real sample and the pseudo-real sample detection result, and obtain the pre-training sample detection loss value based on the sample category label of the pre-training sample and the pre-training sample detection result, so as to obtain the L2 distance loss value based on the pseudo-real sample detection loss value and the pre-training sample detection loss value. In this way, by measuring the distance between the pseudo-real sample and the pre-training sample, the invariance of the features of the two is ensured, that is, the similarity of the data distribution between the pseudo-real sample and the pre-training sample is ensured, and it can also be understood that the common features of the pseudo-real sample and the pre-training sample are learned according to the L2 distance loss value.

[0096] Exemplarily, the above-mentioned pseudo-real sample detection loss value, i.e., pseudo-real sample detection loss, can be denoted as: The above-mentioned pre-training sample detection loss value, i.e., pre-training sample detection loss, can be denoted as: Therefore, the calculation formula of the L2 distance loss value, i.e., L2 distance loss, is as follows:

[0097]

[0098] wherein, L l2 represents the L2 distance loss value, L1 represents the pre-training sample detection loss value L2 represents the pseudo-real sample detection loss value ‖‖2 represents the Euclidean distance, and n represents the number of pseudo-real samples or pre-training samples, represents the loss value corresponding to the i-th sample data in the pre-training sample, represents the loss value corresponding to the i-th pseudo-real sample in the pseudo-real sample.

[0099] It should be noted that, since the pre-training sample and the pseudo-real sample have a common target domain, i.e., the data distribution similarity between the two should be as high as possible, therefore, the prediction result is more similar, i.e., the L2 distance loss value is smaller.

[0100] Similarly, the prediction result of the real sample is denoted as P real , and the prediction result of the pseudo-pre-training sample is denoted as P pre -like Therefore, the calculation formula of the KL divergence loss value, i.e., KL divergence loss, is as follows:

[0101]

[0102] wherein, L kl represents the KL divergence loss value, P pre-like (x) represents the prediction result corresponding to the x-th sample data in the x-th sample data in the pseudo-pre-training sample, P real (x) represents the prediction result corresponding to the x-th sample data in the i-th real sample in the real sample.

[0103] It should be noted that, the above-mentioned prediction result of the real sample and the prediction result of the pseudo-pre-training sample are both used as labels, and the optimization of the network parameters of the network 1 (first network) is guided by the KL divergence loss value; in addition, the KL divergence loss value corrects the cross-domain difference, i.e., eliminates the difference between the data distributions, and ensures the accuracy of the network 1 (first network) in target detection according to the real data (i.e., real sample).

[0104] S503: Adjust the network parameters of the first network based on the L2 distance loss value and the KL divergence loss value, and adjust the network parameters of the second network based on the adjusted network parameters of the first network.

[0105] Specifically, when step S503 is performed, after the server obtains the L2 distance loss value and the KL divergence loss value, the network parameters (i.e., weight parameters) of the first network can be optimized / updated (i.e., adjusted) according to the L2 distance loss value and the KL divergence loss value. Therefore, after obtaining the adjusted network parameters of the first network, the network parameters of the second network can be adjusted based on the adjusted network parameters of the first network, i.e., the network (weight) parameters of network 2 (the second network) are obtained by calculating the network (weight) parameter update of network 1 (the first network).

[0106] It should be noted that the network parameters corresponding to the first network and the second network can each be multiple.

[0107] In an optional implementation, the server can obtain the historical network parameters of the first network at the previous historical time point adjacent to the adjusted network parameters, so as to adjust the network parameters of the second network based on the adjusted network parameters and the historical network parameters, and the parameter weight proportions corresponding to the adjusted network parameters and the historical network parameters; optionally, at this time, the network (weight) parameter update method, i.e., the calculation formula of the exponential moving average, is as follows:

[0108] θ' t = αθ' t-1 + (1-α)θ t

[0109] Wherein, θ t is the network (weight) parameter of network 1 (the first network) at time t (i.e., the current time), i.e., the adjusted network parameter; θ' t is the network (weight) parameter of network 2 (the second network) at time t (the current time); θ' t-1 is the network (weight) parameter of network 2 (the second network) at time t-1 (i.e., the previous historical time), i.e., the historical network parameter; α and 1-α are the parameter weight proportions corresponding to the historical network (weight) parameter θ' t-1 and the adjusted network (weight) parameter θ t respectively; it should be noted that α is set according to experience and can be any value within (0, 1).

[0110] In an alternative implementation, the server can obtain historical network parameters of the first network corresponding to a plurality of historical time points in a historical time range adjacent to the adjusted network parameter; then, based on the time arrangement order of the plurality of historical time points, determine the parameter weight proportion corresponding to each of the obtained plurality of historical network parameters and the adjusted network parameter; finally, based on the plurality of historical network parameters and the adjusted network parameter, and the obtained parameter weight proportion of each, adjust the network parameter of the second network; optionally, at this time, the network (weight) parameter updating method, that is, the calculation formula of the weighted moving average value, is as follows:

[0111]

[0112] wherein θ t is the network (weight) parameter of network 2 (the second network) at time t (the current time), θ t is the network (weight) parameter of network 1 (the first network) at time t (the current time), i.e. the adjusted network parameter, θ t-1 ,..., θ t-T+2 and θ t-T+1 are the historical network parameters of network 1 (the first network) corresponding to a plurality of historical time points in a historical time range adjacent to the adjusted network parameter θ t , T-1 is the total number of the adjusted network parameter and the plurality of historical network parameters, and are the parameter weight proportions corresponding to the adjusted network parameter θ t and the plurality of historical network parameters respectively.

[0113] From the above calculation formula, it can be seen that the time arrangement order corresponding to each network parameter (the adjusted network parameter and the plurality of historical network parameters) is θ t , θ t-1 ,..., θ t-T+2 and θ t-T+1 in turn; therefore, the parameter weight proportion corresponding to each network parameter is: and

[0114] For example, assuming that the above sliding window T is set to 5, the calculation formula of the weighted moving average value is as follows:

[0115]

[0116] Based on the training method steps of the small sample detection model, refer to Figure 6As shown, the server trains the network 1 (first network) according to the pre-training sample to obtain a pre-training network model, and then inputs the real training sample into the pre-training network 1 (first network) model for fine-tuning training to obtain a final model.

[0117] In an optional implementation, referring to Figure 7 As shown, after obtaining the target small sample detection model, the server can obtain small sample scene data containing a target object collected by the data collection device in the small sample scene, so as to obtain a corresponding behavior discrimination result based on the behavior characteristics of the target object in the small sample scene data by using the first network contained in the target small sample detection model; wherein the behavior discrimination result represents whether the behavior of the target object meets the behavior requirement set for the corresponding small sample scene.

[0118] For example, assuming that the small sample scene is a kitchen restaurant scene, and the behavior requirement for the target object (chef) is that the chef wears a mask and a chef's hat, therefore, by using the first network contained in the target small sample detection model, real-time detection of whether the chef wears a mask and a chef's hat in the kitchen restaurant scene can be realized.

[0119] For another example, assuming that the small sample scene data is a video frame cut from a video, then by inputting the video frame into the network 1 (first network) contained in the target small sample detection model, a detection result can be obtained.

[0120] Based on the training method steps of the small sample detection model described in S301-S302, referring to Figure 8 As shown, the server performs contrastive learning on the real sample and the pre-training sample related to the small sample scene respectively, obtains a real sample similar to the pre-training sample that meets a preset domain similarity condition, and a pre-training sample similar to the real sample that meets the domain similarity condition, and then performs multi-round iterative training on the first network and the second network contained in the initial small sample detection model to be trained based on the real sample similar to the pre-training sample and the pre-training sample similar to the real sample, to obtain a target small sample detection model; in this way, the data distribution similarity between the real sample and the pre-training sample is improved to some extent, so that the accuracy of target detection is improved by using the trained small sample detection model when performing target detection on the small sample scene.

[0121] Further, based on the same technical concept, the embodiment of the present application provides a small sample detection model training device for implementing the method flow of the embodiment of the present application. Referring to Figure 9 As shown, the small sample detection model training device comprises a sample generation module 901 and a model training module 902, wherein:

[0122] The sample generation module 901 is configured to perform contrastive learning on the real samples and the pre-training samples corresponding to the small sample scene respectively, to generate the pseudo real samples and the pseudo pre-training samples; wherein the pseudo real samples and the pre-training samples satisfy a preset domain similarity condition, and the pseudo pre-training samples satisfy the domain similarity condition with the real samples.

[0123] The model training module 902 is configured to perform multi-round iterative training on the first network and the second network included in the initial small sample detection model to be trained based on the pseudo real samples and the pseudo pre-training samples, to obtain a target small sample detection model; wherein the first network is used for prediction of the real samples, and the second network is used for prediction of the pseudo pre-training samples.

[0124] In an optional embodiment, when performing contrastive learning on the real samples and the pre-training samples corresponding to the small sample scene respectively to generate the pseudo real samples and the pseudo pre-training samples, the sample generation module 901 is specifically configured to:

[0125] perform feature extraction on the real samples and the pre-training samples respectively, to obtain data distribution features of the real samples and data distribution features of the pre-training samples;

[0126] generate the pseudo pre-training samples based on the data distribution features of the real samples and the pre-training samples, and generate the pseudo real samples based on the data distribution features of the pre-training samples and the real samples.

[0127] In an optional embodiment, when performing multi-round iterative training on the first network and the second network included in the initial small sample detection model to be trained based on the pseudo real samples and the pseudo pre-training samples, the model training module 902 is specifically configured to:

[0128] In the process of performing one round of iterative training on the first network and the second network included in the initial small sample detection model, the following operations are performed:

[0129] obtain, based on the first network, pseudo real sample detection results, pre-training sample detection results and real sample prediction results, and obtain, based on the second network, pseudo pre-training sample prediction results;

[0130] obtain an L2 distance loss value based on the pseudo real sample detection results and the pre-training sample detection results, and obtain a KL divergence loss value based on the real sample prediction results and the pseudo pre-training sample prediction results;

[0131] adjust network parameters of the first network based on the L2 distance loss value, and adjust network parameters of the second network based on the adjusted network parameters of the first network.

[0132] In an optional embodiment, when the L2 distance loss value is obtained based on the class real sample detection result and the pre-training sample detection result, the model training module 902 is specifically configured to:

[0133] obtain a class real sample detection loss value based on the difference between the sample category label of the class real sample and the class real sample detection result, and obtain a pre-training sample detection loss value based on the sample category label of the pre-training sample and the pre-training sample detection result;

[0134] obtain the L2 distance loss value based on the class real sample detection loss value and the pre-training sample detection loss value.

[0135] In an optional embodiment, when the network parameters of the second network are adjusted based on the adjusted network parameters of the first network, the model training module 902 is specifically configured to:

[0136] obtain the historical network parameters of the first network at a previous historical time adjacent to the adjusted network parameters;

[0137] adjust the network parameters of the second network based on the adjusted network parameters and the historical network parameters and the respective parameter weight proportions corresponding to the adjusted network parameters and the historical network parameters.

[0138] In an optional embodiment, when the network parameters of the second network are adjusted based on the adjusted network parameters of the first network, the model training module 902 is specifically configured to:

[0139] obtain the historical network parameters of the first network corresponding to a plurality of historical times within a historical time range adjacent to the adjusted network parameters;

[0140] determine the respective parameter weight proportions corresponding to the obtained plurality of historical network parameters and the adjusted network parameters based on the time arrangement order of the plurality of historical times;

[0141] adjust the network parameters of the second network based on the plurality of historical network parameters and the adjusted network parameters and the obtained respective parameter weight proportions.

[0142] In an optional embodiment, after the target small sample detection model is obtained by performing multi-round iterative training on the first network and the second network included in the initial small sample detection model to be trained based on the class real sample and the class pre-training sample, the model training module 902 is further configured to:

[0143] obtain small sample scene data containing a target object collected by a data acquisition device in a small sample scene;

[0144] The first network included in the target small sample detection model obtains a corresponding behavior discrimination result based on a behavior feature of the target object in the small sample scene data; the behavior discrimination result indicates whether the behavior of the target object meets a behavior requirement set for the corresponding small sample scene.

[0145] Based on the same technical concept, the embodiments of the present application also provide an electronic device, which can implement the training method of the small sample detection model provided by the above-mentioned embodiments of the present application. In an embodiment, the electronic device can be a server, a terminal device or other electronic device. Referring to Figure 10 As shown in the figure, the electronic device can include:

[0146] At least one processor 1001 and a memory 1002 connected with the at least one processor 1001, the specific connection medium between the processor 1001 and the memory 1002 is not limited in the embodiments of the present application, Figure 10 In the embodiment, the connection between the processor 1001 and the memory 1002 is taken as an example connected through the bus 1000. The bus 1000 is used to transmit data and instructions between the processor 1001 and the memory 1002, Figure 10 In the embodiment, the connection between the processor 1001 and the memory 1002 is taken as an example connected through the bus 1000. The bus 1000 is used to transmit data and instructions between the processor 1001 and the memory 1002, Figure 10 In the embodiment, the connection between the processor 1001 and the memory 1002 is taken as an example connected through the bus 1000. The bus 1000 is used to transmit data and instructions between the processor 1001 and the memory 1002,

[0147] In the embodiments of the present application, the memory 1002 stores instructions executable by the at least one processor 1001, and the at least one processor 1001 can execute the training method of the small sample detection model discussed above by executing the instructions stored in the memory 1002. The processor 1001 can implement Figure 9 The functions of each module in the device shown in the figure.

[0148] The processor 1001 is the control center of the device, which can connect each part of the whole control device through various interfaces and lines, and process data and various functions of the device by running or executing the instructions stored in the memory 1002 and calling the data stored in the memory 1002, thereby monitoring the whole device.

[0149] In a possible design, the processor 1001 can include one or more processing units, and the processor 1001 can integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communication. It can be understood that the modem processor can also not be integrated into the processor 1001. In some embodiments, the processor 1001 and the memory 1002 can be implemented on the same chip, and in some embodiments, they can also be implemented on separate chips respectively.

[0150] The processor 1001 can be a general-purpose processor, for example, a CPU, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the training method of a small sample detection model disclosed in the embodiments of the present application can be directly embodied as execution completed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0151] The memory 1002 is a non-volatile computer readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The memory 1002 can include at least one type of storage medium, for example, can include a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RAM), a static random access memory (SRAM), a programmable read-only memory (PROM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 1002 is any other medium capable of carrying or storing desired program codes in the form of instructions or data structures and capable of being accessed by a computer, but is not limited thereto. The memory 1002 in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, used for storing program instructions and / or data.

[0152] By designing and programming the processor 1001, the code corresponding to the training method of a small sample detection model introduced in the foregoing embodiments can be fixed into the chip, so that the chip can execute the code when running Figure 3The steps of the training method of the small sample detection model of the embodiment shown. How to design and program the processor 1001 is a technology known to those skilled in the art, which will not be repeated here.

[0153] Based on the same inventive concept, the embodiments of the present application also provide a storage medium, which stores computer instructions, when the computer instructions run on a computer, make the computer execute the training method of the small sample detection model discussed above.

[0154] In some possible implementation manners, the various aspects of the training method of the small sample detection model can also be implemented in the form of a program product, which includes program codes, when the program product runs on the device, the program codes are used to make the control equipment execute the steps of the training method of the small sample detection model according to various exemplary embodiments of the present application described above in the specification.

[0155] It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is only exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into units embodied by multiple units.

[0156] In addition, although the operations of the method of the present application are described in a specific order in the accompanying drawings, this does not require or imply that the operations must be performed in that specific order, or that all of the shown operations must be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps.

[0157] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0158] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or blocks can be implemented by computer program instructions. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or blocks can be implemented by computer program instructions.

[0159] The program code may, through the use of program components, be implemented in a variety of ways, including procedure-based execution, object-oriented execution, and / or virtual machine execution. The program code illustrated in the flowcharts and / or blocks of the flowcharts and / or blocks can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. The program code can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages.

[0160] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or blocks can be implemented by computer program instructions. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or blocks can be implemented by computer program instructions.

[0161] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A training method for a small-sample detection model, characterized in that, include: The real samples and pre-training samples corresponding to small sample scenarios are compared and learned to generate real-like samples and pre-training-like samples; wherein the real-like samples and the pre-training samples satisfy a preset domain similarity condition, and the pre-training-like samples and the real samples satisfy the domain similarity condition, wherein the samples are images; Based on the class of real samples and the class of pre-trained samples, the first network and the second network included in the initial few-shot detection model to be trained are subjected to multiple rounds of iterative training to obtain the target few-shot detection model; wherein, based on the first network, the class of real sample detection results, the pre-trained sample detection results, and the real sample prediction results are obtained, and based on the second network, the class of pre-trained sample prediction results are obtained; based on the class of real sample detection results and the pre-trained sample detection results, the L2 distance loss value is obtained, and based on the real sample prediction results and the class of pre-trained sample prediction results, the KL divergence loss value is obtained; based on the L2 distance loss value and the KL divergence loss value, the network parameters of the first network are adjusted, and based on the adjusted network parameters of the first network, the network parameters of the second network are adjusted.

2. The method as described in claim 1, characterized in that, The step of comparing and learning real samples and pre-training samples corresponding to small sample scenarios to generate near-real samples and near-pre-training samples includes: Feature extraction is performed on the real samples and the pre-training samples respectively to obtain the data distribution features of the real samples and the data distribution features of the pre-training samples; Based on the data distribution characteristics of the real samples and the pre-training samples, the class of pre-training samples is generated, and based on the data distribution characteristics of the pre-training samples and the real samples, the class of real samples is generated.

3. The method as described in claim 1, characterized in that, The step of obtaining the L2 distance loss value based on the detection results of the real-world samples and the detection results of the pre-trained samples includes: The real sample detection loss value is obtained based on the difference between the sample category label of the real sample and the detection result of the real sample; and the pre-training sample detection loss value is obtained based on the sample category label of the pre-training sample and the detection result of the pre-training sample. The L2 distance loss value is obtained based on the real sample detection loss value and the pre-trained sample detection loss value.

4. The method as described in claim 1, characterized in that, The step of adjusting the network parameters of the second network based on the adjusted network parameters of the first network includes: Obtain the previous historical moment adjacent to the adjusted network parameters, and the historical network parameters of the first network; Based on the adjusted network parameters and the historical network parameters, as well as the respective parameter weight ratios of the adjusted network parameters and the historical network parameters, the network parameters of the second network are adjusted.

5. The method as described in claim 1, characterized in that, The step of adjusting the network parameters of the second network based on the adjusted network parameters of the first network includes: Obtain the historical network parameters of the first network corresponding to multiple historical moments within the historical time range adjacent to the adjusted network parameters; Based on the time sequence of the multiple historical moments, the parameter weight ratios corresponding to the multiple historical network parameters and the adjusted network parameters are determined. Based on the multiple historical network parameters and the adjusted network parameters, as well as the obtained weight ratios of each parameter, the network parameters of the second network are adjusted.

6. The method as described in claim 1, characterized in that, After performing multiple rounds of iterative training on the first and second networks included in the initial few-shot detection model to be trained, based on the class of real samples and the class of pre-trained samples, to obtain the target few-shot detection model, the process further includes: The data acquisition device collects small sample scene data containing the target object in the small sample scene. Using the first network included in the target small sample detection model, a corresponding behavior discrimination result is obtained based on the behavioral characteristics of the target object in the small sample scene data; wherein, the behavior discrimination result represents whether the behavior of the target object conforms to the behavioral requirements set in the corresponding small sample scene.

7. A training device for a small sample detection model, characterized in that, include: The sample generation module is used to compare and learn from real samples and pre-training samples corresponding to small sample scenarios to generate real-like samples and pre-training-like samples; wherein the real-like samples and the pre-training samples satisfy a preset domain similarity condition, and the pre-training-like samples and the real samples satisfy the domain similarity condition, wherein the samples are images; The model training module is used to perform multiple rounds of iterative training on the first network and the second network included in the initial few-shot detection model to be trained, based on the class of real samples and the class of pre-training samples, to obtain the target few-shot detection model. Specifically, based on the first network, it obtains the class of real sample detection results, the pre-training sample detection results, and the real sample prediction results; based on the second network, it obtains the class of pre-training sample prediction results; based on the class of real sample detection results and the pre-training sample detection results, it obtains the L2 distance loss value; based on the real sample prediction results and the class of pre-training sample prediction results, it obtains the KL divergence loss value; based on the L2 distance loss value and the KL divergence loss value, it adjusts the network parameters of the first network, and based on the adjusted network parameters of the first network, it adjusts the network parameters of the second network.

8. The apparatus as claimed in claim 7, characterized in that, When comparing and learning from real samples and pre-training samples corresponding to small sample scenarios to generate real-like samples and pre-training-like samples, the sample generation module is specifically used for: Feature extraction is performed on the real samples and the pre-training samples respectively to obtain the data distribution features of the real samples and the data distribution features of the pre-training samples; Based on the data distribution characteristics of the real samples and the pre-training samples, the class of pre-training samples is generated, and based on the data distribution characteristics of the pre-training samples and the real samples, the class of real samples is generated.

9. The apparatus as claimed in claim 7, characterized in that, When obtaining the L2 distance loss value based on the detection results of the real-world samples and the detection results of the pre-trained samples, the model training module is specifically used for: The real sample detection loss value is obtained based on the difference between the sample category label of the real sample and the detection result of the real sample; and the pre-training sample detection loss value is obtained based on the sample category label of the pre-training sample and the detection result of the pre-training sample. The L2 distance loss value is obtained based on the real sample detection loss value and the pre-trained sample detection loss value.

10. The apparatus as claimed in claim 7, characterized in that, When adjusting the network parameters of the second network based on the adjusted network parameters of the first network, the model training module is specifically used for: Obtain the previous historical moment adjacent to the adjusted network parameters, and the historical network parameters of the first network; Based on the adjusted network parameters and the historical network parameters, as well as the respective parameter weight ratios of the adjusted network parameters and the historical network parameters, the network parameters of the second network are adjusted.

11. The apparatus as claimed in claim 7, characterized in that, When adjusting the network parameters of the second network based on the adjusted network parameters of the first network, the model training module is specifically used for: Obtain the historical network parameters of the first network corresponding to multiple historical moments within the historical time range adjacent to the adjusted network parameters; Based on the time sequence of the multiple historical moments, the parameter weight ratios corresponding to the multiple historical network parameters and the adjusted network parameters are determined. Based on the multiple historical network parameters and the adjusted network parameters, as well as the obtained weight ratios of each parameter, the network parameters of the second network are adjusted.

12. The apparatus as claimed in claim 7, characterized in that, After performing multiple rounds of iterative training on the first and second networks included in the initial few-shot detection model to be trained, based on the class of real samples and the class of pre-trained samples, to obtain the target few-shot detection model, the model training module is further used for: The data acquisition device collects small sample scene data containing the target object in the small sample scene. Using the first network included in the target small sample detection model, a corresponding behavior discrimination result is obtained based on the behavioral characteristics of the target object in the small sample scene data; wherein, the behavior discrimination result represents whether the behavior of the target object conforms to the behavioral requirements set in the corresponding small sample scene.

13. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1-6.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Small sample target detection method based on multi-view learning and meta-learning

    CN114119966A

  • Small sample target detection method based on feature relationship migration

    CN115661542A