A behavior recognition method and system based on transfer learning and WiFi
Through methods based on transfer learning and WiFi, CSI signals are extracted and time-frequency converted, and ResNet18 neural network is used to identify behaviors, which solves the accuracy problem of behavior recognition in cross-domain scenarios and achieves high-accuracy behavior recognition.
Patent Information
- Application Number
- CN202111327197.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-11-10
AI Technical Summary
Existing deep learning methods require a large number of training samples to achieve high behavior recognition accuracy when facing cross-domain scenarios, and are difficult to effectively identify human activities in cross-domain scenarios.
Using a behavior recognition method based on transfer learning and WiFi, the CSI signal sequence is collected, and after denoising, the behavior signal is extracted using principal component analysis and sliding windows, converted into a time-frequency diagram, and input into the pre-trained ResNet18 neural network for recognition.
It achieves high-accuracy behavior recognition in the case of few-sample learning, overcomes the problem of cross-domain scenarios, and achieves a recognition accuracy of 94.2%, adapting to changes in different environments and target distances.
Smart Images

Figure CN114048773B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of behavior recognition, and in particular to a behavior recognition method and system based on transfer learning and WiFi. Background Art
[0002] Human activity recognition is considered a core technology in the Internet of Things and can be applied to various scenarios such as health monitoring, smart home, and fall detection. Traditional methods using wearable devices and cameras have been widely used for human activity recognition. Experimenters can collect data from the movements of various parts of the human body by wearing multiple sensors. However, wearing devices for experiments is inconvenient and may not be able to perform passive detection. Wireless networks have attracted widespread attention for activity recognition due to their unique advantages, such as security, device-free, and specific mapping relationships between different activities and signal fluctuations. Activity recognition technology is based on the multipath effect caused by body movements that can be captured by wireless devices. Therefore, with the widespread deployment of wireless devices, received signal strength (RSS) and channel state information (CSI) can be obtained by utilizing wireless access points. Fine-grained information of the communication channel link is provided by CSI, while coarse-grained information is provided by RSS. Since CSI is more stable than RSS, it is used more frequently in Wi-Fi sensing, such as location and activity recognition. In behavior recognition, human activities can be divided into two categories: fine-grained activities and coarse-grained activities. Fine-grained activities usually refer to activities such as gesture recognition, breathing and heartbeat detection, while coarse-grained activities refer to behaviors such as running, jumping, and falling detection.
[0003] Generally speaking, CSI measurements are affected by environmental conditions, which makes the same person's behavior in different scenarios have different effects on the wireless link. The cross-domain problem means that the system needs to identify human activities in multiple scenarios. Due to different scenarios, the multiple effects produced by the human body are also quite different. In traditional deep learning methods, because the model cannot be pre-trained, traditional deep learning networks need to use a large number of training samples to obtain high accuracy, which is inefficient.
[0004] Therefore, when facing cross-domain scenarios and when behavioral data is difficult to obtain, it is particularly important to provide a behavior recognition method and system based on small sample learning, fewer training times, and high recognition accuracy. Summary of the invention
[0005] In order to solve the technical problem that the deep learning methods in the prior art need to use a large number of training samples to achieve high behavior recognition accuracy when facing cross-domain scenarios, the present invention proposes a behavior recognition method and system based on transfer learning and WiFi.
[0006] According to the first aspect of the present application, a behavior recognition method based on transfer learning and WiFi is proposed, comprising:
[0007] S1. Collect CSI signals of the environment where the mobile target is located at continuous moments and form a CSI signal sequence, and denoise the CSI signal sequence;
[0008] S2. Performing behavior segmentation on the denoised CSI signal sequence based on a behavior extraction algorithm, and extracting different behavior signals;
[0009] S3, converting the behavior signal into a time-frequency graph by short-time Fourier transform; and
[0010] S4. Input the time-frequency graph into a pre-trained neural network to identify and classify different behaviors.
[0011] By collecting the original CSI signal sequence and denoising the CSI signal sequence, and then using the behavior extraction algorithm to detect the start and end of different behaviors, the corresponding valid behavior signals are extracted and some invalid signals are excluded, reducing the cost of collecting data sets. The behavior signals are then converted into time-frequency graphs and imported into the neural network for training. Since its training samples are for valid behavior signals, this small sample learning-based method greatly improves recognition accuracy and can effectively overcome problems faced in cross-domain scenarios.
[0012] Preferably, collecting the CSI signal of the environment in which the mobile target is located at continuous moments in step S1 specifically includes: calculating the CSI channel matrix of the wireless signal propagating between the transmitter and the receiver, and the specific calculation formula of the CSI channel matrix is:
[0013] Y i =H i X i +N i ,i∈[1,n]
[0014] Among them, X i represents the transmitter's transmitted signal vector, Y i represents the received signal vector of the receiver, N i is a Gaussian white noise vector, H i represents the CSI channel matrix, n represents the number of subcarriers used to propagate the signal; the CSI channel matrix H i Specifically expanded as follows:
[0015] H=[h1,h2,…h i ],i∈[1,n]
[0016] Among them, h i Indicates the CSI signal value of each subcarrier; hi The specific calculation formula is:
[0017] h=|h|e jsinθ
[0018] Where |h| represents the amplitude of the subcarrier, and θ represents the phase of the subcarrier.
[0019] The CSI channel matrix is obtained according to the calculation formula of the CSI channel matrix, and then the CSI channel matrix is expanded to obtain the CSI signal value of each subcarrier in the CSI channel matrix.
[0020] Preferably, the denoising of the CSI signal sequence in step S1 specifically includes: denoising the CSI signal sequence using a Butterworth low-pass filter.
[0021] After being filtered by a Butterworth low-pass filter, the high-frequency components in the CSI signal are filtered out.
[0022] Preferably, the behavior extraction algorithm in step S2 specifically includes:
[0023] S21, performing dimensionality reduction processing on the CSI signal sequence by using a principal component analysis method, wherein each data packet index of a subcarrier in the CSI signal sequence is correspondingly converted into a plurality of principal components;
[0024] S22, selecting a plurality of the principal components from the plurality of the principal components and performing sum calculation to obtain a principal component sum;
[0025] S23, establishing a sliding window, taking the first data packet index of the CSI signal sequence as a starting point, using the sliding window to intercept the CSI signal sequence of multiple data packet index lengths each time, obtaining a summation sequence including multiple principal component sums, and calculating the variance of the summation sequence;
[0026] S24, traversing the CSI signal sequence by stepping the sliding window to obtain a variance sequence including a plurality of the variances, and calculating a median of the variance sequence;
[0027] S25, comparing the median value at different times with the environmental threshold, if the median value at a certain time is greater than the environmental threshold, then the time is taken as the behavior starting point, if the median value at a certain time drops to less than the environmental threshold, and the time is more than 4 seconds away from the behavior starting point, then the time is taken as the behavior ending point;
[0028] S26. Extract different behavior signals according to the behavior starting point and the behavior ending point.
[0029] By using the sampling principal component analysis method, the information of multiple variables can be represented by a small number of comprehensive variables to achieve the effect of dimensionality reduction, eliminate some useless data, and reduce the subsequent processing time. The use of the sliding window method to calculate the sum and variance of the principal components and finally the median can better reflect the trend of CSI signal changes caused by behavioral changes, and will not be overly sensitive to mutations at certain locations. The starting and ending points of the behavior are judged by comparing the median with the environmental threshold, thereby extracting different behavioral signals. This behavior extraction method can adapt to uncertain factors such as different environments and changes in the detection target distance, and effectively divide different behaviors.
[0030] Further preferably, the step S22 specifically includes: selecting the second, third and fourth principal components from the plurality of principal components for summation calculation to obtain the principal component sum.
[0031] The main information of the subcarriers in the original CSI signal is contained in the first few principal components corresponding to the dimensionality reduction. Since the first principal component discards more noise, only the second, third and fourth principal components are summed here, which basically contains all the valid information of the subcarriers.
[0032] Further preferably, the sliding window intercepts the CSI signal sequence of 200 data packet index lengths each time.
[0033] Further preferably, the setting standard of the environmental threshold is: measuring the median value of the environment in which the moving target is located within a period of time when the moving target is in a stationary state, and taking one tenth of the maximum measured median value as the threshold.
[0034] Further preferably, after step S25 and before step S26, the method further includes: extending the starting point of the behavior forward by 0.5 seconds, and extending the ending point of the behavior backward by 0.5 seconds.
[0035] There are errors in the result of dividing behaviors by comparing the median with the environmental threshold. In order to ensure that each behavior can be accurately extracted without being affected by the sudden change of the moving target, a larger threshold is usually used. Therefore, the error can be reduced by compensating the starting point and the end point of the behavior by 0.5s.
[0036] Preferably, the neural network in step S4 adopts a ResNet18 transfer learning network.
[0037] After training with the ResNet18 transfer learning network, different behaviors can be fully extracted
[0038] According to the second aspect of the present application, a behavior recognition system based on transfer learning and WiFi is proposed, comprising:
[0039] A CSI signal acquisition unit, configured to collect CSI signals of the environment in which the mobile target is located at continuous moments and form a CSI signal sequence, and denoise the CSI signal sequence;
[0040] A behavior signal extraction unit, configured to perform behavior segmentation on the denoised CSI signal sequence according to a behavior extraction algorithm, and extract different behavior signals;
[0041] A behavior signal conversion unit, configured to convert the behavior signal into a time-frequency graph by short-time Fourier transform;
[0042] The behavior recognition unit is configured to input the time-frequency graph into a pre-trained neural network, so as to recognize and classify different behaviors.
[0043] This application proposes a behavior recognition method and system based on transfer learning and WiFi. The original CSI signal sequence is first denoised by a Butterworth low-pass filter, and then the CSI signal sequence is reduced in dimension using the principal component analysis method. The second, third and fourth principal components generated after the principal component analysis method are summed to obtain the principal component sum. The sampling sliding window method traverses all data packet indexes in the CSI signal sequence to calculate the variance of the principal component sum sequence and the median of the variance sequence, and detects the starting and ending points of different behaviors by comparing the median with the environmental threshold, thereby extracting effective behavior signals. Then, the behavior signal is converted into a time-frequency diagram using a short-time Fourier transform. After preprocessing, the time-frequency diagram is placed in a pre-trained ResNet18 transfer learning network for identification and classification. This method has a small number of training times and a high recognition accuracy. The average recognition accuracy reaches 94.2%, which can effectively overcome cross-domain problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.
[0045] Figure 1 is a flow chart of a behavior recognition method based on transfer learning and WiFi according to an embodiment of the present invention;
[0046] Figure 2 is a WiFi signal reflection scene diagram according to a specific embodiment of the present invention;
[0047] Figure 3is a waveform diagram of an original CSI signal according to a specific embodiment of the present invention;
[0048] Figure 4 is a waveform diagram of an original CSI signal after being filtered by a Butterworth low-pass filter according to a specific embodiment of the present invention;
[0049] Figure 5 is a flow chart of a behavior extraction algorithm according to a specific embodiment of the present invention;
[0050] Figure 6 is a result diagram of behavior signal extraction according to a specific embodiment of the present invention;
[0051] FIG. 7( a ) is a time-frequency diagram corresponding to a human body jumping action according to a specific embodiment of the present invention;
[0052] FIG7( b ) is a time-frequency diagram corresponding to a human walking action according to a specific embodiment of the present invention;
[0053] FIG7( c ) is a time-frequency diagram corresponding to a human squatting action according to a specific embodiment of the present invention;
[0054] FIG7( d ) is a time-frequency diagram corresponding to a human leg-lifting action according to a specific embodiment of the present invention;
[0055] FIG. 7( e ) is a time-frequency diagram corresponding to all human body movements according to a specific embodiment of the present invention.
[0056] Figure 8 is a structural diagram of a ResNet18 transfer learning network according to a specific embodiment of the present invention;
[0057] Fig. 9 is a diagram of a transfer learning structure according to a specific embodiment of the present invention;
[0058] Fig.10 is a TSNE visualized classification result diagram according to a specific embodiment of the present invention;
[0059] Fig.11 is a confusion matrix diagram of behavior recognition according to a specific embodiment of the present invention;
[0060] Fig.12 4 is a block diagram of a behavior recognition system based on transfer learning and WiFi according to an embodiment of the present invention.
[0061] Explanation of the reference numerals: 1. CSI signal acquisition unit; 2. Behavior signal extraction unit; 3. Behavior signal conversion unit; 4. Behavior recognition unit. DETAILED DESCRIPTION
[0062] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.
[0063] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0064] Figure 1 FIG. 4 shows a flow chart of a behavior recognition method based on transfer learning and WiFi according to an embodiment of the present invention. Figure 1 As shown, the behavior recognition method includes the following steps:
[0065] S1. Collect CSI signals of the environment where the mobile target is located at continuous moments and form a CSI signal sequence, and denoise the CSI signal sequence.
[0066] Figure 2 FIG. 4 shows a WiFi signal reflection scene diagram according to a specific embodiment of the present invention. Figure 2 As shown, the wireless signal emitted by the transmitter is received by the receiver after being reflected by the environment such as walls and human bodies (moving targets). Therefore, the movement of the human body will affect the receiving frequency of the receiver, which is the Doppler effect. In the WiFi identification system, the CSI signal is very sensitive to environmental changes, so this embodiment performs behavior identification by collecting the CSI signal.
[0067] In a specific embodiment, the CSI signal acquisition process is as follows:
[0068] It is known that the CSI signal contains multiple subcarriers, and the subcarriers are composed of consecutive packet indices. In 802.11n, each multiple-input multiple-output link composed of multiple subcarriers uses orthogonal frequency division multiplexing technology, and each link has a unique channel frequency response caused by the CSI signal. The 802.11n WiFi network has 56 OFDM subcarriers in the 20MHZ band. By using the tools developed in the Intel 5300 network interface card, the CSI signal can be obtained from 30 subcarriers. Assume that the number of antennas for the transmitter and the receiver are N respectively. t and N r , the transmitter’s sending signal vector and the receiver’s receiving signal vector are X i and Y i , then in this multiple-input multiple-output link, the receiver's received signal vector can be expressed as:
[0069] Y i =H i X i +N i ,i∈[1,n]
[0070] Among them, N i is a Gaussian white noise vector, H i The CSI channel matrix represents the wireless signal propagating between the transmitter and the receiver, and n represents the number of subcarriers used to propagate the signal.
[0071] For each communication link, the CSI channel matrix H i Specifically expanded as follows:
[0072] H=[h1,h2,…h i ],i∈[1,n]
[0073] So each packet index to be analyzed will end up with N t ×N r ×30 CSI signal values. Among them, h i Indicates the CSI signal value of each subcarrier, h i The specific calculation formula is:
[0074] h=|h|e jsinθ
[0075] Where |h| represents the amplitude of the subcarrier, and θ represents the phase of the subcarrier.
[0076] After obtaining the CSI signal value of each subcarrier, the CSI signals of the human body's environment at consecutive moments are combined into a CSI signal sequence, and the CSI signal sequence is denoised.
[0077] In a preferred embodiment, the CSI signal sequence is then denoised by a Butterworth low-pass filter. Figure 3 shows a waveform diagram of an original CSI signal according to a specific embodiment of the present invention, Figure 4 FIG. 4 shows a waveform diagram of an original CSI signal after being filtered by a Butterworth low-pass filter according to a specific embodiment of the present invention. Figure 3 , Figure 4 As shown, the Butterworth low-pass filter filters out the high-frequency components in the CSI signal to achieve denoising of the CSI signal. In other implementations, other low-pass filters can also be used to denoise the CSI signal sequence, which is not further limited here.
[0078] S2. Based on the behavior extraction algorithm, the denoised CSI signal sequence is segmented and different behavior signals are extracted.
[0079] Figure 5 FIG. 4 shows a flow chart of a behavior extraction algorithm according to a specific embodiment of the present invention. Figure 5 As shown, in a specific embodiment, the behavior extraction algorithm specifically includes the following steps:
[0080] S21. Perform dimensionality reduction processing on the CSI signal sequence using a principal component analysis method, and each data packet index of a subcarrier in the CSI signal sequence is correspondingly converted into a plurality of principal components.
[0081] Through the sampling principal component analysis method, the main information of the subcarriers in the original CSI signal sequence is contained in multiple principal components. The information of multiple variables is represented by a small number of comprehensive variables to achieve the effect of dimensionality reduction, which can eliminate some useless data and reduce the subsequent processing time.
[0082] S22. Select several principal components from the plurality of principal components and perform sum calculation to obtain the principal component sum.
[0083] In a specific embodiment, the main information of the subcarriers in the original CSI signal is contained in the first few principal components corresponding to the dimensionality reduction. Since the first principal component discards more noise, only the second, third and fourth principal components of the multiple principal components are selected for summation calculation to obtain the sum of the principal components, which basically includes all the valid information in the original subcarriers.
[0084] S23, establishing a sliding window, taking the first data packet index of the CSI signal sequence as the starting point, using the sliding window to intercept the CSI signal sequence of multiple data packet index lengths each time, obtaining a sum sequence containing multiple principal components, and calculating the variance of the sum sequence.
[0085] In a specific embodiment, the packet transmission frequency is set to 200 Hz, that is, 200 data packet indexes are sent in 1 second, and the sliding window intercepts a CSI signal sequence of 200 data packet index lengths each time, and a sum sequence containing 200 principal components is calculated, and the variance of the sum sequence is calculated, thereby reflecting the changing fluctuation trend of the CSI signal.
[0086] S24. Use the step movement of the sliding window to traverse the CSI signal sequence to obtain a variance sequence including multiple variances, and calculate the median of the variance sequence.
[0087] In a specific embodiment, the median of the variance sequence is obtained using a sliding window method. The median can better reflect the trend of the CSI signal change caused by the behavior change and will not be overly sensitive to sudden changes at certain positions.
[0088] S25. Compare the median values at different times with the environmental threshold. If the median value at a certain time is greater than the environmental threshold, then this time is taken as the starting point of the behavior. If the median value at a certain time drops to less than the environmental threshold, and the distance between this time and the starting point of the behavior exceeds 4 seconds, then this time is taken as the ending point of the behavior.
[0089] In a specific embodiment, the standard for taking the value of the environmental threshold is: first measure the median value of the environment in which the human body is located within a period of time when the human body is in a static state, and take one tenth of the maximum median value measured during the period as the environmental threshold. In this embodiment, the environmental threshold is specifically set to 20. By comparing the median value with the environmental threshold, whenever a behavior occurs, the fluctuation frequency of the data becomes larger, that is, the fluctuation of the CSI signal becomes larger. When the median value is greater than the environmental threshold, it can be judged that the human body has started to perform a behavior action; conversely, when the median value drops to less than the environmental threshold, and the duration of the previous median value being greater than the environmental threshold exceeds 4 seconds, it can be judged that the human body has ended the action, so that the starting point and the end point of the behavior can be accurately judged even in the case of uncertain scenes.
[0090] In a preferred embodiment, a compensation of 0.5s is also made for the behavior starting point and the behavior ending point. Specifically, in order to ensure that each behavior can be accurately extracted without being affected by the sudden change when the human body is at rest, the environmental threshold (20) in this embodiment is relatively large, so there will be errors in dividing the behavior starting point and the behavior ending point by this environmental threshold. In order to reduce the impact of the error, this embodiment also makes a compensation for the behavior starting point and the behavior ending point. The specific compensation number is half the sampling rate (packet sending speed 200 / second), that is, 100 sampling points are added or subtracted from the measured behavior ending point and the behavior starting point, respectively, and the corresponding time is 0.5 seconds. After compensation, the behavior starting point is extended forward by 0.5 seconds, and the behavior ending point is extended backward by 0.5 seconds. This compensation method can adapt to different environments, changes in the detection target distance and other uncertain factors.
[0091] S26. Extract different behavior signals according to the behavior starting point and the behavior ending point.
[0092] Figure 6 FIG. 4 shows a result diagram of behavior signal extraction according to a specific embodiment of the present invention. Figure 6 As shown, based on the behavior extraction algorithm, whenever a behavior occurs, that is, when the frequency of data fluctuation increases, the behavior signal can be effectively cut out.
[0093] S3. Convert the behavioral signal into a time-frequency diagram through short-time Fourier transform.
[0094] FIG7(a) shows a time-frequency diagram corresponding to a human body jumping action according to a specific embodiment of the present invention, FIG7(b) shows a time-frequency diagram corresponding to a human body walking action according to a specific embodiment of the present invention, FIG7(c) shows a time-frequency diagram corresponding to a human body squatting action according to a specific embodiment of the present invention, and FIG7(d) shows a time-frequency diagram corresponding to a human body leg-lifting action according to a specific embodiment of the present invention. As shown in FIG7(a), FIG7(b), FIG7(c), and FIG7(d), in a specific embodiment, four behavioral signals of human body jumping action, walking action, squatting action, and leg-lifting action are finally extracted, and short-time Fourier transform is applied to these four behavioral signals to finally obtain power distribution in the time-frequency domain, i.e., a time-frequency diagram. FIG7(e) shows a time-frequency diagram corresponding to all human body actions according to a specific embodiment of the present invention.
[0095] S4. Input the time-frequency graph into the pre-trained neural network to identify and classify different behaviors.
[0096] In a specific embodiment, a pre-trained ResNet18 transfer learning network is used to train the time-frequency graphs corresponding to all human body movements. Figure 8 FIG. 4 shows a structure diagram of a ResNet18 transfer learning network according to a specific embodiment of the present invention. Figure 8 As shown in the figure, the ResNet18 transfer learning network includes 18 convolutional layers (CONV), one pooling layer (AVGPOOL) and one fully connected layer (FULLY CONNECTERD). Fig. 9 FIG. 4 shows a transfer learning structure diagram according to a specific embodiment of the present invention. Fig. 9 As shown in the figure, the ImageNet dataset is input into ResNet18 for transfer learning, and then input into the residual network layer for analysis together with the collected activity dataset (time-frequency diagram). After fine-tuning, the last fully connected layer is trained to finally identify and classify 4 types of human behavioral actions.
[0097] Fig.10 FIG. 4 shows a TSNE visualization classification result diagram according to a specific embodiment of the present invention, as shown in FIG. Fig.10As shown in the figure, after training with the ResNet18 transfer learning network, the four human behaviors can be better separated. Fig.11 FIG. 4 shows a confusion matrix diagram of behavior recognition according to a specific embodiment of the present invention. Fig.11 As shown in the figure, the recognition rate of the squatting action is 1, and the recognition result is accurate, while the other three actions are misidentified because of their similarities. Specifically, the classification results of the four human actions are shown in Table 1:
[0098]
[0099] Table 1
[0100] Among them, recall reflects the ability of ResNet18 transfer learning network to recognize positive samples. The higher the recall, the stronger the ability to recognize positive samples. Precision reflects the ability of ResNet18 transfer learning network to distinguish negative samples. The higher the precision, the stronger the ability to distinguish negative samples. F1-score is a combination of the two. The higher the F1-score, the more robust the ResNet18 transfer learning network.
[0101] This embodiment also compares the recognition accuracy of various neural network models. The specific comparison results are shown in Table 2:
[0102] Neural Network Model Accuracy time consuming AlexNet 85.00% 31m 12s Vgg11 91.67% 128m 20s vgg13 92.50% 224m 45s Vgg16 92.67% 242m 34s Vgg19 93.33% 276m 10s ResNet18 94.17% 32m 23s ResNet34 90.00% 52m 40s ResNet50 84.17% 69m 56s ResNet101 86.67% 112m 43s ResNet152 92.50% 137m 39s
[0103] Table 2
[0104] As can be seen from Table 2, the ResNet18 neural network model has great advantages in recognition accuracy and time consumption.
[0105] Based on the above behavior recognition method, the present invention also proposes a behavior recognition system based on transfer learning and WiFi. Fig.12 FIG. 4 shows a block diagram of a behavior recognition system based on transfer learning and WiFi according to an embodiment of the present invention. Fig.12 As shown, the behavior recognition system includes:
[0106] A CSI signal acquisition unit 1 is configured to collect CSI signals of the environment in which the mobile target is located at continuous moments and form a CSI signal sequence, and denoise the CSI signal sequence;
[0107] A behavior signal extraction unit 2, configured to perform behavior segmentation on the denoised CSI signal sequence according to a behavior extraction algorithm, and extract different behavior signals;
[0108] A behavior signal conversion unit 3, configured to convert the behavior signal into a time-frequency diagram through short-time Fourier transform;
[0109] The behavior recognition unit 4 is configured to input the time-frequency graph into a pre-trained neural network, so as to recognize and classify different behaviors.
[0110] The present invention proposes a behavior recognition method and system based on transfer learning and WiFi. First, the original CSI signals of the human body's environment at continuous moments are collected and composed into a CSI signal sequence. Then, the CSI signal sequence is denoised by a Butterworth low-pass filter. Then, the CSI signal sequence is reduced in dimension by using the principal component analysis method. The second, third and fourth principal components generated by the principal component analysis method are summed to obtain the principal component sum. The sampling sliding window method traverses all data packet indexes in the CSI signal sequence to calculate the variance of the principal component sum sequence and the median of the variance sequence. The starting point and end point of different activities are detected by comparing the median with the environmental threshold, thereby extracting effective behavior signals. Then, the behavior signal is converted into a time-frequency graph using a short-time Fourier transform. After preprocessing, the time-frequency graph is placed in a pre-trained ResNet18 transfer learning network for identification and classification. This method has a small number of training times and a high recognition accuracy. The average recognition accuracy reaches 94.2%, which can effectively overcome the cross-domain problem.
[0111] In the embodiments of the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device / system / method embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0113] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0115] Obviously, those skilled in the art can make various modifications and changes to the embodiments of the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and changes are within the scope of the claims of the present invention and their equivalents, the present invention is also intended to cover these modifications and changes. The word "comprising" does not exclude the presence of other elements or steps not listed in the claims. The simple fact that certain measures are recorded in mutually different dependent claims does not indicate that the combination of these measures cannot be used to profit. Any reference numerals in the claims should not be considered to limit the scope.
Claims
1. A behavior recognition method based on transfer learning and WiFi, characterized in that: The following steps are involved: S1. Collect CSI signals of the environment where the mobile target is located at continuous moments and form a CSI signal sequence, and denoise the CSI signal sequence; S2. Performing behavior segmentation on the denoised CSI signal sequence based on a behavior extraction algorithm, and extracting different behavior signals; Specifically include: S21, performing dimensionality reduction processing on the CSI signal sequence by using a principal component analysis method, wherein each data packet index of a subcarrier in the CSI signal sequence is correspondingly converted into a plurality of principal components; S22, selecting a plurality of the principal components from the plurality of the principal components and performing sum calculation to obtain a principal component sum; S23, establishing a sliding window, taking the first data packet index of the CSI signal sequence as a starting point, using the sliding window to intercept the CSI signal sequence of multiple data packet index lengths each time, obtaining a summation sequence including multiple principal component sums, and calculating the variance of the summation sequence; S24, traversing the CSI signal sequence by stepping the sliding window to obtain a variance sequence including a plurality of the variances, and calculating a median of the variance sequence; S25, comparing the median value at different times with the environmental threshold, if the median value at a certain time is greater than the environmental threshold, then the time is taken as the behavior starting point, if the median value at a certain time drops to less than the environmental threshold, and the time is more than 4 seconds away from the behavior starting point, then the time is taken as the behavior ending point; S26, extracting different behavior signals according to the behavior starting point and the behavior ending point; S3, converting the behavior signal into a time-frequency graph by short-time Fourier transform; and S4. Input the time-frequency graph into a pre-trained neural network to identify and classify different behaviors.
2. The method according to claim 1, characterized in that The step S1 of collecting the CSI signals of the environment where the mobile target is located at continuous moments specifically includes: calculating the CSI channel matrix of the wireless signal propagating between the transmitter and the receiver. The specific calculation formula of the CSI channel matrix is: Y i =H i X i +N i ,i∈[1,n] Among them, X i represents the transmitter’s transmitted signal vector, Y i represents the received signal vector of the receiver, Ni is the Gaussian white noise vector, H i represents the CSI channel matrix, n represents the number of subcarriers used to propagate the signal; the CSI channel matrix H i Specifically expanded as follows: H=[h1,h2,…h i ],i∈[1,n] Wherein, hi represents the CSI signal value of each subcarrier; the specific calculation formula of hi is: h=|h|ejsinθ Where |h| represents the amplitude of the subcarrier, and θ represents the phase of the subcarrier.
3. The method according to claim 1, characterized in that De-noising the CSI signal sequence in step S1 specifically includes: de-noising the CSI signal sequence using a Butterworth low-pass filter.
4. The method according to claim 1, characterized in that: The step S22 specifically includes: selecting the second, third and fourth principal components from the plurality of principal components for summation calculation to obtain the principal component sum.
5. The method according to claim 1, characterized in that The sliding window intercepts the CSI signal sequence of 200 data packet index lengths each time.
6. The method according to claim 1, characterized in that The setting standard of the environmental threshold is: when the moving target is in a stationary state, the median value of the environment in which it is located within a period of time is measured, and one tenth of the maximum median value measured is used as the threshold.
7. The method according to claim 1, characterized in that After step S25 and before step S26, the method further includes: extending the starting point of the behavior forward by 0.5 seconds, and extending the ending point of the behavior backward by 0.5 seconds.
8. The method according to claim 1, characterized in that The neural network in step S4 adopts the ResNet18 transfer learning network.
9. A behavior recognition system based on transfer learning and WiFi, characterized in that: include: A CSI signal acquisition unit, configured to collect CSI signals of the environment in which the mobile target is located at continuous moments and form a CSI signal sequence, and denoise the CSI signal sequence; A behavior signal extraction unit, configured to perform behavior segmentation on the denoised CSI signal sequence according to a behavior extraction algorithm, and extract different behavior signals; Specifically include: Performing dimensionality reduction processing on the CSI signal sequence by using a principal component analysis method, wherein each data packet index of a subcarrier in the CSI signal sequence is correspondingly converted into a plurality of principal components; Selecting a plurality of the principal components from the plurality of the principal components for summation calculation to obtain a principal component sum; Establishing a sliding window, taking the first data packet index of the CSI signal sequence as a starting point, using the sliding window to intercept the CSI signal sequence of multiple data packet index lengths each time, obtaining a summation sequence including multiple principal component sums, and calculating the variance of the summation sequence; Traversing the CSI signal sequence by stepping the sliding window to obtain a variance sequence including a plurality of the variances, and calculating a median of the variance sequence; Compare the median value at different times with the environmental threshold. If the median value at a certain time is greater than the environmental threshold, then this time is taken as the behavior starting point. If the median value at a certain time drops to less than the environmental threshold, and the distance between this time and the behavior starting point exceeds 4 seconds, then this time is taken as the behavior ending point. Extracting different behavior signals according to the behavior starting point and the behavior ending point; A behavior signal conversion unit, configured to convert the behavior signal into a time-frequency graph by short-time Fourier transform; The behavior recognition unit is configured to input the time-frequency graph into a pre-trained neural network, so as to recognize and classify different behaviors.
