A human-machine collaborative safety warning method and system based on deep vision
Through deep vision technology and the YOLOV5 network model, the robot's working area is monitored in real time, pedestrians are positioned and relative distances are calculated, warning signals are issued and the robot is driven to avoid, which solves the problems of low efficiency and poor real-time performance of human-machine collaboration safety early warning in the existing technology, and improves personnel safety.
Patent Information
- Application Number
- CN202110849847.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-07-27
AI Technical Summary
Existing human-machine collaboration safety early warning methods are inefficient and poor in real-time performance, and cannot effectively avoid collisions between robotic arms and people.
Adopt a human-machine collaboration safety early warning method based on depth vision, use the YOLOV5 network model to collect real-time images of the robot production environment, locate pedestrians and calculate their relative distance to the robot, send out early warning signals based on the set safety protection level distance, and drive the robot Perform motor evasive maneuvers.
It realizes real-time monitoring of the robot's working area, effectively avoids collisions between pedestrians and robots, is suitable for different forms of robot working environments, and improves the safety of human-machine collaboration.
Smart Images

Figure CN113568407B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of human-machine collaboration and computer vision technology, and in particular to a human-machine collaboration safety warning method and system based on depth vision. Background Art
[0002] As the automation and intelligent production level of the manufacturing industry continues to increase, a large number of robots are put into automated production lines, and equipped with certain professionals to work together to complete assembly, welding, handling and other processes. During the whole process, it is inevitable that the robot arm will collide with people and cause injuries. Traditional methods such as installing fences around the robot arm and manually wearing protective equipment not only require additional space, but also make it difficult to quickly change the boundaries of the work area according to task requirements. Moreover, the above methods cannot fundamentally solve the safety problems of human-machine collaboration. Summary of the invention
[0003] The purpose of the present invention is to provide a human-machine collaboration safety warning method and system based on depth vision, so as to solve the problems of low efficiency and poor real-time performance of existing human-machine collaboration safety warning methods, and fundamentally improve the safety of personnel in human-machine collaboration.
[0004] To achieve the above object, the present invention provides the following solutions:
[0005] A human-machine collaborative safety warning method based on deep vision, comprising:
[0006] Collect images of the robot production environment area in real time to obtain an image sequence;
[0007] Using the trained YOLOV5 network model to process the image sequence in real time, locate and mark all pedestrians in the image;
[0008] Calculating the relative distances between all located and marked pedestrians and the robot;
[0009] The relative distance is compared with the set safety protection level distance, and different levels of early warning signals are issued according to the comparison result.
[0010] Optionally, the above-mentioned human-machine collaboration safety warning method based on depth vision further includes determining whether to drive the robot control system to control the robot to perform motion avoidance action according to the comparison result;
[0011] If not, different levels of warning signals are issued only according to the comparison result; if so, different levels of warning signals are issued according to the comparison result, and the robot is driven to make evasive movements to avoid collision between the robot and the pedestrian.
[0012] Optionally, the image sequence is preprocessed using the input end of the YOLOV5 network model, and the preprocessing process specifically includes:
[0013] Using Mosaic to enhance the data of the image sequence to obtain an enhanced image;
[0014] The enhanced image is processed using an adaptive anchor frame algorithm to obtain an image with an optimal anchor frame value;
[0015] The image with the best anchor box value is scaled using an adaptive image scaling algorithm to obtain a preprocessed image.
[0016] Optionally, using the Backbone part of the YOLOV5 network model to process the image sequence to obtain image features;
[0017] The image features are mixed and combined using the Neck part of the YOLOV5 network model to obtain mixed and combined image features;
[0018] The Head part of the YOLOV5 network model is used to predict the mixed and combined image features, locate and generate bounding boxes of all pedestrians, and display the bounding boxes on the original image.
[0019] The YOLOV5 network model uses the GIOU_Loss function to solve the problem of non-overlapping bounding boxes when locating and generating bounding boxes for all pedestrians. The GIOU_Loss function is as follows:
[0020]
[0021] Among them, IOU is the intersection-over-union ratio, which represents the ratio of the intersection and union of the predicted box and the true box, C represents the minimum circumscribed rectangular area of the predicted box and the true box, Δ=BC, and B represents the union of the predicted box and the true box.
[0022] Optionally, the image sequence is processed in real time using a trained pedestrian detection network model to locate and mark all pedestrians in the image, including:
[0023] All pedestrians in the image are located and the output data (x, y, w, h, c) is obtained, where x and y represent the coordinate values of the pedestrian prediction box on the x-axis and y-axis in the image coordinate system, w and h represent the width and height of the pedestrian prediction box, and c represents the confidence of the pedestrian prediction box.
[0024] All pedestrians in the image are marked, and the pedestrian prediction boxes and confidence levels are displayed on the original image.
[0025] Optionally, calculating the relative distances between all located and marked pedestrians and the robot includes:
[0026] The relative distances between all the positioned and marked pedestrians and the robot are calculated using the basic principle of binocular ranging. The calculation formula of the basic principle of binocular ranging is as follows:
[0027]
[0028] Where f is the focal length of the camera, which is obtained by camera calibration, B is the center distance of the camera, which is obtained by camera calibration, and X L -X R Represents the imaging parallax of the target point in the left and right views of the camera.
[0029] The present invention provides a human-machine collaborative safety warning system based on depth vision, comprising:
[0030] An image acquisition module is used to acquire images of the robot production environment area in real time to obtain an image sequence;
[0031] A pedestrian detection module is used to process the image sequence in real time using the trained YOLOV5 network model to locate and mark all pedestrians in the image;
[0032] A depth ranging module, used to calculate the relative distance between all located and marked pedestrians and the robot;
[0033] The safety warning module is used to compare the relative distance with the set safety protection level distance, and issue warning signals of different levels according to the comparison result.
[0034] Optionally, the above-mentioned human-machine collaborative safety warning system based on deep vision also includes:
[0035] The motion avoidance module is used to determine whether to drive the robot control system to control the robot to perform motion avoidance actions according to the comparison results; if not, different levels of warning signals are only issued according to the comparison results; if yes, different levels of warning signals are issued according to the comparison results, and the robot is driven to perform motion avoidance actions to avoid collision between the robot and pedestrians.
[0036] Optionally, the pedestrian detection module includes:
[0037] An image enhancement unit, used for enhancing the data of the image sequence by using Mosaic to obtain an enhanced image;
[0038] An image anchor frame unit, used for processing the enhanced image using an adaptive anchor frame algorithm to obtain an image with an optimal anchor frame value;
[0039] The image scaling unit is used to scale the image with the best anchor frame value using an adaptive picture scaling algorithm to obtain a preprocessed image.
[0040] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0041] The human-machine collaborative safety warning method based on deep vision disclosed by the present invention includes the following steps: real-time acquisition of images of the robot production environment area to obtain an image sequence; real-time processing of the image sequence using a trained pedestrian detection network model to locate and mark all pedestrians in the image; calculation of the relative distance between all located and marked pedestrians and the robot; comparison of the relative distance with the set safety protection level distance, and issuance of different levels of warning signals according to the comparison results. By real-time monitoring of the robot's overall working area, the robot can effectively avoid collisions with pedestrians in the working area. And the method is applicable to different forms of robot working environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 This is a flow chart of the human-machine collaborative safety warning method based on depth vision of the present invention;
[0044] Figure 2 This is a schematic diagram of the depth ranging principle in the human-machine collaborative safety warning method based on depth vision of the present invention;
[0045] Figure 3 This is a schematic diagram of the principle of the human-machine collaborative safety warning method based on depth vision of the present invention. DETAILED DESCRIPTION
[0046] 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 making creative work are within the scope of protection of the present invention.
[0047] The purpose of the present invention is to provide a human-machine collaboration safety warning method and system based on depth vision, so as to solve the problems of low efficiency and poor real-time performance of existing human-machine collaboration safety warning methods, and fundamentally improve the safety of personnel in human-machine collaboration.
[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0049] Example 1
[0050] like Figure 1 As shown, this embodiment provides a human-machine collaborative safety warning method based on depth vision, and the method specifically includes the following steps:
[0051] S1: Collect images of the robot production environment area in real time to obtain an image sequence.
[0052] Specifically, binocular cameras are used to collect images of the robot's working area in real time. The binocular cameras are suspended directly above the robot's working area based on a rotating pan-tilt platform. There are two binocular cameras, each with a viewing angle of 180°. The binocular cameras can obtain rich image color and texture features through visual sensors, and can better reproduce the environmental scenes of the robot's working area than other cameras.
[0053] S2: Use the trained YOLOV5 network model to process the image sequence in real time, locate all pedestrians in the image and mark them.
[0054] Specifically, the method for training the YOLOV5 network model includes making a pedestrian data set, training the self-made pedestrian data set using the YOLOV5 network model, obtaining a weight file, and deploying the weight file to the Nvidia JetsonXavier NX development board to obtain a trained YOLOV5 network model. The Nvidia deep learning embedded AI platform has excellent performance and a compact size, which meets the training requirements of the YOLOV5 network model. The Nvidia deep learning embedded AI platform can be connected to the binocular camera via a USB interface.
[0055] The input end of the YOLOV5 network model uses the Mosaic data enhancement method, and adds an adaptive anchor frame algorithm and an adaptive picture scaling algorithm. In the training process of the YOLOV5 network model, the self-made pedestrian data set can be spliced using Mosaic's random scaling, random cropping, and random arrangement image processing methods, and the self-made pedestrian data set can be enhanced to improve the training accuracy of the YOLOV5 network model. And the enhanced image can also be processed using the adaptive anchor frame algorithm to obtain an image with the best anchor frame value. The YOLOV5 network model embeds the adaptive anchor frame algorithm into the code, and each time it is trained, the best anchor frame value in different training sets is adaptively calculated. Of course, if you feel that the calculated anchor frame effect is not very good, you can also turn off the automatic calculation of the anchor frame function in the code. Finally, the image with the best anchor frame value is scaled using the adaptive picture scaling algorithm to obtain a preprocessed image. The above process of preprocessing the images in the self-made pedestrian data set can enrich the data set and improve the training speed and accuracy of the YOLOV5 network model.
[0056] Specifically, the steps of real-time processing of the image sequence by the YOLOV5 network model include:
[0057] S21: Use the Backbone part of the YOLOV5 network model to process the image sequence and obtain image features.
[0058] Specifically, Backbone is a convolutional neural network composed of a Focus structure and a CSP structure. It can aggregate and form image features at different image granularities, while CSPNet can integrate gradient changes into image features from beginning to end, reducing the amount of calculation while ensuring accuracy.
[0059] S22: Using the Neck part of the YOLOV5 network model, the image features are mixed and combined to obtain mixed and combined image features.
[0060] Specifically, the Neck part is composed of the FPN structure and the PAN structure, which can be used to mix and combine image features and pass the image features to the prediction layer.
[0061] S23: Using the Head part of the YOLOV5 network model, predict the mixed and combined image features, locate and generate bounding boxes of all pedestrians, and display the bounding boxes on the original image.
[0062] Specifically, the Head network uses the non-maximum suppression method to filter out duplicate bounding boxes, and uses the GIOU_Loss function to solve the problem of non-overlapping bounding boxes when locating and generating bounding boxes for all pedestrians. The GIOU_Loss function is as follows:
[0063]
[0064] Among them, IOU is the intersection-over-union ratio, which represents the ratio of the intersection and union of the predicted box and the true box, C represents the minimum circumscribed rectangular area of the predicted box and the true box, Δ=BC, and B represents the union of the predicted box and the true box. From the above formula, it can be seen that the GIOU_Loss function adds an intersection scale measurement method to solve the problem of non-overlapping bounding boxes, which improves the convergence speed and model performance of the YOLOV5 network model.
[0065] The role of the YOLOV5 network model in real-time processing of the image sequence is to mark all people in the video image and output them visually. In simple terms, all pedestrians in the image are located and output data (x, y, w, h, c) is obtained, where x and y represent the coordinate values of the pedestrian prediction box on the x-axis and y-axis in the image coordinate system, w and h represent the width and height of the pedestrian prediction box, and c represents the confidence of the pedestrian prediction box; all pedestrians in the image are marked, and the pedestrian prediction box and confidence are displayed on the original image.
[0066] There are four YOLOV5 network models, namely, YOLOV5s network model, YOLOV5l network model, YOLOV5m network model and YOLOV5x network model. Since the YOLOV5s network model can accurately and quickly detect all pedestrians in the robot's working area under different lighting and viewing angle conditions, it meets the real-time requirements of human-machine collaboration safety. Therefore, in this embodiment, the YOLOV5s network model is used to process the image sequence in real time. It should be noted that using the YOLOV5s network model to process the image sequence in real time is only a preferred implementation provided by this embodiment. Those skilled in the art may also use other types of network models to process the image sequence in real time, and the present invention does not specifically limit this.
[0067] S3: Calculate the relative distance between all located and marked pedestrians and the robot.
[0068] Specifically, the parallax principle of binocular stereo vision is used to calculate the position deviation between the corresponding points of two images of the target pedestrian obtained from different positions, so as to accurately calculate the relative distance between the target pedestrian and the robot. Figure 2 As shown, assuming that P is the center point of the pedestrian rectangle formed by the detection network, X L -X R is the imaging parallax of the target point in the left and right images, B is the camera center distance, f is the camera focal length, Z is the relative distance between the target pedestrian and the robot, O L With O R are the optical centers of the left and right cameras, PL With P R They are the imaging points on the left and right camera sensors respectively.
[0069] Then according to the principle of similar triangles, we can get:
[0070]
[0071] Transforming it yields:
[0072]
[0073] Where f is the focal length of the camera, which is obtained by camera calibration, B is the center distance of the camera, which is obtained by camera calibration, and X L -X R Represents the imaging parallax of the target point in the left and right views of the camera.
[0074] S4: Compare the relative distance with the set safety protection level distance, and issue different levels of warning signals according to the comparison result.
[0075] Specifically, Nvidia's deep learning embedded AI platform can be connected to red and yellow warning lights via cables. The safety protection level distance is divided into yellow safety warning distance and red safety warning distance.
[0076] like Figure 3 As shown, when the relative distance is greater than the yellow safety warning distance, neither the red nor the yellow warning lights flash; when the relative distance is less than the yellow safety warning distance and greater than the red safety warning distance, the yellow warning light flashes; when the relative distance is less than the red safety warning distance, the red warning light flashes.
[0077] The human-machine collaboration safety early warning method based on depth vision provided by the present invention also includes determining whether to drive the robot control system to control the robot to perform motion avoidance action according to the comparison result;
[0078] If not, only different levels of warning signals are issued according to the comparison results; if yes, different levels of warning signals are issued according to the comparison results, and the robot is driven to make evasive movements to avoid collisions between the robot and pedestrians. For example, when the yellow warning is issued, the robot control system is driven to reduce the robot's running speed, and when the red warning is issued, the robot control system is driven to stop the robot from moving.
[0079] The human-machine collaboration safety warning method based on depth vision provided in this embodiment can effectively avoid the robot from colliding with pedestrians in the working area by real-time monitoring the entire working area of the robot. The method is also applicable to different forms of robot working environments.
[0080] Example 2
[0081] This embodiment provides a human-machine collaborative safety warning system based on depth vision corresponding to Embodiment 1, the system comprising:
[0082] An image acquisition module is used to acquire images of the robot production environment area in real time to obtain an image sequence;
[0083] A pedestrian detection module is used to process the image sequence in real time using the trained YOLOV5 network model to locate and mark all pedestrians in the image;
[0084] A depth ranging module, used to calculate the relative distance between all located and marked pedestrians and the robot;
[0085] The safety warning module is used to compare the relative distance with the set safety protection level distance, and issue warning signals of different levels according to the comparison result.
[0086] Specifically, the system also includes:
[0087] The motion avoidance module is used to determine whether to drive the robot control system to control the robot to perform motion avoidance actions according to the comparison results; if not, different levels of warning signals are only issued according to the comparison results; if yes, different levels of warning signals are issued according to the comparison results, and the robot is driven to perform motion avoidance actions to avoid collision between the robot and pedestrians.
[0088] Optionally, the pedestrian detection module includes:
[0089] An image enhancement unit, used for enhancing the data of the image sequence by using Mosaic to obtain an enhanced image;
[0090] An image anchor frame unit, used for processing the enhanced image using an adaptive anchor frame algorithm to obtain an image with an optimal anchor frame value;
[0091] The image scaling unit is used to scale the image with the best anchor frame value using an adaptive picture scaling algorithm to obtain a preprocessed image.
[0092] Visual sensors can obtain richer feature information such as image color and texture, and can reproduce the surrounding environment scenes well. Moreover, they do not need to actively transmit signals, which makes them more suitable for some environments with high real-time requirements. After the introduction of computer vision into the human-machine collaborative safety warning system based on deep vision, when a person approaches the robot's working area, the system can promptly warn people outside the area to stop approaching, and can implement regional graded alarms when people break in. At the same time, the robot can be controlled to reduce its running speed or even stop moving in time, minimizing the occurrence of safety accidents. Machine vision technology is used to monitor the overall working area of the robot, isolate people from the robot, and establish a safe working area for the staff, thereby effectively avoiding human-machine collisions.
[0093] 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 system 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.
[0094] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A human-machine collaborative safety warning method based on deep vision, characterized by: Use binocular cameras to collect images of the robot's working area in real time. The binocular cameras are suspended above the robot's working area based on a rotating pan-tilt platform. There are two binocular cameras, and the viewing angle of each binocular camera is 180°. Collect images of the robot production environment area in real time to obtain image sequences; store the collected images as a self-made pedestrian dataset; Using the trained YOLOV5 network model to process the image sequence in real time, locate and mark all pedestrians in the image, locate and generate bounding boxes of all pedestrians, and display the bounding boxes on the original image; Calculating the relative distances between all located and marked pedestrians and the robot; Comparing the relative distance with the set safety protection level distance, and issuing different levels of early warning signals according to the comparison result; The training of the YOLOV5 network model includes preprocessing of the data set, and the preprocessing includes: Using Mosaic to enhance the data of the image sequence to obtain an enhanced image; Processing the enhanced image using an adaptive anchor frame algorithm to obtain an image with an optimal anchor frame value; The image with the best anchor frame value is scaled by using an adaptive picture scaling algorithm to obtain a preprocessed image. The process of preprocessing the images in the self-made pedestrian dataset can enrich the dataset.
2. According to claim 1, a human-machine collaborative safety warning method based on deep vision is characterized by: It also includes determining whether to drive the robot control system to control the robot to perform a motion avoidance action according to the comparison result; If not, different levels of warning signals are issued only according to the comparison result; if so, different levels of warning signals are issued according to the comparison result, and the robot is driven to make evasive movements to avoid collision between the robot and the pedestrian.
3. The human-machine collaborative safety warning method based on depth vision according to claim 1 is characterized by: Using the Backbone part of the YOLOV5 network model to process the image sequence and obtain image features; Using the Neck part of the YOLOV5 network model to mix and combine the image features, so as to obtain mixed and combined image features; The Head part of the YOLOV5 network model is used to predict the mixed and combined image features.
4. The human-machine collaborative safety warning method based on depth vision according to claim 3 is characterized in that: When the positioning generates the bounding boxes of all pedestrians, the GIOU_Loss function is used to solve the problem of non-overlapping bounding boxes. The GIOU_Loss function is as follows: Among them, IOU is the intersection-over-union ratio, which represents the ratio of the intersection and union of the predicted box and the true box, C represents the minimum circumscribed rectangular area of the predicted box and the true box, Δ=BC, and B represents the union of the predicted box and the true box.
5. The human-machine collaborative safety warning method based on deep vision according to claim 1 is characterized in that: The method of using the trained pedestrian detection network model to process the image sequence in real time, locating all pedestrians in the image and marking them includes: All pedestrians in the image are located and the output data (x, y, w, h, c) is obtained, where x and y represent the coordinate values of the pedestrian prediction box on the x-axis and y-axis in the image coordinate system, w and h represent the width and height of the pedestrian prediction box, and c represents the confidence of the pedestrian prediction box. All pedestrians in the image are marked, and the pedestrian prediction boxes and confidence levels are displayed on the original image.
6. The human-machine collaborative safety warning method based on deep vision according to claim 1 is characterized in that: The relative distances between all pedestrians and the robot after calculation, positioning and marking include: The relative distance between all the positioned and marked pedestrians and the robot is calculated using the basic principle of binocular ranging. The calculation formula of the basic principle of binocular ranging is as follows: Where f is the focal length of the camera, which is obtained by camera calibration, B is the center distance of the camera, which is obtained by camera calibration, and X L -X R Represents the imaging parallax of the target point in the left and right views of the camera.
7. A human-machine collaborative safety warning system based on deep vision, characterized in that: include: The image acquisition module is used to acquire images of the robot production environment area in real time to obtain an image sequence; the acquired images are stored as a self-made pedestrian data set; A pedestrian detection module is used to process the image sequence in real time using the trained YOLOV5 network model, locate and mark all pedestrians in the image, locate and generate bounding boxes of all pedestrians, and display the bounding boxes on the original image; A depth ranging module, used to calculate the relative distance between all located and marked pedestrians and the robot; A safety warning module is used to compare the relative distance with the set safety protection level distance, and issue warning signals of different levels according to the comparison result; Use binocular cameras to collect images of the robot's working area in real time. The binocular cameras are suspended above the robot's working area based on a rotating pan-tilt platform. There are two binocular cameras, and the viewing angle of each binocular camera is 180°. The training of the YOLOV5 network model includes preprocessing of the data set, and the preprocessing includes: Using Mosaic to enhance the data of the image sequence to obtain an enhanced image; Processing the enhanced image using an adaptive anchor frame algorithm to obtain an image with an optimal anchor frame value; The image with the best anchor frame value is scaled by using an adaptive picture scaling algorithm to obtain a preprocessed image. The process of preprocessing the images in the self-made pedestrian dataset can enrich the dataset.
8. The human-machine collaborative safety warning system based on depth vision according to claim 7 is characterized in that: Also includes: A motion avoidance module, used to determine whether to drive the robot control system to control the robot to perform a motion avoidance action according to the comparison result; If not, different levels of warning signals are issued only according to the comparison result; if so, different levels of warning signals are issued according to the comparison result, and the robot is driven to make evasive movements to avoid collision between the robot and the pedestrian.
9. The human-machine collaborative safety warning system based on depth vision according to claim 7 is characterized in that: The pedestrian detection module comprises: An image enhancement unit, used for enhancing the data of the image sequence by using Mosaic to obtain an enhanced image; An image anchor frame unit, used for processing the enhanced image by using an adaptive anchor frame algorithm to obtain an image with an optimal anchor frame value; The image scaling unit is used to scale the image with the best anchor frame value using an adaptive picture scaling algorithm to obtain a preprocessed image.
