CN114821034A - Training method and device of target detection model, electronic equipment and medium - Google Patents

Training method and device of target detection model, electronic equipment and medium Download PDF

Info

Publication number
CN114821034A
CN114821034A CN202210325006.0A CN202210325006A CN114821034A CN 114821034 A CN114821034 A CN 114821034A CN 202210325006 A CN202210325006 A CN 202210325006A CN 114821034 A CN114821034 A CN 114821034A
Authority
CN
China
Prior art keywords
anchor frame
frame information
adaptive
training
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210325006.0A
Other languages
Chinese (zh)
Inventor
王佳琪
卞珂珂
刘瑞
傅强
阿曼太
梁彧
马寒军
田野
王杰
杨满智
金红
陈晓光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Eversec Beijing Technology Co Ltd
Original Assignee
Eversec Beijing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Eversec Beijing Technology Co Ltd filed Critical Eversec Beijing Technology Co Ltd
Priority to CN202210325006.0A priority Critical patent/CN114821034A/en
Publication of CN114821034A publication Critical patent/CN114821034A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention discloses a training method, a device, electronic equipment and a medium of a target detection model, wherein the method comprises the following steps: acquiring a plurality of groups of training sample data, wherein the training sample data comprises a sample image and target anchor frame information corresponding to the sample image; determining adaptive anchor frame information based on the target anchor frame information; replacing original anchor frame information of a pre-established initialization model with the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information; and training the self-adaptive anchor frame model based on the multiple groups of training sample data to obtain a small target detection model. The technical scheme of the application can effectively reduce the use of the number of the anchor frames in the training of the small target detection model, thereby reducing the training time.

Description

Training method and device of target detection model, electronic equipment and medium
Technical Field
The embodiment of the invention relates to the technical field of machine vision, in particular to a training method and device of a target detection model, electronic equipment and a medium.
Background
With the development of machine vision technology, small target detection is widely applied in various fields, for example, detection of small targets such as ground vehicles and pedestrians by unmanned aerial vehicles, detection of ground targets by satellite images, and the like.
However, in the process of implementing the technical solution of the present invention in this embodiment, the inventors of the present invention find that the above-mentioned technology has at least the following technical problems:
the network model of the existing small target detection method is complex, and the training time is too long.
Disclosure of Invention
The embodiment of the invention provides a training method and device of a target detection model, electronic equipment and a medium, which are used for reducing the training time of the target detection model.
In a first aspect, an embodiment of the present invention provides a method for training a target detection model, including:
acquiring a plurality of groups of training sample data, wherein the training sample data comprises a sample image and target anchor frame information corresponding to the sample image;
determining adaptive anchor frame information based on the target anchor frame information;
replacing original anchor frame information of a pre-established initialization model with the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information;
and training the self-adaptive anchor frame model based on the multiple groups of training sample data to obtain a small target detection model.
In a second aspect, an embodiment of the present invention further provides a training apparatus for a target detection model, including:
the training sample acquisition module is used for acquiring a plurality of groups of training sample data, wherein the training sample data comprises a sample image and target anchor frame information corresponding to the sample image;
the self-adaptive anchor frame information determining module is used for determining self-adaptive anchor frame information based on the target anchor frame information;
the information replacement module is used for replacing the original anchor frame information of the pre-established initialization model with the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information;
and the model training module is used for training the self-adaptive anchor frame model based on the multiple groups of training sample data to obtain a small target detection model.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method for training an object detection model as provided by any of the embodiments of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for training the object detection model provided in any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, a plurality of groups of training sample data are obtained, wherein the training sample data comprise sample images and target anchor frame information corresponding to the sample images; further, self-adaptive anchor frame information is determined according to target anchor frame information in training sample data, and the original anchor frame information of the pre-established initialization model is replaced by the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information, so that the use of the anchor frames in the training process is reduced, and the training time can be reduced when the self-adaptive anchor frame model is trained according to multiple groups of training sample data.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a schematic flowchart of a training method of a target detection model according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a training method of a target detection model according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a training apparatus for a target detection model according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
Example one
Fig. 1 is a flowchart illustrating a method for training a target detection model according to an embodiment of the present invention, where the method is applicable to a situation where a small target in an image is automatically detected, the method may be implemented by a device for training the target detection model, the device may be implemented by software and/or hardware, and may be configured in a terminal and/or a server to implement the method for training the target detection model according to the embodiment of the present invention.
As shown in fig. 1, the method of the embodiment may specifically include:
s110, obtaining a plurality of groups of training sample data, wherein the training sample data comprise sample images and target anchor frame information corresponding to the sample images.
The training sample data may be a small target training data set that is created in advance, for example, a training data set of a small target such as a remote human body or a vehicle. In some embodiments, the training sample data may also be a training data set with a mixture of small targets and large targets, which is not limited herein. The training sample data may include a sample image and target anchor frame information corresponding to the sample image, the training sample data may include a plurality of sample images, each sample image has corresponding target anchor frame information, and the target anchor frame information refers to label information of the sample image, that is, correct anchor frame coordinate information.
Specifically, the training sample data can be obtained by calling from a preset storage path, and the sample image in the training sample data and the storage path of the target anchor frame information corresponding to the sample image can be different, so that the sample image and the corresponding target anchor frame information can be separately obtained.
And S120, determining adaptive anchor frame information based on the target anchor frame information.
The adaptive anchor frame information can be used for predetermining the approximate region of the detection target in the sample image, and is a preset parameter of the network model to be trained.
Specifically, each target anchor frame information can be clustered to obtain initial anchor frame information; furthermore, the initial anchor frame information is zoomed based on a preset zoom factor to obtain a plurality of self-adaptive anchor frame information with different zoom ratios, so that the accuracy of the self-adaptive anchor frame information is improved.
On the basis of the above embodiment, the clustering the target anchor frame information to obtain initial anchor frame information includes: and clustering the length-width ratio corresponding to each target anchor frame information to obtain initial anchor frame information.
Illustratively, the aspect ratio corresponding to the target anchor frame information refers to the ratio of the length and width of the target anchor frame. Randomly selecting a preset number of length-width ratios from length-width ratios corresponding to each target anchor frame information to serve as initialized cluster centers; determining the intersection ratio from the length-width ratio corresponding to each target anchor frame information to the cluster center, and clustering according to the intersection ratio and the length-width ratio corresponding to each target anchor frame information to obtain a clustering result; and carrying out mean calculation on a plurality of aspect ratios in each clustering result to obtain an aspect ratio center value, and generating initial anchor frame information based on the aspect ratio center value.
S130, replacing original anchor frame information of a pre-established initialization model with the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information.
The original anchor frame information refers to preset parameters of a pre-established initialization model, and the number of corresponding anchor frames is large, so that a large amount of time is consumed in a training stage. In the embodiment, the original anchor frame information of the pre-established initialization model is replaced by the adaptive anchor frame information, so that the adaptive anchor frame model containing the adaptive anchor frame information is obtained, the number of anchor frames in the preset parameters is reduced, and the training time is shortened. The adaptive anchor frame model may further include a backbone network for target anchor frame content classification, a neck network for feature map multi-scale fusion, and a head network for computing loss.
Illustratively, 9 anchor frames are set by default in original anchor frame information, the number of the anchor frames of the self-adaptive anchor frame is 3, and the number of the anchor frames is reduced by three times, so that the fitting time is reduced by three times during training, the training and predicting speed is greatly accelerated, and the model performance is improved.
S140, training the self-adaptive anchor frame model based on the multiple groups of training sample data to obtain a small target detection model.
Specifically, a plurality of groups of training sample data are input to the self-adaptive anchor frame model in batches to obtain predicted anchor frame information, further, a loss function is determined based on the predicted anchor frame information and target anchor frame information corresponding to the sample image, parameters of the self-adaptive anchor frame model are adjusted based on the loss function until the self-adaptive anchor frame model meets a convergence condition, and a trained small target detection model is obtained.
According to the technical scheme of the embodiment of the invention, a plurality of groups of training sample data are obtained, wherein the training sample data comprise sample images and target anchor frame information corresponding to the sample images; further, self-adaptive anchor frame information is determined according to target anchor frame information in training sample data, and the original anchor frame information of the pre-established initialization model is replaced by the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information, so that the use of the anchor frames in the training process is reduced, and the training time can be reduced when the self-adaptive anchor frame model is trained according to multiple groups of training sample data.
Example two
Fig. 2 is a flowchart of a training method for a target detection model provided in the second embodiment of the present invention, where this embodiment optionally trains the adaptive anchor frame model based on the multiple sets of training sample data to obtain a small target detection model, based on any optional technical solution in the second embodiment of the present invention, and the method includes: inputting a plurality of groups of training sample data into the self-adaptive anchor frame model in batches to obtain predicted anchor frame information; and determining a loss function based on the predicted anchor frame information and target anchor frame information corresponding to the sample image, and adjusting parameters of the adaptive anchor frame model based on the loss function until the adaptive anchor frame model meets a convergence condition.
As shown in fig. 2, the method of the embodiment may specifically include:
s210, obtaining a plurality of groups of training sample data, wherein the training sample data comprise sample images and target anchor frame information corresponding to the sample images.
S220, determining self-adaptive anchor frame information based on the target anchor frame information.
S230, replacing the original anchor frame information of the pre-established initialization model with the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of the anchor frames corresponding to the self-adaptive anchor frame information is less than that of the anchor frames corresponding to the original anchor frame information.
S240, inputting a plurality of groups of training sample data into the self-adaptive anchor frame model in batches to obtain the prediction anchor frame information.
S250, determining a loss function based on the predicted anchor frame information and target anchor frame information corresponding to the sample image, and adjusting parameters of the adaptive anchor frame model based on the loss function until the adaptive anchor frame model meets a convergence condition.
In this embodiment, sample images in multiple sets of training sample data are input to the adaptive anchor frame model in batches as input of the model, so as to obtain prediction anchor frame information corresponding to the sample images. Furthermore, a loss function can be determined based on the predicted anchor frame information corresponding to the sample image phenomenon and the target anchor frame information corresponding to the sample image, and the adaptive anchor frame model is trained according to the loss function until a trained small target detection model is obtained.
On the basis of the foregoing embodiments, before determining the loss function based on the prediction anchor frame information and the target anchor frame information corresponding to the sample image, the method further includes: determining the proportion of each sample image to a target anchor frame region corresponding to the sample image; determining an adjustment parameter based on a threshold range corresponding to the proportion; correspondingly, the determining a loss function based on the prediction anchor frame and the target anchor frame corresponding to the sample image includes: and determining a loss function based on the prediction anchor frame information, the target anchor frame information corresponding to the sample image and the adjusting parameter.
In some embodiments, the number of large targets and small targets in the test set is easily in an unbalanced state, usually the small targets are in a smaller number of states, when the loss function is calculated, the small targets are ignored, and the model can more importantly fit the large target frame to make the positioning accurate. In order to solve the above problem, the present application introduces tuning parameters. The adjustment parameter indicates the degree of importance of the detection target in the sample image, that is, the larger the value of the adjustment parameter indicates the higher the degree of importance of the detection target, and the adjustment parameter can be used for calculation of the loss function.
Specifically, the corresponding area ratio may be determined according to the whole area of each sample image and the area of the target anchor frame region corresponding to the sample image, and the corresponding threshold range may be determined according to the area ratio, so as to determine the adjustment parameter. The threshold range may be divided according to the size of the target to obtain multiple threshold ranges.
On the basis of the above embodiments, before determining the proportion of each sample image to the target anchor frame region corresponding to the sample image, the method further includes: scaling the sizes of the sample images to obtain sample images with the same size, and performing adaptive scaling on target anchor frame information corresponding to the sample images; correspondingly, the determining the proportion of each sample image to the target anchor frame region corresponding to the sample image includes: and determining the proportion based on the sample images with the same size and the target anchor frame area corresponding to the sample images with the same size.
It can be understood that, the sample images are scaled in size to obtain sample images with the same size, for example, 640 × 640, and the number of pixels in the sample images is the same, so that the proportion can be directly determined according to the number of pixels, the area does not need to be determined, and the calculation flow of the proportion is reduced.
Specifically, the proportion may be determined based on the number of pixels of each sample image of the same size and the number of pixels of the target anchor frame region corresponding to the sample image of the same size. In other words, the number of pixels in the target anchor frame region corresponding to the sample image with the same size is divided by the number of pixels in the sample image to obtain a ratio. If the proportion is smaller than the first point threshold value, adjusting the parameter to be a first parameter value; if the proportion is larger than a second point threshold value, the parameter is adjusted to be a second parameter value; and if the proportion is larger than the first point threshold value and smaller than the second point threshold value, adjusting the parameter to be a third parameter value, wherein the third parameter value is between the first parameter value and the second parameter value. The first point threshold and the second point threshold may be set according to a boundary of the size division target.
For example, S may be used to represent the number of pixels in the scaled sample image, p may be used to represent the number of pixels in the target anchor frame region, and the first threshold may be S/2 10 The second point threshold value may be S/2 8 (ii) a The formula for the ratio is as follows:
Figure BDA0003571430030000101
wherein, alpha represents the ratio, p is less than or equal to S/2 10 Sample image representing invalid object, S/2 10 ≤p≤S/2 8 Representing small target sample images, p>S/2 8 A sample image representing a large object. The final loss function can be expressed as:
Figure BDA0003571430030000102
the giou (generalized interaction over union) is a distance measure in target detection, and can be used for calculating a loss function.
According to the technical scheme of the embodiment of the invention, the adjustment parameters corresponding to the proportion can be updated in real time according to the number of the pixel points in the target anchor frame area, namely, the loss function is adjusted in real time, so that the importance of the small target is improved, and the detection precision of the small target detection model is further improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a training apparatus for a target detection model according to a third embodiment of the present invention, where the training apparatus for a target detection model provided in this embodiment may be implemented by software and/or hardware, and may be configured in a terminal and/or a server to implement a training method for a target detection model in the third embodiment of the present invention. The device may specifically comprise:
the training sample obtaining module 310 is configured to obtain multiple sets of training sample data, where the training sample data includes a sample image and target anchor frame information corresponding to the sample image;
an adaptive anchor frame information determining module 320 for determining adaptive anchor frame information based on the target anchor frame information;
an information replacing module 330, configured to replace, by the adaptive anchor frame information, original anchor frame information of a pre-established initialization model to obtain an adaptive anchor frame model, where the number of anchor frames corresponding to the adaptive anchor frame information is less than the number of anchor frames corresponding to the original anchor frame information;
and the model training module 340 is configured to train the adaptive anchor frame model based on the multiple sets of training sample data to obtain a small target detection model.
According to the technical scheme of the embodiment of the invention, a plurality of groups of training sample data are obtained, wherein the training sample data comprise sample images and target anchor frame information corresponding to the sample images; further, self-adaptive anchor frame information is determined according to target anchor frame information in training sample data, and the original anchor frame information of the pre-established initialization model is replaced by the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information, so that the use of the anchor frames in the training process is reduced, and the training time can be reduced when the self-adaptive anchor frame model is trained according to multiple groups of training sample data.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the adaptive anchor frame information determining module 320 includes:
the anchor frame information clustering unit is used for clustering the target anchor frame information to obtain initial anchor frame information;
and the anchor frame information zooming unit is used for zooming the initial anchor frame information based on a preset zooming coefficient to obtain a plurality of self-adaptive anchor frame information with different zooming proportions.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the anchor frame information clustering unit is specifically configured to:
and clustering the length-width ratio corresponding to each target anchor frame information to obtain initial anchor frame information.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the model training module 340 includes:
the prediction anchor frame information determining unit is used for inputting a plurality of groups of training sample data into the self-adaptive anchor frame model in batches to obtain prediction anchor frame information;
and the loss function determining unit is used for determining a loss function based on the predicted anchor frame information and the target anchor frame information corresponding to the sample image, and adjusting the parameters of the adaptive anchor frame model based on the loss function until the adaptive anchor frame model meets the convergence condition.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the apparatus further includes:
the proportion determining unit is used for determining the proportion of each sample image and a target anchor frame area corresponding to the sample image;
an adjustment parameter determining unit, configured to determine an adjustment parameter based on a threshold range corresponding to the ratio;
correspondingly, the loss function determination unit is further configured to:
and determining a loss function based on the prediction anchor frame information, the target anchor frame information corresponding to the sample image and the adjusting parameter.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the apparatus is further configured to:
scaling the sizes of the sample images to obtain sample images with the same size, and performing adaptive scaling on target anchor frame information corresponding to the sample images;
correspondingly, the proportion determining unit further comprises:
and the proportion determining subunit is used for determining the proportion based on the sample images with the same size and the target anchor frame area corresponding to the sample images with the same size.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the proportion determining subunit is specifically configured to:
and determining the proportion based on the number of the pixel points of each sample image with the same size and the number of the pixel points of the target anchor frame region corresponding to the sample image with the same size.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the adjustment parameter determining unit is specifically configured to:
if the proportion is smaller than a first point threshold value, the adjusting parameter is a first parameter value;
if the proportion is larger than a second point threshold value, the adjusting parameter is a second parameter value;
if the ratio is greater than a first point threshold and less than a second point threshold, the adjustment parameter is a third parameter value, wherein the third parameter value is between the first parameter value and the second parameter value.
The device can execute the training method of the target detection model provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the training method of the target detection model.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 4 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 4, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 36 having a set (at least one) of program modules 26 may be stored, for example, in the system memory 28, such program modules 26 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 26 generally perform the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown in FIG. 4, the network adapter 20 communicates with the other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
The processing unit 16 executes programs stored in the system memory 28 to perform various functional applications and data processing, such as implementing a training method for an object detection model provided by an embodiment of the present invention.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for training a target detection model, the method including:
acquiring a plurality of groups of training sample data, wherein the training sample data comprise sample images and target anchor frame information corresponding to the sample images;
determining adaptive anchor frame information based on the target anchor frame information;
replacing original anchor frame information of a pre-established initialization model with the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information;
and training the self-adaptive anchor frame model based on the multiple groups of training sample data to obtain a small target detection model.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (11)

1. A method for training an object detection model is characterized by comprising the following steps:
acquiring a plurality of groups of training sample data, wherein the training sample data comprises a sample image and target anchor frame information corresponding to the sample image;
determining adaptive anchor frame information based on the target anchor frame information;
replacing original anchor frame information of a pre-established initialization model with the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information;
and training the self-adaptive anchor frame model based on the multiple groups of training sample data to obtain a small target detection model.
2. The method of claim 1, wherein determining adaptive anchor frame information based on the target anchor frame information comprises:
clustering the target anchor frame information to obtain initial anchor frame information;
and zooming the initial anchor frame information based on a preset zooming coefficient to obtain a plurality of self-adaptive anchor frame information with different zooming ratios.
3. The method of claim 2, wherein clustering each of the target anchor frame information to obtain initial anchor frame information comprises:
and clustering the length-width ratio corresponding to each target anchor frame information to obtain initial anchor frame information.
4. The method of claim 1, wherein training the adaptive anchor frame model based on the plurality of sets of training sample data to obtain a small target detection model comprises:
inputting a plurality of groups of training sample data into the self-adaptive anchor frame model in batches to obtain predicted anchor frame information;
and determining a loss function based on the predicted anchor frame information and target anchor frame information corresponding to the sample image, and adjusting parameters of the adaptive anchor frame model based on the loss function until the adaptive anchor frame model meets a convergence condition.
5. The method of claim 4, wherein prior to determining a loss function based on the prediction anchor information and target anchor information corresponding to the sample image, the method further comprises:
determining the proportion of each sample image to a target anchor frame region corresponding to the sample image;
determining an adjustment parameter based on a threshold range corresponding to the proportion;
correspondingly, the determining a loss function based on the prediction anchor frame and the target anchor frame corresponding to the sample image includes:
and determining a loss function based on the prediction anchor frame information, the target anchor frame information corresponding to the sample image and the adjusting parameter.
6. The method of claim 5, wherein prior to determining the proportion of each of the sample images to the target anchor frame region to which the sample image corresponds, the method further comprises:
carrying out size scaling on each sample image to obtain sample images with the same size, and carrying out adaptive scaling on target anchor frame information corresponding to the sample images;
correspondingly, the determining the proportion of each sample image to the target anchor frame region corresponding to the sample image includes:
and determining the proportion based on the sample images with the same size and the target anchor frame area corresponding to the sample images with the same size.
7. The method of claim 6, wherein determining the scale based on the same-size sample image and a target anchor frame region corresponding to the same-size sample image comprises:
and determining the proportion based on the number of the pixel points of each sample image with the same size and the number of the pixel points of the target anchor frame region corresponding to the sample image with the same size.
8. The method of claim 5, wherein determining an adjustment parameter based on a threshold range to which the ratio corresponds comprises:
if the proportion is smaller than a first point threshold value, the adjusting parameter is a first parameter value;
if the proportion is larger than a second point threshold value, the adjusting parameter is a second parameter value;
if the ratio is greater than a first point threshold and less than a second point threshold, the adjustment parameter is a third parameter value, wherein the third parameter value is between the first parameter value and the second parameter value.
9. An apparatus for training an object detection model, comprising:
the training sample acquisition module is used for acquiring a plurality of groups of training sample data, wherein the training sample data comprises a sample image and target anchor frame information corresponding to the sample image;
the self-adaptive anchor frame information determining module is used for determining self-adaptive anchor frame information based on the target anchor frame information;
the information replacement module is used for replacing the original anchor frame information of the pre-established initialization model with the self-adaptive anchor frame information to obtain a self-adaptive anchor frame model, wherein the number of anchor frames corresponding to the self-adaptive anchor frame information is less than that of the original anchor frame information;
and the model training module is used for training the self-adaptive anchor frame model based on the multiple groups of training sample data to obtain a small target detection model.
10. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of training an object detection model as claimed in any one of claims 1-8.
11. A storage medium containing computer-executable instructions for performing a method of training an object detection model as claimed in any one of claims 1 to 8 when executed by a computer processor.
CN202210325006.0A 2022-03-29 2022-03-29 Training method and device of target detection model, electronic equipment and medium Pending CN114821034A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210325006.0A CN114821034A (en) 2022-03-29 2022-03-29 Training method and device of target detection model, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210325006.0A CN114821034A (en) 2022-03-29 2022-03-29 Training method and device of target detection model, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN114821034A true CN114821034A (en) 2022-07-29

Family

ID=82531966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210325006.0A Pending CN114821034A (en) 2022-03-29 2022-03-29 Training method and device of target detection model, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114821034A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116993963A (en) * 2023-09-21 2023-11-03 腾讯科技(深圳)有限公司 Image processing method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116993963A (en) * 2023-09-21 2023-11-03 腾讯科技(深圳)有限公司 Image processing method, device, equipment and storage medium
CN116993963B (en) * 2023-09-21 2024-01-05 腾讯科技(深圳)有限公司 Image processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109117831B (en) Training method and device of object detection network
CN112633384B (en) Object recognition method and device based on image recognition model and electronic equipment
CN108450058B (en) Real-time automatic vehicle-mounted camera calibration
CN110348522B (en) Image detection and identification method and system, electronic equipment, and image classification network optimization method and system
EP3746935A1 (en) Object detection based on neural network
CN111667504B (en) Face tracking method, device and equipment
CN113420757B (en) Text auditing method and device, electronic equipment and computer readable medium
CN115131748B (en) Method and system for improving target tracking and identifying accuracy rate of radar and vision all-in-one machine
CN111783626A (en) Image recognition method and device, electronic equipment and storage medium
CN110390295B (en) Image information identification method and device and storage medium
CN112712036A (en) Traffic sign recognition method and device, electronic equipment and computer storage medium
CN114821034A (en) Training method and device of target detection model, electronic equipment and medium
CN110796108A (en) Method, device and equipment for detecting face quality and storage medium
CN113762455A (en) Detection model training method, single character detection method, device, equipment and medium
CN111063011A (en) Face image processing method, device, equipment and medium
CN116309643A (en) Face shielding score determining method, electronic equipment and medium
CN116503596A (en) Picture segmentation method, device, medium and electronic equipment
CN113721240B (en) Target association method, device, electronic equipment and storage medium
CN113762027B (en) Abnormal behavior identification method, device, equipment and storage medium
CN113762017B (en) Action recognition method, device, equipment and storage medium
CN113626120A (en) Method and device for determining display page, electronic equipment and storage medium
CN110348374B (en) Vehicle detection method and device, electronic equipment and storage medium
CN115690191A (en) Optical center determining method, device, electronic equipment and medium
CN111124862A (en) Intelligent equipment performance testing method and device and intelligent equipment
CN112861940A (en) Binocular disparity estimation method, model training method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination