WiFi-based gesture recognition method and device, electronic device, and storage medium
By converting the channel matrix of the WiFi signal into a specified power delay spectrum and performing sliding window processing, the NLOS feature matrix is constructed, which solves the problem of inaccurate gesture recognition in the existing technology and achieves a more accurate gesture recognition effect.
Patent Information
- Application Number
- CN202310073504.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-16
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2043-01-16
AI Technical Summary
In the existing technology, the NLOS change information caused by gesture changes in the CSI information of the WiFi signal is relatively similar to the LOS information and noise information, resulting in inaccurate gesture recognition.
By obtaining the channel matrix of the WiFi signal, converting it into a specified power delay spectrum, performing sliding window processing to remove noise and LOS channel power, constructing an NLOS feature matrix, and performing gesture recognition based on this matrix.
Effectively remove noise and LOS channel power, extract the actual power of NLOS channel caused by gesture changes, and achieve more accurate gesture recognition.
Smart Images

Figure CN116074835B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of gesture recognition, and in particular to a gesture recognition method and device based on WiFi, an electronic device, and a storage medium. Background Art
[0002] An important development direction of the next generation of wireless communication technology is the integration of communication perception / radar. In the future, WiFi signals will not only have the function of data transmission, but also have the function of sensing passive targets (referring to people or other targets without terminal devices). For example, the channel state information (CSI) of the LTF (Long Training Field) of the WiFi signal is used to locate, track, recognize gestures, and perform health detection (such as heartbeat, breathing) and other sensing behaviors of passive targets. Using gesture recognition of wireless signals can help users get rid of remote controls in smart home application scenarios and obtain a better long-distance control experience. For example: users can directly control TVs, Bluetooth headsets, etc. through gestures.
[0003] In the related art, the CSI information of the WiFi signal is extracted, and the features used for gesture classification are extracted from the CSI information, so that the gesture classification is performed with the extracted features. However, the information representing the NLOS (Not Line of Sight) change caused by the gesture change in the CSI information is similar to the information representing the LOS (Line of Sight) and the noise information. The denoising process of the CSI information is not ideal, and the gesture recognition using the features directly extracted from the CSI is not accurate enough. At present, there is an urgent need for a more accurate gesture recognition solution using WiFi signals. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a gesture recognition method and device for WiFi, an electronic device, and a storage medium, which are used to accurately realize gesture recognition with the help of the CSI of the WiFi signal.
[0005] On the one hand, the present application provides a gesture recognition method based on WiFi, comprising:
[0006] Obtain a channel matrix of a WiFi signal, and convert the channel matrix into a specified power delay spectrum; wherein the specified power delay spectrum includes powers of multiple sampling points;
[0007] Perform sliding window processing on the specified power delay spectrum with a search window of a preset length, and calculate the power sum of multiple sampling points in each search window during the sliding window process to obtain the maximum power sum during the sliding window process; wherein the step length of the sliding window processing is one;
[0008] Determine the sampling points in the search window corresponding to the maximum power sum as channel sampling points, and the sampling points outside the search window as noise sampling points;
[0009] Remove the channel sampling points corresponding to the maximum power from the channel sampling points, and subtract the power average of the noise sampling points from the power of the remaining channel sampling points to obtain the actual power of the remaining channel sampling points, and use the multiple actual powers as an actual power sequence;
[0010] Based on the actual power sequence corresponding to a plurality of consecutive information packets of the WiFi signal, an NLOS feature matrix is constructed, and gesture recognition is performed according to the NLOS feature matrix.
[0011] In one embodiment, acquiring a channel matrix of a WiFi signal and converting the channel matrix into a specified power delay spectrum includes:
[0012] Obtain multiple channel matrices of the WiFi signal in the antenna domain, and perform inverse Fourier transform on each channel matrix to obtain multiple time domain channel impulse responses;
[0013] Each time-domain channel impulse response is converted to obtain a plurality of single-sample power delay spectra;
[0014] Averaging processing is performed on the multiple single-sample power delay profiles to obtain the designated power delay profile.
[0015] In one embodiment, the step of obtaining a plurality of channel matrices of a WiFi signal in an antenna domain includes:
[0016] A plurality of channel matrices of a preamble sequence of a WiFi signal are obtained in an antenna domain; wherein the preamble sequence is an L-LTF 312.5 kHz subcarrier and / or a HE-LTF 78.125 kHz subcarrier.
[0017] In one embodiment, after acquiring a plurality of channel matrices of the WiFi signal in the antenna domain, the method further includes:
[0018] Each channel matrix is windowed using a preset window function.
[0019] In one embodiment, performing gesture recognition according to the NLOS feature matrix includes:
[0020] Cutting a sub-feature matrix of a specified length from the NLOS feature matrix, and converting the sub-feature matrix into a target image; wherein the specified length corresponds to a specified duration of receiving an information packet;
[0021] The target image is used as a trained gesture classification model to obtain gesture category information output by the gesture classification model.
[0022] In one embodiment, the gesture classification model is trained in the following manner:
[0023] Using a sample image in a sample data set as an input of a machine learning model to obtain a predicted category output by the machine learning model; wherein the sample image carries a gesture category label, and the sample image is obtained by converting a sub-feature matrix of an NLOS feature matrix;
[0024] adjusting a model parameter of the machine learning model according to a difference between the predicted category and the gesture category label;
[0025] The above process is repeated until the machine learning model converges to obtain a trained gesture recognition model.
[0026] In one embodiment, before using the sample image in the sample data set as the input of the machine learning model to obtain the predicted category output by the machine learning model, the method further includes:
[0027] Acquire multiple sample channel matrices of the WiFi signal, and convert each sample channel matrix into a sample power delay spectrum; wherein the multiple sample channel matrices correspond to multiple preset gesture categories;
[0028] Determine a corresponding NLOS sample feature matrix based on each sample power delay spectrum; wherein each NLOS sample feature matrix corresponds to a gesture category;
[0029] According to each NLOS sample feature matrix, a plurality of sample images are constructed, and gesture category labels corresponding to the NLOS sample feature matrix are added to the sample images;
[0030] The sample data set is constructed based on sample images to which gesture category labels are added.
[0031] On the other hand, the present application provides a gesture recognition device based on WiFi, comprising:
[0032] A conversion module, used to obtain a channel matrix of a WiFi signal and convert the channel matrix into a specified power delay spectrum; wherein the specified power delay spectrum includes the power of multiple sampling points;
[0033] A sliding window module, used to perform sliding window processing on the specified power delay spectrum with a search window of a preset length, and calculate the power sum of multiple sampling points in each search window during the sliding window process to obtain the maximum power sum during the sliding window process; wherein the step length of the sliding window processing is one;
[0034] A determination module, used to determine the sampling point in the search window corresponding to the maximum power sum as the channel sampling point, and the sampling point outside the search window as the noise sampling point;
[0035] A denoising module, used to remove the channel sampling points corresponding to the maximum power from the channel sampling points, and subtract the power average of the noise sampling points from the power of the remaining channel sampling points to obtain the actual power of the remaining channel sampling points, and use the multiple actual powers as an actual power sequence;
[0036] The recognition module is used to construct an NLOS feature matrix based on the actual power sequence corresponding to multiple consecutive information packets of the WiFi signal, and perform gesture recognition according to the NLOS feature matrix.
[0037] In addition, the present application provides an electronic device, the electronic device comprising:
[0038] processor;
[0039] a memory for storing processor-executable instructions;
[0040] Wherein, the processor is configured to execute the above-mentioned gesture recognition method based on WiFi.
[0041] In addition, the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor to complete the above-mentioned WiFi-based gesture recognition method.
[0042] The solution of the present application can convert the channel matrix into a specified power delay spectrum after obtaining the channel matrix of the WiFi signal. The values of the noise power, LOS channel power, and NLOS channel power in the specified power delay spectrum are larger, and the degree of discreteness is higher than the data in the channel matrix. After determining the sampling points of each channel through sliding window processing, the power of the LOS channel and the noise power can be effectively removed, thereby obtaining the actual power of the NLOS channel that can characterize the influence of gesture changes, and the NLOS feature matrix composed of the actual power of the NLOS channel can be used to achieve accurate gesture recognition tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.
[0044] Figure 1 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;
[0045] Figure 2 A flowchart of a gesture recognition method based on WiFi provided in one embodiment of the present application;
[0046] Figure 3 A schematic diagram of a NLOS feature matrix provided in an embodiment of the present application;
[0047] Figure 4 An embodiment of the present application provides Figure 2 Detailed flow chart of step 210;
[0048] Figure 5 An embodiment of the present application provides Figure 2 Detailed flow diagram of step 250;
[0049] Figure 6 A flowchart of a method for training a gesture recognition model provided in one embodiment of the present application;
[0050] Figure 7 A schematic diagram of a flow chart of a method for constructing a sample data set provided in an embodiment of the present application;
[0051] Figure 8 A block diagram of a gesture recognition device based on WiFi provided in one embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0053] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0054] like Figure 1 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 1 A processor 11 is taken as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the following embodiment. In one embodiment, the electronic device 1 can be a router, a communication terminal device (such as a mobile phone, a tablet computer), etc., for executing a gesture recognition method based on WiFi. The electronic device can be equipped with a transmitting antenna and a receiving antenna for transmitting and receiving WiFi signals. The following describes the scheme with the electronic device as the execution theme.
[0055] The memory 12 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0056] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by the processor 11 to complete the WiFi-based gesture recognition method provided by the present application.
[0057] In the smart home application scenario, the electronic device that executes the solution of the present application can be placed in a specified position in the scene (for example, the electronic device is a router, which is placed in the center close to the TV wall in the living room). In the process of transmitting and receiving WiFi signals, the electronic device can obtain channel state information through channel estimation. Since there are various objects in the actual scene (such as furniture, electrical appliances, people, etc.), WiFi signals will have various reflections, so there are multiple wireless channels between the transmitter and the receiver. When the user controls the smart home in the scene through various gestures (such as swinging arms, waving hands, etc.), since the positions of other obstacles in the scene remain unchanged, the channel state information can characterize the impact of gesture changes on the wireless channel. Therefore, the gesture recognition task can be performed with the help of channel state information.
[0058] However, the information representing the NLOS change caused by the gesture change in the channel state information is similar to the information representing the LOS and the noise information. When the channel state information is directly used for gesture recognition, the gesture recognition is often inaccurate due to the unsatisfactory denoising effect. To solve this problem, the present application solution converts the channel state information into a power delay profile (PDP), and then uses the power delay profile to complete the gesture recognition task. See the following description for details.
[0059] See also Figure 2 , is a flow chart of a gesture recognition method based on WiFi provided in an embodiment of the present application, such as Figure 2 As shown, the method may include the following steps 210 - 250 .
[0060] Step 210: Obtain a channel matrix of the WiFi signal, and convert the channel matrix into a specified power delay spectrum; wherein the specified power delay spectrum includes the power of multiple sampling points.
[0061] When transmitting and receiving WiFi signals, electronic devices can obtain a channel matrix as channel state information through channel estimation. After obtaining the channel matrix, the channel matrix can be converted into a specified power delay spectrum. The power delay spectrum describes the dispersion of the channel in time, that is, the power of the multipath channel. The specified power delay spectrum may include the power of multiple sampling points, and the multiple sampling points include a sampling point corresponding to the LOS channel, multiple sampling points corresponding to the NLOS channel, and multiple sampling points corresponding to the channel where the noise is located. Among them, the number of sampling points can be adaptively configured according to the hardware and software conditions of the electronic device.
[0062] Step 220: Perform sliding window processing on the specified power delay spectrum with a search window of preset length, and calculate the power sum of multiple sampling points in each search window during the sliding window process to obtain the maximum power sum during the sliding window process; wherein the step length of the sliding window processing is one.
[0063] Here, the length of the search window may be equal to the length of the OFDM (Orthogonal Frequency Division Multiplexing) prefix cycle. The length represents the number of sampling points that the search window can accommodate. In addition, the length represents the total amount of multipath channels.
[0064] The electronic device can perform sliding window processing starting from index 0 (the first sampling point position) of the specified power delay spectrum according to the search window, and add the powers corresponding to multiple sampling points in each search window during the sliding window process, and the sum of the powers of multiple sampling points in the search window.
[0065] The step size of the sliding window processing is one. After each power sum is calculated, continue to slide to replace a sampling point in the search window and recalculate a power sum. Exemplarily, the specified power delay spectrum includes the power of M sampling points, and the length of the search window is L. Then, the power sum of the first L sampling points of the M sampling points can be calculated first, and then the search window can be slid to calculate the power sum of the 2nd to L+1th sampling points; continue to slide the search window to calculate the power sum of the 3rd to L+2th sampling points. And so on, until the search window slides to the last sampling point of the specified power delay spectrum.
[0066] Through sliding window processing, the power sums corresponding to multiple sampling point combinations (the sampling points within the search window constitute one sampling point combination) can be obtained, and the maximum power sum can be determined therefrom.
[0067] Step 230: Determine the sampling points in the search window corresponding to the maximum power sum as channel sampling points and the sampling points outside the search window as noise sampling points.
[0068] The electronic device can determine that multiple sampling points in the search window corresponding to the maximum power sum are channel sampling points, the channel sampling points are sampling points corresponding to each wireless channel in the multipath channel, and the channel sampling points include a sampling point corresponding to the LOS channel and multiple sampling points corresponding to the NLOS channel. At this time, the sampling points outside the search window are noise sampling points, and the noise sampling points are sampling points corresponding to the channel where the noise is located.
[0069] Step 240: remove the channel sampling points corresponding to the maximum power from the channel sampling points, and subtract the power average of the noise sampling points from the power of the remaining channel sampling points to obtain the actual power of the remaining channel sampling points, and use the multiple actual powers as an actual power sequence.
[0070] Since the LOS channel is not affected by gesture changes, the power corresponding to the LOS channel needs to be filtered out. The electronic device can remove the channel sampling point corresponding to the maximum power from the multiple channel sampling points, and the channel sampling point is the sampling point corresponding to the LOS channel.
[0071] Noise can affect the power of all sampling points. Therefore, the power of the channel sampling point also includes the power of the noise, while the noise sampling point only includes the power of the noise. In this case, denoising can be performed with the help of the power of the noise sampling point.
[0072] The electronic device can calculate the power average of the powers corresponding to all noise sampling points, and the power average can be considered as the noise power contained in the power of each sampling point. The electronic device can subtract the power average from the power of the remaining channel sampling points (the sampling points corresponding to the NLOS channel) after removing the sampling point corresponding to the LOS channel, thereby obtaining the actual power of the remaining channel sampling points. After sorting the multiple actual powers in descending order or in descending order or in the order of arrangement of the corresponding sampling points, an actual power sequence is obtained.
[0073] Step 250: construct an NLOS feature matrix based on actual power sequences corresponding to a plurality of consecutive information packets of the WiFi signal, and perform gesture recognition according to the NLOS feature matrix.
[0074] For any information packet of the WiFi signal, the corresponding actual power sequence can be obtained through the process processing of the aforementioned steps 210 to 240. The electronic device can construct an NLOS feature matrix based on the actual power sequences corresponding to the continuous multiple information packets, and the NLOS feature matrix represents the power change of the NLOS channel caused by the gesture change. Here, the continuous multiple information packets can be multiple information packets that are actually sent continuously, or multiple information packets sampled from the multiple information packets that are actually sent continuously (for example: one information packet is sampled every other information packet).
[0075] See also Figure 3 , is a schematic diagram of a NLOS feature matrix provided in an embodiment of the present application, such as Figure 3 As shown, pdp i j represents the actual power of the jth NLOS channel corresponding to the i+1th information packet, where pdp0 1 、pdp0 2 、pdp0 3 ...pdp0 L-1 is the actual power sequence corresponding to the first information packet. It can be seen that each column in the NLOS feature matrix is the actual power in the actual power sequence corresponding to an information packet. Since the sending and receiving time of each information packet is different, the columns of the NLOS feature matrix are gradually added over time, thereby updating the NLOS feature matrix.
[0076] After the NLOS feature matrix is obtained, since the NLOS feature matrix can characterize the power change of the NLOS channel caused by the gesture change, the gesture recognition task can be performed according to the NLOS feature matrix.
[0077] Through the above measures, after obtaining the channel matrix of the WiFi signal, the channel matrix can be converted into a specified power delay spectrum. The values of noise power, LOS channel power, and NLOS channel power in the specified power delay spectrum are larger, and the degree of discreteness is higher than the data in the channel matrix. After determining the sampling points of each channel through sliding window processing, the power of the LOS channel can be effectively removed, and the noise power can be removed, so as to obtain the actual power of the NLOS channel that can be characterized by the change of gestures, and the NLOS feature matrix based on the actual power of the NLOS channel can be used to achieve accurate gesture recognition tasks. Compared with the solution of directly performing gesture recognition based on channel state information, the feature information representing gestures in the NLOS feature matrix in the solution of this application is more obvious, and the generalization ability is stronger in different application environments.
[0078] In one embodiment, see Figure 4 , provided in one embodiment of the present application Figure 2The detailed flow chart of step 210 is as follows: Figure 4 As shown, the method may include the following steps 211 to 213.
[0079] Step 211: Acquire multiple channel matrices of the WiFi signal in the antenna domain, and perform inverse Fourier transform on each channel matrix to obtain multiple time-domain channel impulse responses.
[0080] Among them, the antenna domain is affected by the number of transmitting antennas, the number of receiving antennas, the number of symbols, the number of IQ channels (2), and the number of infinite impulse response filter elements. In this case, multiple channel matrices can be obtained by transmitting one information packet.
[0081] For multiple channel matrices of the same information packet, the electronic device can perform an inverse Fast Fourier Transform (IFFT) on each channel matrix to obtain a channel impulse response (Cir) in the time domain corresponding to each channel matrix, also called a time domain channel impulse response (hCir).
[0082] Step 212: convert each time domain channel impulse response to obtain a plurality of single sample power delay profiles.
[0083] After obtaining multiple time-domain channel impulse responses, the electronic device can convert each time-domain channel impulse response respectively, thereby obtaining multiple single-sample power delay profiles. Here, the single-sample power delay profile is a power delay profile obtained by converting a single time-domain channel impulse response, and the single-sample power delay profile includes the power of multiple sampling points on a single sample.
[0084] Step 213: performing averaging processing on a plurality of single-sample power delay profiles to obtain a designated power delay profile.
[0085] The electronic device can perform averaging on multiple single-sample power delay spectra. Since each single-sample power delay spectrum includes the same number of sampling points, the average power of the first sampling point in each single-sample power delay spectrum on a single sample can be calculated to obtain the power of the first sample in the specified power delay spectrum. The average power of the second, third, and last sampling points on a single sample is calculated to obtain the power of each sampling point in the specified power delay spectrum. At this time, the power of multiple sampling points constitutes the specified power delay spectrum.
[0086] Through the above measures, the channel matrix as channel state information can be converted into a specified power delay spectrum.
[0087] In one embodiment, when the electronic device obtains multiple channel matrices of the WiFi signal in the antenna domain, it can obtain the preamble sequence of the WiFi signal in the antenna domain. The preamble sequence may be an L-LTF 312.5 kHz subcarrier, or the preamble sequence may be an HE-LTF 78.125 kHz subcarrier, or the preamble sequence may be a combination of an L-LTF 312.5 kHz subcarrier and an HE-LTF 78.125 kHz subcarrier.
[0088] In addition, the electronic device can also obtain the channel matrix of the effective signal of the WiFi signal for subsequent processing.
[0089] In one embodiment, after acquiring multiple channel matrices of the WiFi signal in the antenna domain, the electronic device may perform windowing processing on each channel matrix through a preset window function, so that the spectrum leakage in the channel matrix is more concentrated. Here, the window function may include but is not limited to a Hamming window.
[0090] In one embodiment, see Figure 5 , provided in one embodiment of the present application Figure 2 The detailed flow chart of step 250 is as follows: Figure 5 As shown, the method may include the following steps 251 to 252.
[0091] Step 251: cutting a sub-feature matrix of a specified length from the NLOS feature matrix, and converting the sub-feature matrix into a target image; wherein the specified length corresponds to a specified duration of receiving an information packet.
[0092] During the application process, the NLOS feature matrix is updated in real time. Since the gesture recognition task needs to be performed continuously, the electronic device can continuously cut out a sub-feature matrix of a specified length from the NLOS feature matrix. The specified length corresponds to the specified time length of receiving the information packet. For example, if a gesture can be completed within 2 seconds, the specified time length can be determined as 2 seconds, and the specified length is the number of information packets received within 2 seconds. If 50 information packets are received within 2 seconds, the nearest 50 columns are cut out as the sub-feature matrix.
[0093] After the sub-feature matrix is obtained by cutting, the electronic device can map the sub-feature matrix to RGB (Red Green Blue) space or HSV (Hue Saturation Value) space by image conversion to obtain a target image for gesture recognition.
[0094] Step 252: Using the target image as a trained gesture classification model to obtain gesture category information output by the gesture classification model.
[0095] The electronic device may input the target device into a trained gesture classification model, and process the target image through the gesture classification model to obtain gesture category information corresponding to the target device. Here, the gesture classification model may be trained by a machine learning model and used to classify predetermined types of gesture categories (which may include no gesture).
[0096] Through the above measures, with the help of machine learning methods, the target image converted from the sub-feature matrix cut out from the NLOS feature matrix can be processed to obtain gesture category information.
[0097] In one embodiment, before executing the gesture recognition method of the present application, a gesture recognition model may be trained. Figure 6 , is a flow chart of a method for training a gesture recognition model provided in an embodiment of the present application, such as Figure 6 As shown, the method may include the following steps 610 to 630.
[0098] Step 610: Use the sample image in the sample data set as the input of the machine learning model to obtain the predicted category output by the machine learning model; wherein the sample image carries the gesture category label, and the sample image is obtained by converting the sub-feature matrix of the NLOS feature matrix.
[0099] The sample data set includes a large number of sample images, and each sample image is obtained by converting the sub-feature matrix of the NLOS feature matrix. Each sample image carries a gesture category label, and the gesture category label indicates the gesture category corresponding to the sample image.
[0100] After the electronic device inputs the sample image into the machine learning model, it processes it through the machine learning model to output a predicted category. The predicted category is the output of the machine learning model during the training process.
[0101] Step 620: Adjust the model parameters of the machine learning model based on the difference between the predicted category and the gesture category label.
[0102] Step 630: Repeat the above process until the machine learning model converges to obtain a trained gesture recognition model.
[0103] The electronic device can evaluate the difference between the predicted category and the gesture category label of the sample image through a preset loss function, obtain the function value of the loss function, and adjust the model parameters of the machine learning model based on the function value.
[0104] After adjusting the model parameters, the process can return to step 610, re-input the sample image into the machine learning model, and re-adjust the model parameters based on the difference between the predicted category output by the machine learning model and the gesture category label. After multiple rounds of iterative training, when the function value of the loss function tends to be stable, the machine learning model can be considered to have converged. At this time, the converged machine learning model is used as the trained gesture recognition model.
[0105] Through the above measures, a gesture recognition model for recognizing gestures can be trained.
[0106] In one embodiment, before training the gesture recognition model, a sample dataset may be constructed. Figure 7 , is a flow chart of a method for constructing a sample data set provided in an embodiment of the present application, such as Figure 7 As shown, the method may include the following steps 710 to 740.
[0107] Step 710: Acquire multiple sample channel matrices of the WiFi signal, and convert each sample channel matrix into a sample power delay spectrum; wherein the multiple sample channel matrices correspond to multiple preset gesture categories.
[0108] In the application scenario, people of different body shapes make gestures to be recognized multiple times. At this time, the sample channel matrix of the WiFi signal can be obtained. The sample channel matrix is a channel matrix collected to construct a sample data set. Different sample channel matrices can correspond to a gesture category. For example, when a person makes a gesture for one hour, the collected sample channel matrix corresponds to the gesture category.
[0109] For each sample channel matrix, the electronic device can convert it into a corresponding sample power delay profile. Here, the conversion process can refer to the method of converting the channel matrix into a specified power delay profile in the previous text, which will not be repeated here.
[0110] Step 720: Determine a corresponding NLOS sample feature matrix based on each sample power delay spectrum; wherein each NLOS sample feature matrix corresponds to a gesture category.
[0111] For each sample power delay spectrum, the corresponding NLOS sample feature matrix can be determined therefrom. The NLOS sample feature matrix corresponds to a gesture category and contains the feature information generated by the corresponding gesture category for the NLOS channel. The process of determining the NLOS sample feature matrix from the sample power delay spectrum can refer to the process of determining the NLOS feature matrix from the specified power delay spectrum in the previous text, which will not be repeated here.
[0112] Step 730: construct multiple sample images according to each NLOS sample feature matrix, and add gesture category labels corresponding to the NLOS sample feature matrix to the sample images.
[0113] Step 740: construct a sample data set based on the sample images with gesture category labels added.
[0114] After obtaining multiple NLOS sample feature matrices, the electronic device can cut the multiple NLOS sample feature matrices into specified lengths respectively to obtain multiple sample sub-feature matrices, and convert each sample sub-feature matrix into a sample image respectively to obtain multiple sample images.
[0115] For each sample image, a gesture category label corresponding to the NLOS sample feature matrix where the corresponding sample sub-feature matrix is located is added to the sample image. After obtaining multiple sample images with gesture category labels added, the electronic device can construct a sample data set based on the multiple sample images.
[0116] Figure 8 is a block diagram of a gesture recognition device based on WiFi according to an embodiment of the present invention, such as Figure 8 As shown, the device may include:
[0117] The conversion module 810 is used to obtain a channel matrix of a WiFi signal and convert the channel matrix into a specified power delay spectrum; wherein the specified power delay spectrum includes power of multiple sampling points;
[0118] A sliding window module 820 is used to perform sliding window processing on the specified power delay profile with a search window of a preset length, and calculate the power sum of multiple sampling points in each search window during the sliding window process to obtain the maximum power sum during the sliding window process; wherein the step length of the sliding window processing is one;
[0119] A determination module 830 is used to determine that the sampling point in the search window corresponding to the maximum power sum is a channel sampling point, and the sampling point outside the search window is a noise sampling point;
[0120] A denoising module 840 is used to remove the channel sampling point corresponding to the maximum power from the channel sampling points, and subtract the power average of the noise sampling points from the power of the remaining channel sampling points to obtain the actual power of the remaining channel sampling points, and use the multiple actual powers as an actual power sequence;
[0121] The recognition module 850 is used to construct an NLOS feature matrix based on the actual power sequence corresponding to a plurality of consecutive information packets of the WiFi signal, and perform gesture recognition according to the NLOS feature matrix.
[0122] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned gesture recognition method based on WiFi, and will not be repeated here.
[0123] In several embodiments provided in the present application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0124] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0125] If the function is implemented in the form of a software function module 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 application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several 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 various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
Claims
1. A gesture recognition method based on WiFi, It is characterized in that include: Obtain a channel matrix of a WiFi signal, and convert the channel matrix into a specified power delay spectrum; wherein the specified power delay spectrum includes powers of multiple sampling points; Perform sliding window processing on the specified power delay spectrum with a search window of a preset length, and calculate the power sum of multiple sampling points in each search window during the sliding window process to obtain the maximum power sum during the sliding window process; wherein the step length of the sliding window processing is one; Determine the sampling points in the search window corresponding to the maximum power sum as channel sampling points, and the sampling points outside the search window as noise sampling points; Remove the channel sampling points corresponding to the maximum power from the channel sampling points, and subtract the power average of the noise sampling points from the power of the remaining channel sampling points to obtain the actual power of the remaining channel sampling points, and use the multiple actual powers as an actual power sequence; Based on the actual power sequence corresponding to a plurality of consecutive information packets of the WiFi signal, an NLOS feature matrix is constructed, and gesture recognition is performed according to the NLOS feature matrix.
2. The gesture recognition method based on WiFi according to claim 1, It is characterized in that The acquiring a channel matrix of a WiFi signal and converting the channel matrix into a specified power delay spectrum includes: Obtain multiple channel matrices of the WiFi signal in the antenna domain, and perform inverse Fourier transform on each channel matrix to obtain multiple time domain channel impulse responses; Each time-domain channel impulse response is converted to obtain a plurality of single-sample power delay spectra; Averaging processing is performed on the multiple single-sample power delay profiles to obtain the designated power delay profile.
3. The gesture recognition method based on WiFi according to claim 2, It is characterized in that The obtaining of multiple channel matrices of WiFi signals in the antenna domain includes: A plurality of channel matrices of a preamble sequence of a WiFi signal are obtained in an antenna domain; wherein the preamble sequence is an L-LTF 312.5 kHz subcarrier and / or a HE-LTF 78.125 kHz subcarrier.
4. The gesture recognition method based on WiFi according to claim 2, It is characterized in that After acquiring a plurality of channel matrices of the WiFi signal in the antenna domain, the method further includes: Each channel matrix is windowed using a preset window function.
5. The gesture recognition method based on WiFi according to claim 1, It is characterized in that The performing gesture recognition according to the NLOS feature matrix includes: Cutting a sub-feature matrix of a specified length from the NLOS feature matrix, and converting the sub-feature matrix into a target image; wherein the specified length corresponds to a specified duration of receiving an information packet; The target image is used as a trained gesture classification model to obtain gesture category information output by the gesture classification model.
6. The gesture recognition method based on WiFi according to claim 5, It is characterized in that The gesture classification model is trained in the following way: Using a sample image in a sample data set as an input of a machine learning model to obtain a predicted category output by the machine learning model; wherein the sample image carries a gesture category label, and the sample image is obtained by converting a sub-feature matrix of an NLOS feature matrix; adjusting a model parameter of the machine learning model according to a difference between the predicted category and the gesture category label; The above process is repeated until the machine learning model converges to obtain a trained gesture recognition model.
7. The gesture recognition method based on WiFi according to claim 6, It is characterized in that Before taking the sample images in the sample data set as inputs of the machine learning model to obtain the predicted categories output by the machine learning model, the method further includes: Acquire multiple sample channel matrices of the WiFi signal, and convert each sample channel matrix into a sample power delay spectrum; wherein the multiple sample channel matrices correspond to multiple preset gesture categories; Determine a corresponding NLOS sample feature matrix based on each sample power delay spectrum; wherein each NLOS sample feature matrix corresponds to a gesture category; According to each NLOS sample feature matrix, a plurality of sample images are constructed, and gesture category labels corresponding to the NLOS sample feature matrix are added to the sample images; The sample data set is constructed based on sample images to which gesture category labels are added.
8. A gesture recognition device based on WiFi, It is characterized in that include: A conversion module, used to obtain a channel matrix of a WiFi signal and convert the channel matrix into a specified power delay spectrum; wherein the specified power delay spectrum includes power of multiple sampling points; A sliding window module, used to perform sliding window processing on the specified power delay spectrum with a search window of a preset length, and calculate the power sum of multiple sampling points in each search window during the sliding window process to obtain the maximum power sum during the sliding window process; wherein the step length of the sliding window processing is one; A determination module, used to determine the sampling point in the search window corresponding to the maximum power sum as the channel sampling point, and the sampling point outside the search window as the noise sampling point; A denoising module, used to remove the channel sampling points corresponding to the maximum power from the channel sampling points, and subtract the power average of the noise sampling points from the power of the remaining channel sampling points to obtain the actual power of the remaining channel sampling points, and use the multiple actual powers as an actual power sequence; The recognition module is used to construct an NLOS feature matrix based on the actual power sequence corresponding to multiple consecutive information packets of the WiFi signal, and perform gesture recognition according to the NLOS feature matrix.
9. An electronic device, It is characterized in that The electronic device comprises: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to execute the gesture recognition method based on WiFi as described in any one of claims 1-7.
10. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and the computer program can be executed by a processor to complete the WiFi-based gesture recognition method according to any one of claims 1 to 7.
