A human behavior recognition method and system based on dynamic sliding window

By dynamically adjusting the size of the sliding window and selecting a suitable classifier model, the problem that fixed sliding windows in the prior art cannot adapt to complex and diverse behaviors is solved, and the behavior recognition effect with high accuracy and low latency is achieved.

CN115659222BActive Publication Date: 2025-08-15JINAN ZHONGKE UBIQUITOUS INTELLIGENT COMPUTING RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211377279.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2025-08-15
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

Most existing human behavior recognition methods use fixed sliding windows, which cannot adapt to complex and diverse behavioral characteristics, resulting in low recognition accuracy and poor real-time performance.

Method used

The sliding window is segmented based on the duration of a single occurrence of different behaviors. By dynamically adjusting the window size and selecting a suitable classifier model, a candidate model set is constructed for behavior recognition.

Benefits of technology

It improves the accuracy and real-time nature of behavior recognition, adapts to complex and diverse behavioral characteristics, and reduces recognition delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115659222B_ABST
    Figure CN115659222B_ABST
Patent Text Reader

Abstract

The present invention discloses a human behavior recognition method and system based on a dynamic sliding window, comprising: obtaining a human behavior training set and extracting periodic sampling points of human behavior; selecting a sliding window value for each human behavior based on a fit to the periodic sampling points to construct a sliding window set; training a classifier model based on a set of fixed sliding window values and different sliding window values in the sliding window set to obtain a set of candidate models; obtaining a human behavior test set and performing behavior recognition on the human behavior test set using the sliding window and the corresponding classifier model. The sliding window is segmented based on the duration of a single occurrence of different behaviors, providing good flexibility and adaptability to periodic behaviors and high recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of human behavior recognition, and in particular to a human behavior recognition method and system based on a dynamic sliding window. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Human activity recognition (HAR) is the identification of actions performed by people through a series of observations of people and their surroundings. HAR has been widely used in industries such as healthcare, social security, activity analysis, and traffic safety. Human behavior classification methods mainly include technologies based on visual systems and technologies based on wearable sensor systems. Vision-based HAR faces many challenges. On the one hand, video data is prone to privacy leakage, and image processing takes up a lot of storage space and has high computational costs. On the other hand, the position of the device, offset angle, light intensity, etc. will affect the accuracy. Compared with methods based on vision technology, methods based on wearable sensors are usually lower cost and more robust and portable in various environments.

[0004] Human behavior data from wearable sensors is a continuous data stream. The recognition process typically segments the sensor signal into windows for continuous feature extraction and classification. Sliding windows are the most commonly used data segmentation method. The window size is chosen empirically based on past experiments, and the window length directly affects classification performance.

[0005] Most methods use a fixed sliding window to train and recognize different behaviors. However, a single sliding window cannot effectively segment all behaviors. Furthermore, window size is a critical issue, as it must capture the necessary signal features for correct classification. A small window may fragment a single behavior into multiple separate windows, resulting in truncated signals that lack the complete information describing the behavior. A large window may contain signals from multiple behaviors, leading to misclassification.

[0006] Some research has proposed the concept of dynamic sliding windows, which detect the start and end points of each behavior to determine the size of the time window, thereby improving recognition accuracy. However, most current research on dynamic sliding windows focuses on segmenting different behaviors. However, dividing windows based on behavior duration can introduce additional noise that affects classification results, while overly large sliding windows can reduce the real-time performance of recognition.

[0007] In summary, existing human behavior recognition methods mostly use fixed-length sliding windows for different behaviors. However, for complex and diverse human behaviors, a single fixed sliding window is not suitable for capturing the characteristics of different behaviors. Alternatively, some studies segment behaviors based on their characteristic differences and dynamically adjust the window size. However, the continuous occurrence of behaviors results in overly large segmentation windows, which easily introduces additional noise and reduces classification performance. Summary of the Invention

[0008] In order to solve the above problems, the present invention proposes a human behavior recognition method and system based on dynamic sliding windows, which divides the sliding window based on the duration of a single occurrence of different behaviors. It has good flexible adaptability to periodic behaviors and high recognition accuracy.

[0009] In order to achieve the above object, the present invention adopts the following technical solutions:

[0010] In a first aspect, the present invention provides a human behavior recognition method based on a dynamic sliding window, comprising:

[0011] Obtain a human behavior training set and extract periodic sampling points of human behavior;

[0012] According to the fitting of the periodic sampling points, a sliding window value is selected for each human behavior to construct a sliding window set;

[0013] The classifier models are trained according to the set fixed sliding window value and different sliding window values in the sliding window set to obtain a candidate model set;

[0014] Obtain a human behavior test set, and use a sliding window and the corresponding classifier model to perform behavior recognition on the human behavior test set;

[0015] Specifically including: determining the current sliding window value, and determining the starting boundary of the current sliding window based on the previous sliding window;

[0016] Select a sliding window value that matches the current sliding window in the sliding window set, and call the corresponding classifier model in the candidate model set;

[0017] If there is no sliding window value matching the current sliding window in the sliding window set, the classifier model corresponding to the fixed sliding window value is called in the candidate model set;

[0018] The behavior recognition results are obtained by using the called classifier model on the human behavior test set.

[0019] As an optional implementation method, the human behavior signal is subjected to FFT transformation, the absolute value of the transformed complex number is taken to obtain the amplitude spectrum, the amplitude spectrum is normalized and halved, the amplitude spectrum with the largest local increase is selected as the signal frequency, and the periodic sampling points are calculated based on the signal frequency.

[0020] As an optional implementation, the periodic sampling points obtained in the human behavior training set are merged. Specifically, if the absolute value of the difference between any two periodic sampling points does not exceed a set threshold, the maximum of the two periodic sampling points is taken to reconstruct the periodic sampling point set.

[0021] As an optional implementation, the process of selecting the sliding window value includes: using a kernel density analysis method to fit the periodic sampling points of different users in the periodic sampling point set, and according to the kernel density analysis results, selecting the frequency with the highest kernel density in the periodic sampling point set as the sliding window value.

[0022] As an optional implementation, the process of determining the starting boundary of the current sliding window includes: selecting a periodic sampling point of a minimum value closest to the current time in the previous sliding window as the starting point of the current sliding window.

[0023] As an optional implementation, in the process of selecting a sliding window value that matches the current sliding window in the sliding window set, the number of sampling points is set for each sliding window value in the sliding window set by expanding and contracting, so as to establish a sliding window interval for each sliding window value to match the current sliding window.

[0024] As an optional implementation, the process of matching with the current sliding window includes:

[0025] If the current sliding window falls within the sliding window interval of a certain sliding window, the classifier model corresponding to the sliding window is called in the candidate model set;

[0026] If the current sliding window does not fall within any sliding window interval, the current sliding window selects a fixed sliding window value and calls the corresponding classifier model in the candidate model set;

[0027] Until the behavior recognition of the human behavior training set is completed.

[0028] In a second aspect, the present invention provides a human behavior recognition system based on a dynamic sliding window, comprising:

[0029] a period extraction module, configured to obtain a human behavior training set and extract period sampling points of the human behavior;

[0030] a sliding window selection module configured to select a sliding window value for each human behavior based on a fit to the periodic sampling points to construct a sliding window set;

[0031] A model training module is configured to train a classifier model according to a set fixed sliding window value and different sliding window values in the sliding window set to obtain a candidate model set;

[0032] A behavior recognition module is configured to obtain a human behavior test set and perform behavior recognition on the human behavior test set using a sliding window and a corresponding classifier model;

[0033] Specifically including: determining the current sliding window value, and determining the starting boundary of the current sliding window based on the previous sliding window;

[0034] Select a sliding window value that matches the current sliding window in the sliding window set, and call the corresponding classifier model in the candidate model set;

[0035] If there is no sliding window value matching the current sliding window in the sliding window set, the classifier model corresponding to the fixed sliding window value is called in the candidate model set;

[0036] The behavior recognition results are obtained by using the called classifier model on the human behavior test set.

[0037] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein the computer instructions, when executed by the processor, perform the method described in the first aspect.

[0038] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.

[0039] Compared with the prior art, the present invention has the following beneficial effects:

[0040] The present invention proposes a human behavior recognition method and system based on a dynamic sliding window. The dynamic sliding window is suitable for complex and diverse human behaviors, focusing on the different periodic characteristics of multiple behaviors, and dividing the sliding window based on the duration of a single occurrence of different behaviors. It not only achieves good recognition effects for multiple behaviors, but also ensures low latency in recognition speed. It overcomes the shortcomings of existing sliding window segmentation that use fixed sliding windows or windows that are too large to obtain the best characteristics of different behaviors. It has good flexible adaptability to periodic behaviors and high recognition accuracy.

[0041] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0043] Figure 1 A schematic flow chart of a method for human behavior recognition based on a dynamic sliding window provided in Example 1 of the present invention;

[0044] Figure 2 The process of constructing the candidate model set provided in Example 1 of the present invention;

[0045] Figure 3 A schematic diagram of frequency calculation using FFT provided in Example 1 of the present invention;

[0046] Figure 4(a)-Figure 4(b) Schematic diagram of the boxplot method before and after screening outliers provided in Example 1 of the present invention;

[0047] Figure 5 A schematic diagram of periodic sampling points for kernel density fitting provided in Example 1 of the present invention;

[0048] Figure 6 A flow chart of the recognition process for a human behavior test set provided in Example 1 of the present invention;

[0049] Figure 7 A schematic diagram of a dynamically adjusted sliding window provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0050] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0051] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0052] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0053] In the absence of conflict, the embodiments of the present invention and the features thereof may be combined with each other.

[0054] Example 1

[0055] To address the problem that existing sliding window segmentation cannot obtain optimal features for different behaviors, this embodiment provides a dynamic sliding window-based human activity recognition method (DSWHAR) with good flexibility and high recognition accuracy for periodic behaviors. The method includes a training process and a recognition process.

[0056] Among them, in the training phase, by exploring the relationship between the optimal sliding window length and the signal spectrum of each target behavior, a candidate window set is established for the target behavior, and multiple classifiers are trained using different sliding windows; in the recognition phase, the latest prediction probability is used to dynamically select a suitable sliding window for the next prediction, and the corresponding classifier is used for final recognition.

[0057] In this embodiment, a human behavior recognition method based on a dynamic sliding window is provided. Figure 1 As shown, the following steps are included:

[0058] Obtain a human behavior training set and extract periodic sampling points of human behavior;

[0059] According to the fitting of the periodic sampling points, a sliding window value is selected for each human behavior to construct a sliding window set;

[0060] The classifier models are trained according to the set fixed sliding window value and different sliding window values in the sliding window set to obtain a candidate model set;

[0061] Obtain a human behavior test set, and use a sliding window and the corresponding classifier model to perform behavior recognition on the human behavior test set;

[0062] Specifically include:

[0063] Determine the current sliding window value and determine the starting boundary of the current sliding window based on the previous sliding window;

[0064] Select a sliding window value that matches the current sliding window in the sliding window set, and call the corresponding classifier model in the candidate model set;

[0065] If there is no sliding window value matching the current sliding window in the sliding window set, the classifier model corresponding to the fixed sliding window value is called in the candidate model set;

[0066] The behavior recognition results are obtained by using the called classifier model on the human behavior test set.

[0067] In this embodiment, if Figure 2 The following figure shows the process of building a candidate model set, which includes:

[0068] S1: Extracting behavioral cycles from human behavior based on fast Fourier transform (FFT);

[0069] In everyday activities, walking, running, and cycling can be considered periodic, while sitting and lying down are not. The average walking speed is between 90 and 130 steps per minute, which is a frequency of at least 1.5 Hz. In this embodiment, the accelerometer sampling frequency is 50 Hz, which satisfies the Shannon sampling theorem. Therefore, the time domain signals of different behaviors are synthesized using multiple sine waves based on the fast Fourier transform. The sine wave with the largest local amplification is then found as the behavior frequency, and the period is calculated.

[0070] Specifically, (1) the periodic sampling point set

[0071] The sampling frequency of the acceleration sensor is F s , behavior set A={a1,a2,…a m}, m represents the number of behaviors, user set S = {s1, s2, …s n}, n represents the number of users. Figure 3 The figure shows a schematic diagram of using FFT to calculate behavioral frequency. Ten seconds of user acceleration sensor data are selected and FFT transforms are performed on each of the three dimensions. The absolute value of the transformed complex number, i.e., the amplitude spectrum, is taken. The amplitude spectrum is normalized and halved to remove the influence of the DC component. The amplitude spectrum with the largest local increase is selected as the frequency of that signal segment.

[0072] The frequency F represented by the sampling point t is:

[0073] F=(t-1)*F s / N (1)

[0074] Where N represents the number of sampling points.

[0075] Repeat the above steps for other users, each user s j All get behavior a i The frequency of occurrence on different signal channels, and the periodic sampling points of the three channels are calculated based on the frequency:

[0076]

[0077]

[0078]

[0079] Finally, we get behavior a i The three periodic sampling point sets: P x ={p x,1 ,p x,2 ,…p x,n}, P y ={p y,1 ,p y,2 ,…p y,n}, P z ={p z,1 ,p z,2 ,…p z,n}.

[0080] (2) Outlier screening

[0081] For the periodic sampling point set P x , P y , P2, respectively use the box-line method to filter outliers and delete them. The outlier detection formula is:

[0082] e=x>Q3+1.5*(Q3-Q1)∧x <Q3-1.5*(Q3-Q1) (5)

[0083] Among them, Q1 is the lower quartile, that is, the 25% number after all the values in the sample are arranged from small to large; Q3 is the upper quartile, that is, the 75% number after all the values in the sample are arranged from small to large. Figure 4(a)-Figure 4(b) shown.

[0084] (3) Merge periodic sampling points

[0085] Repeat the above steps for different behaviors in set A to obtain the periodic sampling points G = {g1, g2, ... g m}, and finally merge multiple cycles in the set G if the following conditions are met:

[0086] |g i -g j |≤10 (6)

[0087] Sequentially select the larger of the two elements and reconstruct a new set of periodic sampling points W = {w1, w2, ... w k}(k≤n), k represents the number of cycles after merging.

[0088] (4) Sliding Window Set

[0089] For a single behavior, only one sliding window value is taken. In this embodiment, the kernel density analysis method is used to analyze the periodic sampling point set P x , P y , P zThe periodic sampling points of different users are fitted, and finally the number of periodic sampling points suitable for most people is selected.

[0090] The kernel density estimation formula is as follows:

[0091]

[0092] Where h is the bandwidth, K(x) is the kernel function,

[0093] K(x) satisfies the following conditions:

[0094] K(x)≥0 (8)

[0095] ∫K(x)dx=1 (9)

[0096] ∫xK(x)dx=0 (10)

[0097] ∫x 2 K(x)dx=0 (11)

[0098] K(x) selects the Gaussian kernel:

[0099]

[0100] like Figure 5 As shown, according to the results of kernel density analysis, the periodic sampling point set P is selected y The frequency with the highest kernel density is used as the sliding window value for this behavior.

[0101] S2: Construction of candidate model set

[0102] Using different sliding window values, pre-train multiple classifier models M = {m1,m2,…m k}; In addition, a fixed sliding window value w with t of 3s is selected fix , and for the fixed sliding window value w fix Also train the corresponding classifier m fix , M and m fix Constitute the candidate model set M={m1,m2,…m k ,m fix}.

[0103] In this embodiment, if Figure 6 The figure shows the recognition process of the human behavior test set based on the dynamic sliding window, which includes:

[0104] (1) Select sliding window

[0105] Behaviors generally occur continuously, so the historical data of the previous stage is used to determine the window size for the next prediction to ensure low latency in the recognition process. In addition, due to the lack of sufficient historical data in the first two predictions, a fixed sliding window value w is used. fix and its corresponding classifier m fix Implement classification.

[0106] The dynamic sliding window starts from the third prediction, selects the historical data of the acceleration y-axis 6s before, and uses FFT to calculate the period value of this signal. This period value is the sliding window value of the current prediction.

[0107] (2) Determine the starting boundary

[0108] The value of the sliding window should be consistent with the duration of a single behavior, and the starting point of the sliding window should coincide with the start time of a single behavior as much as possible to ensure better recognition effect.

[0109] After determining the current sliding window value W i After that, we need to determine the current sliding window W i The starting boundary of Figure 7 As shown, using the previous sliding window W i-1 , select the sampling point of the minimum value closest to the current time as the current sliding window W i The starting point of the sliding window is determined, thereby determining the current sliding window value and the starting boundary.

[0110] (3) Calling the classifier model

[0111] After determining the current sliding window value and starting boundary, the classifier model can be called to implement the final prediction process. Different users may exhibit varying speeds and durations of the same behavior, so the behavior period obtained using FFT may not be completely consistent with the sliding window set. However, when it comes to sliding window size, the differences between users of the same behavior are much smaller than the differences between different types of behavior.

[0112] Therefore, during the calling process, the sliding window values in the sliding window set are appropriately adjusted, that is, each sliding window value is expanded and contracted by 10 sampling points to establish a sliding window interval, so as to adapt to the periodic values of the same behavior of different users.

[0113] During the recognition process, the first two recognitions are predicted using the classifier model called by the fixed sliding window value. The third recognition is based on the dynamic sliding window. The size and starting boundary of the current sliding window are obtained using historical data, and the current sliding window is compared with the sliding window interval set.

[0114] If the current sliding window falls within the sliding window interval of a certain sliding window, the classifier model corresponding to the sliding window is called in the candidate model set;

[0115] If the current sliding window does not fall into any sliding window interval, the current sliding window selects the fixed sliding window value w fix , and call the corresponding classifier model m fix ;

[0116] Repeat the above steps until the behavior recognition of the human behavior training set is completed.

[0117] Experimental verification

[0118] The model is trained using the periodic behavior of the MHEALTH dataset, the algorithm is evaluated using test data, and the classification performance of the dynamic sliding window method is analyzed and compared with that of the fixed sliding window and other dynamic sliding window methods.

[0119] Table 1 provides information about the selected behaviors, where x represents the number of repetitions. The dataset was partitioned using simple random sampling, with training data generated from 80% of the subjects and test data generated from the remaining 20%.

[0120] Table 1 Periodic behavior in the MHEALTH dataset

[0121]

[0122] Behavior recognition is a multi-classification task. To comprehensively evaluate the performance of the classification model based on the classification of all categories, in addition to the accuracy, the precision, recall, F1-score, etc. are all macro-averaged. The statistical indicator values are first calculated for each class, and then the arithmetic mean is calculated for all classes.

[0123] Multiple LSTM classifiers were trained using a predefined set of sliding windows, and classification was achieved using a dynamic sliding window during the recognition process. The classification performance of the method of this embodiment was compared with that of a fixed sliding window on the MHEALTH dataset. The results are shown in Table 2, where FSW represents a fixed sliding window.

[0124] Table 2 Performance comparison between fixed-size sliding windows and DSWHAR

[0125]

[0126] The results in Table 2 show that the dynamic sliding window method outperforms the fixed sliding window method. Compared to the fixed sliding window method, DSWHAR achieves a 6% improvement in accuracy. The dynamic sliding window method of this embodiment segments the data sequence based on the time at which a single behavior occurs. This difference, unlike traditional fixed-size sliding windows, allows the features extracted within the dynamic sliding window to better represent the behavior. The method of this embodiment also demonstrates statistically significant improvements in precision, recall, and F1-score.

[0127] The above experiments were repeated with fixed sliding windows of different sizes and the results were compared, as shown in Table 3.

[0128] Table 3 Performance of fixed sliding windows of different sizes

[0129]

[0130] Research has shown that different window sizes affect the effectiveness of behavior recognition. Within a certain range, the F1-score increases significantly with window size. When the window size increases from 1s to 5s, the F1-score increases from 86.41% to 94.41%. When the window size is 5s, the classifier achieves optimal performance across all metrics, with an accuracy of 89.72%. The macro_P, macro_R, and macro_F1 metrics all exceed 89%. Sliding window classifiers with other lengths perform slightly worse. For long-duration dynamic behaviors in a dataset, relatively large windows can capture the full signal of the behavior as much as possible. Therefore, the model's classification performance generally improves with larger windows.

[0131] However, blindly increasing the window size is also unreasonable. Once the window length reaches a certain standard, further increasing the window may result in minimal performance improvement or even a decrease in performance. For example, in this experiment, when the window size was 7 seconds, the classifier's recognition accuracy was only 85.21%. This is because the large window contains multiple behaviors, which affects the recognition results. Furthermore, in practical applications, overly large windows can lead to longer recognition delays. A comparison of Tables 2 and 3 shows that selecting an appropriate window size can achieve the best classification performance in a fixed sliding window-based classification model, but it still lacks an advantage over the dynamic sliding window method.

[0132] To further verify the effectiveness of the DSHAR algorithm, it is compared with other dynamic sliding window methods. References MHM Noor, Z. Salcic, I. Kevin, and K. Wang, “Adaptive sliding window segmentation for physical activity recognition using a single tri-axial accelerometer,” Pervasive and Mobile Computing, vol. 38, pp. 41-59, 2017. A segmentation technique based on adjusting the window size according to signal probability is proposed. This method first specifies a small window size suitable for separating static and dynamic activities. This size is dynamically expanded when a transition activity is encountered. References Z. Sheng, C. Hailong, J. Chuan, and Z. Shaojun, “An adaptive time window method for human activity recognition,” pp. 1188-1192. The proposed dynamic sliding window method utilizes features in quasi-periodic signals for activity recognition. This method uses a pitch extraction algorithm to detect changes in behavior and uses the initial and end times as segmentation boundaries to then identify specific behaviors within the window.

[0133] This example compares the two aforementioned dynamic sliding window methods, abbreviated as ASWS and AATWM, respectively. To avoid interference from the classifier, this example uses the same classifier as the two dynamic sliding window methods. A decision tree is used, and the extracted features include the average value of the three-axis acceleration, the correlation between the three axes, and the spectral energy. The comparison results are shown in Table 4.

[0134] Table 4 Performance comparison between dynamic sliding window and DSWHAR

[0135]

[0136] Table 4 shows that the DSWHAR algorithm significantly improves on all metrics compared to the other dynamic sliding window methods. To determine the best classification performance for each behavior category, the confusion matrices for each behavior obtained using the three methods are analyzed, as shown in Tables 5-7, where columns represent predicted categories and rows represent actual categories.

[0137] Table 5. Matrix confusion of ASWS&DT normalized on the test dataset

[0138]

[0139] Table 6 AATWM&DT normalized matrix confusion for the test dataset

[0140]

[0141] Table 7. Normalized matrix confusion of DSWHAR&DT on the test dataset

[0142]

[0143]

[0144] Each cell in the confusion matrix represents the number of times the behavior in the row is classified as the behavior in the column. It can be seen that for most behaviors, the three algorithms have achieved good recognition results. The dynamic sliding window constructed by ASWS&DT can only be dynamically expanded based on the specified sliding window and cannot be shrunk. Therefore, it is not effective in identifying single behaviors with a short duration, such as running and cycling. The classification effect of the AATWM&DT method on periodic behaviors is better than that of the ASWS&DT method in various indicators, but for behaviors with small movement amplitudes and unclear correlation between data, such as bending forward at the waist, the method performs slightly worse. The method of this embodiment defines the characteristic differences of different behaviors from the perspective of the frequency domain. Experiments show that this method achieves high classification performance for all behaviors.

[0145] Example 2

[0146] This embodiment provides a human behavior recognition system based on a dynamic sliding window, including:

[0147] a period extraction module, configured to obtain a human behavior training set and extract period sampling points of the human behavior;

[0148] a sliding window selection module configured to select a sliding window value for each human behavior based on a fit to the periodic sampling points to construct a sliding window set;

[0149] A model training module is configured to train a classifier model according to a set fixed sliding window value and different sliding window values in the sliding window set to obtain a candidate model set;

[0150] A behavior recognition module is configured to obtain a human behavior test set and perform behavior recognition on the human behavior test set using a sliding window and a corresponding classifier model;

[0151] Specifically including: determining the current sliding window value, and determining the starting boundary of the current sliding window based on the previous sliding window;

[0152] Select a sliding window value that matches the current sliding window in the sliding window set, and call the corresponding classifier model in the candidate model set;

[0153] If there is no sliding window value matching the current sliding window in the sliding window set, the classifier model corresponding to the fixed sliding window value is called in the candidate model set;

[0154] The behavior recognition results are obtained by using the called classifier model on the human behavior test set.

[0155] It should be noted that the above modules correspond to the steps described in Example 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above Example 1. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.

[0156] In further embodiments, there is also provided:

[0157] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed by the processor, wherein when the computer instructions are executed by the processor, the method described in Example 1 is performed. For the sake of brevity, no further details are given here.

[0158] It should be understood that in this embodiment, the processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), off-the-shelf field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0159] The memory may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0160] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the method described in Example 1 is performed.

[0161] The method in Example 1 can be directly implemented as a hardware processor, or can be implemented using a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, it will not be described in detail here.

[0162] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in conjunction with this embodiment can be implemented using electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0163] Although the above describes the specific embodiments of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without any creative work are still within the scope of protection of the present invention.

Claims

1. A human behavior recognition method based on dynamic sliding window, characterized in that: include: Obtain a human behavior training set and extract periodic sampling points of human behavior; According to the fitting of the periodic sampling points, a sliding window value is selected for each human behavior to construct a sliding window set; The classifier models are trained according to the set fixed sliding window value and different sliding window values in the sliding window set to obtain a candidate model set; Obtain a human behavior test set, and use a sliding window and the corresponding classifier model to perform behavior recognition on the human behavior test set; Specifically including: determining the current sliding window value, and determining the starting boundary of the current sliding window based on the previous sliding window; Select a sliding window value that matches the current sliding window in the sliding window set, and call the corresponding classifier model in the candidate model set; If there is no sliding window value matching the current sliding window in the sliding window set, the classifier model corresponding to the fixed sliding window value is called in the candidate model set; The behavior recognition results are obtained by using the called classifier model on the human behavior test set.

2. The human behavior recognition method based on a dynamic sliding window according to claim 1, characterized in that: Perform FFT transformation on human behavior signals, take the absolute value of the transformed complex number to obtain the amplitude spectrum, normalize and halve the amplitude spectrum, select the amplitude spectrum with the largest local increase as the signal frequency, and calculate the periodic sampling points based on the signal frequency.

3. The human behavior recognition method based on dynamic sliding window according to claim 1, characterized in that: The periodic sampling points obtained in the human behavior training set are merged. Specifically, if the absolute value of the difference between any two periodic sampling points does not exceed a set threshold, the maximum of the two periodic sampling points is taken to reconstruct the periodic sampling point set.

4. The human behavior recognition method based on dynamic sliding window according to claim 1, characterized in that: The process of selecting the sliding window value includes: fitting the periodic sampling points of different users in the periodic sampling point set using a kernel density analysis method, and selecting the frequency with the highest kernel density in the periodic sampling point set as the sliding window value based on the kernel density analysis result.

5. The human behavior recognition method based on dynamic sliding window according to claim 1, characterized in that: The process of determining the starting boundary of the current sliding window includes: selecting a periodic sampling point of a minimum value closest to the current time in the previous sliding window as the starting point of the current sliding window.

6. The human behavior recognition method based on dynamic sliding window according to claim 1, characterized in that: In the process of selecting a sliding window value that matches the current sliding window in the sliding window set, the number of sampling points is set for each sliding window value in the sliding window set by expanding and contracting, so as to establish a sliding window interval for each sliding window value, so as to match the current sliding window.

7. The human behavior recognition method based on dynamic sliding window according to claim 6, characterized in that: The process of matching with the current sliding window includes: If the current sliding window falls within the sliding window interval of a certain sliding window, the classifier model corresponding to the sliding window is called in the candidate model set; If the current sliding window does not fall within any sliding window interval, the current sliding window selects a fixed sliding window value and calls the corresponding classifier model in the candidate model set; Until the behavior recognition of the human behavior training set is completed.

8. A human behavior recognition system based on dynamic sliding window, characterized in that: include: a period extraction module, configured to obtain a human behavior training set and extract period sampling points of the human behavior; a sliding window selection module configured to select a sliding window value for each human behavior based on a fit to the periodic sampling points to construct a sliding window set; A model training module is configured to train a classifier model according to a set fixed sliding window value and different sliding window values in the sliding window set to obtain a candidate model set; A behavior recognition module is configured to obtain a human behavior test set and perform behavior recognition on the human behavior test set using a sliding window and a corresponding classifier model; Specifically including: determining the current sliding window value, and determining the starting boundary of the current sliding window based on the previous sliding window; Select a sliding window value that matches the current sliding window in the sliding window set, and call the corresponding classifier model in the candidate model set; If there is no sliding window value matching the current sliding window in the sliding window set, the classifier model corresponding to the fixed sliding window value is called in the candidate model set; The behavior recognition results are obtained by using the called classifier model on the human behavior test set.

9. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 7 is completed.

10. A computer-readable storage medium, characterized in that Used to store computer instructions, which, when executed by a processor, complete the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Non-trimming video behavior identification predication method based on multi-size sliding window

    CN108615011A

  • Gesture recognition method and related device

    CN113064483A