Human presence detection method, apparatus and system

By combining infrared thermal imaging sensors and temporal convolutional neural network models with heat source segmentation and static detection, the problems of false alarms and missed alarms in human presence detection have been solved, achieving accurate identification of human presence and differentiation of interference, thus improving the applicability of smart home applications.

CN115798044BActive Publication Date: 2026-05-26SHENZHEN SHULIAN TIANXIA INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN SHULIAN TIANXIA INTELLIGENT TECH CO LTD
Filing Date
2022-11-30
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technologies are prone to false alarms and false negatives in detecting human presence, especially sensitive to dynamic disturbances and multipath effects, making it difficult to accurately distinguish between human and non-human heat sources.

Method used

Infrared thermal imaging sensors are used to acquire multiple frames of temperature data. Heat sources are identified by calculating heat source segmentation thresholds and hot spot segmentation thresholds. A temporal convolutional neural network model is used to determine whether the heat source is moving. Furthermore, a static heat source detection model is used to identify the nature of the static heat source.

Benefits of technology

It improves the accuracy of human presence detection, reduces the probability of false positives and false negatives, enhances robustness against interference, and is suitable for smart home scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115798044B_ABST
    Figure CN115798044B_ABST
Patent Text Reader

Abstract

This invention relates to the field of smart home technology and discloses a method, device, and system for detecting the presence of a human body. The method acquires infrared data of a target area, including multiple frames of temperature data; detects the presence of a heat source in the target area based on the multiple frames of temperature data; if a heat source is present, it detects whether the heat source is moving; if the heat source is moving, it determines that a human body is present in the target area; otherwise, it uses a temporal convolutional neural network model to determine whether a static heat source in the target area is a human body heat source. This invention can accurately detect the presence of a heat source in a target area and determine whether the heat source is moving, and accurately identifies static human body heat sources based on a temporal convolutional neural network model. Therefore, it has high robustness to interference caused by factors such as sunlight, hot water, and heated objects, improving the accuracy of human body presence detection and enhancing its applicability and portability in home application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart home technology, and in particular to a method, device and system for detecting the presence of a human body. Background Technology

[0002] Currently, smart monitoring services integrated into smart homes are gaining popularity. For example, indoor human presence detection technology plays an important role in the care of vulnerable groups such as children and elderly people living alone, as well as in the interaction of smart homes.

[0003] The relevant technology uses millimeter-wave Doppler radar to detect the presence of people indoors. It primarily relies on fluctuations in signals such as target movement and heartbeat to detect human presence. It is highly sensitive to environmental disturbances, such as moving curtains, fans, or falling objects, which can easily trigger false alarms indicating someone is present, leading to prolonged periods of inactivity and false alarms. Furthermore, millimeter-wave radar is significantly affected by multipath effects, making it prone to missing targets outside its beam range, resulting in missed detections of people within the area. Summary of the Invention

[0004] The main technical problem addressed by the embodiments of the present invention is how to accurately detect the presence of human bodies in a region and reduce the probability of false positives and false negatives.

[0005] To solve the above-mentioned technical problems, one technical solution adopted in the embodiments of the present invention is: to provide a method for detecting the presence of a human body, comprising: acquiring infrared data of a target area, the infrared data including multiple frames of temperature data; detecting whether a heat source exists in the target area based on the multiple frames of temperature data; if a heat source exists in the target area, detecting whether the heat source moves; if the heat source moves, determining that a human body exists in the target area.

[0006] In some embodiments, detecting whether a heat source exists in the target region based on the multi-frame temperature data includes: calculating a heat source segmentation threshold corresponding to each frame of temperature data; obtaining a pixel region corresponding to temperature data greater than or equal to the heat source segmentation threshold based on the temperature data and the heat source segmentation threshold; calculating the maximum connected component area corresponding to the pixel region; sequentially comparing each maximum connected component area with a preset area; obtaining a maximum connected component area greater than or equal to the preset area, and determining that the time-series temperature data corresponding to the maximum connected component area is a heat source temperature data frame, and counting the number of heat source temperature data frames; when the number of heat source temperature data frames is greater than or equal to a first preset threshold, determining that a heat source exists in the target region; otherwise, no heat source exists in the target region.

[0007] In some embodiments, calculating the heat source segmentation threshold corresponding to each frame of temperature data specifically includes: calculating the heat source segmentation threshold corresponding to each frame of temperature data according to the following formula, wherein the formula is:

[0008] threshold1 = α1 * percentile(imge, first percentage) - α2 * percentile(imge, second percentage)

[0009] Where threshold1 is the heat source segmentation threshold, α1 and α2 are parameter factors, imge is the temperature data, percentile is a function used to calculate the quantile value corresponding to the temperature data of each frame, and the first percentage and the second percentage are preset percentage parameters.

[0010] In some embodiments, detecting whether the heat source has moved includes: determining the first frame of data in the multi-frame temperature data as the base frame data; calculating the difference frame of each frame of temperature data based on the base frame data and the multi-frame temperature data; calculating the hot spot segmentation threshold corresponding to the difference frame; obtaining the pixel region corresponding to the difference frame that is greater than or equal to the hot spot segmentation threshold based on the difference frame and the hot spot segmentation threshold, and calculating the maximum connected component area corresponding to the pixel region; sequentially comparing each maximum connected component area with a preset area; when the maximum connected component area is greater than or equal to the preset area, determining the temperature data corresponding to the maximum connected component area as a heat source moving frame, updating the base frame data to the temperature data corresponding to the maximum connected component area, and performing the step of calculating the difference frame of each frame of time-series temperature data based on the base frame data and the multi-frame temperature data based on the updated base frame data to obtain the heat source moving frame; when the number of accumulated heat source moving frames is greater than or equal to a second preset threshold, determining that the heat source has moved; otherwise, the heat source is stationary.

[0011] In some embodiments, calculating the hotspot segmentation threshold corresponding to the difference frame specifically includes: calculating the hotspot segmentation threshold corresponding to the difference frame according to the following formula, wherein the formula is:

[0012] threshold2 = β1 * percentile(diff_imge, first percentage) - β2 * percentile(diff_imge, second percentage)

[0013] Where threshold2 is the hot spot segmentation threshold, β1 and β2 are parameter factors, diff_imge is the difference frame, percentile is a function used to calculate the quantile value corresponding to each difference frame, and the first percentage and the second percentage are preset percentage parameters.

[0014] In some embodiments, if the heat source does not move, the method further includes: acquiring imaging information of the heat source; inputting the imaging information into a static heat source detection model and outputting the probability of whether the heat source is a human heat source; if the probability is greater than or equal to a preset probability threshold, then the heat source is a human heat source; otherwise, the heat source is a non-human heat source.

[0015] In some embodiments, the method further includes: acquiring the static heat source detection model, wherein acquiring the static heat source detection model includes: acquiring batch static heat source sample data, the batch static heat source sample data including human heat sources and non-human heat sources; performing data preprocessing on the batch static heat source sample data to obtain training samples; acquiring preset labels for the training samples, the preset labels including labeled probability values ​​of the presence of human heat sources and labeled probability values ​​of the presence of non-human heat sources in the training samples; inputting the training samples into an algorithm model to output a human presence detection result corresponding to the training samples, the detection result including the probability value of the presence of human heat sources; obtaining a minimum loss function by constraining the relationship between the detection result and the preset labels according to a loss function; and determining the algorithm model corresponding to the minimum loss function as the static heat source detection model.

[0016] In some embodiments, the data preprocessing of the batch static heat source sample data specifically includes performing at least one data processing operation on the batch static heat source sample data, namely, discarding duplicate samples, offline data augmentation, and sample normalization preprocessing.

[0017] In some embodiments, inputting the imaging information into a static heat source detection model and outputting the probability of whether the heat source is a human heat source includes: inputting the imaging information into an encoder to encode each frame of the imaging information; fusing the feature information corresponding to the encoded imaging information to generate temporal features; inputting the temporal features into a decoder for decoding, and outputting the probability that the heat source is classified as a human heat source or a non-human heat source.

[0018] In some embodiments, the encoder includes six convolutional layers, four max-pooling layers, and two fully connected layers, and the decoder includes two long short-term memory network layers and two fully connected layers.

[0019] To solve the above-mentioned technical problems, another technical solution adopted in this embodiment of the invention is: providing a human presence detection device, comprising: a data acquisition module for acquiring infrared data of a target area, the infrared data including multiple frames of temperature data; a heat source presence detection module for detecting whether a heat source exists in the target area based on the multiple frames of temperature data; a heat source movement detection module for detecting whether the heat source has moved if a heat source exists in the target area; and a human presence detection module for determining that a human body exists in the target area if the heat source has moved.

[0020] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of the present invention is: to provide a human presence detection system, including: an infrared sensor and an electronic device, wherein the infrared sensor is communicatively connected to the electronic device, the infrared sensor is disposed in a target area where the presence of a human body is to be detected, and the electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the human presence detection method as described above.

[0021] Unlike related technologies, this invention provides a method, device, and system for detecting the presence of a human body. By acquiring multiple frames of temperature data from a target area, the system detects the presence of a heat source within the target area. If a heat source is present, it determines whether the heat source has moved. If the heat source has moved, the presence of a human body is confirmed within the target area. Otherwise, a trained temporal convolutional neural network model is used to infer whether a static heat source is a human body heat source. This method, device, and system can accurately detect the presence of a heat source in a target area and determine whether the heat source has moved. Furthermore, based on the temporal convolutional neural network model, it accurately identifies static human body heat sources, thus exhibiting high robustness to interference caused by factors such as sunlight, hot water, and heated objects. This improves the accuracy of human body detection and enhances its applicability and portability in home applications. Attached Figure Description

[0022] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0023] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present invention;

[0024] Figure 2 This is a schematic diagram of an application scenario provided by another embodiment of the present invention;

[0025] Figure 3 This is a schematic diagram of the structure of the electronic device 20;

[0026] Figure 4 This is a flowchart of a method for detecting the presence of a human body provided in an embodiment of the present invention;

[0027] Figure 5 This is a thermogram corresponding to the temperature data provided in the embodiments of the present invention;

[0028] Figure 6 This is a flowchart of the method for detecting the presence of a heat source in a target area in the human body presence detection method provided in this embodiment of the invention;

[0029] Figure 7 This is a flowchart of the method for detecting whether a heat source has moved in the human presence detection method provided in this embodiment of the invention;

[0030] Figure 8 This is a flowchart of a method for detecting the presence of a human body according to another embodiment of the present invention;

[0031] Figure 9 This is a structural network diagram of the static heat source detection model provided in the embodiments of the present invention;

[0032] Figure 10 This is a schematic diagram of the structure of a human presence detection device provided in an embodiment of the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0034] It should be noted that, unless otherwise specified, the various features in the embodiments of the present invention can be combined with each other, and all are within the protection scope of the present invention. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different module division or in a different order than that shown in the device schematic diagram or the flowchart.

[0035] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.

[0036] The human presence detection method, apparatus, and system provided in this invention employ a low-resolution infrared thermal imaging sensor to detect human presence in a target area. First, a method for detecting heat sources in indoor scenes is proposed to distinguish whether a heat source exists in the target area and exclude heat source signals with small areas. Second, a heat source movement discrimination method is proposed based on the presence of heat sources, aiming to distinguish between human movement and object disturbance, and to detect whether heat sources within the target area remain static. Finally, a deep learning-based static heat source classification network model is proposed to address the pain points of easily misjudging interfering heat sources as people or missing static human presence.

[0037] For example, please refer to Figure 1 , Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present invention. The human presence detection method can be applied to this application scenario, which includes a target area, an infrared thermal imaging sensor 10, and an electronic device 20.

[0038] The target area can be any type of indoor space, such as the home of an elderly person living alone, a family with children, a nursing home, a kindergarten, a hospital ward, etc. The target area can be any area where human presence detection is desired. One or more target areas can be set.

[0039] Infrared thermal imaging sensors 10 are positioned within the target area. The number and installation location of the infrared thermal imaging sensors 10 within the target area can be set according to the size, shape, etc., of the target area. For example, ... Figure 1 As shown, the infrared thermal imaging sensor 10 is installed at the center of the ceiling corresponding to the target area indoors, with the sensor facing the target area below. Using the infrared thermal imaging sensor 10 to detect the presence of a human body provides better protection of the privacy of the person being detected compared to a camera.

[0040] The infrared thermal imaging sensor 10 can communicate with the electronic device 20 via wired or wireless means. The infrared thermal imaging sensor 10 is used to detect infrared data within a target area and transmit the detected infrared data to the electronic device 20. The electronic device 20 executes a human presence detection method based on this infrared data. For example, the electronic device 20 acquires infrared data of the target area, including multiple frames of temperature data; detects whether a heat source exists in the target area based on the multiple frames of temperature data; if a heat source exists in the target area, detects whether the heat source is moving; if the heat source moves, it determines that a human body exists in the target area.

[0041] The electronic device 20 can be a mobile communication device (such as a smartphone, feature phone, etc.), an ultra-mobile personal computer device (such as a PDA, MID, and UMPC device, etc.), a server, or other electronic devices with data interaction capabilities. Users of the electronic device 20 can determine whether there is a person in the target area based on the detection results of the presence of a human body.

[0042] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of the electronic device 20. (See attached diagram.) Figure 3 As shown, the electronic device 20 includes one or more processors 21 and a memory 22. Figure 3 Take a processor 21 as an example.

[0043] Processor 21 and memory 22 can be connected via a bus or other means. Figure 3 Taking the example of a connection between China and Israel via a bus.

[0044] The memory 22, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the human body presence detection method in this embodiment of the invention (e.g., attached...). Figure 10 (The various modules shown). The processor 21 executes various functional applications and data processing of the server by running non-volatile software programs, instructions, and modules stored in the memory 22, thereby implementing the human presence detection method described in the following method embodiment.

[0045] The memory 22 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the human presence detection device. Furthermore, the memory 22 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 22 may optionally include memory remotely located relative to the processor 21, and this remote memory may be connected to the human presence detection device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0046] The one or more modules are stored in the memory 22, and when executed by the one or more processors 21, they perform the human presence detection method in any of the following method embodiments, for example, performing the following described... Figure 4 Method steps S11 to S14, Figure 6 Method steps S121 to S128, Figure 7Method steps S131 to S138, Figure 8 Method steps S11 to S17, and implementation Figure 10 The functions of modules 401-408 in the document.

[0047] The above-described product can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.

[0048] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating an application scenario provided by another embodiment of the present invention. Figure 2 and Figure 1 The difference lies in the fact that this application scenario also includes user 30, where electronic device 20 is a server, a server cluster consisting of several servers, or a cloud computing service center. Electronic device 20 can execute human presence detection methods for multiple target areas, monitoring and managing the presence of humans in multiple target areas. Electronic device 20 can act as a backend server for detecting human presence in target areas, sending the detection results to the corresponding user 30. User 30 includes mobile terminals such as mobile phones, tablets, laptops, smart bracelets, etc. A mapping relationship can be established between user 30 and its corresponding target area, and this mapping relationship is stored in electronic device 20. User 30 can view the human presence detection results of their associated target area through account login or password verification. Thus, intelligent human presence detection for multiple users and multiple target areas can be achieved. Figure 2 The electronic device 20 can be specifically referred to in the above embodiments, and it is also capable of performing the human presence detection method.

[0049] Please see Figure 4 , Figure 4 This is a flowchart of a human presence detection method provided by an embodiment of the present invention. The human presence detection method can be executed by the aforementioned electronic device 20, and the method includes the following steps:

[0050] S11. Obtain infrared data of the target area, wherein the infrared data includes multiple frames of temperature data.

[0051] In this embodiment, an infrared thermal imaging sensor is used to collect infrared data within the target area, which includes multiple frames of temperature data. The data acquisition frequency of the infrared thermal imaging sensor can be set, for example, to f frames per second (1 <= f <= 32), and the temperature data array for a period of approximately t seconds (1 <= t <= 60) is buffered, resulting in a total of f*t frames of temperature data being collected. The data acquisition frequency f and the buffer window period t can be dynamically adjusted according to the computing power of the electronic device.

[0052] A visual heatmap can be generated from the collected temperature data array, such as... Figure 5 As shown. By analyzing this heat map, we can obtain information such as the distribution range of heat, its approximate shape, and specific temperature values. Figure 5 As shown, the heat source slightly to the lower right of the central area can be considered the human body's heat source, while the heat source slightly to the upper left of the central area can be considered the interfering heat source. The following analysis will focus on confirming the existence of the heat sources and specifically the human body's heat source.

[0053] S12. Detect whether there is a heat source in the target area based on the multi-frame temperature data.

[0054] Infrared thermal imaging sensors detect the temperature of the area corresponding to each pixel. If a heat source is present in the target area, the temperature distribution value of the area corresponding to the heat source will be significantly higher than that of the area without a heat source. (See reference...) Figure 5 Therefore, the presence of a heat source in the target area can be determined based on the temperature distribution shown in the heat map. This heat source includes, but is not limited to, non-human heat sources such as human body heat sources, hot water, and heating appliances.

[0055] In this embodiment, the heat source detection results within the target area can be mainly divided into four cases: no obvious interfering heat source and no human heat source present; obvious interfering heat source present but no human heat source present; human heat source present and moving; and human heat source present and stationary. To address these cases, a layered, progressive human presence detection algorithm is proposed below.

[0056] In some embodiments, please refer to Figure 6 S12. Detecting whether a heat source exists in the target area based on the multi-frame temperature data, including:

[0057] S121. Determine whether the number of frames of the multi-frame temperature data has reached k frames.

[0058] If the number of frames of the multi-frame temperature data is less than k frames, the infrared thermal imaging sensor can continue to detect infrared data within the target area to obtain the temperature data of the target area. If the number of frames of temperature data is greater than or equal to k frames, then step S122 is executed. By obtaining a certain amount of temperature data, a data volume is accumulated for subsequent heat source presence detection and human presence detection, ensuring the accuracy of the detection results. A low-resolution infrared thermal imaging sensor can be used, with a resolution of 24*32, outputting one 24*32 frame of temperature data per acquisition.

[0059] S122. Calculate the heat source segmentation threshold corresponding to each frame of temperature data.

[0060] The heat source segmentation threshold is a temperature differentiation threshold, which uses a suitable temperature value as a boundary to extract the heat source (human body or heat-generating substance) from a frame of temperature data, resulting in high contrast between the heat source and the background. It mainly involves segmenting pixels with temperature values ​​lower than the heat source segmentation threshold (for example, setting the temperature values ​​of pixels with temperatures lower than the threshold to zero), while keeping the temperature values ​​of the remaining pixels unchanged.

[0061] Specifically, embodiments of the present invention can use the following formula to calculate the heat source segmentation threshold corresponding to each frame of temperature data, the formula being:

[0062] threshold1 = α1 * percentile(imge, first percentage) - α2 * percentile(imge, second percentage)

[0063] Where threshold1 is the heat source segmentation threshold, α1 and α2 are parameter factors, image is the temperature data, percentile is a function used to calculate the quantile value corresponding to each frame of temperature data, and the first percentage and the second percentage are preset percentage parameters. The first percentage can be 75%, then the second percentage is 25%. 75% and 25% are parameters roughly tested through data experiments and can be adjusted accordingly. Using these two values ​​can obtain a relatively accurate heat source segmentation threshold. When the first percentage and the second percentage are 75% and 25% respectively, the heat source segmentation threshold is the difference between the percentage value corresponding to 75% of the temperature data and the percentage value corresponding to 25% of the temperature data. Here, α1 and α2 are parameter values ​​determined after extensive data testing. Optionally, α1 takes values ​​in the range [1.5, 3.0], and α2 takes values ​​in the range [0.5, 2.0].

[0064] S123. Based on the temperature data and the heat source segmentation threshold, obtain the pixel region corresponding to the temperature data that is greater than or equal to the heat source segmentation threshold, and calculate the maximum connected area of ​​the pixel region.

[0065] Each frame of temperature data is compared with the heat source segmentation threshold. If the temperature data is greater than or equal to the heat source segmentation threshold, the pixels in the region corresponding to that temperature data are extracted. If the temperature data is less than the heat source segmentation threshold, the pixels in the region corresponding to that temperature data can be discarded, left unprocessed, or the temperature value of the pixel can be set to zero.

[0066] The maximum connected component area of ​​a pixel region can be calculated using conventional methods, such as using OpenCV to find the maximum connected component area. For details, please refer to the relevant technical documentation.

[0067] S124. Compare the area of ​​each maximum connected region with the preset area in turn.

[0068] The maximum connected component area corresponding to each frame is compared with a preset area. If the maximum connected component area is greater than or equal to the preset area, then step S125 is executed; otherwise, the temperature data of the current frame is considered to have no heat source, and its temperature value can be assigned to zero. The preset area can be data measured through data experiments, and can be a specific area value or an area range.

[0069] S125. Determine the time-series temperature data corresponding to the largest connected domain area as a heat source temperature data frame, and accumulate the number of such heat source temperature data frames.

[0070] The heat source temperature data frame refers to the area corresponding to the temperature data in that frame where a heat source exists, and the temperature data in that frame is a heat source temperature data frame.

[0071] S126. Determine whether the number of heat source temperature data frames is greater than or equal to a first preset threshold.

[0072] The first preset threshold can be data measured through data experiments or empirical data.

[0073] If the number of heat source temperature data frames is greater than or equal to the first preset threshold, then step S127 is executed; otherwise, step S128 is executed.

[0074] S127. Determine that a heat source exists within the target area.

[0075] S128. Determine that there is no heat source in the target area.

[0076] The above method can directly, quickly and accurately detect whether there is a heat source in the target area, and the algorithm has strong robustness.

[0077] If a heat source is detected in the target area, step S13 is executed. If no heat source is detected in the target area, it is directly determined that no human body exists in the target area.

[0078] To more accurately determine whether a heat source is a human body, the following embodiments detect whether the heat source is moving, and by processing and analyzing moving and stationary heat sources, determine whether a human body exists in the target area.

[0079] S13. Detect whether the heat source has moved.

[0080] In this embodiment of the invention, if the heat source moves, it is determined that the heat source is a human body heat source, i.e., a human body is present in the target area. Detecting whether the heat source has moved can be based on a method similar to... Figure 5 Heatmaps are used to determine whether a heat source has moved. For example, heatmaps corresponding to temperature data of a target area are periodically acquired. By analyzing all the obtained heatmaps, it is possible to detect whether the temperature data representing the heat source on the heatmap has changed position. If a change has occurred, it is determined that the heat source has moved. However, because temperature data has a certain degree of error, the position of a static, interfering heat source will also vary at different times. Therefore, judging whether a heat source has moved solely based on positional changes is greatly affected by data errors.

[0081] The following embodiment provides a heat source movement detection algorithm. If a person enters or leaves the target area, or if a person is active in the target area, the heat source movement detection algorithm can quickly detect the presence of a human body in the current target area. The principle of this heat source movement detection algorithm is as follows: For an input sample (k consecutive frames of temperature data within a time interval of t seconds), the first frame of temperature data in the input sample is first used as the base frame data. Then, each frame of temperature data in the sample data is traversed, and each frame is compared with the base frame data to obtain the difference frame data. The segmentation threshold is then calculated for the difference frame data, and heat spot segmentation is performed (if the heat source has moved, the difference frame contains a heat spot). If the area of ​​the largest connected region of the segmented heat spot is not less than a preset parameter value, it is considered that the current frame data may have moved relative to the base frame data (or it may be due to data error). The base frame data is then updated to the current frame temperature data, and the detection of subsequent temperature data frames and whether there is a significant difference between them and the base frame data continues. Secondly, the number of difference frames with the largest connected region area of ​​the segmented heat spot not less than the preset parameter value is accumulated (accumulating the number of frames that have detected movement). Finally, based on the size of the accumulated frame count, it can be determined whether the heat source in the target area has moved within the time interval of t seconds.

[0082] Specifically, please refer to Figure 7 S13. Detecting whether the heat source has moved includes:

[0083] S131. Determine the base frame data based on the multi-frame temperature data.

[0084] The base frame data serves as reference data, used to compare whether subsequent temperature data frames show significant changes. If a significant difference is detected between a subsequent temperature data frame and the base frame data, this difference may be due to heat source movement or error. The base frame data is then updated to the temperature data frame with the significant difference from the base frame data. The comparison continues between subsequent temperature data frames and the updated base frame data. In this embodiment, the initial frame temperature data is used as the base frame data. The initial frame temperature data is the first frame temperature data obtained by the aforementioned heat source presence detection algorithm, i.e., the first frame of the multi-frame temperature data.

[0085] S132. Calculate the difference frame of each frame of temperature data based on the base frame data and the multi-frame temperature data.

[0086] Wherein, the base frame data is represented by base_imge, each frame of temperature data in the multi-frame temperature data is represented by imge, and the difference frame is represented by diff_imge, then:

[0087] diff_imge = imge - base_imge.

[0088] S133. Calculate the hot spot segmentation threshold corresponding to the difference frame.

[0089] The hotspot segmentation threshold is a temperature-distinguishing critical value, that is, using a suitable temperature value as a boundary to extract hotspots (human body or heat-generating substances) from a frame of temperature image, so that the hotspots have high contrast with the background. The calculation of the hotspot segmentation threshold corresponding to the difference frame specifically includes: calculating the hotspot segmentation threshold corresponding to the difference frame according to the following formula, where the formula is:

[0090] threshold2 = β1 * percentile(diff_imge, first percentage) - β2 * percentile(diff_imge, second percentage)

[0091] Where threshold2 is the hotspot segmentation threshold, β1 and β2 are parameter factors, diff_imge is the difference frame, percentile is a function used to calculate the quantile value corresponding to each difference frame, and the first percentage and the second percentage are preset percentage parameters. The first percentage can be 75%, and the second percentage can be 25%. 75% and 25% are parameters roughly tested through data experiments and can be adjusted accordingly. Using these two values ​​can obtain a relatively accurate hotspot segmentation threshold. When the first percentage and the second percentage are 75% and 25% respectively, the hotspot segmentation threshold is the difference between the percentage value point corresponding to the 75% difference frame and the percentage value point corresponding to the 25% difference frame. β1 and β2 are parameter values ​​determined after extensive data testing. Optionally, β1 takes values ​​in the range [1.5, 3.0], and β2 takes values ​​in the range [0.5, 2.0].

[0092] S134. Based on the difference frame and the hot spot segmentation threshold, obtain the pixel region corresponding to the difference frame that is greater than or equal to the hot spot segmentation threshold, and calculate the maximum connected component area corresponding to the pixel region.

[0093] S135. Compare the area of ​​each of the largest connected regions in turn to see if it is greater than or equal to the preset area.

[0094] The maximum connected component area corresponding to each frame is compared with a preset area. If the maximum connected component area is greater than or equal to the preset area, then step S136 is executed; otherwise, the heat source corresponding to the temperature data of the current frame is considered to be stationary. The preset area can be data measured through data experiments, and can be a specific area value or an area range.

[0095] S136. Determine that the temperature data corresponding to the maximum connected region area is a heat source moving frame, accumulate the number of heat source moving frames, update the base frame data to the temperature data corresponding to the maximum connected region area, and execute steps S132 to S136 above according to the updated base frame data.

[0096] S137. Determine whether the cumulative number of heat source moving frames is greater than or equal to the second preset threshold.

[0097] Since the temperature values ​​of low-resolution infrared images have a certain error, in this embodiment, setting a second preset threshold is equivalent to setting a confidence level for determining the movement of a heat source. The value range of the second preset threshold can be [1, k / 2], where k is the number of frames of the input sample, that is, the number of frames corresponding to the multi-frame temperature data.

[0098] In practical applications, the specific value of the second preset threshold can be automatically adjusted according to the situation.

[0099] If the number of accumulated heat source movement frames is greater than or equal to the second preset threshold, then step S138 is executed; otherwise, the heat source in the target area is determined to be stationary.

[0100] S138. Determine that the heat source has moved.

[0101] The movement of the heat source includes the heat source entering or leaving the target area, and also includes the heat source moving within the target area.

[0102] If it is determined that the heat source has moved, then proceed with step S14 below.

[0103] S14. Determine that a human body exists in the target area.

[0104] The human presence detection method provided in this invention acquires multiple frames of temperature data in a target area, detects the presence of a heat source within the target area based on this data, and determines whether the heat source has moved if it is found to be present. When the heat source moves, it confirms the presence of a human body within the target area. This method can accurately identify heat sources and determine the presence of a human body in the target area by detecting the movement of the heat source.

[0105] As we know, when a human body is stationary in the target area, there is still a human body present in that target area. Therefore, for a stationary heat source, it is necessary to further detect whether it is a human body heat source or an interfering heat source.

[0106] Please see Figure 8 , Figure 8 This is a flowchart of a method for detecting the presence of a human body according to another embodiment of the present invention. Figure 8 and Figure 4 The difference lies in that, if the heat source is not moved, the method further includes:

[0107] S15. Obtain imaging information of the heat source.

[0108] S16. Input the imaging information into the static heat source detection model and output the probability of whether the heat source is a human body heat source.

[0109] S17. If the probability is greater than or equal to a preset probability threshold, then the heat source is a human body heat source; otherwise, the heat source is a non-human body heat source.

[0110] In this embodiment, by extracting features from stationary heat sources and classifying and identifying stationary heat sources in the current target area according to the constructed static heat source detection model, it is possible to fundamentally understand whether a stationary heat source is a human body heat source or an interfering heat source.

[0111] In this embodiment, a deep backbone network model is constructed based on a large amount of static heat source sample data. The model is specifically as follows: Figure 9As shown, a lightweight model is achieved by stacking several ordinary convolutional layers and adding LSTM (Long Short-Term Memory) modules. Temporal feature fusion is used in the backbone network model for classification training and inference detection of static heat sources corresponding to whether they are occupied or unoccupied. In this embodiment, the deep backbone network includes two modules: an encoder and a decoder. The encoder module consists of 6 ordinary convolutional layers (Conv 3*3), 4 max-pooling layers (MaxPool 2*2), and 2 fully connected layers (FC, with units of 64 and 48 respectively). The decoder module mainly consists of 2 LSTM layers (units: 48) and 2 fully connected layers (FC, with units of 32 and 2 respectively), with a dropout layer added between the two fully connected layers to enhance the model's robustness. Specifically, k frames of 24*32 infrared thermal imaging data within a time interval of t seconds are used as input. The shape of the input data is (k, 24, 32, 1), where the first dimension k is the number of frames in the time-series data, the second dimension 24 is the number of rows in a single frame of infrared temperature data, the third dimension 32 is the number of columns in a single frame of infrared temperature data, and the fourth dimension 1 is the number of channels in a single frame of infrared temperature data. The first four layers of the encoder consist of stacked ordinary convolutional layers and max-pooling layers. Considering the small second and third dimensions of the input sample data, to ensure the learning of basic features such as the shape of the heat source, the first max-pooling layer does not reduce the dimensionality of the sample data. Instead, dimensionality reduction is performed on the second and third dimensions of the sample data starting from the second max-pooling layer. However, the number of channels is increased in the first and second convolutional layers. The fifth to tenth layers of the encoder consist of repeated modules of two ordinary convolutional layers plus one max-pooling layer, mainly to learn features such as the temperature distribution of the heat source and to optimize the input data. The second and third dimensions are gradually reduced to 3 and 4, respectively, while the number of channels corresponding to the fourth dimension of the sample data is also increased. After the sample data is processed by the last max pooling layer, it needs to be transformed into a shape transformation, that is, from (k, 3, 4, c) to (k, L), where c is the number of sample channels after several layers of convolution processing, and L is the hidden layer feature length obtained after processing a single frame of infrared temperature data, and L = 3 * 4 * c. Considering that the hidden layer feature length L corresponding to a single frame of infrared temperature data is relatively large, two fully connected layers are connected in the encoder to perform hidden layer feature dimensionality reduction, and finally the hidden layer feature length L corresponding to a single frame of infrared temperature data is reduced to 48.The decoder module mainly consists of two LSTM layers and two fully connected layers. The LSTM layers primarily aggregate the hidden features corresponding to k frames of temporal data and learn the differences between temporal frames, such as the slight swaying of the body when a human is present, and the heating and cooling characteristics of interfering heat sources. The first fully connected layer in the decoder performs feature weighting, and the second fully connected layer maps the sample feature space to the sample binary classification label space. Ultimately, it obtains the probability values ​​for classifying static heat sources as human heat sources and non-human heat sources.

[0112] The deep backbone network model is constructed and trained to obtain the final static heat source detection model. Specifically, a batch of static heat source sample data is acquired, including human heat sources and non-human heat sources. The batch of static heat source sample data is preprocessed to obtain training samples. Preset labels are obtained for the training samples, including the probability values ​​of the presence of human heat sources and non-human heat sources. The training samples are input into the algorithm model to output the detection result of the human presence corresponding to the training samples, the detection result including the probability value of the presence of human heat sources. The relationship between the detection result and the preset labels is constrained by a loss function to obtain the minimum loss function. The algorithm model corresponding to the minimum loss function is determined as the static heat source detection model, wherein the probability value of the presence of human heat sources in the training samples can be labeled as 1, and the probability value of non-human heat sources can be labeled as 0.

[0113] In acquiring batch static heat source sample data, the data frame number corresponding to when personnel enter and leave the target area can be recorded. Based on the data frame number, it can be determined whether a certain labeled data sequence contains human heat sources. Then, each labeled data segment is divided into data samples of fixed duration (i.e., the number of data frames is consistent). Then, the heat source presence detection algorithm and the heat source movement detection algorithm are used to filter out sample data without heat source presence and non-static heat sources. The samples that are not filtered out are the static heat source sample data. At this time, it is known which labeled data sequence the filtered static heat source sample belongs to, that is, whether the sample is a human heat source or an interfering heat source.

[0114] Specifically, the data preprocessing of the batch of static heat source sample data includes discarding duplicate samples. For example, when obtaining static heat source data from real-world home scenarios, such as fixed interfering heat sources and people standing or sitting in one position for extended periods, there will be a large number of repetitive samples. Since the model training set needs to maintain sample diversity as much as possible, a large number of repetitive samples need to be discarded to improve the generalization performance of the trained model. Specifically, the intermediate frame imge2 of the candidate sample data (k frames) and the intermediate frame imge1 of the selected samples are extracted and processed by difference, i.e., diff_imge = imge2 - imge1. The hot spot segmentation threshold of the difference frame diff_imge is calculated using the formula in the above embodiment. Simultaneously, pixels in the difference frame diff_imge that are greater than or equal to the hot spot segmentation threshold are segmented, and it is determined whether the area of ​​the largest segmented hot spot reaches a preset parameter value. If so, the current sample is added to the training set; otherwise, the current sample is discarded.

[0115] The data preprocessing of the batch of static heat source sample data also includes offline data augmentation. For example, the static heat source sample data is subjected to vertical mirror flipping, horizontal mirror flipping, and 180-degree rotation. In addition, since static interference heat source data is more difficult to obtain and more singular than human static heat source data, the static interference heat source data needs to be further enhanced, that is, firstly, the centroid position of the heat source is locked, and then the heat source is translated vertically and horizontally.

[0116] The data preprocessing of the batch static heat source sample data specifically includes sample normalization preprocessing. For example, preprocessing and normalization are required before the sample data is input into the network. Each frame of data acquired by the infrared thermal imaging sensor is 24*32 pixels in size, and abnormal pixels with null or excessively high or low temperature values ​​need to be processed. For the case where the temperature value corresponding to a pixel is null, the median of the temperature values ​​of all pixels in the current sample data is used for filling; for the case where the temperature value corresponding to a pixel is excessively high or low, truncation is performed by setting upper and lower temperature thresholds. Since the ambient temperature varies greatly in different seasons, the temperature distribution data of the same heat source acquired by the infrared sensor in different seasons also varies greatly. In order to make the algorithm converge faster and the model more robust, the sample data needs to be normalized, that is, the temperature value corresponding to each sample is mapped to a fixed range. The following formula can be used:

[0117] imges1 = (imges0 - T) min ) / T max

[0118] Where imges0 is the k-frame sample time-series data, T min and Tmax are respectively the maximum and minimum temperatures in the current sample data imges0, and imges1 is the normalized sample data.

[0119] During the above model training process, the loss function designed in the embodiments of the present invention is defined as follows:

[0120]

[0121] where N is the number of samples in a single training batch, and W n is the weighting coefficient, that is, the proportion of the number of frames in which hot spots can be detected in the current sample, and y n is the probability value of the presence of a human heat source obtained by the above deep network inference, is the label value indicating whether there is a human heat source in the current sample annotation in the target area.

[0122] After preprocessing and normalizing the sample data with static heat sources, input it into the trained static heat source detection model, and the model output is the probability value p1 of the presence of a human body. Finally, determine whether there is a human body in the target area by comparing the size of the output probability value p1 with the preset threshold p0.

[0123] For example, presence is the value of the human body presence state in the target area. When p1 < p0, presence is 0, indicating that the static heat source in the target area is an interfering heat source; when p1 >= p0, presence is 1, indicating that the static heat source in the target area is a human heat source.

[0124] The human body presence detection method provided by the embodiments of the present invention first detects whether there is an obvious heat source in the target area. If there is no obvious heat source, it directly outputs that there is no one in the target area at the current moment. Otherwise, it judges whether the heat source in the target area moves. If the heat source moves, it outputs that there is someone in the target area at the current moment. Otherwise, it discriminates whether the static heat source in the target area is a human heat source through a temporal convolutional neural network model. This method judges the presence or absence of a person in the target area through an infrared thermal imaging sensor, can accurately identify the presence of a human body, and has the advantage of good privacy protection. The lightweight deep network design in the embodiments of the present invention effectively reduces the size and computational amount of the model, is applicable to lightweight chips, and has a great advantage in hardware cost. The entire algorithm greatly improves the detection accuracy of human body presence, mainly solves the problem of difficult distinction of static heat sources, and improves the applicability and portability of home application scenarios. During the actual application process, it has high robustness to interference caused by sunlight, hot water, and heating objects.

[0125] Please refer to Figure 10 , Figure 10This is a schematic diagram of the structure of a human presence detection device provided in an embodiment of the present invention, as shown below. Figure 10 As shown, the human presence detection device 40 includes a data acquisition module 401, a heat source presence detection module 402, a heat source movement detection module 403, and a human presence detection module 404.

[0126] The data acquisition module 401 is used to acquire infrared data of the target area, the infrared data including multiple frames of temperature data; the heat source presence detection module 402 is used to detect whether there is a heat source in the target area based on the multiple frames of temperature data; the heat source movement detection module 403 is used to detect whether the heat source has moved if there is a heat source in the target area; the human body presence detection module 404 is used to determine that there is a human body in the target area if the heat source has moved.

[0127] Specifically, the heat source presence detection module 402 is used to: calculate the heat source segmentation threshold corresponding to each frame of temperature data; obtain the pixel region corresponding to the temperature data that is greater than or equal to the heat source segmentation threshold based on the temperature data and the heat source segmentation threshold; calculate the maximum connected component area corresponding to the pixel region; sequentially compare each maximum connected component area with a preset area; obtain the maximum connected component area that is greater than or equal to the preset area, and determine that the time-series temperature data corresponding to the maximum connected component area is a heat source temperature data frame, and count the number of heat source temperature data frames; when the number of heat source temperature data frames is greater than or equal to a first preset threshold, determine that there is a heat source in the target area, otherwise there is no heat source in the target area.

[0128] Specifically, calculating the heat source segmentation threshold corresponding to each frame of temperature data includes: calculating the heat source segmentation threshold corresponding to each frame of temperature data according to the following formula:

[0129] threshold1 = α1 * percentile(imge, first percentage) - α2 * percentile(imge, second percentage)

[0130] Where threshold1 is the heat source segmentation threshold, α1 and α2 are parameter factors, imge is the temperature data, percentile is a function used to calculate the quantile value corresponding to the temperature data of each frame, and the first percentage and the second percentage are preset percentage parameters.

[0131] The heat source movement detection module 403 is specifically used for: determining the first frame of the multi-frame temperature data as the base frame data; calculating the difference frame of each frame of temperature data based on the base frame data and the multi-frame temperature data; calculating the hot spot segmentation threshold corresponding to the difference frame; obtaining the pixel region corresponding to the difference frame that is greater than or equal to the hot spot segmentation threshold based on the difference frame and the hot spot segmentation threshold, and calculating the maximum connected component area corresponding to the pixel region; sequentially comparing each maximum connected component area with a preset area; when the maximum connected component area is greater than or equal to the preset area, determining the temperature data corresponding to the maximum connected component area as a heat source movement frame, updating the base frame data to the temperature data corresponding to the maximum connected component area, and performing the step of calculating the difference frame of each frame of time-series temperature data based on the base frame data and the multi-frame temperature data based on the updated base frame data to obtain the heat source movement frame; when the number of accumulated heat source movement frames is greater than or equal to a second preset threshold, determining that the heat source is moving; otherwise, the heat source is stationary.

[0132] Specifically, calculating the hotspot segmentation threshold corresponding to the difference frame includes: calculating the hotspot segmentation threshold corresponding to the difference frame according to the following formula:

[0133] threshold2 = β1 * percentile(diff_imge, first percentage) - β2 * percentile(diff_imge, second percentage)

[0134] Where threshold2 is the hot spot segmentation threshold, β1 and β2 are parameter factors, diff_imge is the difference frame, percentile is a function used to calculate the quantile value corresponding to each difference frame, and the first percentage and the second percentage are preset percentage parameters.

[0135] In some embodiments, the human presence detection device 40 further includes:

[0136] The imaging information acquisition module 405 is used to acquire imaging information of the heat source;

[0137] The static heat source detection module 406 is used to input the imaging information into the static heat source detection model and output the probability of whether the heat source is a human body heat source.

[0138] The human body heat source determination module 407 is used to determine if the heat source is a human body heat source if the probability is greater than or equal to a preset probability threshold, otherwise the heat source is a non-human body heat source.

[0139] Specifically, the static heat source detection module 406 is used to: input the imaging information into the encoder to encode each frame of the imaging information; fuse the feature information corresponding to the encoded imaging information to generate temporal features; input the temporal features into the decoder for decoding, and output the probability that the heat source is classified as a human heat source and the probability that it is not a human heat source.

[0140] Optionally, the encoder includes six convolutional layers, four max-pooling layers, and two fully connected layers, and the decoder includes two long short-term memory network layers and two fully connected layers.

[0141] In some embodiments, the human presence detection device 40 further includes a static heat source detection model acquisition module 408, which is specifically used for:

[0142] Acquire batch static heat source sample data, the batch static heat source sample data including human heat sources and non-human heat sources;

[0143] The batch of static heat source sample data is preprocessed to obtain training samples;

[0144] Obtain the preset labels of the training samples. The preset labels include the labeling probability value of the training samples having human heat sources and the labeling probability value of having non-human heat sources. The labeling probability value of the training samples having human heat sources can be labeled as 1, and the labeling probability value of non-human heat sources can be labeled as 0.

[0145] The training samples are input into the algorithm model to output the detection results of the human body corresponding to the training samples, and the detection results include the probability value of the presence of human heat sources;

[0146] The minimum loss function is obtained by constraining the relationship between the detection results and the preset labels using the loss function.

[0147] The algorithm model corresponding to the minimum loss function is determined as the static heat source detection model.

[0148] Specifically, the data preprocessing of the batch of static heat source sample data includes performing at least one data processing operation on the batch of static heat source sample data, namely, discarding duplicate samples, offline data augmentation, and sample normalization preprocessing.

[0149] It should be noted that the above-mentioned human presence detection device can execute the human presence detection method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in the embodiments of the human presence detection device can be found in the human presence detection method provided in the embodiments of the present invention.

[0150] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0151] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; under the concept of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the present invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for detecting the presence of a human body, characterized in that, include: Acquire infrared data of the target area, the infrared data including multiple frames of temperature data; Detect whether there is a heat source in the target area based on the multi-frame temperature data; If a heat source exists in the target area, detect whether the heat source has moved; If the heat source moves, it is determined that a human body exists in the target area; The detection of whether the heat source has moved includes: The first frame of the multi-frame temperature data is determined as the base frame data; Calculate the difference frame for each frame of temperature data based on the base frame data and the multi-frame temperature data respectively; Calculate the hotspot segmentation threshold corresponding to the difference frame; wherein, the hotspot segmentation threshold corresponding to the difference frame is calculated according to the following formula, the formula being: in, It is the hot spot segmentation threshold. , It is a parameter factor. These are difference frames. Percentile is a function used to calculate the quantile value corresponding to each difference frame. The first percentage and the second percentage are preset percentage parameters. Based on the difference frame and the hot spot segmentation threshold, obtain the pixel region corresponding to the difference frame that is greater than or equal to the hot spot segmentation threshold, and calculate the maximum connected component area corresponding to the pixel region; Compare the area of ​​each maximum connected region with the preset area in turn; When the maximum connected region area is greater than or equal to the preset area, the temperature data corresponding to the maximum connected region area is determined to be a heat source moving frame. The base frame data is updated to the temperature data corresponding to the maximum connected region area. The step of calculating the difference frame of each frame of time-series temperature data based on the base frame data and the multi-frame temperature data is performed according to the updated base frame data to obtain the heat source moving frame. When the number of accumulated heat source movement frames is greater than or equal to a second preset threshold, the heat source is determined to be moving; otherwise, the heat source remains stationary.

2. The method according to claim 1, characterized in that, The step of detecting whether a heat source exists in the target area based on the multi-frame temperature data includes: Calculate the heat source segmentation threshold corresponding to each frame of temperature data; Based on the temperature data and the heat source segmentation threshold, obtain the pixel region corresponding to the temperature data that is greater than or equal to the heat source segmentation threshold; Calculate the area of ​​the largest connected component corresponding to the pixel region; Compare the area of ​​each maximum connected region with the preset area in turn; Obtain the area of ​​the largest connected component that is greater than or equal to the preset area, determine the time-series temperature data corresponding to the largest connected component area as the heat source temperature data frame, and count the number of the heat source temperature data frames. When the number of heat source temperature data frames is greater than or equal to a first preset threshold, it is determined that there is a heat source in the target area; otherwise, there is no heat source in the target area.

3. The method according to claim 2, characterized in that, The calculation of the heat source segmentation threshold corresponding to each frame of temperature data specifically includes: The heat source segmentation threshold corresponding to each frame of temperature data is calculated according to the following formula: in, It is the heat source segmentation threshold. , Here are the parameter factors, where image is the temperature data, percentile is the function used to calculate the quantile value corresponding to each frame of temperature data, and the first and second percentages are preset percentage parameters.

4. The method according to any one of claims 1 to 3, characterized in that, If the heat source is not moved, the method further includes: Obtain imaging information of the heat source; The imaging information is input into the static heat source detection model, and the probability of whether the heat source is a human body heat source is output. If the probability is greater than or equal to a preset probability threshold, then the heat source is a human heat source; otherwise, the heat source is a non-human heat source.

5. The method according to claim 4, characterized in that, The method further includes: acquiring the static heat source detection model. The process of obtaining the static heat source detection model includes: Acquire batch static heat source sample data, the batch static heat source sample data including human heat sources and non-human heat sources; The batch of static heat source sample data is preprocessed to obtain training samples; Obtain the preset labels of the training samples, the preset labels including the labeled probability value of the presence of human heat sources and the labeled probability value of the presence of non-human heat sources in the training samples; The training samples are input into the algorithm model to output the detection results of the human body corresponding to the training samples, and the detection results include the probability value of the presence of human heat sources; The minimum loss function is obtained by constraining the relationship between the detection results and the preset labels using the loss function. The algorithm model corresponding to the minimum loss function is determined as the static heat source detection model.

6. The method according to claim 5, characterized in that, The data preprocessing of the batch of static heat source sample data specifically includes: Perform at least one of the following data processing operations on the batch of static heat source sample data: discard duplicate samples, offline data augmentation, and sample normalization preprocessing.

7. The method according to claim 4, characterized in that, The step of inputting the imaging information into the static heat source detection model and outputting the probability that the heat source is a human body heat source includes: The imaging information is input into the encoder to encode the imaging information for each frame; The feature information corresponding to the encoded imaging information is fused to generate temporal features; The time-series features are input into the decoder for decoding, and the output is the probability that the heat source is classified as a human heat source and the probability that it is not a human heat source.

8. The method according to claim 7, characterized in that, The encoder comprises six convolutional layers, four max pooling layers, and two fully connected layers, while the decoder comprises two long short-term memory network layers and two fully connected layers.

9. A human presence detection device, characterized in that, include: The data acquisition module is used to acquire infrared data of the target area, the infrared data including multiple frames of temperature data; A heat source presence detection module is used to detect whether a heat source exists in the target area based on the multi-frame temperature data. A heat source movement detection module is used to detect whether the heat source has moved if there is a heat source in the target area. A human presence detection module is used to determine the presence of a human in the target area if the heat source moves. The heat source movement detection module is further used for: The first frame of the multi-frame temperature data is determined as the base frame data; Calculate the difference frame for each frame of temperature data based on the base frame data and the multi-frame temperature data respectively; Calculate the hotspot segmentation threshold corresponding to the difference frame; wherein, the hotspot segmentation threshold corresponding to the difference frame is calculated according to the following formula, the formula being: in, It is the hot spot segmentation threshold. , It is a parameter factor. These are difference frames. Percentile is a function used to calculate the quantile value corresponding to each difference frame. The first percentage and the second percentage are preset percentage parameters. Based on the difference frame and the hot spot segmentation threshold, obtain the pixel region corresponding to the difference frame that is greater than or equal to the hot spot segmentation threshold, and calculate the maximum connected component area corresponding to the pixel region; Compare the area of ​​each maximum connected region with the preset area in turn; When the maximum connected region area is greater than or equal to the preset area, the temperature data corresponding to the maximum connected region area is determined to be a heat source moving frame. The base frame data is updated to the temperature data corresponding to the maximum connected region area. The step of calculating the difference frame of each frame of time-series temperature data based on the base frame data and the multi-frame temperature data is performed according to the updated base frame data to obtain the heat source moving frame. When the number of accumulated heat source movement frames is greater than or equal to a second preset threshold, the heat source is determined to be moving; otherwise, the heat source remains stationary.

10. A human presence detection system, characterized in that, include: An infrared sensor and an electronic device, wherein the infrared sensor is communicatively connected to the electronic device, the infrared sensor is disposed in a target area where a human body is to be detected, and the electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the human presence detection method according to any one of claims 1-8.