Public place specific population detection method
By combining the YOLOv5s pedestrian detection algorithm and temperature measurement camera data, the body temperature information correlation algorithm of IoU-PR loss is used to calculate the actual physical distance between pedestrians, solving the problem of infectious virus transmission in public places, and achieving efficient temperature abnormality screening and contact distance detection.
Patent Information
- Application Number
- CN202411345745.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art is difficult to effectively reduce the spread of infectious viruses in public places, especially in pedestrian contact distance and body temperature detection.
The YOLOv5s pedestrian detection algorithm combined with the data of the temperature measurement camera is used to calculate the actual physical distance between pedestrians through the body temperature information correlation algorithm based on IoU-PR loss, and people with abnormal body temperature and close contact are screened out.
It improves the accuracy of screening people with abnormal body temperature, accurately calculates the actual physical distance between pedestrians, effectively reduces the misjudgment of specific personnel, and reduces the risk of transmission of infectious viruses.
Smart Images

Figure CN119693866A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of crowd detection, and in particular to a method for detecting a specific crowd in a public place. Background Art
[0002] Fever is a common clinical symptom and detection indicator in patients infected with infectious viruses. As the body's immune system fights pathogens, body temperature will rise, generally rising to above 37.3°C.
[0003] In addition, studies have shown that maintaining an inappropriate safe distance between pedestrians will increase the risk of infection with infectious viruses. The relationship between the contact distance between people and infected people and the risk of infection is that when the contact distance between people and infected people is less than 1m, the chance of infection increases significantly. Therefore, a method for detecting specific populations in public places is proposed to reduce the spread of infectious viruses in public places. Summary of the invention
[0004] 1. Technical issues to be resolved
[0005] In view of the deficiencies of the prior art, the present invention provides a method for detecting specific populations in public places, which has the advantages of reducing the transmissibility of diseases and solves the problem of reducing the spread of infectious viruses in public places.
[0006] (II) Technical solution
[0007] To achieve the above object, the present invention provides the following technical solution: a method for detecting a specific group of people in a public place, comprising the following steps:
[0008] Step S1, obtain pedestrian data, use the YOLOv5s pedestrian detection algorithm to detect the temperature measurement camera, obtain the pedestrian detection frame, and convert the association information between the face detection frame and the body temperature output by the temperature measurement camera of the body temperature information association algorithm into the association information between the pedestrian detection frame and the body temperature;
[0009] Step S2, calculating the acquired data, calculating the visual transformation parameter matrix required to transform the visible light image into the bird's-eye view, converting the filtered detection frame coordinates to the coordinates under the bird's-eye view, calculating the Euclidean distance between the abnormal body temperature pedestrian detection frame and other detection frames in the bird's-eye view coordinate system, and calculating the actual physical distance between pedestrians through the proportional relationship between the bird's-eye view pixel distance and the actual reference object;
[0010] Step S3, receiving the body temperature and abnormal body temperature person detection frame association information output in the previous stage, as well as the body temperature and close contact person detection frame association information, to complete the detection of specific people.
[0011] Preferably, the step S1 comprises:
[0012] Step S1.1, pedestrian detection in the risk crowd detection module adopts the YOLOv5s framework, and the YOLOv5s pre-trained model is trained and tested using the CrowdHuman dataset;
[0013] Step S1.2, using the OS-DM-FACE100 temperature measurement camera to detect the pedestrian's body temperature, and obtain the correlation information of the visible light image, the face detection frame and the body temperature.
[0014] Step S1.3, using the trained pedestrian detection model to perform pedestrian recognition on the visible light image, and obtain the pedestrian detection frame.
[0015] Step S1.4, input the pedestrian detection frame, face detection frame and body temperature information into the body temperature information association algorithm based on IoU-PR loss to obtain the association information between the face detection frame and the body temperature. The algorithm will calculate the IoU-PR loss between the paired face detection frame and the pedestrian detection frame, and send all the losses to the Hungarian algorithm to start the detection frame pairing step. The IoU-PR loss function is:
[0016]
[0017] S1.41, A is the pedestrian detection frame; B is the face detection frame; h and w are the height and width of the pedestrian detection frame respectively; Δd1 represents the relative distance between the upper edges of the face detection frame and the pedestrian detection frame; Δd2 represents the horizontal distance between their center points, L IoU-PR The value range is between 0 and 1. When Δd1≥h or Δd2≥w, L IoU-PR The value is 0. The smaller the value, the closer the distance between the face and the pedestrian's "face" and the higher the overlap. The IoU-PR loss can effectively measure the positional relationship between the face detection frame and the pedestrian detection frame, thereby realizing the correct association between the body temperature information and the pedestrian detection frame. According to the loss value between the detection frames, the cost matrix is constructed, and then the Hungarian algorithm provided by Python is used to solve the optimal solution pairing solution, and then the body temperature information is associated with the pedestrian detection frame to complete the conversion of the associated information.
[0018] Preferably, the training set contains 15,000 images, the test set and the validation set contain 5,000 and 4,300 images respectively, and each pedestrian in each image is annotated with a head bounding box, a visible body bounding box and a full body bounding box; the visible body boundary annotation boxes of the pedestrians in the images are screened out to obtain the training set, validation set and test set of the final data set, with a ratio of 3:1:1.
[0019] Preferably, the step S2 comprises:
[0020] Step S2.1, calibrating the visible light camera of the temperature measurement camera to obtain the camera's internal parameters and distortion parameters;
[0021] Step S2.2, performing distortion correction on the visible light image by using camera intrinsic parameters and distortion coefficients;
[0022] Step S2.3, using the internal parameters and distortion parameters, calculate the inverse perspective transformation parameter matrix required to transform the corrected visible light image into the bird's-eye view, and transform the filtered detection frame coordinates into the coordinates under the bird's-eye view.
[0023] Step S2.4, in the bird's-eye view coordinate system, calculate the Euclidean distance between the abnormal body temperature pedestrian detection frame and other detection frames, and calculate the actual physical distance between pedestrians through the proportional relationship between the bird's-eye view pixel distance and the actual reference object.
[0024] Preferably, step S3 specifically involves screening out people with abnormal body temperature based on whether their body temperature is greater than 37.3° C., and then selecting pedestrian detection frames whose contact distance with the people with abnormal body temperature is less than 1 m to complete the detection of the specific population.
[0025] (III) Beneficial effects
[0026] Compared with the prior art, the present invention provides a method for detecting specific people in public places, which has the following beneficial effects:
[0027] This method for detecting specific people in public places uses a body temperature information association algorithm based on IoU-PR loss. The temperature measurement camera outputs the association information between body temperature and face detection frame. This part can convert it into the association between body temperature and pedestrian detection frame, improve the accuracy of the original IoU loss matching, and lay the foundation for the subsequent screening of people with abnormal body temperature. Then, the Euclidean distance between the pedestrian detection frame with abnormal body temperature and other detection frames is calculated, and the actual physical distance between pedestrians is calculated through the proportional relationship between the pixel distance of the bird's-eye view and the actual reference object, completing the detection of contact distance. The distance detection accuracy of this part is high, which can effectively reduce the misjudgment of specific people. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A block diagram of a method for detecting specific people in public places proposed by the present invention;
[0029] Figure 2 This is a schematic diagram of a body temperature information association algorithm based on IoU-PR loss in a method for detecting specific people in public places proposed by the present invention;
[0030] Figure 3 This is a schematic diagram of IoU-PR loss of a specific crowd detection method in public places proposed by the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with 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.
[0032] Example 1: Please refer to the attached Figure 1-3 , a method for detecting specific people in public places, comprising the following steps:
[0033] Step S1, obtain pedestrian data, use the YOLOv5s pedestrian detection algorithm to detect the temperature measurement camera, obtain the pedestrian detection frame, and convert the association information between the face detection frame and body temperature output by the temperature measurement camera of the body temperature information association algorithm into the association information between the pedestrian detection frame and body temperature; in addition, the visible light camera of the temperature measurement camera is calibrated to obtain the camera's internal parameters and distortion parameters.
[0034] Step S1.1, pedestrian detection in the risk crowd detection module adopts the YOLOv5s framework, and the YOLOv5s pre-trained model is trained and tested using the CrowdHuman dataset;
[0035] Step S1.2, using a temperature measuring camera to detect the pedestrian's body temperature, and obtaining the correlation information of the visible light image, the face detection frame and the body temperature.
[0036] Step S1.3, using the trained pedestrian detection model to perform pedestrian recognition on the visible light image, and obtain the pedestrian detection frame.
[0037] Step S1.4: Input the pedestrian detection frame, face detection frame and body temperature information into the body temperature information association algorithm based on IoU-PR loss to obtain the association information between the face detection frame and the body temperature. The algorithm will calculate the IoU-PR loss between the paired face detection frame and the pedestrian detection frame, and send all the losses to the Hungarian algorithm to start the detection frame pairing step. The IoU-PR loss function is:
[0038]
[0039] S1.41, A is the pedestrian detection frame; B is the face detection frame; h and w are the height and width of the pedestrian detection frame respectively; Δd 1 Indicates the relative distance between the upper edge of the face detection frame and the pedestrian detection frame; Δd 2 represents the horizontal distance between their center points, L IoU-PR The value range is between 0 and 1 (when Δd 1 ≥h or Δd 2 When ≥w, L IoU-PRThe value is 0), the smaller the value, the closer the distance between the face and the pedestrian's "face" is, and the higher the overlap. The IoU-PR loss can effectively measure the positional relationship between the face detection frame and the pedestrian detection frame, thereby realizing the correct association between the body temperature information and the pedestrian detection frame. According to the loss value between the detection frames, the cost matrix is constructed, and then the Hungarian algorithm provided by Python is used to solve the optimal solution pairing solution, and then the body temperature information is associated with the pedestrian detection frame to complete the conversion of the associated information.
[0040] Among them, the training set contains 15,000 pictures, the test set and validation set contain 5,000 and 4,300 pictures respectively. Each pedestrian in each picture is annotated with the head bounding box, visible body bounding box and whole body bounding box; the visible body boundary annotation boxes of the pedestrians in the pictures are screened out to obtain the training set, validation set and test set of the final data set, with a ratio of 3:1:1.
[0041] Step S2, calculating the acquired data, calculating the visual transformation parameter matrix required to transform the visible light image into the bird's-eye view, converting the filtered detection frame coordinates to the coordinates under the bird's-eye view, calculating the Euclidean distance between the abnormal body temperature pedestrian detection frame and other detection frames in the bird's-eye view coordinate system, and calculating the actual physical distance between pedestrians through the proportional relationship between the bird's-eye view pixel distance and the actual reference object;
[0042] Step S2.1, calibrating the visible light camera of the temperature measurement camera to obtain the camera's internal parameters and distortion parameters;
[0043] Step S2.2, performing distortion correction on the visible light image by using camera intrinsic parameters and distortion coefficients;
[0044] Step S2.3, using the internal parameters and distortion parameters, calculate the inverse perspective transformation parameter matrix required to transform the corrected visible light image into the bird's-eye view, and transform the filtered detection frame coordinates into the coordinates under the bird's-eye view.
[0045] Step S2.4, in the bird's-eye view coordinate system, calculate the Euclidean distance between the abnormal body temperature pedestrian detection frame and other detection frames, and calculate the actual physical distance between pedestrians through the proportional relationship between the bird's-eye view pixel distance and the actual reference object.
[0046] Step S3, receiving the body temperature and abnormal body temperature person detection frame association information output in the previous stage, as well as the body temperature and close contact person detection frame association information, to complete the detection of specific people.
[0047] Step S3 specifically involves screening out people with abnormal body temperature based on whether their body temperature is greater than 37.3°C, and then selecting pedestrian detection frames whose contact distance with the people with abnormal body temperature is less than 1m to complete the detection of specific people.
[0048] The beneficial effects of the present invention are as follows: the method for detecting specific people in public places, through the body temperature information association algorithm based on IoU-PR loss, the temperature measuring camera outputs the association information of body temperature and face detection frame, which can be converted into the association between body temperature and pedestrian detection frame, thereby improving the accuracy of the original IoU loss matching, laying a foundation for the subsequent screening of people with abnormal body temperature, and then calculating the Euclidean distance between the abnormal body temperature pedestrian detection frame and other detection frames, and calculating the actual physical distance between pedestrians through the proportional relationship between the bird's-eye view pixel distance and the actual reference object, thereby completing the detection of the contact distance.
[0049] Although the embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations may be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents. It should be noted that the sources of face and pedestrian data obtained in this application are all obtained in a reasonable and legal manner. At the same time, attention is paid to data privacy protection to ensure that personal privacy information is not leaked. In the process of data processing and use, we always follow the principles of legality, legitimacy and necessity to ensure the compliance of data use and the legality and security of data.
Claims
1. A method for detecting specific people in public places, characterized in that: The following steps are involved: Step S1, obtain pedestrian data, use the YOLOv5s pedestrian detection algorithm to detect the temperature measurement camera, obtain the pedestrian detection frame, and convert the association information between the face detection frame and the body temperature output by the temperature measurement camera of the body temperature information association algorithm into the association information between the pedestrian detection frame and the body temperature; Step S2, calculating the acquired data, calculating the visual transformation parameter matrix required to transform the visible light image into the bird's-eye view, converting the filtered detection frame coordinates to the coordinates under the bird's-eye view, calculating the Euclidean distance between the abnormal body temperature pedestrian detection frame and other detection frames in the bird's-eye view coordinate system, and calculating the actual physical distance between pedestrians through the proportional relationship between the bird's-eye view pixel distance and the actual reference object; Step S3, receiving the body temperature and abnormal body temperature person detection frame association information output in the previous stage, as well as the body temperature and close contact person detection frame association information, to complete the detection of specific people.
2. A method for detecting specific people in public places according to claim 1, characterized in that: The step S1 comprises: Step S1.1, pedestrian detection in the risk crowd detection module adopts the YOLOv5s framework, and the YOLOv5s pre-trained model is trained and tested using the CrowdHuman dataset; Step S1.2, using the OS-DM-FACE100 temperature measurement camera to detect the pedestrian's body temperature, and obtain the correlation information of the visible light image, the face detection frame and the body temperature; Step S1.3, using the trained pedestrian detection model to perform pedestrian recognition on the visible light image, and obtaining a pedestrian detection frame; Step S1.4, input the pedestrian detection frame, face detection frame and body temperature information into the body temperature information association algorithm based on IoU-PR loss to obtain the association information between the face detection frame and the body temperature. The algorithm will calculate the IoU-PR loss between the paired face detection frame and the pedestrian detection frame, and send all the losses to the Hungarian algorithm to start the detection frame pairing step. The IoU-PR loss function is: S1.41, where A is the pedestrian detection frame; B is the face detection frame; h and w are the height and width of the pedestrian detection frame, respectively; Δd1 represents the relative distance between the upper edges of the face detection frame and the pedestrian detection frame; Δd2 represents the horizontal distance between their center points, and L IoU-PR The value range is between 0 and 1. When Δd1≥h or Δd2≥w, L IoU-PR The value is 0. The smaller the value, the closer the distance between the face and the pedestrian's "face" and the higher the degree of overlap. The IoU-PR loss can measure the positional relationship between the face detection frame and the pedestrian detection frame. According to the loss value between the detection frames, the cost matrix is constructed and solved using the Hungarian algorithm provided by Python. The body temperature information is associated with the pedestrian detection frame to complete the conversion of the associated information.
3. A method for detecting specific people in public places according to claim 2, characterized in that: in, The training set contains 15,000 images, the test set and validation set contain 5,000 and 4,300 images respectively. Each pedestrian in each image is annotated with the head bounding box, visible body bounding box and full body bounding box. The visible body bounding boxes of the pedestrians in the images are screened out to obtain the training set, validation set and test set of the final data set, with a ratio of 3:1:
1.
4. A method for detecting specific people in public places according to claim 2, characterized in that: in, The visible light camera of the temperature measurement camera is calibrated to obtain the camera's intrinsic parameters and distortion parameters.
5. A method for detecting specific people in public places according to claim 1, characterized in that: The step S2 comprises: Step S2.1, calibrating the visible light camera of the temperature measurement camera to obtain the camera's internal parameters and distortion parameters; Step S2.2, performing distortion correction on the visible light image by using camera intrinsic parameters and distortion coefficients; Step S2.3, using the internal parameters and distortion parameters to calculate the inverse perspective transformation parameter matrix required to transform the corrected visible light image into the bird's-eye view, and transform the filtered detection frame coordinates into the coordinates under the bird's-eye view; Step S2.4, in the bird's-eye view coordinate system, calculate the Euclidean distance between the abnormal body temperature pedestrian detection frame and other detection frames, and calculate the actual physical distance between pedestrians through the proportional relationship between the bird's-eye view pixel distance and the actual reference object.
6. A method for detecting specific people in public places according to claim 1, characterized in that: Step S3 specifically involves screening out people with abnormal body temperature based on whether their body temperature is greater than 37.3°C, and then selecting pedestrian detection frames whose contact distance with the people with abnormal body temperature is less than 1m to complete the detection of specific people.