Target detection and tracking method, storage medium and device based on YOLO neural network

By simultaneously training and detecting multiple target categories in the same YOLO network structure and performing post-processing, the problem of long inference time of YOLO neural network on embedded devices is solved, achieving faster response speed and higher security.

CN115239949BActive Publication Date: 2025-09-23YIPU PHOTOELECTRIC (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210900096.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-28
Publication Date
2025-09-23
Estimated Expiration
2042-07-28

AI Technical Summary

Technical Problem

The existing YOLO neural network needs to use multiple networks when detecting and tracking targets of different categories, which increases the model inference time and is not conducive to deployment on embedded devices.

Method used

The same Yolo network structure is used to train and detect at least two different categories of detection targets in the sample data set, multiple output layers are used to detect different targets respectively, and post-processing is performed by calculating the distance ratio to improve the model accuracy and security.

Benefits of technology

It effectively shortens the model's inference time, improves deployment efficiency on embedded devices, and enhances the response speed and safety performance of target detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115239949B_ABST
    Figure CN115239949B_ABST
Patent Text Reader

Abstract

The present application provides a target detection and tracking method, storage medium, and device based on a YOLO neural network. The target detection and tracking method based on a YOLO neural network includes obtaining and preprocessing a sample data set; obtaining a YOLO network structure, and using the YOLO network structure to simultaneously train and detect at least two different categories of detection targets in the sample data set; post-processing the neural network target detection results; and image rendering and dedistortion. Compared with related technologies, the target detection and tracking method, storage medium, and device based on a YOLO neural network provided in the present application shorten the model's inference time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of target detection technology, and in particular relates to a target detection and tracking method, storage medium and device based on a YOLO neural network. Background Art

[0002] The Yolo (You Only Look Once) framework is an end-to-end object detection algorithm that rapidly predicts the location and category of objects in images. It integrates target region prediction and target category prediction into a single neural network model, enabling rapid object detection and recognition with high accuracy, making it ideal for field applications.

[0003] However, when using the related technology of the YOLO neural network to detect and track targets of different categories, multiple different networks need to be used separately, which increases the inference time of the model and is not conducive to use on embedded devices. Summary of the Invention

[0004] In response to the shortcomings of the existing technology, the purpose of this application is to provide a target detection and tracking method, storage medium and device based on the YOLO neural network that can effectively shorten the inference time of the model and is more conducive to deployment on embedded devices.

[0005] The technical solution adopted by this application to solve its technical problems is:

[0006] In a first aspect, an embodiment of the present application provides a target detection and tracking method based on a YOLO neural network, comprising:

[0007] Obtain sample data sets and preprocess them;

[0008] Obtain the YOLO network structure and use it to train and detect at least two different categories of detection targets in the sample data set simultaneously;

[0009] Post-processing of neural network target detection results;

[0010] Image rendering and dedistortion.

[0011] According to some embodiments of the first aspect of the present application, obtaining a sample data set includes:

[0012] Get the image;

[0013] Label at least two different categories of detection targets in the image.

[0014] According to some embodiments of the first aspect of the present application, the at least two different categories of detection targets include:

[0015] A first detection target and a second detection target;

[0016] Using the yolo network structure to train and test the sample data set includes:

[0017] Detecting a first detection target using at least one output layer of a yolo network structure;

[0018] The remaining output layers of the yolo network structure are used to detect the second detection target.

[0019] According to some embodiments of the first aspect of the present application, for the first detection target and the second detection target, a loss function of each output layer is calculated and satisfies the following formula:

[0020] Total loss=m*Objects[1]loss+Objects[2]loss;

[0021] Among them, Total loss is the total loss function, Objects[1]loss is the loss function of the first detection target, Objects[2]loss is the loss function of the second detection target, and m is the weight coefficient.

[0022] According to some embodiments of the first aspect of the present application, post-processing of neural network target detection results includes:

[0023] calculating a distance ratio to the first detected target and / or the second detected target;

[0024] When the distance ratio to the first detection target or the second detection target is in a dangerous area, the control issues an alarm.

[0025] According to some embodiments of the first aspect of the present application, the distance ratio is calculated as follows:

[0026] Ratio1 = (l1 / r1);

[0027] Ratio2=(√(x–a2x) 2 +(y–a2y) 2 ) / (√(x–b2x) 2 +(y–b2y)2);

[0028] Ratio3=(√(x–a3x) 2 +(y–a3y) 2 ) / (√(x–b3x) 2 +(y–b3y) 2 );

[0029] avgDratio=Ratio1+Ratio2+Ratio3;

[0030] Where ratio1 represents the first ratio; ratio2 represents the second ratio; ratio3 represents the third ratio; avgDratio represents the final distance ratio; a2, a3, b2, and b3 represent different measurement points; x represents the horizontal axis coordinate value; and y represents the vertical axis coordinate value.

[0031] According to some embodiments of the first aspect of the present application, training and testing a sample data set using a YOLO network structure includes:

[0032] The area of ​​the IOU error is controlled to be greater than 0.85, where the area of ​​the IOU error is:

[0033] Prediction box size ∩ real box size / prediction box size ∪ real box size.

[0034] According to some embodiments of the first aspect of the present application, the preprocessing includes:

[0035] Histogram equalization processing, and / or random brightness and contrast processing, and / or motion blur processing, and / or random flash processing, and / or random rain and snow processing, and / or image mosaic processing.

[0036] In a second aspect, an embodiment of the present application further provides a computer storage medium on which computer program instructions are stored; when the computer program instructions are executed by a processor, a target detection and tracking method based on a YOLO neural network as described above is implemented.

[0037] In a third aspect, an embodiment of the present application also provides a target detection and tracking device based on a yolo neural network, including a computer storage medium as any of the foregoing.

[0038] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects:

[0039] The present application provides a target detection and tracking method based on the YOLO neural network. In this method, by utilizing the YOLO network structure, at least two different categories of detection targets in a sample data set are trained and detected simultaneously, that is, at least two different categories of detection targets in a sample data set are trained and detected in the same network model, which can effectively shorten the inference time of the model and is conducive to deployment on embedded devices.

[0040] The present application also provides a computer storage medium, which stores computer program instructions and can implement the aforementioned target detection and tracking method based on the YOLO neural network when the computer program instructions are executed by an executor. Therefore, the computer storage medium can also effectively shorten the speculation time of the model and have a faster response speed.

[0041] The present application also provides a target detection and tracking device based on the YOLO neural network. Since the device includes the aforementioned computer storage medium, the device also has a faster response speed for different detection targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a flowchart of the target detection and tracking method based on the YOLO neural network provided in this application;

[0043] Figure 2 This is a flowchart of step S3 in Example 1 of the target detection and tracking method based on the YOLO neural network provided in this application;

[0044] Figure 3 This is a flowchart of step S3 in Example 2 of the target detection and tracking method based on the YOLO neural network provided in this application;

[0045] Figure 4 A simplified diagram of lane keeping calculation using the target detection and tracking method based on the YOLO neural network provided by this application;

[0046] Figure 5 YOLO model diagram of the target detection and tracking device based on the YOLO neural network provided in this application. DETAILED DESCRIPTION

[0047] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.

[0048] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0049] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.

[0050] The Yolo framework is an end-to-end object detection algorithm that rapidly predicts the location and category of objects in images. It integrates target region prediction and target category prediction into a single neural network model, enabling rapid target detection and recognition with high accuracy, making it more suitable for field applications.

[0051] In the target detection and tracking methods of related technologies, the weights trained by the more mainstream ImageNet+COCO dataset are used for prediction and positioning, which may result in false detection and missed detection. At the same time, when there are different categories of detection targets in the sample dataset, different networks are often required to detect them separately.

[0052] For example, in an embodiment where the yolo framework is deployed on an AR-HUD (Augmented Reality-Head Up Display) embedded device, the targets that need to be detected in the sample data set can be various lane lines and vehicles, pedestrians or other objects on the lanes. At this time, the relevant technology needs to be equipped with a yolo network structure to detect various lane lines. At the same time, it is also necessary to be equipped with a yolo network structure to detect other objects such as vehicles and pedestrians. In this way, using different yolo network structures to detect lanes and objects respectively will increase the speculation time of the model and is not conducive to deployment in AR-HUD embedded devices.

[0053] Based on the above considerations, the inventors have conducted in-depth research and design and provided a target detection and tracking method based on the YOLO neural network. This method can effectively shorten the inference time of the model and is therefore more conducive to deployment in embedded devices.

[0054] It should be noted that the target detection and tracking method based on the YOLO neural network provided in this application can be applied to at least the vehicle's AR-HUD system, or smart wearable devices such as AR glasses and AR helmets. This application is described using the vehicle's AR-HUD system as an example.

[0055] Figure 1 This is a flowchart of the target detection and tracking method based on the YOLO neural network provided in this application; Figure 2 This is a flowchart of step S3 in Example 1 of the target detection and tracking method based on the YOLO neural network provided in this application; Figure 3 This is a specific flow chart of step S3 in Example 2 of the target detection and tracking method based on the YOLO neural network provided in this application.

[0056] Please refer to Figures 1 to 3 Some embodiments of the first aspect of the present application provide a target detection and tracking method based on a YOLO neural network, including:

[0057] Step S1: Obtain sample data set and preprocess;

[0058] In this step, the sample dataset can be obtained by on-site photography, video recording, or downloading from the Internet. The sample dataset may include images of various complex road backgrounds, such as one-way streets, multiple lanes, uphill and downhill roads, curves, mountain roads, bridges, tunnels, and country roads.

[0059] The purpose of preprocessing the sample data set is to enhance the samples and amplify the data to increase the stability and robustness of the model.

[0060] Step S2: Obtain the Yolo network structure, and use the Yolo network structure to train and detect at least two different categories of detection targets in the sample data set;

[0061] The purpose of this step is to train the neural network design and model and fine-tune the deployment. The obtained yolo network structure can be yoloV1 network structure, yoloV2 network structure, yoloV3 network structure, yoloV4 network structure or yoloV5 network structure, etc., which can be selected according to actual conditions.

[0062] In this embodiment, the obtained yolo network structure is yoloV4 as an example for description.

[0063] Using the YOLO network structure to train and detect at least two different categories of detection targets in the sample data set means that while using the YOLO network structure to train and detect one detection target in the sample data set, another detection target is also trained and detected.

[0064] For example, in the case of AR-HUD, the detection targets in the sample data set can be set to various lane lines, vehicles or pedestrians, etc. In these embodiments of the present application, the YOLO network structure can be used to train and detect various lane lines while training and detecting objects such as vehicles and pedestrians on the road.

[0065] In this way, using the YOLO model to simultaneously detect lane lines and objects on the road can shorten the model's inference time, which is conducive to the deployment of the YOLO model on embedded devices such as AR-HUD.

[0066] Step S3: post-processing of neural network target detection results;

[0067] Step S4: Image rendering and dedistortion.

[0068] The purpose of step S3 and step S4 is to improve the accuracy of the model. Post-processing can use NMS (Non-max Suppression), Soft-NMS, etc.

[0069] In these embodiments of the present application, by utilizing the yolo network structure to simultaneously train and detect at least two different categories of detection targets in the sample data set, that is, training and detecting at least two different categories of detection targets in the sample data set in the same network model, the inference time of the model can be effectively shortened, which is conducive to deployment on embedded devices.

[0070] In some embodiments of the first aspect of the present application, obtaining the sample dataset includes:

[0071] Acquire pictures; in order to obtain a sufficient number of sample data sets so that the background data of the sample data sets are more comprehensive, in some embodiments of the present application, more than or equal to 2,500,000 pictures can be acquired and recorded.

[0072] Similarly, pictures can be obtained by taking photos, filming or downloading from the Internet.

[0073] Label at least two different categories of detection targets in the image.

[0074] Among them, the labeling step can be implemented using professional labeling tools such as Labelimage, labelme, Labelbox, RectLabel, CVAT, VIA, etc.

[0075] At the same time, in an embodiment applied to AR-HUD, at least two different categories of detection targets can be set to pedestrians, bicycles, cars, riders, buses, trucks, zebra crossings, bus stops, arrows and letters, intersections or various lane lines.

[0076] In this way, each image will have multiple objects annotated, and the annotation tool will generate a corresponding label file for each image. The images and the annotation files together constitute the sample dataset for neural network training.

[0077] In some embodiments of the first aspect of the present application, the at least two different categories of detection targets include:

[0078] A first detection target and a second detection target;

[0079] Illustratively, in this embodiment, the first detection target is a vehicle or a pedestrian, and the second detection target is at least four types of lane lines.

[0080] Using the yolo network structure to train and test the sample data set includes:

[0081] Detecting a first detection target using at least one output layer of a yolo network structure;

[0082] The remaining output layers of the yolo network structure are used to detect the second detection target.

[0083] Exemplarily, in this embodiment, the yolo network structure is provided with three output layers in total, wherein the first two output layers are used to detect vehicles or pedestrians, and the third output layer is used to detect at least four different lane lines.

[0084] In this way, using the same YOLO network structure to simultaneously train and detect vehicles, pedestrians, and various lane lines can effectively shorten the model's inference time and facilitate deployment in vehicle embedded devices with AR-HUD systems.

[0085] In some embodiments of the first aspect of the present application, for the first detection target and the second detection target, a loss function of each output layer is calculated and satisfies the following formula:

[0086] Total loss=m*Objects[1]loss+Objects[2]loss;

[0087] Among them, Total loss is the total loss function, Objects[1]loss is the loss function of the first detection target, Objects[2]loss is the loss function of the second detection target, and m is the weight coefficient.

[0088] In these embodiments of the present application, since the detection loss of lane lines is greater than the detection loss of objects such as vehicles and pedestrians during the training process, a weight coefficient is added before the loss of the first detection target to balance the two types of losses during the training process.

[0089] For example, if the value of the weight coefficient m=5, when the object loss is reduced to 10%, the total loss of the loss function is reduced to 50%.

[0090] It should be noted that the loss function of each layer includes at least three parts: classification error, confidence error, and detection area error.

[0091] For example, in these embodiments of the present application, since the first detection target consists of a vehicle and a pedestrian, the above formula can be transformed into:

[0092] Total loss=m*(Objects[0]loss+Objects[1]loss)+Lanes[0]loss;

[0093] Among them, Objects[0]loss is the loss of the vehicle; Objects[1]loss is the loss of the pedestrian; Lanes[0]loss is the loss of the lane line.

[0094] In some embodiments of the first aspect of the present application, training and testing a sample data set using a yolo network structure includes:

[0095] The area of ​​the IOU error is controlled to be greater than 0.85, where the area of ​​the IOU error is:

[0096] Prediction box size ∩ real box size / prediction box size ∪ real box size.

[0097] In these embodiments of the present application, in order to improve the training reliability of the IOU error, the maximum number of bounding box values ​​at each scale can be increased to 200.

[0098] In some embodiments of the first aspect of the present application, the preprocessing comprises:

[0099] Histogram equalization processing, and / or random brightness and contrast processing, and / or motion blur processing, and / or random flash processing, and / or random rain and snow processing, and / or image mosaic processing.

[0100] In some embodiments of the first aspect of the present application, by applying the above preprocessing steps to the sample data set, the contrast, brightness, and clarity of the sample data set can be adjusted, and the noise in the image caused by weather conditions such as highlights, rain, snow, and mosaics can be identified, making the sample data set more reliable, thereby achieving the purpose of improving the stability and robustness of the model.

[0101] In some embodiments of the first aspect of the present application, post-processing of neural network target detection results includes:

[0102] calculating a distance ratio to the first detected target and / or the second detected target;

[0103] By calculating the distance ratio to the first detected target and the distance ratio to the second detected target, the distance to each target can be determined in real time. In the embodiment applied to vehicle AR-HUD, the distance between the vehicle and surrounding vehicles, pedestrians, or lane markings can be determined in real time, thereby improving driving safety.

[0104] Exemplarily, in these embodiments of the present application, the target detection and tracking method based on the YOLO neural network can be applied to a lane keeping assist system, and / or a forward collision warning system, and / or a forward ranging system.

[0105] When the distance ratio to the first detection target or the second detection target is in a dangerous area, the control issues an alarm.

[0106] In some embodiments of the present application, it can also be set that when the distance ratio to the first detection target or the second detection target is in a safe area, the driver can be prompted to relax driving, to increase the speed appropriately, or to open some entertainment functions of the vehicle.

[0107] At the same time, in some embodiments of the present application, it can also be set that when the distance ratio of the first detection target or the second detection target is in the warning area, the driver can be prompted to drive carefully, or the seat can be controlled to vibrate, the air outlet can be controlled to output cold air, etc. to warn the driver.

[0108] For example, the thresholds for the distance ratios in the aforementioned three situations may be set as follows:

[0109] Safe zone: -40% to 40%, Warning zone: -60% to -40% & 40% to 60%, Danger zone: <-60% to >60%. In these embodiments of the present application, the positive and negative values ​​can refer to the ratio of the distance to the left and right of the vehicle, or the ratio of the distance to the front and back of the vehicle, and the choice can be made based on actual conditions.

[0110] In this way, the target detection and tracking method based on the YOLO neural network is applied to the lane keeping assist system, forward collision warning system, or forward ranging system.

[0111] In order to explain the technical solution of the present application in detail, the following two specific embodiments are provided for detailed explanation:

[0112] Example 1:

[0113] The present invention provides a method for target detection and tracking based on a YOLO neural network, which includes the following steps:

[0114] Step S1, obtaining a sample data set and preprocessing it;

[0115] Step S2, obtaining a YOLO network structure, and using the YOLO network structure to simultaneously train and detect at least two different categories of detection targets in the sample data set;

[0116] Step S3, post-processing of neural network target detection results;

[0117] In this embodiment, the YOLO network structure is deployed in the vehicle's AR-HUD device and is used to detect lane lines on both sides of the vehicle. The post-processing process is to determine the distance between the vehicle and the two lane lines. This is also known as the lane keeping assist system. Based on the lane line detection results of the target detection and tracking method based on the YOLO neural network provided in this application, it can perform the following post-processing steps to accurately locate the left and right lanes:

[0118] Please refer to Figure 4 , Figure 4 A simplified diagram of lane keeping calculation using the target detection and tracking method based on the YOLO neural network provided in this application. Step S3 includes the following sub-steps:

[0119] Step S31: Based on the detected lane slope and offset, the left and right coordinates of the lane line are calculated from the starting point and the vanishing point;

[0120] Step S32: obtaining the Euclidean distance by measuring the distance between the starting point and the vanishing point;

[0121] Step S33: Measure and calculate the distance ratio from the left and right lanes;

[0122] Step S34: Calculate the lane offset by obtaining a total ratio based on all left and right lane distance measurements.

[0123] The specific calculation formula of the distance ratio is as follows:

[0124] Ratio1 = (l1 / r1);

[0125] Ratio2=(√(x–a2x) 2 +(y–a2y) 2 ) / (√(x–b2x) 2 +(y–b2y) 2 );

[0126] Ratio3=(√(x–a3x) 2 +(y–a3y) 2 ) / (√(x–b3x) 2 +(y–b3y) 2 );

[0127] avgDratio=Ratio1+Ratio2+Ratio3;

[0128] Where ratio1 represents the first ratio; ratio2 represents the second ratio; ratio3 represents the third ratio; avgDratio represents the final distance ratio; a2, a3, b2, and b3 represent different measurement points; x represents the horizontal axis coordinate value; and y represents the vertical axis coordinate value.

[0129] It should be noted that the calculation of ratio2 and ratio3 is actually l2 / r2 and l3 / r3.

[0130] This embodiment aims to use the target detection and tracking method based on the YOLO neural network provided in the above embodiment to perform lane keeping calculation, and its detection target is the second detection target, namely the lane line.

[0131] In the figure, a1 is the starting point of the left lane; a3 is the vanishing point of the left lane; a2 is a middle point of the left lane; b1 is the starting point of the right lane; b3 is the vanishing point of the left lane; and b2 is a middle point of the left lane.

[0132] The positions of points a2 and b2 can be adjusted as needed. In some embodiments, point a2 can be located halfway between the starting point a1 and the vanishing point a3, and point b2 can be located halfway between the starting point b1 and the vanishing point b3. This will result in a more accurate lane offset.

[0133] Step S4: image rendering and dedistortion.

[0134] Example 2:

[0135] The present invention provides a method for target detection and tracking based on a YOLO neural network, which includes the following steps:

[0136] Step S1, obtaining a sample data set and preprocessing it;

[0137] Step S2, obtaining a YOLO network structure, and using the YOLO network structure to simultaneously train and detect at least two different categories of detection targets in the sample data set;

[0138] Step S3, post-processing of neural network target detection results;

[0139] In this embodiment, the YOLO network structure is deployed in the vehicle's AR-HUD device and is used to detect the distance between the vehicle and the object in front (vehicle or pedestrian). The post-processing process is to determine the distance between the vehicle and the object in front. That is, the forward collision warning system can perform the following post-processing steps based on the object detection results of the target detection and tracking method based on the YOLO neural network provided in this application to accurately locate the position of the object in front:

[0140] Step S3 includes the following sub-steps:

[0141] Step S31': demarcate a trapezoidal area in front;

[0142] Step S32': Calculate the slope and offset of the left and right lanes in the trapezoidal area;

[0143] Step S33 ′: Calculate the range of the forward collision according to the maximum-minimum vertical coordinates of the front trapezoidal area.

[0144] Some embodiments of the second aspect of the present application provide a computer storage medium on which computer program instructions are stored; when the computer program instructions are executed by a processor, a target detection and tracking method based on a YOLO neural network as in any of the aforementioned embodiments is implemented.

[0145] Figure 5 YOLO model diagram of the target detection and tracking device based on the YOLO neural network provided in this application.

[0146] Please refer to Figure 5 Some embodiments of the third aspect of the present application provide a target detection and tracking device based on a yolo neural network, including a computer storage medium as in any of the aforementioned embodiments.

[0147] For ease of understanding, Figure 5 Some English terms that appear in the article are explained: conv: convolution; mish: activation function; stride2: step size 2; maxpool: maximum pooling; residual: residual; spatial: space; dilate: expansion.

[0148] In the target detection and tracking device based on the YOLO neural network, the number of residual blocks is at least two. At the same time, by adding a spatial block, the target detection and tracking device based on the YOLO neural network can use the spatial block to calculate the distance between the first detection target and / or the second detection target during the target detection and tracking process, thereby giving feedback to the driver and passengers before an accident occurs and issuing an alarm, thereby increasing the safety and reliability of the target detection and tracking device based on the YOLO neural network.

[0149] The device can be an AR-HUD embedded device used in vehicles, or a wearable device such as AR smart glasses or AR helmets.

[0150] The above description is merely a preferred embodiment of the present application. The scope of protection of the present application is not limited to the above embodiments. All technical solutions based on the concept of the present application are within the scope of protection of the present application. It should be noted that for those skilled in the art, improvements and modifications that do not depart from the principles of the present application should also be considered within the scope of protection of the present application.

Claims

1. A target detection and tracking method based on yolo neural network, characterized in that: include: Obtain sample data sets and preprocess them; Obtain a Yolo network structure, and use the Yolo network structure to simultaneously train and detect at least two different categories of detection targets in the sample data set; Post-processing of neural network target detection results; Image rendering and dedistortion; The obtaining of the sample data set comprises: Get the image; Label at least two different categories of detection targets in the image; The at least two different categories of detection targets include: A first detection target and a second detection target; The training and testing of the sample data set using the YOLO network structure includes: Detecting the first detection target using at least one output layer of a yolo network structure; Utilize the remaining output layers of the yolo network structure to detect the second detection target; For the first detection target and the second detection target, calculate the loss function of each output layer and satisfy the following formula: Total loss=m*0objects[1]loss+0objects[2]loss; Among them, Total loss is the total loss function, Objects[1]loss is the loss function of the first detection target, Objects[2]loss is the loss function of the second detection target, and m is the weight coefficient; The post-processing of the neural network target detection results includes: calculating a distance ratio to the first detection target and / or the second detection target; When the distance ratio to the first detection target or the second detection target is in a dangerous area, controlling an alarm; The distance ratio is calculated as follows: Ratio1 = (l1 / r1); <h2 style=";text-align:left;direction:ltr">Ratio2=(√(x–a2x)<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +(y–a2y)<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> ) / (√(x–b2x)<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +(y–b2y)<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> ); Ratio3=(√(x–a3x) 2 +(y–a3y) 2 ) / (√(x–b3x) 2 +(y–b3y) 2 ); avgDratio=Ratio1+Ratio2+Ratio3; Where, ratio1 represents the first ratio; ratio2 represents the second ratio; ratio3 represents the third ratio; avgDratio represents the final distance ratio; a2, a3, b2, and b3 represent different measurement points; x represents the horizontal axis coordinate value; y represents the vertical axis coordinate value; The training and testing of the sample data set using the YOLO network structure includes: The area of ​​the IOU error is controlled to be greater than 0.85, wherein the area of ​​the IOU error is: Prediction box size ∩ real box size / prediction box size ∪ real box size; The pretreatment includes: Histogram equalization processing, and / or random brightness and contrast processing, and / or motion blur processing, and / or random flash processing, and / or random rain and snow processing, and / or image mosaic processing.

2. A computer storage medium, characterized in that The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the target detection and tracking method based on the YOLO neural network as claimed in claim 1 is implemented.

3. A target detection and tracking device based on yolo neural network, characterized in that: Comprising the computer storage medium of claim 2.