A lightweight embedded object detection method and system
By segmenting the video frame by frame and combining the prediction results of each adjacent image using a lightweight object detection model, the applicability problem of object detection on embedded platforms is solved, and efficient and accurate object detection is achieved.
Patent Information
- Application Number
- CN202211619942.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-12-15
AI Technical Summary
Most existing object detection algorithms run on high-performance GPU servers and are not suitable for low-resource embedded platforms.
The video to be detected is divided into multiple images frame by frame. A lightweight object detection model is used to combine the results with the highest prediction confidence for each of the three adjacent images to select the bounding box, thereby improving the detection accuracy.
Implementing target detection on an embedded platform improves the accuracy and efficiency of detection.
Smart Images

Figure CN115937748B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of target detection, and more specifically, to a lightweight embedded target detection method and system. Background Technology
[0002] Image classification is the most fundamental task in the field of computer vision. The goal of image classification is to categorize different images into different classes with minimal classification error. For single-label image classification problems, there are three main categories: cross-species semantic-level image classification, fine-grained subclass image classification, and instance-level image classification. Cross-species semantic-level image classification identifies different categories of objects at the species level, such as distinguishing between cats and dogs. Fine-grained subclass image classification refers to classifying subclasses within the same broad category, such as distinguishing between different birds. Instance-level image classification distinguishes different individuals; the most typical task is face recognition.
[0003] Object detection builds upon image classification to achieve multi-object classification and real-time inference. Image segmentation, object tracking, and keypoint detection all rely on object detection. Applications of object detection primarily include face recognition, intelligent transportation, industrial inspection, and medical image detection. Object detection techniques can be categorized into two types based on the detection stage: single-stage object detection and two-stage object detection. Single-stage object detection involves first generating many candidate regions, then extracting features from each candidate region using a deep network, feeding these features into a classifier for each category to determine if it belongs to that category, and finally using a regressor to refine the candidate bounding box positions. Commonly used single-stage algorithms include R-CNN, SPP-Net, Fast R-CNN, and Faster R-CNN. Two-stage object detection eliminates the candidate bounding box generation step, directly using a deep network to transform the detection problem into a regression problem. Mainstream algorithms include OverFeat, YOLOv1, YOLOv2, YOLOv3, YOLOv3-Tiny, SSD, and RetinaNet.
[0004] However, most current object detection algorithms run on high-performance GPU servers and are not suitable for object detection and classification on low-resource embedded platforms. Summary of the Invention
[0005] To overcome the technical shortcomings of current target detection algorithms that are not suitable for embedded platforms, this invention provides a lightweight embedded target detection method and system.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0007] A lightweight embedded target detection method, comprising the following steps:
[0008] S1: acquire a plurality of time lengths of a to-be-detected video in seconds, respectively segment each second to-be-detected video into a plurality of images according to frames, and correspondingly obtain a plurality of image sets;
[0009] S2: in each image set, select n images as to-be-detected images according to equal time intervals of the number n of video frames to be output;
[0010] S3: use a lightweight target detection model to perform inference prediction on the to-be-detected images, respectively select the prediction results with the highest prediction confidence in each adjacent three to-be-detected images, combine the selected prediction results, and frame the corresponding three to-be-detected images according to the combined results;
[0011] S4: recombine the framed to-be-detected images into a video and output, and complete target detection.
[0012] In the above scheme, by segmenting the to-be-detected video according to frames, selecting to-be-detected images according to the number of video frames to be output, using a lightweight target detection model to perform inference prediction on the to-be-detected images, target detection can be performed on an embedded platform; at the same time, the prediction results with the highest prediction confidence are selected in each adjacent three to-be-detected images, the selected prediction results are combined, and the corresponding three to-be-detected images are framed according to the combined results, thereby improving the accuracy of target detection.
[0013] Preferably, before using the lightweight target detection model to perform inference prediction on the to-be-detected images, the following steps are further included:
[0014] A1: collect a plurality of images, and respectively perform target labeling on each collected image, and correspondingly obtain a plurality of labeled files with labeling information;
[0015] A2: respectively perform data enhancement on each collected image and each labeled file;
[0016] A3: use the enhanced images and labeled files to train a pre-constructed lightweight target detection model, and obtain a trained lightweight target detection model.
[0017] Preferably, the labeling information includes target category and position information.
[0018] Preferably, the data enhancement includes translation transformation, flip transformation, random cropping, noise disturbance, contrast transformation, and scale transformation.
[0019] Preferably, the lightweight target detection model comprises an input layer, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a seventh convolutional layer, an eighth convolutional layer, a ninth convolutional layer, a tenth convolutional layer, an eleventh convolutional layer, a twelfth convolutional layer, a thirteenth convolutional layer, a first max-pooling layer, a second max-pooling layer, a third max-pooling layer, a fourth max-pooling layer, a fifth max-pooling layer, a sixth max-pooling layer, an average pooling layer, an up-sampling layer, a concat layer, a first YOLO layer, a second YOLO layer, and an output layer; wherein,
[0020] The input layer, the first convolutional layer, the first max-pooling layer, the second convolutional layer, the second max-pooling layer, the third convolutional layer, the third max-pooling layer, the fourth convolutional layer, the fourth max-pooling layer, the fifth convolutional layer, the fifth max-pooling layer, the sixth convolutional layer, the sixth max-pooling layer, the seventh convolutional layer, the eighth convolutional layer, the ninth convolutional layer, the tenth convolutional layer, and the first YOLO layer are sequentially connected; one branch output end of the third convolutional layer is connected to the input end of the average pooling layer; one branch output end of the eighth convolutional layer is connected to the input end of the eleventh convolutional layer, and the output end of the eleventh convolutional layer is connected to the input end of the up-sampling layer; the output end of the up-sampling layer, the output end of the average pooling layer, and one branch output end of the fifth convolutional layer are respectively connected to the input end of the concat layer; the concat layer, the twelfth convolutional layer, the thirteenth convolutional layer, and the second YOLO layer are sequentially connected; the output end of the first YOLO layer and the output end of the second YOLO layer are respectively connected to the input end of the output layer.
[0021] Preferably, the convolution kernel size of the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer, the sixth convolutional layer, the seventh convolutional layer, the ninth convolutional layer, and the twelfth convolutional layer is 3x3; the convolution kernel size of the eighth convolutional layer, the tenth convolutional layer, the eleventh convolutional layer, and the thirteenth convolutional layer is 1x1; the pooling window shape of the first max-pooling layer, the second max-pooling layer, the third max-pooling layer, the fourth max-pooling layer, the fifth max-pooling layer, and the sixth max-pooling layer is 2x2.
[0022] Preferably, the number of convolution kernels of the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer, the sixth convolutional layer, the seventh convolutional layer, the eighth convolutional layer, the ninth convolutional layer, and the tenth convolutional layer is 16, 32, 64, 128, 256, 512, 1024, 256, 512, and 255, respectively.
[0023] Preferably, the output of the lightweight target detection model includes the final loss function value, the predicted classification, and the bounding box regression value.
[0024] Preferably, when the bounding box selection is performed in step S3, the predicted bounding box, the predicted classification and the predicted probability are also labeled on the image.
[0025] A lightweight embedded target detection system for implementing the lightweight embedded target detection method, comprising a data acquisition module, a data processing module and an inference prediction module.
[0026] The data acquisition module is configured to acquire a plurality of time-length videos to be detected in seconds.
[0027] The data processing module is configured to divide each second video to be detected into a plurality of images by frame segmentation, select n images as detection images according to the equal time interval of the video frame number n to be output, and recombine the detection images with the bounding box into a video.
[0028] The inference prediction module is configured to use a lightweight target detection model to perform inference prediction on the detection images, select the highest prediction confidence in each adjacent three detection images, and combine the selected prediction results to perform bounding box selection in the corresponding three detection images.
[0029] Compared with the prior art, the technical scheme of the present application has the following beneficial effects:
[0030] The present application provides a lightweight embedded target detection method and system, which divides the detection video by frame, selects detection images according to the video frame number to be output, uses a lightweight target detection model to perform inference prediction on the detection images, and can perform target detection on an embedded platform. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 The technical scheme of the present application is implemented by the step flowchart.
[0032] Figure 2 The network structure of the lightweight target detection model in the present application is shown in the schematic diagram. DETAILED DESCRIPTION
[0033] The accompanying drawings are only used for illustrative purposes and should not be construed as limiting the present patent;
[0034] In order to better illustrate the present embodiment, some components in the drawings may be omitted, enlarged or reduced, and do not represent the actual size of the product;
[0035] It will be appreciated by those skilled in the art that certain known structures and their descriptions can be omitted from the drawings for the sake of brevity.
[0036] The technical solutions of the present application will be further described below in combination with the drawings and examples.
[0037] Example 1
[0038] As shown in the figure, a lightweight embedded target detection method comprises the following steps: Figure 1
[0039] S1: Obtain a plurality of time lengths of to-be-detected videos in seconds, respectively segment each second to-be-detected video into multiple images by frames, and correspondingly obtain a plurality of image sets;
[0040] S2: In each image set, select n images as to-be-detected images according to an equal time interval of a video frame number n to be output;
[0041] S3: Use a lightweight target detection model to perform inference prediction on the to-be-detected images, respectively select the prediction results with the highest prediction confidence in each adjacent three to-be-detected images, combine the selected prediction results, and frame in the corresponding three to-be-detected images according to the combined results;
[0042] S4: Re-combine the framed to-be-detected images into a video and output, and complete target detection.
[0043] In the specific implementation process, by segmenting the to-be-detected video by frames and selecting to-be-detected images according to the video frame number to be output, using a lightweight target detection model to perform inference prediction on the to-be-detected images, target detection can be performed on an embedded platform; at the same time, the prediction results with the highest prediction confidence are selected in each adjacent three to-be-detected images, the selected prediction results are combined, and the corresponding three to-be-detected images are framed according to the combined results, thereby improving the accuracy of target detection.
[0044] Example 2
[0045] A lightweight embedded target detection method comprises the following steps:
[0046] S1: Obtain a plurality of time lengths of to-be-detected videos in seconds, respectively segment each second to-be-detected video into multiple images by frames, and correspondingly obtain a plurality of image sets;
[0047] S2: In each image set, select n images as to-be-detected images according to an equal time interval of a video frame number n to be output;
[0048] S3: using a lightweight target detection model to perform inference prediction on the to-be-detected images, selecting the prediction result with the highest prediction confidence in each adjacent three to-be-detected images respectively, and combining the selected prediction results, and performing frame selection in the corresponding three to-be-detected images according to the combined results;
[0049] S4: recombining the frame-selected to-be-detected images into a video and outputting, completing target detection.
[0050] More specifically, before using a lightweight target detection model to perform inference prediction on the to-be-detected images, the following steps are further included:
[0051] A1: collecting multiple images, and respectively performing target labeling on each collected image, and correspondingly obtaining multiple labeled files with labeling information;
[0052] More specifically, the labeling information includes target category and position information.
[0053] In actual implementation, a camera on an embedded platform is used to collect target images to be recognized, LabelImg is used to label the images, the target is framed, and the target position and category in each file are recorded in a TXT file, and finally the training set and the verification set are divided according to the ratio of 8:2; in this embodiment, the IMX219 camera is taken as an example, and the resolution of the collected RGB format picture is 640*480.
[0054] A2: respectively performing data enhancement on each collected image and each labeled file;
[0055] More specifically, the data enhancement includes translation transformation, flip transformation, random cropping, noise disturbance, contrast transformation and scale transformation.
[0056] In actual implementation, the labeled file is processed synchronously, the position of the target is also flipped when flipping, and the position of the target is also transformed when scale transformation.
[0057] A3: using the enhanced images and the labeled files to train a pre-constructed lightweight target detection model, to obtain a trained lightweight target detection model.
[0058] In actual implementation, a lightweight target detection model is trained on a server platform with a GPU, a maximum training round epochs=1000 is defined, a loss function value is calculated through two YOLO layers, the loss function value loss is recorded, when the loss no longer decreases within 10 training rounds, i.e., the training is stopped in advance, the lightweight target detection model is saved as a file in a persistent manner; in this embodiment, the lightweight target detection model is built using Pytorch, and the saved format is ModelName.pth. Then the ModelName.pth file is transmitted from the server platform to the embedded platform through an interface such as a USB or an Ethernet port, and the file is read into the memory of the embedded platform using Python code.
[0059] More specifically, as shown in FIG. 1, Figure 2 The lightweight target detection model includes an input layer, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a seventh convolutional layer, an eighth convolutional layer, a ninth convolutional layer, a tenth convolutional layer, an eleventh convolutional layer, a twelfth convolutional layer, a thirteenth convolutional layer, a first max-pooling layer, a second max-pooling layer, a third max-pooling layer, a fourth max-pooling layer, a fifth max-pooling layer, a sixth max-pooling layer, an average pooling layer, an up-sampling layer, a concat layer, a first YOLO layer, a second YOLO layer, and an output layer; wherein,
[0060] The input layer, the first convolutional layer, the first max-pooling layer, the second convolutional layer, the second max-pooling layer, the third convolutional layer, the third max-pooling layer, the fourth convolutional layer, the fourth max-pooling layer, the fifth convolutional layer, the fifth max-pooling layer, the sixth convolutional layer, the sixth max-pooling layer, the seventh convolutional layer, the eighth convolutional layer, the ninth convolutional layer, the tenth convolutional layer, and the first YOLO layer are connected in sequence; one branch output end of the third convolutional layer is connected to an input end of the average pooling layer; one branch output end of the eighth convolutional layer is connected to an input end of the eleventh convolutional layer, and an output end of the eleventh convolutional layer is connected to an input end of the up-sampling layer; an output end of the up-sampling layer, an output end of the average pooling layer, and one branch output end of the fifth convolutional layer are respectively connected to input ends of the concat layer; the concat layer, the twelfth convolutional layer, the thirteenth convolutional layer, and the second YOLO layer are connected in sequence; an output end of the first YOLO layer and an output end of the second YOLO layer are respectively connected to input ends of the output layer.
[0061] More specifically, the convolution kernel size of the first convolution layer, the second convolution layer, the third convolution layer, the fourth convolution layer, the fifth convolution layer, the sixth convolution layer, the seventh convolution layer, the ninth convolution layer and the twelfth convolution layer is 3x3; the convolution kernel size of the eighth convolution layer, the tenth convolution layer, the eleventh convolution layer and the thirteenth convolution layer is 1x1; the pooling window shape of the first maximum pooling layer, the second maximum pooling layer, the third maximum pooling layer, the fourth maximum pooling layer, the fifth maximum pooling layer and the sixth maximum pooling layer is 2x2.
[0062] More specifically, the number of convolution kernels of the first convolution layer, the second convolution layer, the third convolution layer, the fourth convolution layer, the fifth convolution layer, the sixth convolution layer, the seventh convolution layer, the eighth convolution layer, the ninth convolution layer and the tenth convolution layer is 16, 32, 64, 128, 256, 512, 1024, 256, 512, 255 respectively.
[0063] In the specific implementation process, a light embedded YOLO (LE-YOLO) model is built using Pytorch, which includes convolution operation, pooling operation and up-sampling operation. In the main part of the model, the input is extracted by a convolution kernel with a size of 3x3 and a number of 16, then the data is reduced in dimension by a maximum pooling with a size of 2x2, and this operation is repeated 6 times, and the number of convolution kernels is multiplied by 2, which is 32, 64, 128, 256, 512, 1024 respectively. After passing through the 1024 convolution kernels, no pooling is performed, and then the data is passed through 256 1x1 convolution kernels, 512 3x3 convolution kernels and finally 255 1x1 convolution kernels, to obtain the YOLO layer of the main part. In the branch part of the upper layer of the model, an average pooling is performed to extract low-level abstract features, and in the branch part of the lower layer of the model, a convolution is performed first and then an up-sampling is performed to extract medium-level abstract features. Then the feature matrices output by the two branch parts are spliced, and the spliced feature matrix and the output of the branch part of the middle layer of the model are spliced to realize a 3% accuracy improvement at a small cost of matrix addition calculation. Then, 3x3 and 1x1 convolution is performed respectively, and finally the YOLO layer of the branch part is obtained. The output of the light embedded YOLO model is obtained through the YOLO layer function encapsulated in Pytorch. The above feature fusion corresponds to the detection of large, medium and small objects respectively.
[0064] More specifically, the output of the light embedded YOLO model includes the final loss function value, the predicted classification and the bounding box regression value.
[0065] More specifically, when the frame selection is performed in step S3, the predicted candidate frame, the predicted classification and the predicted probability are also labeled on the image.
[0066] Embodiment 3
[0067] A lightweight embedded target detection system for implementing the lightweight embedded target detection method, comprising a data acquisition module, a data processing module, and an inference prediction module.
[0068] The data acquisition module is configured to acquire a plurality of time-length videos to be detected in units of seconds.
[0069] The data processing module is configured to divide each second video to be detected into a plurality of images by frame, select n images as target detection images according to equal time intervals of the video frame number n to be output, and recombine the selected target detection images into a video.
[0070] The inference prediction module is configured to use a lightweight target detection model to infer and predict the target detection images, select the prediction result with the highest prediction confidence in each adjacent three target detection images, combine the selected prediction results, and frame the corresponding three target detection images according to the combined results.
[0071] Embodiment 4
[0072] In this embodiment, a simulation experiment is performed using the lightweight embedded target detection method, and the specific process is as follows.
[0073] The hardware platform of the simulation experiment of this embodiment is as follows: the processor is AMD ThreadRipper 3960xCPU, the main frequency is 3.8GHz, the memory is 128GB, and the graphics card is NVIDIA GeForce RTX 3080TI.
[0074] The software platform of the simulation experiment of this embodiment is as follows: Ubuntu20.04 operating system, Python3.7.13, and Pytorch1.12.1.
[0075] The dataset used in the simulation experiment of this embodiment is MSCOCO2017 built by Microsoft for image recognition, target detection, and segmentation tasks, and the dataset is divided into a training set, a test set, and a validation set, wherein the target detection has a total of 80 categories.
[0076] In the simulation experiment of this embodiment, the lightweight embedded target detection method (LE-YOLO) and the prior art are used to detect the images in the validation set.
[0077] In the simulation experiment, the prior art used is as follows:
[0078] In "YOLOv3: An Incremental Improvement", Joseph Redmon, Ali Farhadi, et al. proposed a single-stage target detection method using DarkNet as the backbone. In the simulation experiment, the improved DarkNet was used as the backbone of the LE-YOLO target detection algorithm, and an embedded Linux platform was built as the deployment and running environment to realize a general target detection system.
[0079] To evaluate the effect of the simulation results, the AP is used as the performance evaluation index to compare with the prior art. The definition of AP is the area under the curve formed by Precision and Recall. The precision Precision is defined as TP / (TP+FP), and the recall Recall is defined as TP / (TP+FN). TP, FP, TN and FN represent true class, false positive class, true negative class and false negative class, respectively. mAP is defined as the average value of AP. The comparison results are shown in Table 1:
[0080] Table 1 Comparison of AP between the present application and the prior art in simulation experiment
[0081] Data FPS mAP50 mAP50_95 YOLOv3Tiny COCO eval 129 33 16 LE-YOLO COCO eval 127 36 21
[0082] To reduce the influence of system load at different times on the test results, the values in Table 1 are the average values of 5 measurements. mAP50 refers to the mAP when the IoU value is 0.5. mAP50_90 refers to the average value of AP at IOU values from 50% to 95% with a step of 5%. The above simulation experiment uses the MSCOCO2017 dataset, and the FPS is the value of 5000 pictures divided by the processing time.
[0083] From Table 1, it can be seen that LE-YOLO has obvious improvement in both mAP50 and mAP50_95 tests, and the value of FPS is only reduced by 1.5%.
[0084] In the specific implementation process, the method is aimed at target detection on low-resource embedded Linux platforms. On the one hand, the target detection algorithm is optimized to improve the average accuracy of large, medium and small target detection. On the other hand, a strategy for object recognition on embedded Linux platforms is provided. The data acquisition, data enhancement and multi-feature fusion used in the strategy also improve the recognition accuracy at the training and prediction level, further improving the accuracy of the model.
[0085] Obviously, the above embodiments of the present application are merely exemplary but not intended to limit the embodiments of the present application. Based on the above description, any other variations or changes can be made by those skilled in the art without departing from the spirit and principles of the present application. It is not necessary to list all the embodiments here. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall fall within the scope of the claims of the present application.
Claims
1. A lightweight embedded object detection method, characterized in that, The method comprises the following steps: S1: acquire a plurality of time lengths of to-be-detected videos in seconds, respectively segment each second to-be-detected video into a plurality of images according to frames, and correspondingly obtain a plurality of image sets; S2: in each image set, select n images as to-be-detected images according to equal time intervals of the number of to-be-output video frames n; S3: use a lightweight target detection model to perform inference prediction on the to-be-detected images, respectively select the prediction results with the highest prediction confidence in each adjacent three to-be-detected images, combine the selected prediction results, and frame the corresponding three to-be-detected images according to the combination results; S4: recombine the framed to-be-detected images into a video and output, and complete target detection; The lightweight target detection model comprises an input layer, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a seventh convolutional layer, an eighth convolutional layer, a ninth convolutional layer, a tenth convolutional layer, an eleventh convolutional layer, a twelfth convolutional layer, a thirteenth convolutional layer, a first maximum pooling layer, a second maximum pooling layer, a third maximum pooling layer, a fourth maximum pooling layer, a fifth maximum pooling layer, a sixth maximum pooling layer, an average pooling layer, an up-sampling layer, a concat layer, a first YOLO layer, a second YOLO layer, and an output layer; wherein, The input layer, the first convolutional layer, the first maximum pooling layer, the second convolutional layer, the second maximum pooling layer, the third convolutional layer, the third maximum pooling layer, the fourth convolutional layer, the fourth maximum pooling layer, the fifth convolutional layer, the fifth maximum pooling layer, the sixth convolutional layer, the sixth maximum pooling layer, the seventh convolutional layer, the eighth convolutional layer, the ninth convolutional layer, the tenth convolutional layer, and the first YOLO layer are connected in sequence; one branch output end of the third convolutional layer is connected to the input end of the average pooling layer; one branch output end of the eighth convolutional layer is connected to the input end of the eleventh convolutional layer, and the output end of the eleventh convolutional layer is connected to the input end of the up-sampling layer; the output end of the up-sampling layer, the output end of the average pooling layer, and one branch output end of the fifth convolutional layer are respectively connected to the input end of the concat layer; the concat layer, the twelfth convolutional layer, the thirteenth convolutional layer, and the second YOLO layer are connected in sequence; the output end of the first YOLO layer and the output end of the second YOLO layer are respectively connected to the input end of the output layer; The convolution kernel size of the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer, the sixth convolutional layer, the seventh convolutional layer, the ninth convolutional layer, and the twelfth convolutional layer is 3x3; the convolution kernel size of the eighth convolutional layer, the tenth convolutional layer, the eleventh convolutional layer, and the thirteenth convolutional layer is 1x1; the pooling window shape of the first maximum pooling layer, the second maximum pooling layer, the third maximum pooling layer, the fourth maximum pooling layer, the fifth maximum pooling layer, and the sixth maximum pooling layer is 2x2; The number of convolution kernels of the first convolution layer, the second convolution layer, the third convolution layer, the fourth convolution layer, the fifth convolution layer, the sixth convolution layer, the seventh convolution layer, the eighth convolution layer, the ninth convolution layer and the tenth convolution layer is 16, 32, 64, 128, 256, 512, 1024, 256, 512 and 255 respectively.
2. The lightweight embedded object detection method of claim 1, wherein, Before the inference prediction of the to-be-detected image by using the lightweight target detection model, the following steps are further included: A1: a plurality of images are collected, and each of the collected images is labeled with a target to obtain a plurality of labeled files with label information; A2: each of the collected images and each of the labeled files is subjected to data enhancement; A3: the pre-constructed lightweight target detection model is trained by using the enhanced images and the labeled files to obtain a trained lightweight target detection model.
3. The lightweight embedded object detection method of claim 2, wherein, The label information includes target categories and position information.
4. The lightweight embedded object detection method of claim 2, wherein, The data enhancement includes translation transformation, flip transformation, random cropping, noise disturbance, contrast transformation and scale transformation.
5. The lightweight embedded object detection method of claim 1, wherein, The output of the lightweight target detection model includes a final loss function value, a predicted classification and a bounding box regression value.
6. The lightweight embedded object detection method of claim 1, wherein, When the frame selection is performed in step S3, the predicted candidate frame, the predicted classification and the predicted probability are further labeled on the image.
7. A lightweight embedded object detection system, characterized in that, The system comprises a data acquisition module, a data processing module and an inference prediction module. The data acquisition module is configured to acquire a to-be-detected video with a time length of several seconds. The data processing module is configured to divide each second to-be-detected video into a plurality of images by frame segmentation, select n images as to-be-detected images according to an equal time interval of n video frames to be output, and recombine the frame-selected to-be-detected images into a video. The inference prediction module is configured to perform inference prediction on the to-be-detected images by using the lightweight target detection model, select the prediction result with the highest prediction confidence in each of three adjacent to-be-detected images, combine the selected prediction results, and perform frame selection in the corresponding three to-be-detected images according to the combined results. The lightweight target detection model comprises an input layer, a first convolution layer, a second convolution layer, a third convolution layer, a fourth convolution layer, a fifth convolution layer, a sixth convolution layer, a seventh convolution layer, an eighth convolution layer, a ninth convolution layer, a tenth convolution layer, an eleventh convolution layer, a twelfth convolution layer, a thirteenth convolution layer, a first maximum pooling layer, a second maximum pooling layer, a third maximum pooling layer, a fourth maximum pooling layer, a fifth maximum pooling layer, a sixth maximum pooling layer, an average pooling layer, an up-sampling layer, a concat layer, a first YOLO layer, a second YOLO layer and an output layer. The input layer, the first convolutional layer, the first max pooling layer, the second convolutional layer, the second max pooling layer, the third convolutional layer, the third max pooling layer, the fourth convolutional layer, the fourth max pooling layer, the fifth convolutional layer, the fifth max pooling layer, the sixth convolutional layer, the sixth max pooling layer, the seventh convolutional layer, the eighth convolutional layer, the ninth convolutional layer, the tenth convolutional layer and the first YOLO layer are sequentially connected; one branch output end of the third convolutional layer is connected to an input end of an average pooling layer; one branch output end of the eighth convolutional layer is connected to an input end of an eleventh convolutional layer, and an output end of the eleventh convolutional layer is connected to an input end of an up-sampling layer; an output end of the up-sampling layer, an output end of the average pooling layer and one branch output end of the fifth convolutional layer are respectively connected to input ends of a concat layer; the concat layer, a twelfth convolutional layer, a thirteenth convolutional layer and a second YOLO layer are sequentially connected; an output end of the first YOLO layer and an output end of the second YOLO layer are respectively connected to input ends of an output layer; The convolution kernel sizes of the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer, the sixth convolutional layer, the seventh convolutional layer, the ninth convolutional layer and the twelfth convolutional layer are all 3x3; the convolution kernel sizes of the eighth convolutional layer, the tenth convolutional layer, the eleventh convolutional layer and the thirteenth convolutional layer are all 1x1; the pooling window shapes of the first max pooling layer, the second max pooling layer, the third max pooling layer, the fourth max pooling layer, the fifth max pooling layer and the sixth max pooling layer are all 2x2; The numbers of convolution kernels of the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer, the sixth convolutional layer, the seventh convolutional layer, the eighth convolutional layer, the ninth convolutional layer and the tenth convolutional layer are respectively 16, 32, 64, 128, 256, 512, 1024, 256, 512 and 255.
Citation Information
Patent Citations
Face detection and search method for a monitoring video
CN109522853A
Method for detecting image target in smart home environment
WO2021244079A1