Single-stage target detection model training method and device, and storage medium

By optimizing the loss function value using adaptive focus loss functions of different scales in the single-stage object detection model, the poor performance caused by the training differences of feature maps at different scales is solved, thereby improving the model training effect and the diagnostic accuracy of fundus screening.

CN116342997BActive Publication Date: 2025-12-09BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210106814.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-12-20
Filing Date
2022-01-28
Publication Date
2025-12-09
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

Existing single-stage object detection models suffer from poor performance during training because they use a uniform loss function value for feature maps at different scales, ignoring the differences between scales.

Method used

By employing loss function values ​​corresponding to different scales and optimizing them using an adaptive focal loss function, the loss function values ​​for each scale are calculated and the final loss function value is determined to improve the model training effect.

Benefits of technology

It has improved model training effectiveness and performance without increasing model parameters, especially enhancing diagnostic accuracy in fundus screening systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116342997B_ABST
    Figure CN116342997B_ABST
Patent Text Reader

Abstract

The disclosure discloses a single-stage target detection model training method and device and a storage medium, relates to the fields of deep learning, computer vision, intelligent image and artificial intelligence, and the method comprises the following steps: in the training process of the single-stage target detection model, when classification loss calculation is required, loss function values corresponding to feature maps of different scales are respectively obtained, the loss function is a focal loss function; the final loss function value is determined according to the obtained loss function values, and the training of the single-stage target detection model is performed according to the final loss function value. The scheme disclosed in the disclosure can improve the model training effect and model performance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to a single-stage target detection model training method, device and storage medium in the fields of deep learning, computer vision and intelligent image. BACKGROUND

[0002] The intelligent fundus screening system refers to a system that makes intelligent decisions in line with the diagnosis experience of a doctor based on the fundus retinal image information of a subject and in combination with the physical condition information of the subject without the assistance of the diagnosis experience of a professional ophthalmologist. The current intelligent fundus screening system is mainly realized based on deep learning technology and can be divided into two categories: black box model and white box model. The white box model can give the positioning of the relevant lesion location while outputting the diagnosis result, and thus has more important significance in practical application.

[0003] The white box model has two main implementation methods: one is the end-cloud interaction method, and the other is the method of making autonomous decisions by using local intelligent terminal hardware, i.e., directly making diagnosis decisions on the local intelligent terminal for the images to be screened. In the latter method, a single-stage target detection model (or a single-stage target detector, etc.) is usually used to realize the diagnosis decisions. In the single-stage target detection model, the feature pyramid network (FPN) and the focal loss function are common structures and components. In the mainstream implementation method of the existing single-stage target detection model, the feature maps of different scales in the FPN correspond to a unified loss function value, thereby ignoring the differences between the scales and further leading to poor model training effect and reduced model performance. SUMMARY

[0004] The present disclosure provides a single-stage target detection model training method, device and storage medium.

[0005] A single-stage target detection model training method comprises the following steps:

[0006] In the training process of the single-stage target detection model, when classification loss calculation is needed, loss function values corresponding to feature maps of different scales are obtained respectively, and the loss function is a focal loss function.

[0007] A final loss function value is determined according to the obtained loss function values, and the training of the single-stage target detection model is performed according to the final loss function value.

[0008] A single-stage target detection model training device comprises a first training module and a second training module.

[0009] The first training module is configured to, in the training process of the single-stage target detection model, obtain loss function values corresponding to feature maps of different scales respectively when classification loss calculation is required, and the loss function is a focal loss function.

[0010] The second training module is configured to determine a final loss function value according to the obtained loss function values, and train the single-stage target detection model according to the final loss function value.

[0011] An electronic device comprises:

[0012] at least one processor; and

[0013] a memory connected to the at least one processor in communication; wherein

[0014] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method as described above.

[0015] A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method as described above.

[0016] A computer program product comprising a computer program which, when executed by a processor, implements the method as described above.

[0017] One embodiment in the above disclosure has the following advantages or beneficial effects: different scale loss function values corresponding to different scales can be used to replace the unified loss function value, thereby realizing the targeted optimization of different scales, and further improving the model training effect and model performance.

[0018] It should be understood that the contents described in this part are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS

[0019] The accompanying drawings serve to better understand the present scheme and do not constitute a limitation on the present disclosure. Among them:

[0020] Figure 1 Flowchart of the single-stage target detection model training method embodiment of the present disclosure;

[0021] Figure 2 Schematic diagram of the statistical results of the present disclosure;

[0022] Figure 3 Schematic diagram of the training process of the existing single-stage target detection model;

[0023] Figure 4 Structure diagram of the single-stage target detection model based on Anchor according to the present disclosure;

[0024] Figure 5 Structure diagram of the single-stage target detection model training device embodiment 50 according to the present disclosure;

[0025] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0026] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, which are included to provide a thorough understanding of embodiments of the present disclosure by individuals of ordinary skill in the art, and they should be considered in conjunction only, and should not be considered alone. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, in order to be clear and concise, descriptions of well-known functions and structures are omitted in the following description.

[0027] In addition, it should be understood that the term "and / or" herein is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after it.

[0028] Figure 1 Flowchart of the single-stage target detection model training method embodiment according to the present disclosure. As shown in Figure 1 the following specific implementation is included.

[0029] In step 101, during the training process of the single-stage target detection model, when classification loss calculation is needed, the loss function values corresponding to the feature maps of different scales are obtained respectively, and the loss function is Focal loss.

[0030] In step 102, the final loss function value is determined according to the obtained loss function values, and the training of the single-stage target detection model is performed according to the final loss function value.

[0031] The existing single-stage target detection model is mainly divided into two types. One is an anchor-based single-stage target detection model, mainly represented by a target detection network (RetinaNet) model and an efficient detection (EfficientDet) model. The core is to increase the degree of feature fusion of different resolutions through the top-down structure brought by FPN, and to mine difficult example samples in the training process through Focal loss. In the training and inference process of the model, the offset between the anchor and the positive sample is calculated to match the positive and negative samples. The other is an anchor-free single-stage target detection model, which is represented by a fully convolutional single-stage target detection (FCOS, Fully Convolutional One-Stage Object Detection) model. The model is also trained through the combination of FPN and Focal loss. The difference from the first type is that the positive and negative samples are matched mainly through the key point position and other related information.

[0032] Taking the RetinaNet model as an example, in the training process of the RetinaNet model, the ground truth of each image is matched with different layers of anchors according to the intersection-over-union (IoU) size, and the anchor with the largest IoU is selected to calculate the classification loss and the bounding box regression loss.

[0033] For a general target detection data set (COCO, Common Objects in Context), the number of positive samples matched by the anchor in one iteration process and the number of potential negative samples can be counted, Figure 2 The schematic diagram of the statistical results of the present disclosure is shown.

[0034] Through Figure 2 It can be seen that there is a great difference between the overall positive and negative sample ratio in the model training process and the positive and negative sample ratio matched to different scale feature maps such as C3-C7. Therefore, the optimization difficulty, convergence speed, etc. of different scales are also different. If a unified loss function value is used to optimize different scales uniformly, the actual effect is often not good.

[0035] Therefore, in the scheme of the method embodiment of the present disclosure, the loss function value corresponding to different scales is used instead of the unified loss function value, so as to realize the targeted optimization of different scales, that is, the training process of different feature maps is optimized in layers, and then the effects of improving the model training effect and model performance without increasing the model parameters are achieved.

[0036] Figure 3 The training process of the existing single-stage target detection model is shown in FIG. 1. Figure 3 As shown in the figure, it mainly includes steps 301-305, that is, mainly includes sample input, generation of prediction results, target assignment, classification / regression loss calculation and gradient back propagation, etc. In step 306, if convergence is determined, the process can be ended, otherwise, step 301 can be repeatedly executed. In the present disclosure, the classification loss calculation in the step of "classification / regression loss calculation" is optimized and adjusted, and the loss function value corresponding to each scale is calculated separately according to the prediction distribution on each scale.

[0037] Taking an anchor-based single-stage target detection model as an example, Figure 4 The structure diagram of the anchor-based single-stage target detection model is shown in FIG. 2. Figure 4 As shown in the figure, the left side is the backbone of the model, which is mainly realized by a plurality of layers of stacked convolution layers to realize feature fusion and down-sampling operations, etc. The middle is the feature pyramid structure commonly used in single-stage models, which is mainly realized by 1x1 convolution layers and up-sampling layers to realize "top-down" feature fusion operations, wherein the interpolation method used by the up-sampling layer is the nearest neighbor interpolation method. The right side is the branch network (Subnets) of the detection frame classification / regression, which is mainly composed of a plurality of convolution layers, and the position and probability of the prediction frame are generated according to the numerical value output at last and the size of the corresponding point Anchor. As shown in FIG. 3, the loss function values 1 (Loss_1) to Loss_5 are additionally used in the present disclosure to optimize the prediction results of different Subnets. Figure 4

[0038] According to the existing Focal Loss, the loss function value can be calculated in the following manner:

[0039]

[0040]

[0041] wherein, represents the positive sample weight, γ represents the difficulty sample mining degree, y represents the sample label, p t ​denotes the predicted probability value (or referred to as the predicted result probability value, etc.) corresponding to any sample, n denotes the total number of positive and negative samples, FL(p t ) denotes the loss function value corresponding to any sample, FL mean denotes the final loss function value.

[0042] Generally, it is a fixed value, and the specific value can be determined according to actual needs. When the sample is a positive sample, the value of y can be 1, and vice versa, when the sample is a negative sample, the value of y can be 0. Gamma represents the degree of difficult example sample mining, which mainly achieves the purpose of making the model focus on difficult example samples by suppressing the weight of simple samples. In the model training process, gamma is usually set to 1.5 or 2, and the larger the value of gamma, the more the model will focus on a small number of difficult example samples during optimization.

[0043] Similarly, in the present disclosure, when obtaining the loss function value corresponding to different scales, the following processing can be performed respectively for any scale, i.e., for each scale: respectively obtaining the loss function value corresponding to each sample matched to the scale; calculating the mean value of the loss function value corresponding to each sample, and taking the mean value as the loss function value corresponding to the scale.

[0044] Among them, for any scale, when respectively obtaining the loss function value corresponding to each sample matched to the scale, the first parameter corresponding to the scale can be obtained first, and the first parameter represents the degree of difficult example sample mining. Then, for any sample matched to the scale, the loss function value corresponding to the sample can be calculated according to the predicted probability value corresponding to the sample, the first parameter, the second parameter and the third parameter, respectively, the second parameter represents the weight of positive samples, and the third parameter represents the sample label.

[0045] Focal loss achieves the effect of online mining of difficult example samples by suppressing the weight of simple samples. However, during the model convergence process, the proportion of difficult example samples will continuously decrease with the convergence of the model, so more samples will be assigned a lower weight with iteration, and thus be in a state of being ignored in model training. Therefore, how to solve the degradation problem in the training process and maintain the continuously effective backpropagation gradient is also a problem to be solved by the present disclosure.

[0046] Correspondingly, the present disclosure proposes that for any scale, the first parameter corresponding to the scale can be determined according to the average difficulty level of each sample matched to the scale in each batch in the training process, so that the effect of paying attention to more difficult example samples at the early stage of training and dynamically improving the suppression degree of simple samples in Focal loss with the progress of the iteration process can be achieved.

[0047] Specifically, for any scale, in each batch in the training process, the mean of the prediction probability values corresponding to each positive sample matched to the scale in the batch can be calculated respectively, and the mean can be logarithmized, and then the negative of the logarithmized result can be taken as the first parameter corresponding to the scale.

[0048] Based on the above introduction, there are:

[0049]

[0050]

[0051] wherein, AFL (p t ) represents a loss function value corresponding to any sample, that is, an Adaptive Focal Loss value, that is, the second parameter, represents a positive sample weight, y, that is, the third parameter, represents a sample label, and p t represents a prediction probability value corresponding to any sample, represents the first parameter, corresponding to γ in formula (1), and m represents the number of positive samples matched to the scale corresponding to the “any sample”, and for a positive sample, the value of y is 1, so y in formula (4) can also be omitted.

[0052] For any scale, after the loss function values corresponding to each sample matched to the scale are obtained respectively, the mean of the loss function values corresponding to each sample can be calculated, and the mean is taken as the loss function value corresponding to the scale.

[0053] Further, the final loss function value can be determined according to the obtained loss function values corresponding to each scale. For example, the mean of the obtained loss function values corresponding to each scale can be calculated, and the mean is taken as the final loss function value.

[0054] That is, AFL mean = (AFL1 + AFL2 + AFL3 + AFL4 + AFL5) / 5; (5)

[0055] wherein, AFL1 represents Figure 4 the loss function value corresponding to C3 as shown in formula (2), AFL2 represents Figure 4 the loss function value corresponding to C4 as shown in formula (3), and so on, and AFL mean represents the final loss function value.

[0056] The training of the single-stage target detection model can be performed according to the final loss function value, and the specific implementation is the prior art.

[0057] After adopting the above processing method, in the early stage of model training, due to the large number of difficult examples, Focal loss will pay more attention to the optimization of difficult examples. As the model continues to train and iterate, the number of difficult examples tends to decrease. The model will still maintain effective gradient backpropagation during training, instead of ignoring the vast majority of examples as it iterates, as in the existing Focal loss, thereby further improving the model training effect and model performance.

[0058] In addition, the single-stage target detection model trained in accordance with the manner described in this disclosure can be used for actual fundus screening, and the accuracy of the screening results can be improved.

[0059] Taking the RetinaNet model as an example, Table 1 is a performance comparison diagram between the RetinaNet model obtained according to the method described in this disclosure, namely the Ad-RetinaNet model, and the existing RetinaNet model.

[0060]

[0061] Table 1 Performance Comparison

[0062] As shown in Table 1, performance can be validated based on the COCO dataset, using average precision (AP) as the evaluation metric. Specifically, AP and AP can be used to evaluate the performance. 50 AP 75 APs, AP M and AP L The terms "etc." refer to existing technologies. As shown in Table 1, the Ad-RetinaNet model offers a significant performance improvement compared to the existing RetinaNet model.

[0063] It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this disclosure. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this disclosure.

[0064] The above is an introduction to the method embodiments. The following describes the solution described in this disclosure further through device embodiments.

[0065] Figure 5 This is a schematic diagram of the structural composition of Embodiment 50 of the single-stage target detection model training device described in this disclosure. Figure 5 As shown, it includes: a first training module 501 and a second training module 502.

[0066] The first training module 501 is configured to, in the training process of the single-stage target detection model, obtain loss function values corresponding to feature maps of different scales respectively when classification loss calculation is required, and the loss function is Focal Loss.

[0067] The second training module 502 is configured to determine a final loss function value according to the obtained loss function values, and train the single-stage target detection model according to the final loss function value.

[0068] Specifically, the first training module 501 can perform the following processing for any scale: obtaining loss function values corresponding to samples matched to the scale respectively; calculating the mean of the loss function values corresponding to the samples, and taking the mean as the loss function value corresponding to the scale.

[0069] The first training module 501 can also perform the following processing for any scale: obtaining a first parameter corresponding to the scale, the first parameter representing the degree of difficult sample mining; for any sample matched to the scale, calculating the loss function value corresponding to the sample according to the prediction probability value corresponding to the sample, the first parameter, a second parameter and a third parameter respectively, the second parameter representing the weight of positive samples, and the third parameter representing the sample label.

[0070] The first training module 501 can determine the first parameter corresponding to the scale according to the average difficulty of the samples matched to the scale in each batch during the training process for any scale.

[0071] For example, the first training module 501 can calculate the mean of the prediction probability values corresponding to the positive samples matched to the scale in each batch during the training process for any scale, and can take the logarithm of the mean, and then the negative of the logarithm result can be taken as the first parameter corresponding to the scale.

[0072] In addition, the second training module 502 can determine the final loss function value according to the loss function values corresponding to the scales, for example, can calculate the mean of the loss function values corresponding to the scales, and take the mean as the final loss function value.

[0073] Further, the second training module 502 can also train the single-stage target detection model according to the final loss function value.

[0074] Figure 5 The specific working process of the device embodiment is described above in the method embodiment, and will not be repeated here.

[0075] In summary, by using the scheme described in the device embodiment of the present disclosure, different scale corresponding loss function values can be used to replace the unified loss function value, thereby realizing the targeted optimization of different scales and the like, and further improving the model training effect and model performance and the like.

[0076] The scheme described in the present disclosure can be applied to the field of artificial intelligence, and in particular relates to the field of artificial intelligence such as deep learning, computer vision and intelligent image.

[0077] Artificial intelligence is a discipline that studies enabling computers to simulate some thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.) of humans, and includes both hardware and software technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing, etc. Artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, and machine learning / deep learning, big data processing technology, knowledge graph technology, etc. several major directions.

[0078] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product.

[0079] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, servers, servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are merely examples and are not intended to limit the implementations of the present disclosure described and / or claimed herein.

[0080] As shown in Figure 6 The device 600 includes a computing unit 601 that can perform various appropriate actions and processes according to computer programs stored in a read-only memory (ROM) 602 or loaded into a random access memory (RAM) 603 from a storage unit 608. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0081] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through computer networks, such as the Internet, and / or various telecommunication networks.

[0082] The computing unit 601 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs various methods and processes described above, such as the methods described in the present disclosure. For example, in some embodiments, the methods described in the present disclosure can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded onto the RAM 603 and executed by the computing unit 601, one or more steps of the methods described in the present disclosure can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the methods described in the present disclosure by any other appropriate means, such as by means of firmware.

[0083] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0084] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package, or entirely on a remote machine or server.

[0085] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0086] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0087] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0088] The computer system can include clients and servers. This relationship can be. The servers are typically remote from the clients with the interactions between them occurring over a communication network. The relationship between clients and servers arises by interplay between programs running on the respective computers and having a client-server relationship. The servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are a host product in the cloud computing service system to solve the defects of large management difficulty and weak business scalability in traditional physical hosts and virtual private servers (VPS). The servers can also be servers of a distributed system, or servers combined with a blockchain.

[0089] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, in series, or in a different order, without departing from the desired results of the technical solutions of the present disclosure, and this is not limited herein.

[0090] The above detailed description does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A single-stage target detection model training method, comprising: The method is applied to autonomous decision-making using local intelligent terminal hardware, the autonomous decision-making is a diagnostic decision made on a local intelligent terminal for an image to be screened, and the diagnostic decision is a diagnostic decision realized using a single-stage target detection model; During training of the single-stage target detection model, when classification loss calculation is required, loss function values corresponding to feature maps of different scales are obtained, including: for any scale, the following processing is performed: a first parameter corresponding to the scale is obtained, the first parameter represents a degree of difficult example sample mining, for any sample matched to the scale, a loss function value corresponding to the sample is calculated according to a prediction probability value corresponding to the sample, the first parameter, a second parameter, and a third parameter, the second parameter represents a positive sample weight and is a fixed value, and the third parameter represents a sample label, an average value of the loss function values corresponding to the samples matched to the scale is calculated, and the average value is taken as the loss function value corresponding to the scale, and the loss function is a focal loss function; A final loss function value is determined according to the obtained loss function values corresponding to the scales, and training of the single-stage target detection model is performed according to the final loss function value.

2. The method of claim 1, wherein, The first parameter corresponding to the scale is obtained, including: For any scale, the first parameter corresponding to the scale is determined according to an average difficulty level of the samples matched to the scale in each batch during training.

3. The method of claim 2, wherein, The first parameter corresponding to the scale is determined according to the average difficulty level of the samples matched to the scale in the batch, including: An average value of the prediction probability values corresponding to the positive samples matched to the scale in the batch is calculated, a logarithm of the average value is taken, and a negative number of the logarithm result is taken as the first parameter corresponding to the scale.

4. The method of claim 1, wherein, The final loss function value is determined according to the obtained loss function values corresponding to the scales, including: An average value of the loss function values corresponding to the scales is calculated, and the average value is taken as the final loss function value.

5. A single-stage object detection model training apparatus, comprising: A first training module and a second training module; The device is applied to autonomous decision-making using local intelligent terminal hardware, the autonomous decision-making is a diagnostic decision made on a local intelligent terminal for an image to be screened, and the diagnostic decision is a diagnostic decision realized using a single-stage target detection model; The first training module is configured to, in the training process of the single-stage target detection model, obtain loss function values corresponding to feature maps of different scales respectively when classification loss calculation is required, including: for any scale, the following processing is performed respectively: obtaining a first parameter corresponding to the scale, the first parameter representing a degree of difficult example mining, for any sample matched to the scale, calculating a loss function value corresponding to the sample according to a prediction probability value corresponding to the sample, the first parameter, a second parameter, and a third parameter, the second parameter representing a positive sample weight and being a fixed value, the third parameter representing a sample label, calculating a mean value of the loss function values corresponding to the samples matched to the scale, and taking the mean value as the loss function value corresponding to the scale, the loss function being a focal loss function. The second training module is configured to determine a final loss function value according to the obtained loss function values corresponding to the scales, and train the single-stage target detection model according to the final loss function value. 6.The apparatus of claim 5, wherein, The first training module is configured to, for any scale, determine the first parameter corresponding to the scale according to an average difficulty level of the samples matched to the scale in each batch in the training process. 7.The apparatus of claim 6, wherein, The first training module is configured to calculate a mean value of the prediction probability values corresponding to the positive samples matched to the scale in the batch, take a logarithm of the mean value, and take a negative number of the logarithm result as the first parameter corresponding to the scale. 8.The apparatus of claim 5, wherein, The second training module is configured to calculate a mean value of the obtained loss function values corresponding to the scales, and take the mean value as the final loss function value. 9.An electronic device comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.

10. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-4. 11.A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Neural network training method and device, object recognition method and device and electronic equipment

    CN110490306A