Human body detection method based on thermal infrared sensor

Through the combination of thermal infrared sensors and machine learning models, the problems of poor lighting conditions and privacy protection in human detection at security doors are solved, and efficient and accurate human detection is achieved, which is suitable for a variety of application scenarios.

CN118609160APending Publication Date: 2024-09-06WONLY SECURITY & PROTECTION TECH CO LTD

Patent Information

Application Number
CN202410646913.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

In the field of security doors, human detection algorithms based on visual sensors have poor accuracy when lighting conditions are poor, may leak user privacy, consume large amounts of computing resources, and are costly to obtain annotated data.

Method used

A thermal infrared sensor is used to obtain thermal infrared image data, the heat map and temperature values ​​are adjusted and spliced, the machine learning model is input for training, a judgment model is generated to determine whether the object outside the safety door is a human body, and the inter-frame difference method is combined to determine human movement.

Benefits of technology

It achieves accurate human detection under various lighting conditions, protects user privacy, reduces computing resource consumption, simplifies the acquisition of annotated data, and is suitable for a variety of application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118609160A
    Figure CN118609160A
Patent Text Reader

Abstract

The invention relates to the technical field of safety door human body recognition, and discloses a human body detection method based on a thermal infrared sensor, and the method employs the thermal infrared sensor to obtain thermal infrared image data, and the thermal infrared image data comprises a thermodynamic diagram and a group of temperature values corresponding to the thermodynamic diagram. The thermal infrared image data comprises human body thermal infrared image data and non-human body thermal infrared image data; adjusting the sizes of the thermodynamic diagram and the corresponding group of temperature values, and splicing and combining the thermodynamic diagram and the corresponding group of temperature values to obtain a multi-channel image; inputting the multi-channel image into a machine learning model for training to obtain a judgment model; and judging whether the object outside the safety door is a human body or not based on the judgment model and thermal infrared image data acquired by a thermal imaging sensor installed on the safety door. The method is not affected by illumination, effective human body recognition can be carried out under the weak illumination condition, only heat distribution of a target can be detected, a human face cannot be captured, and therefore good privacy protection is achieved in human body detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of human body recognition for safety doors, and in particular to a human body detection method based on a thermal infrared sensor. Background Art

[0002] In the field of security doors, human detection algorithms based on visual sensors may perform poorly when lighting conditions are poor or when lighting changes greatly, affecting the accuracy of detection. Using cameras for human detection may involve privacy issues, because cameras can capture people's facial information, which may cause concerns about privacy leaks or infringement of personal privacy. In complex backgrounds, human detection algorithms based on visual sensors may be affected by background interference, resulting in false detection or missed detection. Some human detection algorithms based on visual sensors require a lot of computing resources to achieve real-time detection, which is difficult to achieve in some resource-constrained scenarios. Human detection algorithms based on deep learning usually require a large amount of labeled data for training, and the acquisition of labeled data may consume a lot of time and labor costs. Summary of the invention

[0003] In view of this, the present invention provides a human body detection method based on a thermal infrared sensor to solve the problems of inaccurate recognition and leakage of user privacy in security door monitoring due to light limitation.

[0004] In a first aspect, the present invention provides a method for detecting a human body based on a thermal infrared sensor, the method comprising:

[0005] Acquire thermal infrared image data using a thermal infrared sensor, wherein the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map, and the thermal infrared image data includes human thermal infrared image data and non-human thermal infrared image data;

[0006] Resize the thermal map and its corresponding set of temperature values ​​and combine them to obtain a multi-channel image;

[0007] Input the multi-channel image into the machine learning model for training to obtain a judgment model;

[0008] Based on the judgment model and the thermal infrared image data obtained by the thermal imaging sensor installed on the safety door, it is judged whether the object outside the safety door is a human body.

[0009] The human body detection method based on thermal infrared sensor provided in this embodiment is not affected by lighting conditions, so it can perform effective detection under various lighting conditions. Thermal infrared sensors will not capture recognizable images, but will only detect the heat distribution of the target, so they have better privacy protection in human body detection. In addition to being used outdoors, they can also be used in indoor environments, and are suitable for security doors in different application scenarios, such as video doorbells, important document security monitoring, indoor anti-theft, safe doors, etc. They have a wide range of applications, accurate recognition, and protect facial information to improve user experience.

[0010] In an optional embodiment, the size of the thermal map and its corresponding set of temperature values ​​are adjusted and the two are combined to obtain a multi-channel image, including:

[0011] Adjusting a set of temperature values ​​based on a preset data format and a preset image format to obtain adjusted temperature values;

[0012] Adjust the size of the heat map to obtain an adjusted heat map;

[0013] The adjusted thermal map and its corresponding adjusted set of temperature values ​​are merged to obtain a multi-channel image.

[0014] The human body detection method based on thermal infrared sensor provided in this embodiment adjusts and splices the temperature values ​​and then splices and merges them with the thermal map. It can filter the thermal map data that is similar to the human body shape but not the human body, reduce junk data, improve the availability of training data, and provide a data basis for subsequent model training.

[0015] In an optional implementation, inputting a multi-channel image into a machine learning model for training to obtain a judgment model includes:

[0016] Annotate several multi-channel images, and divide the annotated multi-channel images into a training set, a validation set, and a test set;

[0017] Using the training set to train the machine learning model to obtain a trained machine learning model;

[0018] Use the validation set to evaluate the trained machine learning model, and optimize the trained machine learning model based on the evaluation results;

[0019] The optimized machine learning model is evaluated again using the test set.

[0020] The human body detection method based on thermal infrared sensor provided in this embodiment divides multi-channel data into training set, verification set and test set, so that the input data of the machine learning model training process are all new data, thereby avoiding the randomness of the training results, and improving the generalization ability of the machine learning model by adjusting parameters and evaluating multiple times, making the output results more accurate.

[0021] In an optional implementation, the machine learning model includes three prediction modules. The machine learning model is trained using a training set to obtain a trained machine learning model, including:

[0022] Adjusting the prediction module of the machine learning model to obtain a machine learning model including a first prediction module and a second prediction module, wherein the first prediction module is used to detect objects at a close distance, and the second prediction module is used to detect objects at a slightly farther distance;

[0023] The adjusted machine learning model is trained using the training set, and the model parameters are optimized based on the stochastic gradient descent algorithm to obtain the trained machine learning model.

[0024] The human body detection method based on thermal infrared sensor provided in this embodiment adjusts the prediction module of the machine learning model so that the machine learning model can reduce unnecessary data processing and improve recognition efficiency. It is trained by inputting training data to provide a basis for further adjustment and optimization of subsequent models.

[0025] In an optional implementation, using a validation set to evaluate the trained machine learning model, and optimizing the trained machine learning model based on the evaluation result, includes:

[0026] Use the validation set to evaluate the accuracy, recall, and precision of the trained machine learning model;

[0027] Based on the evaluation results, adjust the initial value of the learning rate, hyperparameters, and network structure of the machine learning model to obtain an optimized machine learning model

[0028] The thermal infrared sensor-based human body detection method provided in this embodiment further improves the generalization ability and recognition accuracy of the model by adding a validation set to adjust and evaluate the machine learning model.

[0029] In an optional implementation, the optimized machine learning model is evaluated again using a test set, including:

[0030] The test set is used to re-evaluate the accuracy, recall, and precision of the machine learning model, and based on the evaluation results, the initial value of the learning rate, hyperparameters, and network structure of the machine learning model are adjusted to optimize the machine learning model until the preset conditions are met to obtain a judgment model; if the preset conditions are not met, several new annotated multi-channel images are used as new training sets for re-evaluation and optimization.

[0031] The human body detection method based on thermal infrared sensor provided in this embodiment performs final adjustment and evaluation on the machine learning model by adding a test set, thereby improving the generalization ability and recognition accuracy of the model and providing a model basis for obtaining a judgment model.

[0032] In an optional implementation, after determining whether the object outside the safety door is a human body, the method further includes:

[0033] The inter-frame difference method is used to determine whether the human body in the thermal map is moving.

[0034] The human body detection method based on thermal infrared sensor provided in this embodiment can realize the recognition of human body images by obtaining a judgment model through training and optimization of the machine learning model. By adding the judgment of motion information, the result of human body recognition is further made more accurate.

[0035] In a second aspect, the present invention provides a thermal infrared sensor human body detection device, the device comprising:

[0036] A data collection module, used to acquire thermal infrared image data using a thermal infrared sensor, wherein the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map;

[0037] A data processing module, used to adjust the size of the thermal map and its corresponding set of temperature values ​​and combine the two to obtain a multi-channel image;

[0038] A model training module is used to input multi-channel images into a machine learning model for training to obtain a judgment model;

[0039] The model deployment module is used to determine whether an object outside the security door is a human body based on the judgment model and thermal infrared image data obtained by the thermal imaging sensor installed on the security door.

[0040] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the human body detection method based on thermal infrared sensor of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the human body detection method based on a thermal infrared sensor according to the first aspect or any corresponding embodiment thereof.

[0042] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the human body detection method based on a thermal infrared sensor according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 is a schematic flow chart of a human body detection method based on a thermal infrared sensor according to an embodiment of the present invention;

[0045] Figure 2 is a flow chart of another method for detecting a human body based on a thermal infrared sensor according to an embodiment of the present invention;

[0046] Figure 3 is a flow chart of another method for detecting a human body based on a thermal infrared sensor according to an embodiment of the present invention;

[0047] Figure 4 is a flow chart of another method for detecting a human body based on a thermal infrared sensor according to an embodiment of the present invention;

[0048] Figure 5 is a structural block diagram of a thermal infrared sensor human body detection device according to an embodiment of the present invention;

[0049] Figure 6 is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention;

[0050] Figure 7 It is the structural framework of the adjusted yolov5 model of the embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0052] In the security door monitoring and identification process, the use of cameras for human body detection may involve privacy issues, because the camera can capture the image information of the face, which may cause privacy leakage or infringement of personal privacy. In complex backgrounds, human body detection algorithms based on visual sensors may be affected by background interference, resulting in false detection or missed detection. Some human body detection algorithms based on visual sensors may require a large amount of computing resources to achieve real-time detection, which may become a problem in some resource-constrained scenarios. Human body detection algorithms based on deep learning usually require a large amount of annotated data for training, and the acquisition of annotated data may consume a lot of time and manpower costs. An embodiment of the present invention provides a human body detection method based on a thermal infrared sensor, which captures thermal imaging of the human body with a thermal infrared sensor to achieve the technical effect of accurately identifying the human body, not being affected by light and protecting the privacy of the face.

[0053] According to an embodiment of the present invention, an embodiment of a human body detection method based on a thermal infrared sensor is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0054] In this embodiment, a human body detection method based on a thermal infrared sensor is provided, which can be used in mobile terminals such as mobile phones, tablet computers, etc. Figure 1 is a flow chart of a method for detecting a human body based on a thermal infrared sensor according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0055] Step S101, using a thermal infrared sensor to acquire thermal infrared image data, the thermal infrared image data including a thermal map and a set of temperature values ​​corresponding to the thermal map, the thermal infrared image data including human thermal infrared image data and non-human thermal infrared image data.

[0056] The thermal infrared image data output by the thermal infrared sensor is collected. The thermal infrared sensor collects a set of thermal map data each time to obtain a thermal map and a set of 1024 temperature values ​​corresponding to the thermal map. The thermal map includes various postures and movements of the human body, non-human heat-generating objects, and heat distribution in different environments.

[0057] Step S102, adjusting the size of the thermal map and its corresponding set of temperature values ​​and combining the two to obtain a multi-channel image.

[0058] Merging the heat map and temperature values ​​can make human body recognition results more accurate. The image size of the heat map obtained by the sensor is 702×675, while the set of 1024 temperature values ​​corresponding to the heat map is arranged in 32×32. The sizes are different and the data types are different, so they cannot be merged. Therefore, it is necessary to adjust the size of the heat map and its corresponding set of temperature values ​​and then merge them to obtain a large number of multi-channel images.

[0059] Step S103, input the multi-channel image into the machine learning model for training to obtain a judgment model.

[0060] The multi-channel images are input into the machine learning model for model training and the training results are output. The training results are evaluated and the relevant parameters of the yolov5 model are adjusted according to the evaluation results until the human body recognition accuracy of the output results of the machine learning model meets the requirements. At this time, the machine learning model whose output results meet the requirements is used as the judgment model, and the judgment model will be applied to the human body recognition judgment of the security door.

[0061] Step S104, judging whether the object outside the security door is a human body based on the judgment model and the thermal infrared image data acquired by the thermal imaging sensor installed on the security door.

[0062] The judgment model judges and recognizes the thermal infrared image data obtained by the thermal imaging sensor, determines whether the thermal infrared image is a human body, and outputs the corresponding result: 1 for non-human body and 0 for human body. The entry and exit results can be transmitted to the display screen or alarm device to remind the user of the situation outside the door.

[0063] The human body detection method based on thermal infrared sensor provided in this embodiment is not affected by lighting conditions, so it can perform effective detection under various lighting conditions. Thermal infrared sensor will not capture recognizable images, but only detect the heat distribution of the target, so it has better privacy protection in human body detection. In addition to being used outdoors, it can also be used in indoor environments. It is suitable for different application scenarios, such as security monitoring, smart home, human behavior analysis, etc. It has a wide range of applications, accurate recognition, protection of facial information and improved user experience.

[0064] In this embodiment, a human body detection method based on a thermal infrared sensor is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 2 is a flow chart of a method for detecting a human body based on a thermal infrared sensor according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0065] Step S201, using a thermal infrared sensor to obtain thermal infrared image data, the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map, and the thermal infrared image data includes human thermal infrared image data and non-human thermal infrared image data. For details, please refer to Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0066] Step S202, adjusting the size of the thermal map and its corresponding set of temperature values ​​and combining the two to obtain a multi-channel image.

[0067] Specifically, the above step S202 includes:

[0068] Step S2021: adjusting a set of temperature values ​​based on a preset data format and a preset image format to obtain adjusted temperature values.

[0069] The temperature value is a real value, and the value range of the image channel of the heat map is [0,255]. Each temperature value needs to be converted into the value range corresponding to the heat map, that is, converted into the preset data format. Each temperature value X is processed as follows: X i =(X÷40)×255; where X i It is the conversion value of the ith temperature value in a set of temperature values. The human body temperature range is preset to be 0 to 40 degrees Celsius. Each temperature value is proportionally converted into a data format with the same value range as the image channel of the thermal map.

[0070] A set of 1024 temperature values ​​is arranged in 32×32, and each temperature value is copied 7 times, that is, 32×7, and the arrangement of 32×32 is transformed into an arrangement of 244×224, that is, transformed into a preset image format, to obtain the temperature value after the image format is adjusted.

[0071] Step S2022, adjusting the size of the heat map to obtain an adjusted heat map.

[0072] The image size of the thermal map obtained by the sensor is 702×675. The resize function is used to unify the image size to 224×224 to obtain the adjusted thermal map.

[0073] Step S2023, the adjusted thermal image and its corresponding adjusted set of temperature values ​​are merged to obtain a multi-channel image. Specifically, the processed thermal image and its corresponding adjusted temperature values ​​are merged to obtain a 4-channel image. The traditional image includes three channels, R, G, and B, that is, R: red, G: green, and B: blue. The temperature value channel is added to the traditional three-channel image to obtain a 4-channel image.

[0074] After obtaining the 4-channel image, the 4-channel image can be processed first, and then the subsequent model training is performed. The processing process includes enhancing the contrast of the image and performing image enhancement, wherein enhancing the contrast refers to enhancing the difference between the human body and the non-human body in the image to make it more visually effective and recognizable, and image enhancement refers to increasing the size of the data set by one or more combined data enhancement transformations such as shearing, rotation or reflection or flipping transformation, scaling transformation, translation transformation, scale transformation, contrast transformation, noise disturbance, color transformation, etc. Image enhancement generates similar but different training samples by making a series of random changes to the training images, thereby expanding the scale of the training data set, and randomly changing the training samples can reduce the model's dependence on certain attributes, thereby improving the generalization ability of the model.

[0075] Step S203: Input the multi-channel image into the machine learning model for training to obtain a judgment model. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0076] Step S204: Based on the judgment model and the thermal infrared image data obtained by the thermal imaging sensor installed on the security door, it is judged whether the object outside the security door is a human body. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0077] The human body detection method based on thermal infrared sensor provided in this embodiment adjusts and splices the temperature values ​​and then splices and merges them with the thermal map. It can filter the thermal map data of non-human bodies that are similar to the human body shape, reduce junk data, improve the availability of training data, and provide a data basis for subsequent model training.

[0078] In this embodiment, a human body detection method based on a thermal infrared sensor is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 3 is a flow chart of a method for detecting a human body based on a thermal infrared sensor according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0079] Step S301, using a thermal infrared sensor to obtain thermal infrared image data, the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map, and the thermal infrared image data includes human thermal infrared image data and non-human thermal infrared image data. For details, please refer to Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0080] Step S302, adjust the size of the thermal map and its corresponding set of temperature values ​​and combine them to obtain a multi-channel image. Figure 2Step S102 of the illustrated embodiment will not be described in detail here.

[0081] Step S303: input the multi-channel image into the machine learning model for training to obtain a judgment model.

[0082] Specifically, the above step S303 includes:

[0083] Step S3031, annotate a plurality of multi-channel images, and divide the annotated plurality of multi-channel images into a training set, a validation set, and a test set.

[0084] Several 4-channel images are labeled, the human 4-channel images are labeled as 0, and the non-human 4-channel images are labeled as 1, and the labeled 4-channel images are divided into training set, validation set, and test set. The training set, validation set, and test set will be used as input data for subsequent model training, so that each step of the model training process has new input data to avoid the randomness of the judgment results.

[0085] Step S3032: train the machine learning model using the training set to obtain a trained machine learning model. The machine learning model includes three prediction modules.

[0086] Specifically, step S3032 includes the following specific steps:

[0087] Step a1, adjust the prediction module of the machine learning model to obtain a machine learning model including a first prediction module and a second prediction module, the first prediction module is used to detect objects at a close distance, and the second prediction module is used to detect objects at a slightly farther distance.

[0088] In this embodiment, the machine learning model adopts the yolov5 model. The traditional yolov5 model has three prediction modules, which respectively predict close-range images, slightly farther-range images, and farther-range images. This embodiment adjusts the prediction model of the model, such as Figure 7 The figure shows the structural framework of the adjusted yolov5 model. By adjusting the convolutional layer parameters of the yolov5 model, only two prediction modules of the yolov5 model are retained, that is, the first prediction module is used to detect objects at a close distance, and the second prediction module is used to detect objects at a slightly farther distance.

[0089] Step a2: Use the training set to train the adjusted machine learning model, and optimize the model parameters based on the stochastic gradient descent algorithm to obtain the trained machine learning model.

[0090] Firstly, the parameters of the convolutional layer are adjusted according to the training set, and a fully connected layer is added at the end of the model framework to limit the output to two results: whether the image is a human body or not. The cross entropy loss function is used as the loss function to calculate the difference loss between the training result and the labeled result. The stochastic gradient descent optimizer (SGD) is used to optimize the model training, and the learning rate warm-up value is set. In the warm-up value stage, the learning rate of the model training starts from zero and quickly reaches the maximum learning rate, and then the learning rate is gradually reduced according to the linear scheme, so that the training difference loss is minimized faster.

[0091] When the training set is input for training, the back propagation algorithm is used to optimize the machine learning model parameters so that the machine learning model can accurately learn the characteristics and position information of the human body. During the training process, the learning rate is adjusted, data is enhanced, and the cross-validation evaluation model is used to improve the generalization ability of the model and the training effect, thereby obtaining a trained machine learning model.

[0092] Step S3033, use the validation set to evaluate the trained machine learning model, and optimize the trained machine learning model based on the evaluation results.

[0093] Specifically, step S3033 includes the following specific steps:

[0094] Step b1: Use the validation set to evaluate the accuracy, recall, and precision of the trained machine learning model.

[0095] Use validation set data to evaluate the performance of the trained machine learning model, including indicators such as accuracy, recall, and precision.

[0096] Step b2: Based on the evaluation results, adjust the initial learning rate value, hyperparameters, and network structure of the machine learning model to obtain an optimized machine learning model.

[0097] Tune the machine learning model based on the evaluation results, adjust the network structure, hyperparameters, etc. of the machine learning model, and further improve the performance of the model.

[0098] Step S3034, use the test set to evaluate the optimized machine learning model again.

[0099] Specifically, step S3034 includes the following specific steps:

[0100] Step c1, use the test set to re-evaluate the accuracy, recall rate, and precision of the machine learning model, and adjust the initial value of the learning rate, hyperparameters, and network structure of the machine learning model based on the evaluation results to optimize the machine learning model until the preset conditions are met to obtain a judgment model; if the preset conditions are not met, use several new annotated multi-channel images as new training sets for re-evaluation and optimization.

[0101] Use the test set data to perform a final evaluation and test on the tuned machine learning model to evaluate the generalization ability and performance of the model on new data. When the final evaluation does not meet the required accuracy, add a new annotated 4-channel image dataset for iterative training until the output accuracy of the machine learning model meets the required accuracy.

[0102] The human body detection method based on thermal infrared sensor provided in this embodiment divides the 4-channel data into a training set, a validation set, and a test set, so that the input data of the machine learning model training process are all new data, thereby avoiding the randomness of the training results, and improving the generalization ability of the machine learning model through multiple parameter adjustments and evaluations, making the output results more accurate.

[0103] In this embodiment, a human body detection method based on a thermal infrared sensor is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 4 is a flow chart of a method for detecting a human body based on a thermal infrared sensor according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0104] Step S401, using a thermal infrared sensor to obtain thermal infrared image data, the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map, and the thermal infrared image data includes human thermal infrared image data and non-human thermal infrared image data. For details, please refer to Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0105] Step S402, adjust the size of the thermal map and its corresponding set of temperature values ​​and combine them to obtain a multi-channel image. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0106] Step S403: Input the multi-channel image into the machine learning model for training to obtain a judgment model. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0107] Step S404: Based on the judgment model and the thermal infrared image data obtained by the thermal imaging sensor installed on the security door, it is judged whether the object outside the security door is a human body. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0108] Step S405, judging whether the human body in the thermal map is moving by using the frame difference method.

[0109] Video sequences are continuous. If there is no moving target in the scene, the changes between consecutive frames are very slight. If there is a moving target, there will be obvious changes between consecutive frames. Temporal Difference is based on this principle. When the target in the scene is moving, the position of the target image in different image frames is different. Temporal Difference performs differential operations on two or three consecutive frames in time, subtracts the corresponding pixels of different frames, and determines the absolute value of the grayscale difference. When the absolute value exceeds a certain threshold, it can be judged as a moving target, thereby realizing the detection function of moving targets.

[0110] The human body detection method based on thermal infrared sensor provided in this embodiment can realize the recognition of human body images by obtaining a judgment model through training and optimization of the machine learning model. By adding the judgment of motion information, the result of human body recognition is further made more accurate.

[0111] As one or more specific application embodiments of the embodiments of the present invention, the human body detection method based on the thermal infrared sensor includes the following steps:

[0112] 1. A thermal infrared sensor is used to obtain thermal infrared image data, wherein the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map, and the thermal infrared image data includes human thermal infrared image data and non-human thermal infrared image data.

[0113] A large amount of thermal infrared image data captured by the thermal infrared sensor is acquired, the thermal infrared image data includes thermal infrared image data of human body and non-human body, and each thermal infrared image data includes a thermal map and a group of 1024 temperature values ​​corresponding to the thermal map.

[0114] 2. Adjust the size of the heat map and its corresponding set of temperature values ​​and combine them to obtain a multi-channel image.

[0115] First, the thermal map is denoised, and the thermal map and a set of 1024 temperature values ​​corresponding to the thermal map are spliced ​​to obtain a 4-channel image, so that the 4-channel image can be subsequently enhanced in contrast and image enhancement, thereby making the human body shape and non-human body shape of the thermal image more obvious. The thermal map and a set of 1024 temperature values ​​corresponding to the thermal map are not the same type of data, and the data format and image format need to be adjusted so that the thermal map and a set of 1024 temperature values ​​corresponding to the thermal map can be spliced ​​and merged.

[0116] Convert each temperature value X to a different data format: i =(X÷40)×255; where X i is the conversion value of the i-th temperature value in a set of temperature values;

[0117] The image format of each group of temperature values ​​is converted: the preset image format is 224×224, and a group of 1024 temperature values ​​is converted from the 32×32 format to the 224×224 image format. The specific conversion method is to copy each temperature value 7 times.

[0118] 3. Input the multi-channel image into the machine learning model for training to obtain the judgment model.

[0119] The multi-channel image is a 4-channel image obtained by splicing a set of 1024 temperature values ​​corresponding to the heat map. The 4-channel image includes a 4-channel image of a human body and a 4-channel image of a non-human body. The 4-channel image of a human body is marked as 0, and the 4-channel image of a non-human body is marked as 1. Manual marking or other marking methods can be used. The 4-channel image is divided into a training set, a validation set, and a test set. The machine learning model, i.e., the yolov5 model, is adjusted so that the output result of the machine learning model is two results of human or non-human. The training set is input into the machine learning model for training to obtain the machine learning model and output result after the initial training. This output result is the human or non-human model labeling result of the 4-channel image. By comparing the difference between the output result and the labeling result, the recognition performance of the machine learning model is evaluated. The validation set and the test set are continued to be used to evaluate the trained machine learning model and adjust the parameters, or a new 4-channel image is used to repeatedly iterate the training, evaluation, and parameter tuning process until the error range between the output result and the labeling result is within the preset range to obtain a judgment model.

[0120] 4. Based on the judgment model and the thermal infrared image data obtained by the thermal imaging sensor installed on the security door, determine whether the object outside the security door is a human body.

[0121] The trained judgment model is deployed in actual applications to judge the thermal infrared image data obtained by the thermal imaging sensor. The display screen or alarm can be connected, and the display screen or alarm outputs sound or text prompts of two results: non-human or human.

[0122] 5. Use the inter-frame difference method to determine whether the human body in the thermal map is moving.

[0123] By adding motion information and using the inter-frame difference method, it is determined whether the objects appearing in the picture are moving, thereby improving the accuracy of the algorithm.

[0124] In this embodiment, a thermal infrared sensor human body detection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0125] This embodiment provides a thermal infrared sensor human body detection device, such as Figure 5 As shown, including:

[0126] A data collection module 501 is used to obtain thermal infrared image data using a thermal infrared sensor, wherein the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map;

[0127] A data processing module 502 is used to adjust the size of the thermal map and its corresponding set of temperature values ​​and combine the two to obtain a multi-channel image;

[0128] A model training module 503 is used to input a multi-channel image into a machine learning model for training to obtain a judgment model;

[0129] The model deployment module 504 is used to determine whether the object outside the security door is a human body based on the judgment model and the thermal infrared image data obtained by the thermal imaging sensor installed on the security door.

[0130] In some optional implementations, the data processing module 502 includes:

[0131] The temperature value processing unit is used to adjust a set of temperature values ​​based on a preset data format and a preset image format to obtain adjusted temperature values.

[0132] The heat map processing unit is used to adjust the size of the heat map to obtain an adjusted heat map.

[0133] The stitching unit is used to merge the adjusted thermal map and its corresponding adjusted set of temperature values ​​to obtain a multi-channel image.

[0134] In some optional implementations, the model training module 503 includes:

[0135] The labeling unit is used to label several multi-channel images and divide the labeled multi-channel images into a training set, a verification set, and a test set.

[0136] The training unit is used to train the machine learning model using the training set to obtain a trained machine learning model.

[0137] The optimization evaluation unit is used to evaluate the trained machine learning model using a validation set, and optimize the trained machine learning model based on the evaluation result.

[0138] The re-evaluation unit is used to re-evaluate the optimized machine learning model using the test set.

[0139] In some optional implementations, the training unit includes:

[0140] A prediction module generating subunit, used to adjust the prediction module of the machine learning model to obtain a machine learning model including a first prediction module and a second prediction module, wherein the first prediction module is used to detect objects at a close distance, and the second prediction module is used to detect objects at a slightly farther distance;

[0141] The algorithm training subunit is used to train the adjusted machine learning model using the training set, and optimize the model parameters based on the stochastic gradient descent algorithm to obtain the trained machine learning model.

[0142] In some optional embodiments, the optimization evaluation unit includes:

[0143] The evaluation subunit uses the validation set to evaluate the accuracy, recall, and precision of the trained machine learning model;

[0144] The optimization subunit adjusts the initial value of the learning rate, hyperparameters, and network structure of the machine learning model based on the evaluation results to obtain the optimized machine learning model.

[0145] In some optional embodiments, the reassessment unit comprises:

[0146] Adjust the iterative sub-units, use the test set to re-evaluate the accuracy, recall, and precision of the machine learning model, and adjust the initial value of the learning rate, hyperparameters, and network structure of the machine learning model based on the evaluation results to optimize the machine learning model until the preset conditions are met to obtain a judgment model; if the preset conditions are not met, use several new annotated multi-channel images as new training sets for re-evaluation and optimization.

[0147] In some optional implementations, the model deployment module 504 includes:

[0148] Determine the motion unit and whether the human body in the thermal map is moving by using the inter-frame difference method.

[0149] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0150] The thermal infrared sensor human body detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0151] The embodiment of the present invention also provides a computer device having the above Figure 5 The thermal infrared sensor human body detection device shown.

[0152] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0153] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0154] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0155] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0156] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0157] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0158] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0159] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0160] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0161] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A human body detection method based on thermal infrared sensor, It is characterized in that The method comprises: Acquire thermal infrared image data using a thermal infrared sensor, wherein the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map, and the thermal infrared image data includes human thermal infrared image data and non-human thermal infrared image data; Resize the thermal map and its corresponding set of temperature values ​​and combine them to obtain a multi-channel image; Input the multi-channel image into the machine learning model for training to obtain a judgment model; Based on the judgment model and the thermal infrared image data obtained by the thermal imaging sensor installed on the safety door, it is judged whether the object outside the safety door is a human body.

2. The method according to claim 1, It is characterized in that Resize and combine the heatmap and its corresponding set of temperature values ​​to create a multi-channel image, including: Adjusting the temperature value based on the preset data format and the preset image format to obtain an adjusted temperature value; Adjust the size of the heat map to obtain an adjusted heat map; The adjusted thermal map and its corresponding adjusted set of temperature values ​​are merged to obtain a multi-channel image.

3. The method according to claim 1, It is characterized in that The multi-channel image is input into the machine learning model for training to obtain the judgment model including: Annotate several multi-channel images, and divide the annotated multi-channel images into a training set, a validation set, and a test set; Using the training set to train the machine learning model to obtain a trained machine learning model; Use the validation set to evaluate the trained machine learning model, and optimize the trained machine learning model based on the evaluation results; The optimized machine learning model is evaluated again using the test set.

4. The method according to claim 3, It is characterized in that The machine learning model includes three prediction modules. The machine learning model is trained using a training set to obtain a trained machine learning model, including: Adjusting the prediction module of the machine learning model to obtain a machine learning model including a first prediction module and a second prediction module, wherein the first prediction module is used to detect objects at a close distance, and the second prediction module is used to detect objects at a slightly farther distance; The adjusted machine learning model is trained using the training set, and the model parameters are optimized based on the stochastic gradient descent algorithm to obtain the trained machine learning model.

5. The method according to claim 3, It is characterized in that Use the validation set to evaluate the trained machine learning model and optimize the trained machine learning model based on the evaluation results, including: Use the validation set to evaluate the accuracy, recall, and precision of the trained machine learning model; Based on the evaluation results, the initial learning rate value, hyperparameters, and network structure of the machine learning model are adjusted to obtain the optimized machine learning model.

6. The method according to claim 3, It is characterized in that Use the test set to evaluate the optimized machine learning model again, including: The test set is used to re-evaluate the accuracy, recall, and precision of the machine learning model, and based on the evaluation results, the initial value of the learning rate, hyperparameters, and network structure of the machine learning model are adjusted to optimize the machine learning model until the preset conditions are met to obtain a judgment model; if the preset conditions are not met, several new annotated multi-channel images are used as new training sets for re-evaluation and optimization.

7. The method according to claim 1, It is characterized in that After determining whether the object outside the safety door is a human body, the method further includes: The inter-frame difference method is used to determine whether the human body in the thermal map is moving.

8. A thermal infrared sensor human body detection device, It is characterized in that The device comprises: A data collection module, used to acquire thermal infrared image data using a thermal infrared sensor, wherein the thermal infrared image data includes a thermal map and a set of temperature values ​​corresponding to the thermal map; A data processing module, used to adjust the size of the thermal map and its corresponding set of temperature values ​​and combine the two to obtain a multi-channel image; A model training module is used to input multi-channel images into a machine learning model for training to obtain a judgment model; The model deployment module is used to determine whether an object outside the security door is a human body based on the judgment model and thermal infrared image data obtained by the thermal imaging sensor installed on the security door.

9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the human body detection method based on a thermal infrared sensor as described in any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the human body detection method based on a thermal infrared sensor according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • A deep neural network architecture of bounding box segmentation supervision for accurate real-time pedestrian detection of visible light and infrared images

    CN111209810A

  • Fusion identification method and device achieving both body temperature measurement and identity authentication

    CN111797807A

  • Industrial-grade application dangerous forbidden zone personnel detection system and method

    CN115331258A

  • Tunnel equipment temperature detection method and device and computer equipment

    CN117740186A

Cited By

  • Intelligent early warning method for tunnel blasting construction safety risk

    CN120451888A