Method and device for detecting human and animal targets based on passive infrared sensors
By improving the passive infrared sensor signal amplification circuit and the enhanced random forest model, the problems of accuracy and adaptability of target detection in complex outdoor environments were solved, achieving high-precision, low-power human and animal target detection.
Patent Information
- Application Number
- CN202511579781.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-10-31
AI Technical Summary
Existing passive infrared sensors struggle to achieve high accuracy and adaptability in detecting human and animal targets in complex outdoor environments, primarily due to the simple design of traditional signal processing circuits, which leads to a high false alarm rate and an inability to effectively distinguish between real targets and environmental noise.
A signal amplification circuit consisting of a second-order voltage-controlled low-pass filter and a multi-stage inverting amplifier is used. Combined with multi-domain feature extraction and an enhanced random forest model, a target detection feature library is constructed through signal amplification, preprocessing, feature extraction, decision tree training, and weighted voting, enabling in-depth mining and intelligent analysis of PIR signals.
It significantly improves the accuracy and robustness of detection, reduces power consumption, and achieves high-precision target detection on low-power microcontroller terminal devices, with generalization ability and long-term stability.
Smart Images

Figure CN121051609B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent monitoring and security technology, and particularly relates to a human and animal target detection method and device based on passive infrared sensors in outdoor complex environments. BACKGROUND
[0002] Existing human and animal target detection technologies have been widely applied in the fields of security monitoring, forestry protection, ecological monitoring and smart agriculture. However, the complexity and uncertainty of outdoor environments, such as weather changes, light fluctuations and vegetation obstructions, pose severe challenges to the accuracy and reliability of detection systems. To address these issues, the industry has developed a variety of sensing technologies based on different physical principles.
[0003] Optical and infrared thermal imaging cameras: Optical imaging cameras can provide high-resolution image information, but their performance is heavily dependent on lighting conditions, which is greatly compromised in night, fog or rainy weather. Infrared thermal imaging cameras can overcome the lighting limitations and directly sense the heat of the target, but they have high equipment costs and high power consumption, and both face the challenges of large data storage / transmission pressure and potential privacy leakage risks.
[0004] Microwave radar: Microwave radar has all-weather working capability, can penetrate rain, fog, and can directly measure the distance and speed of the target. However, it is susceptible to same-frequency electromagnetic interference, has complex algorithms, and may produce false alarms for non-target moving objects in the environment, such as large branches blown by the wind.
[0005] Passive infrared sensor (PIR): PIR technology detects by passively receiving the infrared radiation emitted by the target (such as humans and animals) itself. Its core advantages are: extremely low power consumption, suitable for long-term battery-powered outdoor deployment; complete passivity, no signal emission, no electromagnetic radiation concerns, and cannot be detected, high security; natural privacy protection, only sensing heat signals, not involving specific images.
[0006] Although PIR has great potential, there are still some bottlenecks in the application of existing technologies in outdoor complex environments. The traditional PIR signal is extremely weak, and the signal processing circuit design that goes with it is usually oriented towards simplicity and low cost. These circuits mostly only amplify the analog signals sensed by the sensor and output a binary signal of high / low level through a comparator. This "yes / no" type of rough signal loses a lot of details that can reflect the characteristics of the target, resulting in a high false alarm rate when it comes to outdoor wind and environmental temperature changes, which is one of the fundamental reasons for the high false alarm rate.
[0007] Based on the above binary signal, the existing PIR detection algorithm adopts a simple threshold judgment logic. For example, once a high-level signal is detected, or the number of high-level pulses within a certain time exceeds a certain fixed threshold, the system determines that there is a target intrusion. This fixed threshold method cannot fully adapt to the dynamic changes of the outdoor thermal environment. For example, the background temperature difference between summer and winter is huge, and a threshold effective in winter may cause a large number of false alarms caused by ground and rock warming in summer. Therefore, such algorithm has poor environmental adaptability and is not suitable for outdoor precise detection requirements.
[0008] Therefore, the existing PIR technology has significant deficiencies in hardware signal acquisition and software algorithm level, and it is difficult to meet the requirements of high accuracy and strong adaptability in outdoor complex scenes. SUMMARY
[0009] The present application provides a passive infrared sensor-based human and animal target detection method and device to solve the problem that the existing passive infrared sensor cannot meet the requirements of high accuracy and strong adaptability in outdoor complex scenes.
[0010] The first aspect of the present application provides a signal amplification circuit of a passive infrared sensor, comprising: a second-order voltage-controlled low-pass filter, which is connected with a target passive infrared sensor to perform low-pass filtering on the original energy change signal collected by the target passive infrared sensor and obtain a low-frequency effective signal; a first inverting amplifier connected with the second-order voltage-controlled low-pass filter to perform signal amplification and phase inversion on the low-frequency effective signal and obtain a first-order energy change signal; and a second inverting amplifier connected with the first inverting amplifier to perform signal amplification and phase inversion on the first-order energy change signal and obtain a second-order energy change signal.
[0011] The second aspect of the present application provides a passive infrared sensor-based human and animal target detection method, comprising the following steps:
[0012] The signal amplification circuit of the passive infrared sensor collects a secondary energy change signal of a target environment, and pre-processes the secondary energy change signal to obtain a plurality of data frames; multi-domain feature extraction is performed on the plurality of data frames to obtain a plurality of initial feature vectors, wherein each initial feature vector includes a plurality of initial feature variables, weather, illumination, terrain, target state characteristics and target / no target state characteristics; degree of discrimination evaluation and correlation analysis are performed on the plurality of initial feature vectors to screen out final feature vectors; the collection, multi-domain feature extraction, degree of discrimination evaluation and correlation analysis processes are iteratively executed to construct and update a target detection feature library containing the plurality of final feature vectors; random sampling is performed on the target detection feature library to construct a plurality of training subsets; a plurality of decision trees are constructed according to the plurality of training subsets, and the out-of-bag error rate of each decision tree and the corresponding weight are calculated; weighted voting statistics are performed according to the out-of-bag error rate of each decision tree and the corresponding weight to decide whether there is a human / animal target in the target environment.
[0013] Optionally, the pre-processing of the secondary energy change signal to obtain a plurality of data frames comprises:
[0014] The secondary energy change signal is subjected to direct current component removal to obtain an effective alternating current signal; and the effective alternating current signal is segmented into a plurality of data frames of a preset length.
[0015] Optionally, the degree of discrimination evaluation and correlation analysis of the plurality of initial feature vectors to screen out final feature vectors comprises:
[0016] The degree of discrimination of the plurality of initial feature vectors is evaluated to calculate the contribution value of each initial feature vector to the classification task; the Pearson correlation coefficient between any two features in the plurality of initial feature vectors is calculated; and the plurality of initial feature vectors are screened according to the contribution value and the Pearson correlation coefficient to obtain the final feature vector.
[0017] Optionally, the random sampling on the target detection feature library to construct a plurality of training subsets comprises:
[0018] A plurality of feature vector samples with target / no target states are extracted from the target detection feature library, and the plurality of feature vector samples with target / no target states are pre-processed to construct a total training data set; a plurality of feature vector samples are randomly sampled multiple times in the total training data set, and the plurality of feature vector samples randomly sampled each time are taken as a training subset.
[0019] Optionally, the calculation of the out-of-bag error rate of each decision tree and the corresponding weight comprises:
[0020] The prediction performance of each decision tree is independently evaluated by using preset out-of-bag data to obtain an out-of-bag error rate of each decision tree.
[0021] The third aspect of the present application provides a human and animal target detection device based on a passive infrared sensor, comprising:
[0022] The acquisition module is configured to acquire a secondary energy change signal of a target environment by using a signal amplification circuit of the passive infrared sensor, and pre-process the secondary energy change signal to obtain a plurality of data frames; the feature extraction module is configured to perform multi-domain feature extraction on the plurality of data frames to obtain a plurality of initial feature vectors, wherein each initial feature vector includes a plurality of initial feature variables, weather, illumination, terrain, target state features, and target marker state features; the screening module is configured to perform distinctness evaluation and correlation analysis on the plurality of initial feature vectors to screen out final feature vectors; the feature library construction module is configured to iteratively perform the acquisition, multi-domain feature extraction, distinctness evaluation, and correlation analysis processes to construct and update a target detection feature library containing the plurality of final feature vectors; the training set construction module is configured to randomly sample the target detection feature library to construct a plurality of training subsets; the model generation module is configured to construct a plurality of decision trees according to the plurality of training subsets, and calculate an out-of-bag error rate and a corresponding weight of each decision tree; and the decision module is configured to perform weighted voting statistics according to the out-of-bag error rate and the corresponding weight of each decision tree to construct a random forest target detection model, and use the random forest target detection model to determine whether the target environment has a human / animal target.
[0023] The fourth aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the human and animal target detection method based on the passive infrared sensor as described in the above embodiments.
[0024] The fifth aspect of the present application provides a computer program product, wherein the computer program / instructions are executed by the processor to implement the human and animal target detection method based on the passive infrared sensor as described above.
[0025] The sixth aspect of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the program is executed by the processor to implement the human and animal target detection method based on the passive infrared sensor as described above.
[0026] The present invention proposes a method and apparatus for human and animal target detection based on a passive infrared sensor. This method utilizes an optimized circuit consisting of a second-order voltage-controlled low-pass filter and a multi-stage amplifier to perform high-quality filtering and amplification of the passive sensor signal. The amplified PIR signal is then sampled and converted into a digital signal sequence. Time-domain and frequency-domain feature vectors are systematically extracted, and features with high discriminative power and low redundancy are prioritized to form target detection feature vectors, constructing a target detection feature library for complex outdoor scenes. Based on this feature library, an enhanced random forest model based on performance-weighted voting is used for training. This model effectively avoids the overfitting risk of a single decision model by constructing and combining the prediction results of multiple decision trees for comprehensive voting, thus exhibiting generalizability. The model exhibits strong adaptability and environmental capability. After training, it undergoes pruning and quantization strategies for lightweighting, enabling deployment on low-power microcontroller terminal devices. An adaptive adjustment mechanism is introduced for individual terminal devices. Based on a pre-trained feature library, it utilizes on-site collected feature vector data and employs a "first-in, first-out" sliding update method to update the feature library samples. The model then replaces poorly performing decision trees with decision trees obtained from newly trained samples, allowing it to continuously learn and adapt to changes in the individual device environment. This invention achieves end-to-end optimization from hardware to algorithm, significantly improving the accuracy of PIR signal-based detection of humans and animals, and demonstrating generalization, robustness, and long-term stability, while achieving milliwatt-level power consumption on terminal devices.
[0027] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0028] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0029] Figure 1 A flowchart illustrating a method for detecting human and animal targets based on a passive infrared sensor, provided in an embodiment of the present invention;
[0030] Figure 2 A schematic diagram of a signal amplification circuit for a passive infrared sensor provided in an embodiment of the present invention;
[0031] Figure 3 This is an example diagram comparing a person-occupied state signal and an unoccupied state signal provided in an embodiment of the present invention, wherein (a) is the signal in a target-free state (background noise), and (b) is the signal when a target (such as a human body) passes through the sensor detection area;
[0032] Figure 4 A flowchart illustrating the establishment of a PIR signal feature library for human and animal detection provided in this embodiment of the invention;
[0033] Figure 5 A human and animal detection-oriented enhanced random forest model training flowchart provided by an embodiment of the present application;
[0034] Figure 6 A random forest detection model embedded low-power terminal device flowchart provided by an embodiment of the present application;
[0035] Figure 7 A feature library and random forest model fine-tuning update mechanism schematic diagram provided by an embodiment of the present application;
[0036] Figure 8 A block schematic diagram of a human and animal target detection device based on a passive infrared sensor provided by an embodiment of the present application;
[0037] Figure 9 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0038] Embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference signs represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as a limitation of the present application.
[0039] A human and animal target detection method and device based on a passive infrared sensor are described below according to an embodiment of the present application. In view of the significant deficiencies of the existing PIR technology in hardware signal acquisition and software algorithm level mentioned in the above background art, which are difficult to meet the requirements of high accuracy and strong adaptability in outdoor complex scenes, the present application provides a full-link optimization scheme from hardware collection to algorithm decision by deep mining and intelligent analysis of PIR signals. In this scheme, a design scheme of a passive infrared sensor signal amplification circuit is constructed, and a feature vector extraction and optimization strategy for target detection in outdoor complex environments is proposed based on the signal amplification circuit. Thus, efficient and reliable target detection in outdoor complex environments can be achieved, taking into account detection accuracy, system low power consumption and algorithm practicability, which significantly improves the outdoor application performance of the existing passive infrared target detection.
[0040] Specifically, Figure 1 A flowchart of a human and animal target detection method based on a passive infrared sensor provided by an embodiment of the present application.
[0041] As Figure 1 shown, the human and animal target detection method based on a passive infrared sensor includes the following steps:
[0042] In step S101, the signal amplification circuit of the passive infrared sensor collects the secondary energy change signal of the target environment, and pre-processes the secondary energy change signal to obtain a plurality of data frames.
[0043] In some embodiments, the signal amplification circuit of the passive infrared sensor comprises:
[0044] A second-order voltage-controlled low-pass filter connected with the target passive infrared sensor to low-pass filter the original energy change signal collected by the target passive infrared sensor to obtain a low-frequency effective signal;
[0045] A first inverting amplifier connected with the second-order voltage-controlled low-pass filter to signal amplify and phase invert the low-frequency effective signal to obtain a primary energy change signal;
[0046] A second inverting amplifier connected with the first inverting amplifier to signal amplify and phase invert the primary energy change signal to obtain a secondary energy change signal.
[0047] In some embodiments, the secondary energy change signal is pre-processed to obtain a plurality of data frames, comprising:
[0048] The secondary energy change signal is subjected to direct current component removal to obtain an effective alternating current signal;
[0049] The effective alternating current signal is divided into a plurality of data frames of a preset length.
[0050] In actual execution process, such as Figure 2As shown, the signal amplification circuit of the passive infrared sensor adopts multi-stage amplification and anti-interference design to solve the amplification and noise suppression processing problem of the infrared analog signal, specifically including a power supply processing module, a second-order voltage-controlled low-pass filter, a two-stage reverse amplifier and a signal output protection circuit. Among them, the power supply processing module mainly includes a power supply filtering and voltage stabilizing circuit, C1 and C2 capacitors constitute a filtering circuit to filter out power supply noise, and through a power supply voltage stabilizing chip (LDO), the 12V input voltage is converted into a stable 5V voltage to ensure stable power supply for the subsequent circuit, and this design suppresses the power fluctuations that may exist in the outdoor environment; the second-order voltage-controlled low-pass filter is the primary signal processing unit of the circuit, mainly composed of U1A operational amplifier and its peripheral elements. The weak signal output by the passive infrared sensor is first filtered by the second-order voltage-controlled low-pass filter, which retains the low-frequency effective signal in the signal. This filter adopts Sallen-Key topology design, which is composed of R6, R7, R12, R13 and C5, C9. This structure has good low-pass characteristics, with a cutoff frequency of 10Hz, effectively filtering out high-frequency noise while retaining the characteristic frequency components (1-10Hz) generated by human / animal movement to obtain low-frequency effective signals. The U1A operational amplifier selects the low-power LM328, which has high input impedance and low output impedance characteristics, ensuring the integrity of signal transmission. The low-pass filtered signal enters the first-stage reverse amplifier, which is composed of U1B operational amplifier and R4, R8 resistors and C6 capacitor. Its voltage gain is R4 / R8. R3 and R9 divide the 5V voltage to provide DC bias, so that the amplified signal remains at a suitable operating point, obtaining a first-order energy change signal. The second-stage reverse amplifier is the same as the first stage, composed of U1C operational amplifier and R5, R10 resistors and C7 capacitor, but its function is to further amplify the signal amplified by the first stage and reverse the phase again, further improving the signal amplitude, so that the phase of the final output signal is consistent with the input, obtaining a second-order energy change signal. After the two-stage amplifier is connected in series, the weak signal of the passive infrared sensor is amplified to a level that can be effectively processed by the subsequent circuit, and through a dedicated connector, it is directly connected to the AD (analog-to-digital conversion) interface of the single-chip microcomputer, thereby realizing high-precision and high-signal-to-noise ratio digital signal acquisition.
[0051] After Figure 2 The signal output by the passive infrared sensor is effectively conditioned after being processed by the signal amplification circuit shown, such as Figure 3 (a) In the absence of a target state (background noise), the amplitude of the signal is stable around the DC bias voltage of 2.5V, with slight fluctuations, showing a smooth baseline, such as Figure 3(b) The signal when the target (such as a human body) passes through the sensor detection area presents obvious, sinusoidal-like bipolar pulse characteristics, and the voltage fluctuation range is 0.8V to 3.7V. The high-quality signal waveform has clear morphological characteristics and is easy to identify, providing a solid and reliable data foundation for subsequent digital sampling and feature extraction algorithms, and is a key prerequisite for realizing high-precision target detection.
[0052] Further, the signal amplification circuit of the passive infrared sensor is used to collect the secondary energy change signal of the target environment, and the subsequent microcontroller is used to perform analog-to-digital conversion at a preset sampling rate. In the embodiment of the present application, the preset sampling rate is 1kHz, so as to obtain the digitized time sequence of the passive infrared sensor signal (i.e. the secondary energy change signal), and the collected digital signal sequence is subjected to a direct current component removal operation to obtain an effective alternating current signal. Specifically, the mean removal method is used in the embodiment of the present application, that is, the arithmetic mean value of the signal in a time window is calculated, and the mean value is subtracted from each sampling point in the window. The purpose of this step is to eliminate the quasi-static direct current bias caused by the environmental temperature baseline or the circuit itself drift, so as to make the signal fluctuate around zero level, and effectively highlight the dynamic signal part caused by the target movement.
[0053] Further, in order to analyze the continuous signal stream, the sliding window technology is used in the embodiment of the present application to divide it into a series of data frames with fixed length. Specifically, the window length is set to 1 second (corresponding to 1000 sampling points), and the overlap rate is set to 50%. The use of overlapping windows can ensure that the complete signal characteristics of the target will not be split due to falling exactly on the boundary of two discontinuous windows, thereby significantly reducing the probability of feature missing detection. In addition, a Hamming window can also be applied to each frame of data when framing, so as to smooth the edges of the data frame. The purpose is to reduce the frequency spectrum leakage caused by signal truncation when performing fast Fourier transform subsequently, and to ensure the accuracy of the frequency domain features.
[0054] In step S102, multi-domain feature extraction is performed on the plurality of data frames to obtain a plurality of initial feature vectors, wherein each initial feature vector includes a plurality of initial feature variables, weather, illumination, terrain, target state features and presence / absence of marker state features.
[0055] In the actual execution process, for each data frame, the embodiment of the present application extracts a group of statistical features capable of fully describing the signal characteristics in parallel from two dimensions of time domain and frequency domain. Among them, the time domain features are calculated directly on the time sequence of the signal, to represent the energy, amplitude change and waveform form of the signal, and the frequency domain features are first obtained by performing fast Fourier transform on the data frame to obtain its frequency spectrum, and then extracted from the frequency spectrum, to represent the frequency composition and energy distribution of the signal. Specifically, the following aspects are mainly included:
[0056] (1) Standard Deviation : A statistical measure of the dispersion of a signal distribution.
[0057]
[0058] where, is each sample point in the signal, is the mean of the signal, is the number of sample points in the signal.
[0059] (2) Root Mean Square Value : The effective value of a signal, widely used to analyze the amplitude characteristics of a signal.
[0060]
[0061] where, is each sample point in the signal, is the number of sample points in the signal.
[0062] (3) Peak Value : The absolute maximum amplitude of a signal, indicating the limit value that the signal can reach.
[0063]
[0064] where, is each sample point in the signal.
[0065] (4) Zero Crossing Rate : The number of times a signal crosses zero, reflecting the frequency characteristics of signal changes.
[0066]
[0067] where, is the indicator function.
[0068] (5) Differential Mean : The average value of the difference between adjacent sample points, reflecting the overall situation of the signal's change trend and change amplitude.
[0069]
[0070] where, and are adjacent sample points in the signal.
[0071] (6) Skewness : Describes the symmetry of the signal distribution.
[0072]
[0073] where, is the mean of the signal, is the standard deviation of the signal.
[0074] (7) Kurtosis : describes the degree of peakedness of the signal distribution.
[0075]
[0076] where, is the mean of the signal, is the standard deviation of the signal.
[0077] (8) Frequency Center of Gravity : is the center of mass of the signal spectrum, indicating the center of gravity position of the frequency distribution.
[0078]
[0079] where, is the frequency, is the amplitude corresponding to the frequency, is the index of the corresponding frequency point, is the index set of all frequency points.
[0080] (9) Dominant Frequency : is the frequency component with the largest amplitude in the signal, and the parabolic fitting can obtain a more accurate dominant frequency position.
[0081]
[0082] where, is the index of the frequency point corresponding to the maximum amplitude, is the frequency corresponding to the maximum amplitude, is the maximum amplitude of the parabolic fitting, is the next amplitude of the maximum amplitude of the parabolic fitting, is the previous amplitude of the maximum amplitude of the parabolic fitting, is the frequency resolution.
[0083] (10) Total Energy of Frequency Band : is the total energy of the signal in the frequency domain, reflecting the intensity of the signal in the entire frequency range.
[0084]
[0085] where, is the amplitude corresponding to the frequency.
[0086] (11) Energy of 1-10Hz Frequency Band : is the energy distribution of the signal in the specific frequency range of 1-10Hz.
[0087]
[0088] wherein, is the amplitude of the corresponding frequency.
[0089] (12) 10-100Hz band energy : is the energy distribution of the signal in the specific frequency range of 10-100Hz.
[0090]
[0091] wherein, is the amplitude of the corresponding frequency.
[0092] (13) Spectral entropy: is an index for measuring the degree of disorder of the spectral distribution of the signal, similar to information entropy.
[0093]
[0094] wherein, is the normalized spectral amplitude.
[0095] By combining the above time domain and frequency domain features, a total of 13 initial feature vectors including each signal segment, standard deviation, root mean square, peak value, zero crossing rate, differential mean, skewness, kurtosis, frequency center of gravity, main frequency, total frequency energy, 1-10Hz energy, 10-100Hz energy, and spectral entropy are extracted, providing rich and comprehensive raw information for subsequent feature optimization and classification recognition.
[0096] In step S103, the plurality of initial feature vectors are evaluated for discrimination degree and analyzed for correlation to screen out final feature vectors.
[0097] In some embodiments, the plurality of initial feature vectors are evaluated for discrimination degree and analyzed for correlation to screen out final feature vectors, including:
[0098] The plurality of initial feature vectors are evaluated for discrimination degree to calculate a contribution value of each initial feature vector to a classification task.
[0099] The Pearson correlation coefficient between any two features in the plurality of initial feature vectors is calculated.
[0100] The plurality of initial feature vectors are screened according to the contribution value and the Pearson correlation coefficient to obtain the final feature vectors.
[0101] In actual execution process, for example, Figure 4As shown, after extracting an initial feature vector containing multiple dimensions, this embodiment of the invention establishes a systematic feature optimization method to address the diversity of outdoor environments (such as different weather, terrain, and lighting conditions) and the differences in target types. This method aims to select the feature combination that contributes the most to the target detection task and has the lowest redundancy from the generated 13-dimensional initial feature vector.
[0102] In the feature selection section, the discriminative power of all initial features is first evaluated to measure the contribution of each feature to the classification task. Specifically, the information gain provided by each feature in distinguishing between "target" and "no target" states is quantified. Information gain refers to the degree to which the system's classification uncertainty decreases after knowing the value of a feature. A higher information gain means a greater role in distinguishing the target from the background. The calculation formula is as follows:
[0103]
[0104] in, Representation of features In the dataset Information gain on It is the entropy of the dataset. Indicates in features Values The entropy of the corresponding subset of data at that time. Features All possible values of .
[0105] The Pearson correlation coefficient between any two features in the initial feature vector is then calculated to measure the degree of linear correlation between the features. If the absolute value of the correlation coefficient between two features exceeds a preset threshold (e.g., 0.9), they are considered to be highly redundant. In this case, features with greater information gain are retained first, while redundant features are removed to reduce the dimensionality of the feature set and decrease the computational complexity and overfitting risk of the subsequent model.
[0106] Through the dual screening of discrimination evaluation and correlation redundancy elimination, features with relatively low correlation and relatively high information gain are finally selected to form the final feature vector. In a specific implementation scheme, after optimization, five features are finally selected: standard deviation, 1-10Hz frequency band energy, skewness, zero-crossing rate, and dominant frequency. This set of features can comprehensively characterize the target signal in both the time and frequency domains, and are independent of each other, thus forming the final feature vector used for target detection.
[0107] In step S104, the processes of data acquisition, multi-domain feature extraction, discrimination evaluation, and correlation analysis are executed iteratively to construct and update a target detection feature library containing multiple final feature vectors.
[0108] In actual execution process, as shown in Figure 4 Based on the final feature vector, the application constructs an outdoor complex scene target detection feature library by processing a large number of sample signals collected in different outdoor scenes. Table 1 shows some feature vector sample instances in the library, realizing digital standard expression of environment and signal features, effectively supporting subsequent target detection algorithms, and the feature library has scalability and self-learning ability, supporting subsequent field supplement learning.
[0109] Table 1 Random sample of sample feature vectors in different scenes
[0110]
[0111] Note: Feature vector format (no target state): (E, V, K, Z, F)
[0112] Feature vector format (with target state): (d, E, V, K, Z, F), where d is distance (m)
[0113] Table 2 Feature abbreviation meaning table
[0114]
[0115] Table 3 Scene parameter coding table
[0116]
[0117] In step S105, random sampling is performed in the target detection feature library to construct multiple training subsets.
[0118] In some embodiments, random sampling is performed in the target detection feature library to construct multiple training subsets, including:
[0119] In the target detection feature library, multiple feature vector samples with target / no target state are extracted, and the multiple feature vector samples with target / no target are preprocessed to construct a total training data set.
[0120] Multiple feature vector samples are randomly sampled in the total training data set multiple times, and the multiple feature vector samples randomly sampled each time are respectively taken as a training subset.
[0121] In actual execution process, as shown in Figure 5 Based on the aforementioned constructed outdoor complex scene target detection feature library, the embodiment of the application constructs an enhanced random forest model training process for human and animal detection, and the specific steps of the preprocessing stage are as follows:
[0122] A large number of feature vector samples with labels (such as target / no target) are extracted from the outdoor complex scene target detection feature library constructed as described above as a training data set. In order to eliminate the influence of different features due to different orders of magnitude, zero-mean normalization preprocessing is required, that is, each feature value is subtracted from the mean value of the feature in the training set and divided by the standard deviation, so that all feature variables conform to a distribution with a mean of 0 and a variance of 1, and are in a similar numerical range, facilitating the model to learn the contribution of each feature fairly. Then, resample the samples, that is, randomly sample multiple samples from the total training set to form a training subset, which is used to construct a decision tree. It should be noted that about 36.8% of the samples will not be drawn in this process, which are referred to as "out-of-bag" data, which will be used to evaluate the performance of the decision tree in the subsequent.
[0123] In step S106, a plurality of decision trees are constructed according to a plurality of training subsets, and the out-of-bag error rate of each decision tree and the corresponding weight are calculated.
[0124] In step S107, the out-of-bag error rate of each decision tree and the corresponding weight are weighted and voted to construct a random forest target detection model, and the random forest target detection model is used to determine whether there is a human / animal target in the target environment.
[0125] In some embodiments, calculating the out-of-bag error rate of each decision tree and the corresponding weight comprises:
[0126] The prediction performance of each decision tree is independently evaluated using the predetermined out-of-bag data to obtain the out-of-bag error rate of each decision tree;
[0127] The weight of each decision tree is calculated according to the out-of-bag error rate of each decision tree.
[0128] In actual execution, as shown in Figure 5 The specific steps of the parallel training phase of the enhanced random forest model training process for human and animal detection constructed by the embodiment of the present application are as follows:
[0129] Based on the above random sampling, N decision trees are independently trained in parallel to form a "forest". Since there is no dependency between the decision trees, this process can be efficiently parallelized.
[0130] Further, the embodiment of the present application introduces a performance-based weighted voting mechanism based on "simple majority voting". First, the prediction performance of each decision tree is independently evaluated using the "out-of-bag" data reserved in the training phase, and the out-of-bag error rate is calculated. Then, according to the error rate, a weight is assigned to each decision tree. For the weight of the first decision tree, the weight of the second decision tree, and the weight of the Nth decision tree. According to the out-of-bag error rate is defined as:
[0131]
[0132] wherein, is the total number of decision trees in the random forest.
[0133] The decision tree with lower out-of-bag error rate indicates stronger generalization ability and more reliable prediction, and thus should be given higher weight in the final decision; otherwise, it should be given lower weight, and the sum of all weights is 1. For each sample to be predicted, all decision trees give the prediction result of "target" or "non-target" respectively. Let be the classification output of the i-th tree for the sample (1 represents target and 0 represents non-target), and the weighted votes of the two classes are:
[0134]
[0135]
[0136] wherein, is the weighted vote of the target class, is the weighted vote of the non-target class, is an indicator function, which takes 1 when the condition in the parentheses is true, and 0 otherwise.
[0137] The final decision class is determined by the one with the highest weighted vote, that is, if then it is determined as "target", otherwise as "non-target". In this way, the model can automatically integrate the judgments of each decision tree, thereby effectively improving the accuracy and anti-interference ability of target detection in complex outdoor environments.
[0138] Further, as shown in Figure 6 , in order to apply the complex random forest model to a low-power microcontroller (such as STM32F103C8T6, whose SRAM is only 20KB) with extremely limited resources, the embodiment of the present application adopts a strategy of "backend PC model training and lightweight, front-end microcontroller inference".
[0139] The backend PC model training and lightweight stage is based on the aforementioned constructed outdoor complex scene target detection feature library, and is performed in a PC environment according to the following steps: Figure 5 The random forest model is trained. To ensure that the model can be successfully deployed, the embodiment of the application implements a multi-level lightweight strategy, and in a preferred embodiment, the random forest target detection model is simplified to 20 decision trees, and the depth of each tree is limited to within 8 layers. This controls the total number of nodes of the model to 622, significantly reducing the complexity of the model. The floating point operations used in the model during training are converted to fixed point operations. This conversion greatly reduces the computational burden of the microcontroller and reduces the operation time. A two-stage inference strategy is designed, and the device first uses the time domain features with extremely low computational complexity (such as zero-crossing rate) for rapid preliminary screening to eliminate obvious non-target signals; only when the signal passes the preliminary screening, the full features are called to perform accurate classification. This strategy effectively reduces the average power consumption of the system. Finally, the model trained on the PC and subjected to lightweight is automatically converted into C language code. This process exports the node information of each decision tree (such as split features, threshold, and child node index) and the global parameters of the model (such as class weight and feature scaling factor) and solidifies them into C language structure arrays and constant arrays. This design enables the traversal and inference of the tree on the MCU through efficient array index operations, avoiding dynamic memory allocation and complex pointer operations. The final generated model code (including header files and implementation files) occupies a storage space of about 12.24KB, fully meeting the memory limit of STM32F103C8T6.
[0140] The front-end microcontroller inference stage is to compile and burn the generated C code to the microcontroller (i.e., to be independent of the PC) and then perform automatic operation of integrated target detection in the outdoor field (i.e., the microcontroller controls the passive infrared sensor to collect environmental signals in real time). For the collected signal segment, the aforementioned 5 features are calculated in real time to form a feature vector; the random forest inference function solidified in the program is called, which loads the feature vector and performs parallel inference on each decision tree, and the final decision is made through a weighted voting mechanism, and the final output is a detection result of "target" or "no target".
[0141] The embodiment of the application has been tested in various outdoor environments, and the microcontroller has achieved a detection accuracy of 95%, with an average power consumption of less than 120mW. In a 30-day long-term stability test, the device did not have any hardware failure or software crash.
[0142] To further enhance the environmental adaptability of the model in long-term deployment and cope with the influence of seasonal changes and scene changes, the embodiment of the application also designs a feature library and random forest model fine-tuning and updating mechanism as shown in Figure 7 The specific implementation of the mechanism is as follows: the front-end microcontroller is continuously running, and the newly collected and detected signal feature vectors are transmitted back to the back-end PC through wired or wireless communication.
[0143] On the back-end PC, the signal feature vector is sent to the outdoor complex scene target detection feature library through the FIFO (First Input First Output) update module. The feature library adopts a "first-in, first-out" sliding window strategy for management. New feature samples are continuously added to the library, while the oldest samples are simultaneously eliminated. This ensures that the feature library always reflects the signal characteristics in the recent environment. When the accumulated new samples on the PC reach the preset threshold, the model adaptive update module will be automatically triggered. This module will use the current latest feature library data to train a new decision tree on the PC that can better represent the current environment. Subsequently, the new tree is subjected to lightweight processing, and its parameters are packaged into a compact update file, which is then sent by the PC to the front-end microcontroller. After receiving the update package, the microcontroller only needs to perform a simple replacement operation, i.e., replacing the parameters of an old or poorly performing tree in the random forest with those of the new decision tree. This "back-end training, front-end updating" type of local hot updating method enables the model to maintain stable knowledge learned from massive historical data while sensitively capturing and learning the latest environmental features. This greatly enhances the long-term robustness of the model and effectively reduces the false positive rate and the risk of missed reports caused by environmental changes.
[0144] In summary, the human and animal target detection method based on passive infrared sensors according to the embodiments of the present application has the following beneficial effects:
[0145] (1) A passive infrared sensor signal amplification circuit is constructed, effectively realizing multi-stage amplification of the original signal and noise suppression processing, improving the application ability of the passive infrared detector in weak signal and complex noise environment, and facilitating the extraction and analysis of signal features by subsequent algorithms;
[0146] (2) A feature vector extraction and optimization strategy for target detection in outdoor complex environments is proposed. Through two-dimensional statistical analysis of feature correlation and feature discrimination, the features with the largest difference and low redundancy between target and non-target states are automatically selected to form a feature vector and establish a pre-trained outdoor complex scene target detection feature library, supporting flexible adaptation to multiple scenes and improving target recognition accuracy and noise tolerance;
[0147] (3) A low-power terminal lightweight random forest target detection model pre-training and deployment method is proposed, which effectively avoids the overfitting risk of a single decision model by constructing and combining the prediction results of multiple decision trees for comprehensive voting, significantly enhances the generalization ability and robustness of the model, and makes it naturally resistant to complex environmental noise and signal disturbances. In order to ensure the stability and universality of the model in different hardware platforms and variable outdoor scenes, all feature vectors input into the model are subjected to zero-mean normalization processing to eliminate the order-of-magnitude difference between different features, ensuring the consistency of model training and reasoning, and facilitating model migration and deployment. The pre-trained decision model can be efficiently deployed on a low-power and low-cost microcontroller. Thanks to the small calculation amount and low memory occupation of the decision model, the entire processing flow from signal conditioning, real-time feature calculation to final target decision can be run in real time on the microcontroller, without relying on any high-performance processor or redundant peripherals. Compared with deep learning methods relying on high-performance platforms or traditional single-sensor threshold judgment methods, the entire system can run at a power consumption of a few milliwatts, which meets the needs of outdoor long-term monitoring, has low algorithm complexity, ensures rapid detection and instantaneous response of moving targets, and all calculations are completed on the local side without external network support, greatly improving the deployment flexibility and data security of the system in remote or non-network coverage areas. The technical problems of limited energy supply and tight computing resources faced by outdoor embedded devices in actual deployment are effectively solved, while achieving high-precision target detection and minimizing system power consumption and hardware cost.
[0148] (4) An updating and fine-tuning mechanism for the feature library and the pre-trained random forest model is proposed. The mechanism dynamically maintains a vector sample library reflecting recent environmental features through a sliding window using a "first-in, first-out" strategy, so that the model can continuously learn the features of new environments without interrupting operation and consuming a large amount of computing resources, thereby continuously optimizing itself based on historical knowledge, solving the performance degradation problem caused by seasonal changes and scene changes after long-term deployment, greatly enhancing the long-term robustness of the model, effectively reducing false positives and false negatives caused by environmental drift, and ensuring high performance of the system throughout its life cycle.
[0149] Secondly, the human and animal target detection device based on passive infrared sensors according to the embodiments of the present application is described with reference to the accompanying drawings.
[0150] Figure 8 A block diagram of the human and animal target detection device based on passive infrared sensors according to the embodiments of the present application is provided.
[0151] As Figure 8As shown, the human and animal target detection device 80 based on a passive infrared sensor includes: an acquisition module 801, a feature extraction module 802, a screening module 803, a feature library construction module 804, a training set construction module 805, a model generation module 806, and a decision module 807.
[0152] The system comprises the following modules: Acquisition module 801 acquires secondary energy change signals of the target environment using a signal amplification circuit of a passive infrared sensor, and preprocesses these signals to obtain multiple data frames. Feature extraction module 802 performs multi-domain feature extraction on the multiple data frames to obtain multiple initial feature vectors. Each initial feature vector includes multiple initial feature variables, weather, illumination, terrain, target presence features, and target absence features. Filtering module 803 performs discrimination evaluation and correlation analysis on the multiple initial feature vectors to filter out the final feature vectors. Feature library construction module 804 iteratively executes the acquisition, multi-domain feature extraction, discrimination evaluation, and correlation analysis processes to construct and update a target detection feature library containing multiple final feature vectors. Training set construction module 805 randomly samples from the target detection feature library to construct multiple training subsets. Model generation module 806 constructs multiple decision trees based on the multiple training subsets and calculates the out-of-bag error rate and corresponding weights for each decision tree. The decision module 807 is used to perform weighted voting statistics based on the out-of-bag error rate and corresponding weight of each decision tree to construct a random forest target detection model, and to use the random forest target detection model to determine whether there are human / animal targets in the target environment.
[0153] In some embodiments, the acquisition module 801 includes:
[0154] The removal unit is used to remove the DC component from the secondary energy change signal to obtain an effective AC signal;
[0155] A segmentation unit is used to divide a valid AC signal into multiple data frames of a preset length.
[0156] In some embodiments, the feature library construction module 804 includes:
[0157] The evaluation unit is used to evaluate the discriminative power of multiple initial feature vectors to calculate the contribution of each initial feature vector to the classification task.
[0158] The coefficient calculation unit is used to calculate the Pearson correlation coefficient between any two features in multiple initial feature vectors;
[0159] The filtering unit is used to filter multiple initial feature vectors based on their contribution values and Pearson correlation coefficients to obtain the final feature vectors.
[0160] In some embodiments, the training set construction module 805 comprises:
[0161] a feature vector extraction unit configured to extract a plurality of feature vector samples with target / no-target states from the target detection feature library and pre-process the plurality of feature vector samples with target / no-target states to construct a total training data set;
[0162] a random sampling unit configured to randomly sample a plurality of feature vector samples in the total training data set multiple times and take each time of the randomly sampled plurality of feature vector samples as a training subset.
[0163] In some embodiments, the model generation module 806 comprises:
[0164] an evaluation unit configured to independently evaluate the prediction performance of each decision tree by using the preset out-of-bag data to obtain an out-of-bag error rate of each decision tree;
[0165] a weight calculation unit configured to calculate the weight of each decision tree according to the out-of-bag error rate of each decision tree.
[0166] It should be noted that the foregoing description of the embodiment of the passive infrared sensor-based human and animal target detection method is also applicable to the embodiment of the passive infrared sensor-based human and animal target detection device, which will not be described here again.
[0167] The passive infrared sensor-based human and animal target detection device according to the embodiment of the present application has the following beneficial effects:
[0168] (1) A passive infrared sensor signal amplification circuit is constructed, which effectively realizes multi-stage amplification of the original signal and noise suppression processing, improves the application ability of the passive infrared detector in a weak signal and complex noise environment, and facilitates the extraction and analysis of signal characteristics by subsequent algorithms;
[0169] (2) A feature vector extraction and optimization strategy for target detection in an outdoor complex environment is proposed, which automatically selects features with the largest difference and low redundancy between target and non-target states through two-dimensional statistical analysis of feature correlation and feature discrimination, forms a feature vector, establishes a pre-training required outdoor complex scene target detection feature library, supports flexible adaptation to multiple scenes, and improves target recognition accuracy and noise tolerance;
[0170] (3) A low-power terminal lightweight random forest target detection model pre-training and deployment method is proposed, which effectively avoids the overfitting risk of a single decision model by constructing and combining the prediction results of multiple decision trees for comprehensive voting, significantly enhances the generalization ability and robustness of the model, and makes it naturally resistant to complex environmental noise and signal disturbances. In order to ensure the stability and universality of the model in different hardware platforms and variable outdoor scenes, all feature vectors input into the model are subjected to zero-mean normalization processing to eliminate the order-of-magnitude difference between different features, ensuring the consistency of model training and reasoning, facilitating model migration and deployment. The pre-trained decision model can be efficiently deployed on a low-power and low-cost microcontroller. Thanks to the small calculation amount and low memory occupation of the decision model, the entire processing flow from signal conditioning, real-time feature calculation to final target decision can form a real-time closed-loop operation on the microcontroller without relying on any high-performance processor or redundant peripherals. Compared with deep learning methods relying on high-performance platforms or traditional single-sensor threshold judgment methods, the entire system can run at a milliwatt level of power consumption, which meets the outdoor long-term monitoring needs, has low algorithm complexity, ensures rapid detection and instantaneous response of moving targets, and all calculations are completed on the local side without external network support, greatly improving the deployment flexibility and data security of the system in remote or non-network coverage areas. The technical problems of limited energy supply and tight computing resources faced by outdoor embedded devices in actual deployment are effectively solved, while the system power consumption and hardware cost are minimized.
[0171] (4) An updating and fine-tuning mechanism for the feature library and the pre-trained random forest model is proposed. The mechanism dynamically maintains a vector sample library reflecting recent environmental features through a sliding window using a "first-in, first-out" strategy, so that the model can continuously learn the features of the new environment without interrupting the operation and consuming a large amount of computing resources, thereby continuously optimizing itself based on historical knowledge, solving the performance degradation problem caused by seasonal replacement and scene change factors after long-term deployment, greatly enhancing the long-term robustness of the model, effectively reducing false positives and false negatives caused by environmental drift, and ensuring high performance of the system throughout its life cycle.
[0172] Figure 9 The structure schematic diagram of the electronic device provided by the embodiment of the present application is provided. The electronic device can include:
[0173] The memory 901, the processor 902, and the computer program stored in the memory 901 and executable on the processor 902.
[0174] The processor 902 implements the passive infrared sensor-based human and animal target detection method provided in the above embodiments when executing the program.
[0175] Further, the electronic device further comprises:
[0176] The communication interface 903 is configured to communicate between the memory 901 and the processor 902.
[0177] The memory 901 is configured to store computer programs executable on the processor 902.
[0178] The memory 901 can include a high-speed RAM memory, and can also include a non-volatile memory, for example, at least one disk memory.
[0179] If the memory 901, the processor 902 and the communication interface 903 are implemented independently, the communication interface 903, the memory 901 and the processor 902 can be connected to each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 9 Only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0180] Optionally, in a specific implementation, if the memory 901, the processor 902 and the communication interface 903 are integrated on a chip, the memory 901, the processor 902 and the communication interface 903 can complete communication between each other through an internal interface.
[0181] The processor 902 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present application.
[0182] The embodiments of the present application also provide a computer program product, and the computer programs / instructions are executed by the processor to implement the above-mentioned passive infrared sensor-based human and animal target detection method.
[0183] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the above-mentioned method for detecting human and animal targets based on a passive infrared sensor.
[0184] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or N embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples without contradiction.
[0185] In addition, the terms "first", "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "N" is at least two, for example, two, three, etc., unless otherwise specifically limited.
[0186] Any process or method descriptions in flow charts or otherwise described herein can be understood as representing code modules, segments, or portions of code that include one or more executable instructions for performing a specified logic function or process, and the various embodiments of the present application also include the possibility that the functions described can be implemented using a plurality of separate program components or objects to perform the described functions, and that these components or objects can be written in accordance with the present application and can be implemented with hardware that is specifically constructed to store and perform the executable instructions, or alternatively can be implemented with a general purpose receiver or a general purpose computer that is programmed to be a special purpose computer according to the present application.
[0187] The logic and / or steps represented in flow diagrams or otherwise described herein, for example, can be considered as a sequence of instructions to implement logic functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this specification, a "computer-readable medium" can be any means that can contain, store, communicate, propagate or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a machine-readable storage device (e.g., magnetic, optical or other) a machine-readable storage diskette (e.g., floppy, flexible or other), a machine-readable storage card (e.g., ROM, EEPROM, flash memory or other), a machine- readable storage tape (e.g., magnetic, optical or other), a machine-readable storage medium (e.g., a portable electronic device, a computer diskette, a computer memory stick, a computer hard drive, a computer tape, a computer readable storage medium, or other), or a machine-readable wireless transmission (e.g., a radio frequency signal, an infrared signal, a microwave signal, or other). More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for example, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
[0188] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware and in another embodiment, any of the following technologies known in the art or their combinations can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
[0189] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiment methods can be completed by programs instructing related hardware, and the programs can be stored in a computer-readable storage medium. When the programs are executed, they include one or a combination of the steps of the method embodiments.
[0190] In addition, each function unit in each embodiment of the present application can be integrated in one processing module, or each unit can be physically present separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module. When the integrated module is realized in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
[0191] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A method for detecting human and animal targets based on a passive infrared sensor, characterized in that, Includes the following steps: The passive infrared sensor's signal amplification circuit acquires secondary energy change signals from the target environment and preprocesses these signals to obtain multiple data frames. The passive infrared sensor's signal amplification circuit includes: A second-order voltage-controlled low-pass filter is connected to the target passive infrared sensor to perform low-pass filtering on the raw energy change signal collected by the target passive infrared sensor to obtain a low-frequency effective signal. A first inverting amplifier is connected to the second-order voltage-controlled low-pass filter to amplify and invert the phase of the low-frequency effective signal to obtain a first-order energy change signal. A second inverting amplifier is connected to the first inverting amplifier to amplify and invert the phase of the first-stage energy change signal to obtain a second-stage energy change signal. Multi-domain feature extraction is performed on the multiple data frames to obtain multiple initial feature vectors, wherein each initial feature vector includes multiple initial feature variables, weather, illumination, terrain, target state features and target-free state features; Discrimination evaluation and correlation analysis are performed on the multiple initial feature vectors to select the final feature vectors; The process of iteratively executing data acquisition, multi-domain feature extraction, discrimination evaluation, and correlation analysis is used to construct and update a target detection feature library containing the final feature vector. Random sampling is performed on the target detection feature library to construct multiple training subsets; Multiple decision trees are constructed based on the multiple training subsets, and the out-of-bag error rate and corresponding weights of each decision tree are calculated. A weighted voting statistical method is used to construct a random forest target detection model based on the out-of-bag error rate and corresponding weight of each decision tree, and the random forest target detection model is used to determine whether there are human / animal targets in the target environment.
2. The method for detecting human and animal targets based on a passive infrared sensor according to claim 1, characterized in that, The preprocessing of the secondary energy change signal to obtain multiple data frames includes: The DC component of the secondary energy change signal is removed to obtain an effective AC signal; The effective AC signal is divided into multiple data frames of a preset length.
3. The method for detecting human and animal targets based on a passive infrared sensor according to claim 1, characterized in that, The step of performing discrimination evaluation and correlation analysis on the multiple initial feature vectors to select the final feature vectors includes: The discrimination of the multiple initial feature vectors is evaluated to calculate the contribution of each initial feature vector to the classification task; Calculate the Pearson correlation coefficient between any two features in the plurality of initial feature vectors; The multiple initial feature vectors are filtered based on the contribution value and the Pearson correlation coefficient to obtain the final feature vector.
4. The method for detecting human and animal targets based on a passive infrared sensor according to claim 1, characterized in that, The step involves randomly sampling from the target detection feature library to construct multiple training subsets, including: Multiple feature vector samples with target / no target states are extracted from the target detection feature library, and the multiple feature vector samples with target / no target states are preprocessed to construct the total training dataset; Multiple feature vector samples are randomly sampled multiple times in the total training dataset, and each random sample of multiple feature vector samples is used as a training subset.
5. The method for detecting human and animal targets based on a passive infrared sensor according to claim 1, characterized in that, The calculation of the out-of-bag error rate and corresponding weights for each decision tree includes: The prediction performance of each decision tree is independently evaluated using preset out-of-bag data to obtain the out-of-bag error rate of each decision tree; The weight of each decision tree is calculated based on its out-of-bag error rate.
6. A human and animal target detection device based on a passive infrared sensor, characterized in that, include: The acquisition module is used to acquire secondary energy change signals of the target environment using the signal amplification circuit of a passive infrared sensor, and to preprocess the secondary energy change signals to obtain multiple data frames. The signal amplification circuit of the passive infrared sensor includes: A second-order voltage-controlled low-pass filter is connected to the target passive infrared sensor to perform low-pass filtering on the raw energy change signal collected by the target passive infrared sensor to obtain a low-frequency effective signal. A first inverting amplifier is connected to the second-order voltage-controlled low-pass filter to amplify and invert the phase of the low-frequency effective signal to obtain a first-order energy change signal. A second inverting amplifier is connected to the first inverting amplifier to amplify and invert the phase of the first-stage energy change signal to obtain a second-stage energy change signal. The feature extraction module is used to perform multi-domain feature extraction on the multiple data frames to obtain multiple initial feature vectors, wherein each initial feature vector includes multiple initial feature variables, weather, illumination, terrain, target state features and target-free state features; The filtering module is used to perform discrimination evaluation and correlation analysis on the multiple initial feature vectors in order to filter out the final feature vectors. A feature library construction module is used to iteratively execute the processes of data acquisition, multi-domain feature extraction, discrimination evaluation, and correlation analysis, in order to construct and update a target detection feature library containing the final feature vector. A training set construction module is used to randomly sample from the target detection feature library to construct multiple training subsets; The model generation module is used to construct multiple decision trees based on the multiple training subsets, and to calculate the out-of-bag error rate and corresponding weights of each decision tree; The decision module is used to perform weighted voting statistics based on the out-of-bag error rate and corresponding weight of each decision tree to construct a random forest target detection model, and to use the random forest target detection model to determine whether there are human / animal targets in the target environment.
7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the human and animal target detection method based on a passive infrared sensor as described in any one of claims 1-5.
8. A computer program product, characterized in that, When executed by a processor, the computer program / instructions implement the human and animal target detection method based on a passive infrared sensor as described in any one of claims 1-5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the human and animal target detection method based on a passive infrared sensor as described in any one of claims 1-5.
Citation Information
Patent Citations
Data processing method and device of infrared sensor
CN117828535A
Method, apparatus, and systems for wireless event detection and monitoring
WO2017100706A1