A method for detecting and identifying garbage in elevators based on deep learning
Through the deep learning-based garbage detection and identification method in the elevator, the deep learning network model is used to automatically monitor and identify the garbage inside the elevator, which solves the problem of low efficiency of manual detection in the existing technology and realizes efficient and unattended garbage detection. Detection and reminder reduce operating costs.
Patent Information
- Application Number
- CN202011633494.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-12-31
AI Technical Summary
The existing garbage detection in elevators mainly relies on manpower, which results in high cost, low efficiency and the inability to achieve 24-hour unmanned monitoring, which affects elevator hygiene and air quality.
A method for detecting and identifying garbage in elevators based on deep learning is adopted, video stream data is obtained through elevator cameras, and deep learning network models are used to train and identify images inside the elevator to realize automatic monitoring and reminders of garbage.
It significantly improves the accuracy of garbage detection, reduces human resource requirements, enables 24-hour unattended garbage detection, reduces operating costs, and improves work efficiency.
Smart Images

Figure CN112733676B
Abstract
Description
Technical Field
[0001] The present invention relates to a video monitoring technology in an elevator, and in particular to a garbage detection and identification method in an elevator based on deep learning. Background Art
[0002] With the rapid development of the national economy and the continuous acceleration of urbanization, the number of elevators in my country is also increasing rapidly. Data from the China Elevator Industry Association shows that the number of elevators in my country has increased from 1.37 million in 2009 to about 7.0975 million in 2019, with an annual compound growth rate of 16.13%. According to the purpose of the elevator, the elevator can be divided into: passenger elevators, freight elevators, medical elevators, sightseeing elevators, vehicle elevators, etc. The elevators that are closely related to our daily life are mainly two types: cabin passenger elevators and freight elevators. The common characteristics of these two types of elevators include: fixed space size, large flow, high frequency of use, and poor air circulation. With the increasing utilization rate of elevators, a series of problems such as elevator hygiene have also been brought about. Littering causes odor in the air inside the elevator, which is easy to breed mosquitoes in summer and affect people's health. The existing more common solution is to arrange cleaning staff to clean the elevator regularly, which wastes a lot of manpower, material resources and financial resources. Now with the gradual increase in labor costs, the investment and use costs of this garbage detection and cleaning solution that relies on manpower are also increasing.
[0003] The present invention is proposed in view of the above. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method for detecting and identifying garbage in elevators based on deep learning, which can monitor and identify the garbage left in the elevator and remind the staff to deal with it in time to avoid the garbage being left in the elevator for a long time.
[0005] In order to achieve this object, the present invention adopts the following technical solution:
[0006] A method for detecting and identifying garbage in an elevator based on deep learning, comprising a model training step and a detection and identification step, wherein the model training step comprises:
[0007] Step a1, obtaining images containing garbage and establishing a picture set;
[0008] Step a2: Create a training data set and a test data set based on the established image set;
[0009] Step a3: input the training data set and the test data set into the deep learning network model for training, and complete the training of the deep learning network model after the model converges;
[0010] The detection and identification step comprises:
[0011] Step b1, obtaining monitoring video stream data through the elevator camera, and selecting an image when the elevator interior is clean as the background image;
[0012] Step b2, extracting the video frame image to be detected from the video stream data;
[0013] Step b3, performing frame difference processing on the extracted video frame image and the background image to obtain the foreground target;
[0014] Step b4: binarize the obtained foreground target and perform morphological operation-opening operation on the image to obtain a connected area;
[0015] Step b5: Use a rectangular box to select the connected area, calculate the area of the rectangular box, and exclude the selected area that is smaller than a preset threshold;
[0016] Step b6, calculating the coordinates of the rectangular frame, and then displaying it on the original video frame image according to the obtained coordinate values;
[0017] Step b7: input the original image of the selected area into the trained deep learning network model for recognition, and output the recognition result;
[0018] Step b8: Display the recognition result on the original video frame image and send a prompt message to the staff.
[0019] Furthermore, the picture set in step a1 at least includes images obtained by the elevator camera when there is garbage inside the elevator, or the picture set is composed of library images containing garbage and images obtained by the elevator camera when there is garbage inside the elevator.
[0020] Furthermore, the process of preparing the training data set and the test data set in step a2 is as follows:
[0021] a2.1, extract a single picture from the picture set;
[0022] a2.2. Use annotation tools to annotate the garbage in the image, obtain the coordinate information of all bounding boxes, and obtain the label corresponding to each bounding box;
[0023] a2.3. Create training data sets and test data sets in a certain ratio.
[0024] Furthermore, the deep learning network model is a Mobilenet model.
[0025] Further, the step a3 comprises:
[0026] a3.1. Download the ckpt model pre-trained with the coco dataset from tensorflow models zoo;
[0027] a3.2. Perform fine-tuning on the training data set and the test data set, and obtain the parameter model in the format of ckpt after the training.
[0028] a3.3. Convert the ckpt parameter model into a pb file that can be used by OpenCV, and export the corresponding network model pbtxt file from the pb file.
[0029] Furthermore, the detection and identification step is performed when there are no passengers in the elevator.
[0030] Furthermore, in step b2, when extracting the video frame images, the extraction can be performed at certain time intervals.
[0031] Furthermore, in the step b8, the recognition result is displayed close to the rectangular frame, and the prompt information is a text message prompt.
[0032] The technical solution of the present invention brings the following beneficial effects:
[0033] The present invention adopts a deep learning detection solution to detect garbage left in the elevator, which can significantly improve the detection accuracy and eliminate the influence of uneven lighting inside the elevator on the detection algorithm. Since the entire monitoring and identification process adopts a computer vision processing solution, no human participation is required throughout the detection process. The elevator can be detected 24 hours a day without sleep. The detection results can be directly displayed on the display and a garbage presence alarm can be sent, which can effectively save human resources, reduce labor costs and improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 : Flowchart of the present invention. DETAILED DESCRIPTION
[0035] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0036] like Figure 1 As shown, a method for detecting and identifying garbage in an elevator based on deep learning includes a model training step and a detection and identification step, wherein the model training step includes:
[0037] Step a1, obtaining images containing garbage and establishing a picture set;
[0038] Step a2: Create a training data set and a test data set based on the established image set;
[0039] Step a3: input the training data set and the test data set into the deep learning network model for training, and complete the training of the deep learning network model after the model converges.
[0040] The detection and identification step comprises:
[0041] Step b1, obtaining monitoring video stream data through the elevator camera, and selecting an image when the elevator interior is clean as the background image;
[0042] Step b2, extracting the video frame image to be detected from the video stream data;
[0043] Step b3, performing frame difference processing on the extracted video frame image and the background image to obtain the foreground target;
[0044] Step b4: binarize the obtained foreground target and perform morphological operation-opening operation on the image to obtain a connected area;
[0045] Step b5: Use a rectangular box to select the connected area, calculate the area of the rectangular box, and exclude the selected area that is smaller than a preset threshold;
[0046] Step b6, calculating the coordinates of the rectangular frame, and then displaying it on the original video frame image according to the obtained coordinate values;
[0047] Step b7: input the original image of the selected area into the trained deep learning network model for recognition, and output the recognition result;
[0048] Step b8: Display the recognition result on the original video frame image and send a prompt message to the staff.
[0049] Preferably, the above detection and identification steps are performed when there are no passengers in the elevator. For example, a human body recognition algorithm can be added to the program, and garbage identification can be performed after confirming that there are no passengers in the video. Alternatively, an infrared sensing device can be used to directly sense whether there are passengers in the elevator. If there are no passengers, the surveillance video stream data obtained by the camera can be identified.
[0050] Specifically, in step a1, there are multiple methods for establishing the picture set. In this embodiment, the picture set is mainly composed of images of garbage inside the elevator acquired by the elevator camera. The image generation process can be to manually capture the image with garbage directly from the video captured by the camera, or use the following method to select the image with garbage:
[0051] a1.1. Select the clean image of the elevator interior as the background image;
[0052] a1.2. Obtain monitoring video stream data in real time through the camera, and extract video frame images from the video stream data when there is no one in the elevator (which can be achieved through a human body detection device);
[0053] a1.3, performing frame difference processing on the extracted video frame image and the background image, and performing adaptive binarization processing on the obtained image;
[0054] a1.4, perform morphological processing on the image processed in a1.3 - opening operation, remove discrete points, eliminate small interference blocks, and obtain connected areas;
[0055] a1.5. Use a rectangular box to mark the connected area and calculate the area of the rectangular box, excluding the connected areas smaller than a certain threshold;
[0056] a1.6. Calculate the coordinate information of the rectangular frame, mark it on the original video frame image, and output the video frame image;
[0057] a1.7, repeating steps a1.2 to a1.6 at a certain time interval until the number of output images reaches a predetermined value, and generating an initial image set;
[0058] a1.8. Manually check the initial image set, exclude images that do not meet the requirements, and aggregate the remaining images into the image set.
[0059] Since there are fewer pictures containing garbage obtained through the elevator, in other embodiments of the present invention, the picture collection can also add images containing garbage in the network picture library in a certain proportion, which can enrich the picture collection resources.
[0060] The process of making the training data set and the test data set in step a2 is as follows:
[0061] a2.1, extract a single picture from the picture set;
[0062] a2.2. Use the annotation tool to annotate the garbage in the image, obtain the coordinate information of all bounding boxes, and obtain the label corresponding to each bounding box. For example, if the garbage in the image is paper shell, the label can be defined as paper shell;
[0063] a2.3. Prepare a training data set and a test data set in a certain ratio. Preferably, the ratio of the training data set to the test data set is 7:3.
[0064] Specifically, the deep learning network model is a Mobilenet model. The present invention adopts Google's open source Tensorflow framework for training operations, and after comparison, selects the SSDLite-mobilenet network model that has both detection speed and accuracy.
[0065] Specifically, the step a3 includes:
[0066] a3.1. Download the ckpt model pre-trained with the coco dataset from tensorflow models zoo;
[0067] a3.2. Fine-tune the training data set and the test data set. With this training method, the model converges quickly and the loss value can quickly drop to a reasonable range. The number of training times is set to 200,000 times, the momentum is set to 0.9, the basic learning rate is set to 0.0001, and the learning rate is reduced by 0.1 every 10,000 iterations. After the training is completed, the parameter model in the format of ckpt is obtained.
[0068] a3.3. Convert the trained ckpt parameter model into a pb file that can be used by OpenCV, and export the corresponding network model pbtxt file from the pb file.
[0069] In this embodiment, only one model training method is listed. However, for those skilled in the art, most of other existing training methods are also applicable to the present invention, so they are not described in detail.
[0070] Preferably, in step b2, when extracting the video frame images, the extraction can be performed at certain time intervals, which can reduce the amount of data that needs to be processed.
[0071] Preferably, in step b8, the recognition result is displayed close to a rectangular frame, and the prompt information is a text message prompt.
[0072] The present invention can realize 24-hour uninterrupted monitoring of the garbage left inside the elevator, and actively remind the staff to clean it up after the garbage is found. This can reduce the number of times the elevator maintenance personnel actively check the elevator, thereby reducing the burden on the staff.
[0073] The above is an embodiment of the present invention. It should be pointed out that for ordinary technicians in this field, various modifications and improvements can be made without departing from the principle of the present invention, which should also be regarded as the protection scope of the present invention.
Claims
1. A method for detecting and identifying garbage in elevators based on deep learning, comprising a model training step and a detection and identification step, characterized in that: The model training step includes: Step a1, obtaining images containing garbage and establishing a picture set; Step a2: Create a training data set and a test data set based on the established image set; Step a3: input the training data set and the test data set into the deep learning network model for training, and complete the training of the deep learning network model after the model converges; The step a3 comprises: a3.
1. Download the ckpt model pre-trained with the coco dataset from tensorflow models zoo; a3.
2. Fine-tune the training data set and the test data set. The number of training times is set to 200,000 times, the momentum is set to 0.9, the basic learning rate is set to 0.0001, and the learning rate is reduced by 0.1 every 10,000 iterations. After the training, the parameter model in the format of ckpt is obtained. a3.
3. Convert the ckpt parameter model into a pb file that can be used by OpenCV, and export the corresponding network model pbtxt file from the pb file; The detection and identification step is performed when there are no passengers in the elevator, and the detection and identification step includes: Step b1, obtaining monitoring video stream data through the elevator camera, and selecting an image when the elevator interior is clean as the background image; Step b2, extracting the video frame image to be detected from the video stream data; when extracting the video frame image, extracting at a certain time interval; Step b3, performing frame difference processing on the extracted video frame image and the background image to obtain the foreground target; Step b4: binarize the obtained foreground target and perform morphological operation-opening operation on the image to obtain a connected area; Step b5: Use a rectangular box to select the connected area, calculate the area of the rectangular box, and exclude the selected area that is smaller than a preset threshold; Step b6, calculating the coordinates of the rectangular frame, and then displaying it on the original video frame image according to the obtained coordinate values; Step b7: input the original image of the selected area into the trained deep learning network model for recognition, and output the recognition result; Step b8: Display the recognition result on the original video frame image and send a prompt message to the staff.
2. According to the method for detecting and identifying garbage in an elevator based on deep learning in claim 1, it is characterized in that: The picture set in step a1 at least includes images obtained by the elevator camera when there is garbage inside the elevator, or the picture set is composed of library images containing garbage and images obtained by the elevator camera when there is garbage inside the elevator.
3. According to the method for detecting and identifying garbage in an elevator based on deep learning in claim 1, it is characterized in that: The process of making the training data set and the test data set in step a2 is as follows: a2.1, extract a single picture from the picture set; a2.
2. Use annotation tools to annotate the garbage in the image, obtain the coordinate information of all bounding boxes, and obtain the label corresponding to each bounding box; a2.
3. Create training data sets and test data sets in a certain ratio.
4. According to the method for detecting and identifying garbage in an elevator based on deep learning in claim 1, it is characterized in that: The deep learning network model is a Mobilenet model.
5. The method for detecting and identifying garbage in an elevator based on deep learning according to claim 1, characterized in that: In the step b8, the recognition result is displayed close to the rectangular frame, and the prompt information is a text message prompt.
