Smoke and fire monitoring position extraction method and system based on Yolo V5
The fireworks monitoring orientation extraction method based on Yolo V5 solves the problem of users having difficulty in obtaining camera orientation information, achieves efficient acquisition of fireworks monitoring information, and adapts to small systems through model improvements, improving operating speed and compatibility.
Patent Information
- Application Number
- CN202210492263.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-07
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-05-07
AI Technical Summary
In the field of forest fire monitoring, it is difficult for users to directly obtain camera position information, resulting in low efficiency in obtaining firework monitoring information.
The fireworks monitoring orientation extraction method based on Yolo V5 is used to extract and obtain the monitoring orientation information by acquiring monitoring images, annotating orientation information, improving the yolov5 network, training recognition networks and text recognition models.
It improves the efficiency of obtaining pyrotechnic monitoring orientation information, and reduces the model size and improves the running speed through model improvements, making it suitable for edge devices, adaptable to small systems, and has high compatibility.
Smart Images

Figure CN114758345B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text recognition, and more specifically to a method and system for extracting the orientation of fireworks monitoring based on Yolo V5. Background Art
[0002] In the field of forest fire monitoring, fire identification and early warning through cameras is a common technical means. However, many users can only get the video channel, while various parameters such as camera position information are displayed on the screen and cannot be directly obtained by users. Therefore, for those skilled in the art, how to directly obtain the fire monitoring position information is an urgent problem to be solved. Summary of the invention
[0003] In view of this, the present invention provides a method and system for extracting the direction of fireworks monitoring based on Yolo V5 to solve the problems existing in the background technology.
[0004] In order to achieve the above object, the present invention adopts the following technical solution: a method for extracting the direction of fireworks monitoring based on Yolo V5, the specific steps of which include the following:
[0005] Acquire a surveillance image, and annotate the position information in the surveillance image to construct a position information detection data set;
[0006] Improve the yolov5 network to get the first network;
[0007] Training the first network to obtain a recognition network;
[0008] Using the recognition network to recognize the position information detection data set, extracting the position information area in each image and saving it as an image, constructing a text recognition data set, and annotating the text recognition data set;
[0009] Paddlepaddle OCR is trained as a recognition model to obtain the first model;
[0010] The image area extracted by the recognition network is input into the first model to obtain monitoring orientation information.
[0011] Optionally, the method for improving the yolov5 network is: reducing the number of C3 structures, reducing the channel parameters of each convolutional layer of the backbone and head, and the specific implementation is: the basic number of the 4th layer C3 of the banckbone is changed from 6 to 3, the basic number of the 6th layer C3 is changed from 9 to 3, the output channel of the 7th layer Conv is changed from 1024 to 256, the output channel of the 8th layer C3 is changed from 1024 to 256, the output channel of the 9th layer SPPF is changed from 1024 to 256, and the output channels of all other layers are changed to half of the original.
[0012] Optionally, the position information in the monitoring image is labeled with classification labels according to different fonts, and the position information detection data set is divided into a training set and a test set at a ratio of 9:1.
[0013] Optionally, when training the first network, imgsize is set to 640 and multi-scale is set to True.
[0014] Optionally, load pre-trained weights to train the paddlepaddle ocr model, using ch_ppocr_mobile_v2.0_rec as the pre-trained weights.
[0015] Optionally, the monitoring images are images of different monitoring locations in different time periods, all of which are visible light images.
[0016] On the other hand, a fireworks monitoring position extraction system based on Yolo V5 is provided, comprising a data set acquisition module, a recognition network construction module, a text recognition data set construction module, a first model construction module, and a position information acquisition module; wherein,
[0017] The data set acquisition module is used to acquire a surveillance image, and to mark the position information in the surveillance image to construct a position information detection data set;
[0018] The recognition network building module is used to improve the yolov5 network to obtain a first network; train the first network to obtain a recognition network;
[0019] The text recognition data set construction module is used to use the recognition network to recognize the orientation information detection data set, extract the orientation information area in each image, save it as an image, construct a text recognition data set, and annotate the text recognition data set;
[0020] The first model building module is used to train the paddlepaddle ocr as a recognition model to obtain a first model;
[0021] The orientation information acquisition module is used to input the image area extracted by the recognition network into the first model to obtain monitoring orientation information.
[0022] Optionally, a training module is also included, and the training module includes a first training module and a second training module; wherein the first training module is used to train the first network, and the second training module is used to train the paddlepaddle ocr model.
[0023] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a method and system for extracting the position of fireworks monitoring based on Yolo V5, which has the following beneficial technical effects:
[0024] (1) The camera's position information can be obtained through the fireworks monitoring image, which improves the efficiency of obtaining position information;
[0025] (2) Through the improvement of the yolov5 network, the model weight file size is reduced from 40.8MB (yolov5m) to 6.34MB, and the model parameter volume is reduced from 21.2M (yolov5m) to 3.15M, which greatly reduces the model size and improves the running speed. It can also be applied to edge devices, making it adaptable to various small systems with high compatibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0027] Figure 1 is a flow chart of the method of the present invention;
[0028] Figure 2 It is a system structure diagram of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] Embodiment 1 of the present invention discloses a method for extracting the direction of fireworks monitoring based on Yolo V5, such as Figure 1As shown, the specific steps include the following:
[0031] S1. Obtain surveillance images, annotate the position information in the surveillance images, and construct a position information detection data set;
[0032] Specifically, images of different monitoring locations at different time periods are obtained. The acquired monitoring images are all visible light images. The images are annotated, the location areas are framed, and classification labels are added according to different fonts. The data set is divided into a training set and a test set at a ratio of 9:1. In this embodiment, two types of fonts, type 1 and type 2, are separated, and finally 2006 annotated images are sorted out as a training data set and 236 as a test data set.
[0033] S2, improve the yolov5 network to obtain the first network;
[0034] In the Yolov5 network, each layer sets a very high output channel value in order to separate more feature information and deal with hundreds or even thousands of target recognition. In this embodiment, there are not so many types of targets, only 2 categories, so the improvement is as follows: modify the network parameters in the Yolov5m.yaml file, the 4th layer C3 of banckbone, the basic number is changed from 6 to 3, the 6th layer C3 basic number is changed from 9 to 3, the 7th layer Conv output channel is changed from 1024 to 256, the 8th layer C3 output channel is changed from 1024 to 256, the 9th layer SPPF, the output channel is changed from 1024 to 256, and the output channels of all other layers are changed to half of the original, and the Head except the last Detect layer, all other output channels are set to 256. C3 is a structural module in the Yolov5 network.
[0035] S3, training the first network to obtain a recognition network;
[0036] During training, imgsize is set to 640 and multi-scale is set to True to enhance the richness of data and improve the adaptability of the network. After 400 epochs of training, the recognition network has an accuracy of 99.2% and a recall of 99.5%.
[0037] S4, using the recognition network to identify the orientation information detection data set, extracting the orientation information area in each image, saving it as an image, constructing a text recognition data set, and annotating the text recognition data set;
[0038] Use the recognition network trained in S3 to recognize the position information detection data set in S1. Take the target area with the highest confidence in each image, extract the corresponding area of the position information in each image, save it as an image, build a text recognition data set, and then annotate the text recognition data set;
[0039] S5, training the paddlepaddle ocr as a recognition model to obtain a first model;
[0040] Use paddlepaddle ocr as the recognition model, load the pre-trained weights for training. In this embodiment, ch_ppocr_mobile_v2.0_rec is used as the pre-trained weight. ch_ppocr_mobile_v2.0_rec is the weight file officially provided by the OCR model.
[0041] S6. Input the image area extracted by the recognition network into the first model to obtain monitoring orientation information.
[0042] Embodiment 2 of the present invention provides a fire monitoring position extraction system based on Yolo V5, such as Figure 2 As shown, it includes a data set acquisition module, a recognition network construction module, a text recognition data set construction module, a first model construction module, and a position information acquisition module; wherein,
[0043] The data set acquisition module is used to acquire surveillance images, annotate the position information in the surveillance images, and construct a position information detection data set;
[0044] The recognition network building module is used to improve the yolov5 network to obtain the first network; the first network is trained to obtain the recognition network;
[0045] A text recognition data set construction module is used to use a recognition network to recognize the orientation information detection data set, extract the orientation information area in each image, save it as an image, construct a text recognition data set, and annotate the text recognition data set;
[0046] The first model building module is used to train the paddlepaddle ocr as a recognition model to obtain a first model;
[0047] The orientation information acquisition module is used to input the image area extracted by the recognition network into the first model to obtain the monitoring orientation information.
[0048] Furthermore, it also includes a training module, which includes a first training module and a second training module; wherein the first training module is used to train the first network, and the second training module is used to train the paddlepaddle ocr model.
[0049] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0050] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for extracting the direction of fireworks monitoring based on Yolo V5. It is characterized in that The specific steps include the following: Acquire a surveillance image, and annotate the position information in the surveillance image to construct a position information detection data set; The yolov5 network is improved to obtain the first network; the method of improving the yolov5 network is: deleting the number of C3 structures, reducing the channel parameters of each convolution layer of the backbone and the head, and specifically implemented as follows: the base number of the 4th layer C3 of the banckbone is changed from 6 to 3, the base number of the 6th layer C3 is changed from 9 to 3, the output channel of the 7th layer Conv is changed from 1024 to 256, the output channel of the 8th layer C3 is changed from 1024 to 256, the output channel of the 9th layer SPPF is changed from 1024 to 256, and the output channels of all other layers are changed to half of the original; Training the first network to obtain a recognition network; Using the recognition network to recognize the position information detection data set, extracting the position information area in each image and saving it as an image, constructing a text recognition data set, and annotating the text recognition data set; Paddlepaddle OCR is trained as a recognition model to obtain the first model; The image area extracted by the recognition network is input into the first model to obtain monitoring orientation information.
2. According to the method for extracting the direction of fireworks monitoring based on Yolo V5 in claim 1, It is characterized in that The position information in the monitoring image is labeled with classification labels according to different fonts, and the position information detection data set is divided into a training set and a test set at a ratio of 9:
1.
3. According to the method for extracting the direction of fireworks monitoring based on Yolo V5 in claim 1, It is characterized in that When training the first network, imgsize is set to 640 and multi-scale is set to True.
4. According to the method for extracting the direction of fireworks monitoring based on Yolo V5 in claim 1, It is characterized in that Load pre-trained weights to train the paddlepaddle ocr model, using ch_ppocr_mobile_v2.0_rec as the pre-trained weights.
5. According to the method for extracting the direction of fireworks monitoring based on Yolo V5 in claim 1, It is characterized in that The monitoring images are images of different monitoring locations at different time periods, and are all visible light images.
6. A fire and smoke monitoring position extraction system based on Yolo V5, applying the fire and smoke monitoring position extraction method based on Yolo V5 described in any one of claims 1 to 5, It is characterized in that It includes a data set acquisition module, a recognition network construction module, a text recognition data set construction module, a first model construction module, and a position information acquisition module; wherein, The data set acquisition module is used to acquire a surveillance image, and to mark the position information in the surveillance image to construct a position information detection data set; The recognition network building module is used to improve the yolov5 network to obtain a first network; train the first network to obtain a recognition network; The text recognition data set construction module is used to use the recognition network to recognize the orientation information detection data set, extract the orientation information area in each image, save it as an image, construct a text recognition data set, and annotate the text recognition data set; The first model building module is used to train the paddlepaddle ocr as a recognition model to obtain a first model; The orientation information acquisition module is used to input the image area extracted by the recognition network into the first model to obtain monitoring orientation information.
7. A smoke and fire monitoring position extraction system based on Yolo V5 according to claim 6, It is characterized in that It also includes a training module, which includes a first training module and a second training module; wherein the first training module is used to train the first network, and the second training module is used to train the paddlepaddle ocr model.
Citation Information
Patent Citations
Multi-scale fire target identification method and system
CN113011319A
Forbidden zone intrusion behavior identification method, storage device and server
CN113255533A
Character recognition method and system based on industrial equipment label and storage medium
CN113971726A
Smoke flame identification method and device
CN114330503A
Lightweight optimization Yolo v4-based tea disease identification method and system
CN114359727A
