Next Article in Journal
Thermodynamics of the Ising Model Encoded in Restricted Boltzmann Machines
Previous Article in Journal
Scale Enhancement Pyramid Network for Small Object Detection from UAV Images
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Novel Drinking Category Detection Method Based on Wireless Signals and Artificial Neural Network

1
School of Computer Science and Technology, Xi’an University of Posts and Telecommunications, Xi’an 710121, China
2
Shaanxi Key Laboratory of Network Data Analysis and Intelligent Processing, Xi’an 710121, China
3
Xi’an Key Laboratory of Big Data and Intelligent Computing, Xi’an 710121, China
4
School of Information Science and Technology, NorthWest University, Xi’an 701127, China
*
Author to whom correspondence should be addressed.
Entropy 2022, 24(11), 1700; https://doi.org/10.3390/e24111700
Submission received: 17 October 2022 / Revised: 15 November 2022 / Accepted: 17 November 2022 / Published: 21 November 2022
(This article belongs to the Topic Machine and Deep Learning)

Abstract

:
With the continuous improvement of people’s health awareness and the continuous progress of scientific research, consumers have higher requirements for the quality of drinking. Compared with high-sugar-concentrated juice, consumers are more willing to accept healthy and original Not From Concentrated (NFC) juice and packaged drinking water. At the same time, drinking category detection can be used for vending machine self-checkout. However, the current drinking category systems rely on special equipment, which require professional operation, and also rely on signals that are not widely used, such as radar. This paper introduces a novel drinking category detection method based on wireless signals and artificial neural network (ANN). Unlike past work, our design relies on WiFi signals that are widely used in life. The intuition is that when the wireless signals propagate through the detected target, the signals arrive at the receiver through multiple paths and different drinking categories will result in distinct multipath propagation, which can be leveraged to detect the drinking category. We capture the WiFi signals of detected drinking using wireless devices; then, we calculate channel state information (CSI), perform noise removal and feature extraction, and apply ANN for drinking category detection. Results demonstrate that our design has high accuracy in detecting drinking category.

1. Introduction

With the development of people’s living standards and the gradual enhancement of health awareness, the consumption demand for beverages is also rising. At the same time, it is beginning to show a diversified trend. People no longer focus on the function of thirst quenching, and prefer natural, low sugar, and healthy drinks [1,2]. In addition to providing water and other nutrients necessary for human life, different kinds of drinks play different roles in the human body. Some drinks have the function of dietotherapy and healthcare, and some drinks have the function of regulating body function [3].
According to research from the United States, drinking one or two glasses of beer a day can help bones be healthier [4]. For women, drinking one or two glasses of wine a day has the same effect [5,6]. However, researchers warn that the important thing is to drink in moderation; when things go too far, they will lead to osteoporosis. Many applications, however, would benefit from knowing the exact drinking category. For example, safety checks in public transport and adulterant identification. Security personnel need to know the category of liquid accurately to avoid dangerous liquids such as flammables and explosives being brought into public transportation and affecting people’s safety. At present, there are many counterfeit products on the market to confuse consumers, such as counterfeiting luxury perfumes, making milk with water and additives, making liquor with methanol, and counterfeit and shoddy medicines. Among them, methanol and counterfeit drugs are harmful to the human body.
Currently, many industries are solving this problem with some instruments. For example, drinking categories can be detected and drinking concentrations analyzed by conventional viscosity testing instruments [7,8,9,10]. However, these instruments are expensive and invasive. In addition, because the instruments need to be inserted into the probe for detection, it will contaminate the drinking.
In recent years, non-contact drinking category detection methods based on wireless signals such as radio frequency (RF) signals [11,12,13], Ultra-wideband (UWB) signals [14], etc. have been researched. For example, LiquID [14] uses UWB signals to measure the permittivity of liquids to detect drinking categories. However, these methods commonly rely on expensive equipment and these signals are not widely popularized in our daily life.
This paper introduces a novel drinking category detection method based on wireless signals and an artificial neural network that leverages WiFi signals to identify drinking categories, which are inexpensive and ubiquitous with WiFi devices. The intuition of our design is that when the WiFi signals propagate in different drinking, the signals will have different attenuation [15], which is the basis of the detection method based on the WiFi signals, which can be used as fingerprints to identify different drinking categories.
Our design employs a transmitter and a receiver, which are commercial off-the-shelf (COTS) devices, for transmitting and receiving wireless signals, respectively. The wireless signals are transmitted from the transmitter to the target to be tested and then propagated to the receiver through multiple paths. Different drinking categories have different multipath profiles, also known as CSI measurements, which can be leveraged to detect drinking categories.
One challenge is the noise in the CSI measurements, resulting in lower detection accuracy for drinking categories. Since WiFi devices are susceptible to interference, CSI measurements are noisy even in static environments without human activity. Moreover, because conventional denoising methods are only suitable for low-density noise, and the noise density in CSI measurements is higher, conventional denoising methods do not perform well in removing noises. To overcome this challenge, our design leverages a principal component analysis (PCA)-based CSI denoising method.
Another challenging problem is the need to extract effective features from the received wireless signals for drinking category detection. Different materials will change the propagation paths of wireless signals, resulting in different multipath effects. The detection method based on wireless signals detects the drinking categories by capturing multipath profiles of different drinks. Therefore, feature extraction is the basis of this method, and the effective features will improve the overall performance of our design. To remove the limitations, we extract fifteen time–frequency domain statistical features and then use ANN to detect and classify drinking categories.
Summary of Results: We built a model of our design using COST devices as a transceiver and evaluated it with six common drinking categories. Our experimental results show that our design can achieve high detection accuracy.
Contributions: Our design makes the following contributions:
  • It presents a novel drinking category detection method based on wireless signals and an artificial neural network. As a result, our design has high detection accuracy and high classification precision.
  • It demonstrates that ANN performs well in drinking category detection compared with traditional machine learning methods.

2. Materials and Methods

2.1. Sample Preparation

The beverage is a liquid for human or livestock drinking; it is a product with quantitative packaging for direct drinking or mixing or brewing with water in a certain proportion, where the ethanol content (mass content) does not exceed 0.5%. According to the general classification rules for beverages, beverages can be divided into 11 categories: packaged drinking water, fruit and vegetable juice, carbonated beverages, protein beverages, special purpose beverages, flavor beverages, tea beverages, coffee beverages, plant beverages, solid beverages, and other beverages.
The classification includes the following:
  • Carbonated beverages (soft drinks) refer to drinks filled with carbon dioxide gas under certain conditions, generally including Coke, Sprite, soda, etc.
  • Fruit and vegetable juice drinks refer to fruit and vegetable juice obtained directly from refrigerated or fresh vegetables and fruits without the addition of any foreign substances, and are made from fruit and vegetable juice with water, sugar, acid, or spices. Generally includes fruit juice, fresh juice, vegetable juice, mixed fruit and vegetable juice, etc.
  • Energy drinks (functional drinks) refer to a beverage that regulates human function to a certain degree by changing the composition and nutritional content percentage of the drink. According to energy drink categorization based on relevant references [16], they are considered functional drinks in a broad sense including polysaccharide beverages, vitamin beverages, mineral beverages, sports beverages, probiotic beverages, low-energy beverages, and other beverages with healthcare functions.
  • Tea drinks refer to tea products made by soaking the tea in water, extracting, filtering, or clarifying, and/or by adding water, sugar, sour, food flavors, and fruit juices into the tea soup. Generally includes green tea, black tea, oolong tea, wheat tea, herbal tea, fruit tea, etc.
  • Milk beverages refer to the products made from fresh milk or dairy products after fermentation or without fermentation, generally including milk, yogurt, milk tea, etc.
  • Coffee drinks are made from roasted coffee beans. Generally includes coffee.
In this paper, we investigate six kinds of drinks in all.

2.2. Preliminary about Wireless Sensing

Wireless sensing technology refers to the non-contact sensing technology for people and the environment through universal wireless signals, such as electromagnetic waves [17], light waves [18], and sound waves [19]. The technology has broad application prospects in the Internet of Things, artificial intelligence, healthcare, and national defense.
Taking the RF signal as an example, the principle of wireless sensing is that the wireless signal generated by the transmitter has physical phenomena such as direct reflection and scattering in the propagation process, thus forming multiple propagation paths, as shown in Figure 1. The multipath signal received at the receiver carries the information reflecting the signal propagation space. Wireless sensing technology obtains the characteristics of signal propagation space by analyzing the changes of wireless signals in the propagation process so as to realize scene sensing.
Compared with current sensing technology [20,21,22,23], it has the three following advantages: (1) sensorless, it is no longer necessary to deploy special sensors to sense people and environment, which is different from wireless sensor networks in which sensors are responsible for sensing and wireless signals are responsible for communication; (2) wireless, no need to deploy wired lines for communications and sensors; (3) contactless, compared with various wearable smart devices, users do not need to wear any devices.

2.3. Channel State Information

CSI describes how the WiFi signals propagate from the transmitter to the receiver [24], reflecting the impacts of signal propagation, such as scattering, attenuation, etc.
When the deployed device has n transmit antennas and m receive antennas, the system will receive m × n × s subcarriers at the receiver, where s is the number of subcarriers in each channel. In addition, the measured channel frequency response H ( f , t ) can be expressed by the following formula [25]:
H ( f , t ) = Y ( f , t ) X ( f , t )
where X ( f , t ) and Y ( f , t ) are the transmit signals and the received signals, and f and t are frequency and time, respectively.
Currently, there are two key methods for drinking category detection based on wireless signals, including received signal strength (RSS) and CSI.
The WiFi signals propagate through the target to the receiver via reflection, refraction, attenuation, etc., resulting in wireless signals distortion, which is known as the multipath effect. RSS is sensitive to the environment and is vulnerable to multipath propagation, which affects detection accuracy [26]. Furthermore, RSS-based detection methods do not give fine-grained channel data.
CSI describes how the physical environment affects the wireless signals [24]. Furthermore, CSI may provide fine-grained information about WiFi signal propagation—such as time delays, amplitude attenuation, and so on—of multipaths on each subcarrier, which can expose information about signal propagation.
Compared with RSS, CSI can obtain more fine-grained information and higher accuracy [27]; so, our design chooses the drinking category detection method based on CSI.
The WiFi-signal-based drinking category detection method relies on similar CIR measurements. To analyze whether WiFi signals can detect drinking categories, we plot the CSI magnitude images for different drinks in the same environment and the same drinks collected multiple times, as shown in Figure 2. From Figure 2, we can see that different drinks have different CSI magnitudes, which can be used as a fingerprint for drinking category detection. Meanwhile, the CSI magnitudes of the same drinking are similar, which proves the stability of our design.

3. Drinking Category Detection

Figure 3 shows the framework of the detection method, which includes data collection and noise removal, feature extraction, and detection in three main phases.

3.1. Data Collection and Noise Removal

Data Collection. Our design uses two wireless devices to collect CSI measurements at the receiver end of the wireless link, one as a transmitter and the other as a receiver. Current CSI-based detection methods collect CSI measurements using the PicoScenes tool [28,29], which uses the IWL 5300 NIC (Network Interface Card). Besides, the transmitter is a router and the receiver is a personal computer (PC) or laptop with NICs. For our design, we used an IWL 5300 NIC with two antennas as the receiver and a router as the transmitter. The sequence of CSI time series for each subcarrier for a given pair of transmitting and receiving antennas is called a CSI stream. Our design uses the PicoScenes tool to collect data; since our design sends a packet per millisecond, the system receives 1000 packets per second. In addition, after analysis by PicoScenes MATLAB Toolbox [30], 117 subcarriers are received.
Noise Removal. For the fluctuation of the collected CSI measurements due to the interference of factors such as internal CSI reference levels, transmission rates, and transmit power levels, CSI measurements frequently contain noise in the time domain and frequency domain. Therefore, the collected CSI measurements need to be denoised for further feature extraction and drinking category detection. In this paper, our design uses Principal Component Analysis (PCA) to remove noise [31,32,33,34], as detailed below.
Generally, the denoising steps of PCA include preprocessing, correlation estimation, eigendecomposition, and movement signal reconstruction. First, 1-second data are intercepted for each CSI stream and the average is calculated as a constant offset for each CSI stream, which is the average CSI amplitude. After that, the static path components in each CSI stream are removed by subtracting the corresponding offset from each stream. Next, the remaining CSI streams are formed into a matrix of C H . Then, we calculate the correlation matrix, denoted C H T × C H . The dimension of the matrix is n × n , where n is the CSI stream size and n = 117 . Next, we decompose the features of the correlation matrix to calculate its eigenvectors. Finally, we reconstruct the movement signal. We construct the principal components using the following equation:
p i = C H × e i
where e i and p i are separately the ith eigenvector and the ith principal component.
The first principal component p 1 contains noise and CSI reflected back by the target. The CSI measurements are also included in other principal components [31]; so, we discard p 1 and retain the remaining 30 principal components as denoised CSI measurements for feature extraction.
We plot the CSI measurements of different drinking categories before and after denoising, as shown in Figure 4. From Figure 4, we can find that there are differences in CSI measurements for different drinking before and after denoising, which can be used as a fingerprint for drinking category detection. Moreover, the CSI measurements after denoising are smoother, which proves that the noise has been removed.

3.2. Feature Extraction

Time domain statistics features [35,36] are extracted, such as standard deviation (STD), peak, Kurtosis, etc. We also extract the Frequency domain statistics features [37,38], including mean frequency (MF), root-mean-square frequency (RMSF), standard deviation frequency (STDF), etc. We merge them as the final detection feature, and the feature descriptions are shown in the following Table 1.
We plotted the box plots of the feature values, as shown in Figure 5. From Figure 5, we can see that the distribution of feature values of different drinking under each feature is different, which proves that our proposed features are effective to distinguish different drinking.
To analyze the necessity of the 15 features, we have verified the effectiveness of the features based on the F-test, and the results of the F-test are represented in a heat map, as shown in Figure 6. Each subplot is the F-test result for different drinking under one feature, and the rows and columns represent six types of drinking. The smaller the F-test result, the better—that is, the lighter color proves that the difference between the two drinking in the corresponding rows and columns under that feature is greater and they can be distinguished more easily by this feature. As we can see from the figure, there are multiple areas with lighter colors in each subplot, which proves that the F-test results are significant between multiple drinking under our feature. It shows that all of our features can clearly distinguish between more than two types of drinking, proving the validity of our features. Therefore, we do not need to redundantly remove features.

3.3. Detection

Our design uses a fully connected, feed-forward artificial neural network for drinking category detection, as shown in Figure 7. The input to the detection model is the features extracted above, and the output is the label of the drinking. Generally speaking, building and using a detection model are two steps, including training the model and using the model.
The extracted feature length determines the number of nodes within the input layer, and the drinking categories affect the number of nodes within the output layer. The detection model learns how to relate CSI measurements to different drinking categories based on the training data. Once the model has learned the mapping, it can easily be used to test the CSI measurements. We use the back propagation of the Stochastic Gradient Descent (SGD) method and the cross-entropy loss function to train the detection model, see Appendices Appendix A and Appendix B for details. The training cost of the model comes from two parts, including collecting and preprocessing training data, and building the detection model.

4. Experimental Results

4.1. Experimental Setup

Wireless devices setup. We employ a TL-WR886N router as the transmitter and an IWL 5300 NIC with a mini PC as the receiver to collect CSI. In our design, shown in Figure 8, we deploy the transmitter on one side and the receiver on the other side, the transmitter is 1 m from the receiver, and the drink to be tested is placed in the midline position between the two. Besides, the table is 1.2 m from the ground.
Drinking categories. In our design, we chose six common drinks as test targets, including Coke, freshly squeezed watermelon juice, RedBull energy drink, black tea, milk, and instant coffee. All drinks were purchased from the supermarket; so, the density and materials of the same drinks to be tested were kept fixed. During the data collection, the volume of all drinks to be tested was fixed at 300 mL, and the collection environment and container were kept constant.
Model Parameters. Our design utilizes s i g m o i d as the kernel function, the loss function is the Mean absolute error performance function (MAE), and the optimization problem is solved using Stochastic Gradient Descent (SGD).
Model Evaluation. In drinking category detection model, we consider the detection performance impact of different hidden layer numbers starting from two to ten and different numbers of neurons in the hidden layer from 100 to 1000. In addition, we compare our detection model with current common learning methods and we use cross-validation to evaluate our design.
Evaluation metrics. Four evaluation metrics, including accuracy, precision, recall, and f1-score, are used to evaluate the effectiveness of the proposed method in the experiment. When T P , T N , F P , and F N represent the true positive rate, the true negative rate, the false positive rate, and the false negative rate, respectively, the following equation may be used to calculate the above four evaluation metrics:
a c c u r a c y = T P + T N T P + T N + F P + F N
p r e c i s i o n = T P T P + F P
r e c a l l = T P T P + F N
f 1 s c o r e = 2 × p r e c i s i o n × r e c a l l p r e c i s i o n + r e c a l l .

4.2. Main Findings of the Evaluation

The main findings of evaluations are as follows:
  • Our method achieves about 87.9% accuracy for detecting the drinking categories. The results show that this method can successfully achieve drinking category detection, which promotes its actual implementation in further development.
  • Our system is novel and intelligent compared with current drinking category detection methods. The system’s novelty and intelligence are represented in the fact that it does not need any support of professional devices and it can be achieved using commercial devices. However, our design only provides a prototype framework; more drinking categories can be detected and additional intelligent functions can be developed in the future.

4.3. Overall Performance

In all detection models, we fixed the training datasets and test datasets. Besides, we used the evaluation metrics above to evaluate the detection performance, which is shown in Figure 9a. Besides, we plot the confusion matrix for the performance of our design, as shown in Figure 9b. Note that in the experiment, we use a seven-layer ANN with 500 nodes to detect the drinking category.
Figure 9 shows the drinking category detection performance in the violin plot. It can be seen from Figure 9 that our design can detect the drinking category with an accuracy of 87.9%, and the average precision, recall, and f1-score of drinking detection are 88.3%, 87.9%, and 87.8%, respectively.

4.4. The Network Parameters

In the parameter adjustment of neural network, the number of hidden layer nodes and the number of layers are also used closely, which can fully adjust the effect of neural network. The activation function and model complexity control play a major role. In the process of neural network training, parameter adjustment is through continuous attempt and running, and it is a common optimization method to adjust the four parameters in the neural network model. These parameters need to be combined continuously to achieve the best model. The most typical parameters are the number of hidden layers, the number of nodes in each hidden layer, and the loss function. Thus, in the experiment, we evaluate the three parameters.

4.4.1. Number of Hidden Layers

The results show that a seven-layer ANN will be the better choice of our design.
More network layers can better help the network capture relationships, but can also lead to overfitting. Therefore, to evaluate the impact of hidden layers on the method performance, we increase the number of hidden layers from two layers to ten layers. The convolution kernel structure is the same in the experiment and the results of evaluation metrics are shown in Figure 10. The experimental results show that detection performs well when the ANN used is seven layers.
As can be seen from Table 2, the accuracy of eight layers is the highest, which is 88.79%; seven layers have the second highest accuracy of 88.62%; and the three-layer accuracy is the lowest, which is 86.04%. The difference between the seven-layer and eight-layer accuracy is about 0.1%, which can be ignored, and the difference from the lowest accuracy is about 3%. The more hidden layers, the higher the training time. Besides, from Figure 10, we can see that the seven-layer accuracy distribution is more compact; so, our design finally chooses seven layers as the most suitable number of hidden layers—of course, eight layers can also be chosen.

4.4.2. Number of Neurons in Hidden Layer

The results demonstrate that 500 is an excellent choice for ANN nodes at each layer.
When the number of nodes in the network is too large, the information processing ability is enhanced, causing the limited amount of data included in the training dataset to not be enough to train all the neurons in the hidden layer, and it is difficult to obtain the expected effect. In order to properly choose the number of nodes for each layer in ANN, we choose the number of nodes in each layer from 100 to 1000 to compare the performance improvements. It should be noted that the network structure employed in the models is the same. Figure 11 shows how the number of ANN layer nodes impacts the detection performance. As shown in Figure 11, when the number of nodes is 500, our design achieves pretty high accuracy in drinking category detection.
As can be seen from Table 3, when the number of nodes in ANN hidden layers is 500, the accuracy of the drinking category detection model is the best, which is 91.8%. When the number of nodes is 300, the accuracy of the detection model is the worst, about 84%. Compared with other node numbers, the difference between the highest and lowest accuracy is about 8%, which is about 4% higher than the average accuracy. Therefore, 500 nodes are the best choice, and the detection performance is the best at this time.

4.4.3. The Different Loss Function

Experimental results show that using MAE as loss function has higher detection accuracy.
The loss function is a measure of the performance of the prediction model. No loss function can be applied to all types of data. In order to select the loss function suitable for the drinking category detection model, we selected the loss function including MAE, Mean squared error performance function (MSE), Sum absolute error performance function (SAE), Sum squared error performance function (SSE), and Cross-entropy performance function (CE) to compare their performance. The network structure used in the model is the same. Figure 12 shows how different loss functions affect the detection performance. As shown in Figure 12, when the loss function is MSE, the performance of drinking category detection is the best.
As can be seen from Table 4, when the loss function is MAE, the performance of the drinking category detection model is the best (88.8%) and the time complexity is good (2.8). When the loss function is MSE, the accuracy is the second best, which is 0.75% lower than the highest accuracy, but the time complexity is 2.5 higher than MAE. When the loss function is CE, the performance of the model is the worst (54.1%) and the time complexity is the best (1.3). Therefore, the loss function selected as MAE is the most suitable, with the best performance and good time complexity.

4.5. The Different Detection Models

The results show that the ANN detection model has a significant performance improvement compared with other detection models.
To evaluate the drinking category detection performance, we compare ANN with three commonly used learning methods including SVM (Supported Vector machine), RF (Random Forest), and KNN (K-Nearest Neighbor). The results are shown in Figure 13. From Figure 13, we can see that ANN has the best detection performance compared with other algorithms.
From Table 5, we can see that the performance of traditional machine learning algorithms for drinking category detection does not vary much, with an average accuracy of about 75%. The ANN model has the best detection performance, higher than 88%, and the SVM is the next best, at about 78%. Therefore, the best performance for drinking category detection is achieved when ANN is chosen for the detection model.

5. Discussion

There is still potential for improvement in terms of the performance of our design, and we will discuss various points below.
Feasibility. Since our design requires a fixed transceiver, changes in device deployment may require the re-collection of fingerprints in real-world scenarios. We believe this will not be a problem as we can solve it using transfer learning. For the drinking category detection model used in this paper, in addition to the above six drinking categories, other types of drinking can also be added to the training dataset, allowing our design to identify more drinking categories. However, the increase in the variety of drinks may affect the detection performance;, we can extract other features that are better suited for drinking category detection, which is beyond the scope of this paper and will be the subject of future research.
Depending on particular hardware cards. In order to collect CSI measurements, specific NICs in the Linux system, which includes IWL 5300 NICs and Atheros NICs, must be used. However, both wireless transmitters and NICs are commercial devices, and they are quite inexpensive—for example, the IWL 5300 network card, costs around USD 3. With the growth of smart houses, wireless transmitters may become widespread. Furthermore, as CSI-based detection applications proliferate and mature, CSI will be accessible to upper layers via most NICs in the foreseeable future.
Target. The purpose of this paper is to detect drinking categories, and the drinking to be tested is a single category. We have not detected mixed drinking categories. Besides, there is research on adulterants identification based on wireless signals [12,14,47,48], and we have performed some validation experiments, but this is our future work.
Impact factors. Our design assumes no human activity in the current environment when detecting the drinking category, which is the assumption of most current wireless-signal-based detection methods. When the environment is noisy or there is human activity, the CSI measurements received at the receiver are mixed signals [24,27] of the target signals and environmental noise and they are difficult to separate. However, we believe that by combining the method of Wang [49] and Venkatnarayan [34], the noisy signals can be separated to improve the detection performance, which is our work in the future. Because the application scenario of our design is security check and self-checkout, all drinks are purchased from supermarkets, and the density and material of the same drinks to be tested are kept fixed. In addition, we designed experiments and found that the CSI measurements of different drinking in different equipment deployments, volumes, and container shapes are different and can be used as fingerprints to detect drinking categories. Furthermore, humidity has little impact on the propagation of WiFi signals [50]. In the actual application, we can re-collect data in a new environment to perform the detection.

6. Related Work

Material identification techniques play an important role in industry [51,52], technology, etc. For example, Zhou et al. [51] proposed a tool wear condition monitoring method in small samples. Dhekne et al. [14] distinguished between Diet Coke and Pepsi by UWB signals. Our work focuses on designing a novel drinking category detection method based on wireless signals and an artificial neural network. Current drinking category detection technologies are generally divided into four types: instrument-based methods, wireless-signal-based methods, sensor-based methods, and optical-based methods. We will introduce them as follows. Table 6 shows these methods and their differences from our design.
Instrument-based methods. This method utilizes the differences in chemical properties of different drinking, applies instruments to analyze them, and then detects the target [7,8,9,10]. For example, Agilent Technologies [10] uses the instrument to measure the permittivity of the target to be measured, and since different drinking has different permittivity, it can be used to detect drinking. However, this method requires that the chemical properties of the different drinking are significantly different; otherwise, the detection performance is significantly reduced. Moreover, the method with an instrument is contacting, which means that it can contaminate the drinking to be measured.
Wireless-signal-based methods. This method utilizes the propagation characteristics of wireless signals through the target drinking to detect the drinking category. Currently, there are several popular wireless-signal-based liquid detection methods: based on RF signals [11,12,13,53], based on UWB signals [14,54], radar-based signals [48,55]. For example, TagScan [12] detects liquids by extracting the Received Signal Strength Indicator (RSSI) and phase changes from the RF signals. However, this method requires a complicated setup and is time-consuming to label each target. LiquID [14] identifies liquids based on UWB signals by estimating the permittivity. However, UWB signals are not universal in daily life. FG-LiquID [48] identifies 30 different liquids based on Radar signals. However, radar devices are expensive and radar signals interfere with noise.
Optical-based methods. This method analyzes the optical spectra of different liquids by obtaining information about the optical absorption or reflection from the liquid to detect the target [56,57,58]. For example, Al-light [56] utilizes the principles of near-infrared spectroscopy to detect alcohol concentration. However, the method requires specialized equipment and professional people to operate it.
Table 6. Drinking category detection related work.
Table 6. Drinking category detection related work.
ModelsProsCons
Instrument-based
methods
Equipment [7,8,9,10]high accuracyequipment maintenance
drinking contaminate
Wireless-signal-based
methods
RF [11,12,13,53]estimate the horizontal
cut images of targe
waste resources
UWB [14,54]identify a wide varietynot universal signals
radar [48]adulterants differentiationaffected by noise
Optical-based
methods
Device [56,57,58]fine-grained detectionspecialized equipment
professional people operate

7. Conclusions

This paper presents a novel drinking category detection method based on wireless signals and an artificial neural network, which identifies which category (i.e., Coke, tea, milk) contains the detected target. A convolution kernel is first used to extract features automatically; then, ANN is used to detect the target. A large number of experiments are performed to demonstrate the effectiveness of the method, including model parameters comparison and currently used model comparison. Experimental results demonstrate the effectiveness of our design, which can achieve about 88% accuracy in multiclass classification. We believe that combined with multicategory detection and considering more interference factors and more drinking categories in current drinking category detection systems, the system can be more intelligent, which is beyond the scope of this paper and will be our future work.

Author Contributions

Conceptualization, J.Z. and Z.W.; methodology, J.Z.; software, K.Z.; validation, J.Z., K.Z., and R.B.; investigation, R.B.; data curation, K.Z.; writing—original draft preparation, J.Z.; writing—review and editing, Z.W.; visualization, J.Z.; project administration, J.Z.; funding acquisition, J.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This work is supported by the Natural Science Foundation of China (62002287), and Key research and development plan of Shaanxi Province—General Projects (2022SF-037).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
NFCNot From Concentrated
CSIChannel State Information
ANNArtificial Neural Network
RFradio frequency
UWBUltra-wideband
COTScommercial off-the-shelf
PCAprincipal component analysis
RSSreceived signal strength
NICNetwork Interface Card
STDstandard deviation
MFmean frequency
RMSFroot-mean-square frequency
STDFstandard deviation frequency
SGDStochastic Gradient Descent
MAEMean absolute error performance function
MSEMean squared error performance function
SAESum absolute error performance function
SSESum squared error performance function
CECross-entropy performance function

Appendix A. ANN

Artificial neural networks (abbreviated ANN), also referred to as connection models or neural networks, are mathematical models of information processing that use a structure comparable to the synaptic connections of brain nerves. The neural network is simply to connect neurons to form a network, and it is characterized by multiple layers and full connection between neurons—that is, the neurons of the latter layer will be connected to each neuron of the former layer.
Generally, the input layer is the network’s leftmost layer, and the neurons in it are called the input neurons. The rightmost and output layers contain output neurons. The middle layer is known as the hidden layer because the neurons inside are neither input nor output. Neurons are the fundamental building blocks of neural networks, and there are multiple kinds of neurons. In this paper, we use s i g m o i d as the neurons and activation function of the network, which can be calculated as the following equation:
σ ( z ) = 1 1 + e ( z ) .
The neural network function is such that we provide it with a large amount of data (both input and output) for training in advance. After training, we hope it can also give a satisfactory output for the input of real environments. Therefore, we use the loss function, which can be represented by the difference between the real output and predicted output.
For a three-layer artificial neural network, it can be represented by the following equation:
f ( x ) = G ( b ( 2 ) + W ( 2 ) ( s ( b ( 1 ) + W ( 1 ) x ) ) ) .
For the input layer, what you input is the input of input layer. For example, there are n neurons if the input is an n-dimensional vector. For the hidden layer, which is fully connected with the input layer, the output of the hidden layer is f ( w ( 1 ) x + b ( 1 ) ) while supposing that the input layer is presented by vector x, and w ( 1 ) is the weight (also known as the connection coefficient), b ( 1 ) is the offset, and f can be a commonly used t a n h function or s i g m o i d function. The following equation may be used to calculate the t a n h function:
t a n h ( z ) = e z e z e 2 + e z .
Indeed, the hidden layer to the output layer may be considered as a multi-category logical regression—that is, s o f t m a x regression, the output of the output layer is s o f t m a x ( W ( 2 ) x 1 + b ( 2 ) ) , and x 1 represents the output f ( W ( 1 ) x + b ( 1 ) ) of the hidden layer. For a specific problem, how can we determine the connection weight and offset between layers? The gradient descent method (SGD) is used to solve the optimization problem, and it first randomly initializes all parameters, then trains iteratively, continually calculating gradients and updating parameters until the given condition is fulfilled, for example, when the error is small enough or the number of iterations is large enough.
The connection weights between nodes are adjusted according to the back-propagation error, and the correction direction of each weight is the opposite direction of the gradient of the error function. Let w i j be the weight of the i t h hidden layer node to the j t h output layer node, η be the learning rate, and E represent the error function of the output layer. We can obtain the following equation:
Δ w i j = η E w i j .

Appendix B. Loss Layer

Generally, the loss layer is used in the training phase of the model. After each batch of training data is sent to the model, the predicted result is output through forward propagation, and the loss layer calculates the difference between the predicted result and the real result. Then, the difference is used to update each parameter of the model through back propagation to reduce the loss between the real result and the predicted result, so that the predicted result generated by the model moves closer to the real result, so as to achieve the purpose of learning. The loss layer can be used to solve both regression and classification problems, which accomplishes this based on the loss function.
The loss function is an operation function used to measure the difference between the predicted result and the real result of the model, which is a non-negative, real-valued function. The smaller the loss function, the more robust the model will be.
Currently, the commonly used loss functions of ANN are M A E , M S E , S S E , and C E , which will be introduced as follows.
MAE is a common loss function used in regression models and classification models. It calculates the sum of the absolute values of the difference between the real result and the predicted result and represents the average margin of error of the predicted result, regardless of the direction of the error. MAE is applicable to the situation where there are outliers in the training data, and it can be updated in the direction of reducing the error of outliers through calculation without degrading the overall performance of the model. The formula of the MAE is expressed as
M A E = 1 n i = 1 n f i y i
where f i is the output result of neural network and y i is the real result for each group of input, when there are assumed n groups of sample data including input and real results (also called expected results or expected outputs).
MSE calculates the Euclidean distance between the predicted result and the real result. In the classification problems, the ANN model converts the labels to calculate the loss between the predicted result and the real result. In regression problems, MSE is used to calculate the distance from the sample points to the regression curve, the sample points can better fit the regression curve by minimizing the squared loss, and its formula can be expressed as
M S E = 1 n i = 1 n ( f i y i ) 2 .
Absolute error refers to the difference between the predicted result and the true result, which reflects the magnitude of the deviation of the predicted value from the true value; so, it is called absolute error. SAE sums the absolute errors according to the following formula:
S A E = i = 1 n f i y i .
SSE calculates the sum of the squares of the error corresponding to the real result and the predicted result. After fitting an appropriate model according to n observations, the remaining part that cannot be fitted is called error; the sum of squares of all n residuals is called sum of squares of errors, and the formula is as follows:
S S E = i = 1 n ( f i y i ) 2 .
CE is used to evaluate the difference between the predicted result obtained by training and the real result. In the classification problem of uneven positive and negative samples, CE is often used as the loss function because the surface of CE is very steep; so, the learning speed is relatively fast when the model effect is poor, which is conducive to the iteration of gradient descent. At present, CE is a commonly used classification loss function in neural networks, and can also be used to solve regression problems. It can be calculated as the following equation:
C E = i = 1 n f i log y i .

References

  1. The Health Diary. 2022. Available online: https://thehealthdiary.com/6-healthy-drinks-to-quench-your-thirst/ (accessed on 13 November 2022).
  2. Biotech Advanced. 2022. Available online: https://www.adv-bio.com/quenching-thirst-and-boosting-health-with-functional-drinks/ (accessed on 13 November 2022).
  3. Biotech Advanced. 2022. Available online: https://www.adv-bio.com/transforming-energy-drinks-the-demand-for-natural-compounds/ (accessed on 13 November 2022).
  4. Dealy Meal. 2018. Available online: https://www.thedailymeal.com/drink/beer-every-day-benefits-gallery (accessed on 13 November 2022).
  5. WebMD. 2004. Available online: https://www.webmd.com/osteoporosis/news/20041004/beer-wine-may-make-bones-stronger (accessed on 13 November 2022).
  6. Tschinkel, A. 2019. Available online: https://www.insider.com/drinking-health-benefits-heart-nutrition-2019-10 (accessed on 13 November 2022).
  7. Blom, C.M.J. Torsion pendula with electromagnetic drive and detection system for measuring the complex shear modulus of liquids in the frequency range 80–2500 Hz. Rheol. Acta 1984, 23, 98–105. [Google Scholar] [CrossRef] [Green Version]
  8. Riesch, C.; Reichel, E.; Keplinger, F.; Jakoby, B. Characterizing Vibrating Cantilevers for Liquid Viscosity and Density Sensing. J. Sensors 2008, 2008, 1–10. [Google Scholar] [CrossRef] [Green Version]
  9. Shih, W.; Li, X.; Gu, H.; Shih, W.H.; Aksay, I. Simultaneous liquid viscosity and density determination with piezoelectric unimorph cantilevers. J. Appl. Phys. 2001, 89, 1497–1505. [Google Scholar] [CrossRef] [Green Version]
  10. Note, A. Agilent Basics of Measuring the Dielectric Properties of Materials; Keysight Technologies: Santa Rosa, CA, USA, 2005. [Google Scholar]
  11. Ha, U.; Ma, Y.; Zhong, Z.; Hsu, T.M.; Adib, F. Learning Food Quality and Safety from Wireless Stickers. In Proceedings of the 17th ACM Workshop, Redmond, WA, USA, 15–16 November 2018. [Google Scholar]
  12. Wang, J.; Xiong, J.; Chen, X.; Jiang, H.; Balan, R.K.; Fang, D. Simultaneous Material Identification and Target Imaging with Commodity RFID Devices. IEEE Trans. Mob. Comput. 2021, 20, 739–753. [Google Scholar] [CrossRef]
  13. Xie, B.; Xiong, J.; Chen, X.; Chai, E.; Li, L.; Tang, Z.; Fang, D. Tagtag: Material Sensing with Commodity RFID. In Proceedings of the SenSys ’19: The 17th Conference on Embedded Networked Sensor Systems, New York, NY, USA, 10–13 November 2019; pp. 338–350. [Google Scholar] [CrossRef]
  14. Dhekne, A.; Gowda, M.; Zhao, Y.; Hassanieh, H.; Choudhury, R.R. LiquID: A Wireless Liquid IDentifier. In Proceedings of the 16th Annual International Conference, Munich, Germany, 10–15 June 2018. [Google Scholar]
  15. Gu, Y.; Zhu, Y.; Li, J.; Ji, Y. WiMate: Location-independent Material Identification Based on Commercial WiFi Devices. In Proceedings of the 2021 IEEE Global Communications Conference (GLOBECOM), Madrid, Spain, 7–11 December 2021; pp. 1–6. [Google Scholar] [CrossRef]
  16. Imaherb Biotech. 2019. Available online: https://www.imaherb.com/functional-drinks/ (accessed on 27 September 2022).
  17. Tan, M.; Zhou, J.; Xu, K.; Peng, Z.; Ma, Z. Static Hand Gesture Recognition With Electromagnetic Scattered Field via Complex Attention Convolutional Neural Network. IEEE Antennas Wirel. Propag. Lett. 2020, 19, 705–709. [Google Scholar] [CrossRef]
  18. Gupta, V.; Basak, B.; Roy, B. A Fault-Detecting and Motion-Sensing Wireless Light Controller for LED Lighting System. In Proceedings of the 2020 IEEE Calcutta Conference (CALCON), Duhok, Iraq, 23–20 December 2020; pp. 462–466. [Google Scholar] [CrossRef]
  19. Ling, K.; Dai, H.; Liu, Y.; Liu, A.X.; Wang, W.; Gu, Q. UltraGesture: Fine-Grained Gesture Sensing and Recognition. IEEE Trans. Mob. Comput. 2020, 21, 2620–2636. [Google Scholar] [CrossRef]
  20. Beheshti, M.; Shafiei, V.; Narimani, H. Enhanced compressed sensing autofocus for high-resolution airborne synthetic aperture radar. Digit. Signal Process. 2022, 127, 103543. [Google Scholar] [CrossRef]
  21. Yang, Z.; Qi, G.; Bao, R. Indoor Regional People Counting Method Based on Bi-Motion-Model-Framework Using UWB Radar. IEEE Geosci. Remote. Sens. Lett. 2022, 19, 1–5. [Google Scholar] [CrossRef]
  22. Feng, R.; Greef, E.D.; Rykunov, M.; Sahli, H.; Pollin, S.; Bourdoux, A. Multipath Ghost Recognition for Indoor MIMO Radar. IEEE Trans. Geosci. Remote. Sens. 2022, 60, 1–10. [Google Scholar] [CrossRef]
  23. Yang, X.; Zhang, X.; Ding, Y.; Zhang, L. Indoor Activity and Vital Sign Monitoring for Moving People with Multiple Radar Data Fusion. Remote. Sens. 2021, 13, 3791. [Google Scholar] [CrossRef]
  24. Zheng, Y.; Liu, Y.; Zhou, Z. From RSSI to CSI: Indoor Localization via Channel Response. ACM Comput. Surv. 2013, 46, 1–32. [Google Scholar]
  25. Li, M.; Yan, M.; Liu, J.; Zhu, H.; Liang, X.; Yao, L.; Na, R. When CSI Meets Public WiFi: Inferring Your Mobile Phone Password via WiFi Signals. In Proceedings of the ACM Sigsac Conference, Vienna, Austria, 24–28 October 2016. [Google Scholar]
  26. Tang, Z.; Liu, Q.; Wu, M.; Chen, W.; Huang, J. WiFi CSI gesture recognition based on parallel LSTM-FCN deep space-time neural network. China Commun. 2021, 18, 205–215. [Google Scholar] [CrossRef]
  27. Zhang, J.; Wang, Z.; Yan, Q. Intelligent user identity authentication in vehicle security system based on wireless signals. Complex Intell. Syst. 2022, 8, 1243–1257. [Google Scholar] [CrossRef]
  28. Jiang, Z. PicoScenes. Available online: https://ps.zpj.io/ (accessed on 27 September 2022).
  29. Jiang, Z.; Luan, T.H.; Ren, X.; Lv, D.; Hao, H.; Wang, J.; Zhao, K.; Xi, W.; Xu, Y.; Li, R. Eliminating the Barriers: Demystifying Wi-Fi Baseband Design and Introducing the PicoScenes Wi-Fi Sensing Platform. IEEE Internet Things J. 2022, 9, 4476–4496. [Google Scholar] [CrossRef]
  30. Jiang, Z. PicoScenes MATLAB Toolbox. Available online: https://ps.zpj.io/matlab.html (accessed on 27 September 2022).
  31. Wang, W.; Liu, A.X.; Shahzad, M.; Ling, K.; Lu, S. Understanding and Modeling of WiFi Signal Based Human Activity Recognition. In Proceedings of the MobiCom ’15 21st Annual International Conference on Mobile Computing and Networking, New York, NY, USA, 7–11 September 2015; pp. 65–76. [Google Scholar] [CrossRef]
  32. Li, W.; Bocus, M.J.; Tang, C.; Piechocki, R.J.; Woodbridge, K.; Chetty, K. On CSI and Passive Wi-Fi Radar for Opportunistic Physical Activity Recognition. IEEE Trans. Wirel. Commun. 2022, 21, 607–620. [Google Scholar] [CrossRef]
  33. Li, C.; Liu, M.; Cao, Z. WiHF: Gesture and User Recognition With WiFi. In Proceedings of the 21st Annual International Conference on Mobile Computing and Networking, New York, NY, USA, 3–7 October 2022; Association for Computing Machinery: New York, NY, USA, 2022. MobiCom ’22. pp. 757–768. [Google Scholar] [CrossRef]
  34. Venkatnarayan, R.H.; Page, G.; Shahzad, M. Multi-User Gesture Recognition Using WiFi. In Proceedings of the MobiSys ’18 16th Annual International Conference on Mobile Systems, Applications, and Services, New York, NY, USA, 10–15 June 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 40–413. [Google Scholar]
  35. Han, C.; Wu, K.; Wang, Y.; Ni, L.M. WiFall: Device-Free Fall Detection by Wireless Networks. IEEE Trans. Mob. Comput. 2017, 16, 581–594. [Google Scholar]
  36. Zeng, Y.; Pathak, P.H.; Mohapatra, P. Analyzing Shopper’s Behavior through WiFi Signals. In Proceedings of the 2nd Workshop on Workshop on Physical Analytics, New York, NY, USA, 16 June 2015; Association for Computing Machinery: New York, NY, USA, 2015. WPA ’15. pp. 13–18. [Google Scholar] [CrossRef]
  37. Lei, Y.; Zuo, M.J.; He, Z.; Zi, Y. A multidimensional hybrid intelligent method for gear fault diagnosis. Expert Syst. Appl. 2010, 37, 1419–1430. [Google Scholar] [CrossRef]
  38. Zeng, Y.; Pathak, P.H.; Mohapatra, P. WiWho: WiFi-Based Person Identification in Smart Spaces. In Proceedings of the 2016 15th ACM/IEEE International Conference on Information Processing in Sensor Networks, Vienna, Austria, 111–14 April 2016; IPSN ’16. pp. 1–12. [Google Scholar] [CrossRef]
  39. Zeng, Y.; Pathak, P.H.; Mohapatra, P. Your AP Knows How You Move: Fine-Grained Device Motion Recognition through WiFi. In Proceedings of the 1st ACM Workshop on Hot Topics in Wireless, Maui, HI, USA, 11 September 2014; Association for Computing Machinery: New York, NY, USA, 2014. HotWireless ’14. pp. 49–54. [Google Scholar] [CrossRef]
  40. Chang, J.-b.; Li, T.-f.; Li, P.-f. The selection of time domain characteristic parameters of rotating machinery fault diagnosis. In Proceedings of the 2010 International Conference on Logistics Systems and Intelligent Management (ICLSIM), Harbin, China, 9–10 January 2010; ICLSIM ’10. pp. 619–623. [Google Scholar] [CrossRef]
  41. Zhang, J.; Wei, B.; Hu, W.; Kanhere, S.S. WiFi-ID: Human Identification Using WiFi Signal. In Proceedings of the 2016 International Conference on Distributed Computing in Sensor Systems (DCOSS), Washington, DC, USA, 26–28 May 2016; pp. 75–82. [Google Scholar] [CrossRef]
  42. Bodarwé, K.-A.; Noack, J.; Philipp, J.-J. Emotion-based music recommendation using supervised learning. In Proceedings of the 14th International Conference on Mobile and Ubiquitous Multimedia (MUM ’15), Linz, Austria, 30 November–2 December 2015; Association for Computing Machinery: New York, NY, USA, 2015; pp. 341–344. [Google Scholar] [CrossRef]
  43. Dai, Y.; Huang, X.; Chen, Z. Application of Wavelet Denoising and Time- Frequency Domain Feature Extraction on Data Processing of Modulated Signals. In Proceedings of the 2021 2nd International Seminar on Artificial Intelligence, Networking and Information Technology (AINIT), Shanghai, China, 15–17 October 2021; pp. 611–615. [Google Scholar] [CrossRef]
  44. Chai, H.; Huang, H.; Yan, Z.; Zhang, X.; Li, Y.; Gan, P.; Huang, Y. Multi-Threshold Wavelet Packet-Based Method to Attenuate Noise from Seismic Signal. In Proceedings of the the 7th International Conference on Informatics, Environment, Energy and Applications, Beijing, China, 28–31 March 2018; IEEA ’18. pp. 212–216. [Google Scholar] [CrossRef]
  45. Suresh, S.; Yeow, R.C.-H. ADetection of anxiety through analysis of occipital EEG. In Proceedings of the International Convention on Rehabilitation Engineering & Assistive Technology (i-CREATe 2014). Midview, Singapore, 20–22 August 2014. [Google Scholar] [CrossRef]
  46. Nakayama, M.; Katsukura, M. Assessing Usability for Input Operation Using Frequency Components of Eye-Movements. In Proceedings of the Tenth Australasian Conference on User Interfaces, Wellington, New Zealand, January 2009; Volume 93, pp. 45–52. [Google Scholar] [CrossRef]
  47. Song, H.; Wei, B.; Yu, Q.; Xiao, X.; Kikkawa, T. WiEps: Measurement of Dielectric Property With Commodity WiFi Device—An Application to Ethanol/Water Mixture. IEEE Internet Things J. 2020, 7, 11667–11677. [Google Scholar] [CrossRef]
  48. Liang, Y.; Zhou, A.; Zhang, H.; Wen, X.; Ma, H. FG-LiquID: A Contact-Less Fine-Grained Liquid Identifier by Pushing the Limits of Millimeter-Wave Sensing. Proc. ACM Interact. Mob. Wearable Ubiquitous Technol. 2021, 5, 1–27. [Google Scholar] [CrossRef]
  49. Pei, W.; Guo, B.; Tong, X.; Zhu, W.; Yu, Z. TinySense: Multi-user respiration detection using Wi-Fi CSI signals. In Proceedings of the IEEE International Conference on E-health Networking, Dalian, China, 12–15 October 2017. [Google Scholar]
  50. Dai, Q.; Huang, Y.; Wang, L.; Ruby, R.; Wu, K. mm- Humidity: Fine-Grained Humidity Sensing with Millimeter Wave Signals. In Proceedings of the 2018 IEEE 24th International Conference on Parallel and Distributed Systems (ICPADS), Singapore, 11–13 December 2018; pp. 204–211. [Google Scholar] [CrossRef]
  51. Zhou, Y.; Zhi, G.; Chen, W.; Qian, Q.; He, D.; Sun, B.; Sun, W. A new tool wear condition monitoring method based on deep learning under small samples. Measurement 2022, 189, 110622. [Google Scholar] [CrossRef]
  52. Zhou, Y.; Kumar, A.; Parkash, C.; Vashishtha, G.; Tang, H.; Xiang, J. A novel entropy-based sparsity measure for prognosis of bearing defects and development of a sparsogram to select sensitive filtering band of an axial piston pump. Measurement 2022, 203, 111997. [Google Scholar] [CrossRef]
  53. Ha, U.; Leng, J.; Khaddaj, A.; Adib, F. Food and Liquid Sensing in Practical Environments Using RFIDs. In Proceedings of the NSDI’20 17th Usenix Conference on Networked Systems Design and Implementation, Santa Clara, CA, USA, 25–27 February 2020; USENIX Association: Santa Clara, CA, USA, 2020; pp. 1083–1100. [Google Scholar]
  54. Levitas, B.; Matuzas, J.; Viswanath, G.; Basalingappa, V.; Venkoparao, V. UWB based oil quality detection. In Proceedings of the 2011 IEEE International Conference on Ultra-Wideband (ICUWB), Bologna, Italy, 14–16 September 2011; pp. 220–224. [Google Scholar] [CrossRef]
  55. Weiß, J.; Santra, A. One-Shot Learning for Robust Material Classification Using Millimeter-Wave Radar System. IEEE Sensors Lett. 2018, 2, 1–4. [Google Scholar] [CrossRef]
  56. Matsui, H.; Hashizume, T.; Yatani, K. Al-Light: An Alcohol-Sensing Smart Ice Cube. Proc. ACM Interact. Mob. Wearable Ubiquitous Technol. 2018, 2, 1–20. [Google Scholar] [CrossRef]
  57. Rahman, T.; Adams, A.T.; Schein, P.; Jain, A.; Erickson, D.; Choudhury, T. Nutrilyzer: A Mobile System for Characterizing Liquid Food with Photoacoustic Effect. In Proceedings of the SenSys ’16, 14th ACM Conference on Embedded Network Sensor Systems CD-ROM, Stanford, CA, USA, 14–16 November 2016; Association for Computing Machinery: New York, NY, USA, 2016; pp. 123–136. [Google Scholar] [CrossRef] [Green Version]
  58. Yue, S.; Katabi, D. Liquid Testing with Your Smartphone. Commun. ACM 2021, 64, 75–83. [Google Scholar] [CrossRef]
Figure 1. The rationale of wireless-signal-based drinking category detection. When different drinking categories are detected, the multipath effect causes different distortions that may be used as fingerprints to detect drinking category.
Figure 1. The rationale of wireless-signal-based drinking category detection. When different drinking categories are detected, the multipath effect causes different distortions that may be used as fingerprints to detect drinking category.
Entropy 24 01700 g001
Figure 2. The CSI magnitude images of six detected drinks. The X-axis is the time, the Y-axis is the subcarrier, and the color represents the size of the magnitude. (a) The CSI magnitudes for different categories of drinking. (b) The CSI magnitudes collected multiple times for the same category of drinking.
Figure 2. The CSI magnitude images of six detected drinks. The X-axis is the time, the Y-axis is the subcarrier, and the color represents the size of the magnitude. (a) The CSI magnitudes for different categories of drinking. (b) The CSI magnitudes collected multiple times for the same category of drinking.
Entropy 24 01700 g002
Figure 3. Framework of the drinking category detection method.
Figure 3. Framework of the drinking category detection method.
Entropy 24 01700 g003
Figure 4. The CSI measurements of different drinking categories. The X-axis is the time and the Y-axis is the magnitude. (a) Before denoising. (b) After denoising.
Figure 4. The CSI measurements of different drinking categories. The X-axis is the time and the Y-axis is the magnitude. (a) Before denoising. (b) After denoising.
Entropy 24 01700 g004
Figure 5. The box plots of the feature values. The X-axis is the different drinking and the Y-axis is the range of extracted feature values. Each subplot represents a box plot of the feature values of different drinking under one feature.
Figure 5. The box plots of the feature values. The X-axis is the different drinking and the Y-axis is the range of extracted feature values. Each subplot represents a box plot of the feature values of different drinking under one feature.
Entropy 24 01700 g005
Figure 6. The heat maps of the featured F-tests. Each subplot is the F-test result for different drinking under one feature, and the rows and columns represent six drinking. The lighter the color, the smaller the F-test result; the greater the variability between the two drinking in the corresponding row and column, the better the feature.
Figure 6. The heat maps of the featured F-tests. Each subplot is the F-test result for different drinking under one feature, and the rows and columns represent six drinking. The lighter the color, the smaller the F-test result; the greater the variability between the two drinking in the corresponding row and column, the better the feature.
Entropy 24 01700 g006
Figure 7. ANN-based drinking category detection model.
Figure 7. ANN-based drinking category detection model.
Entropy 24 01700 g007
Figure 8. Experimental setup. (a) Device setup image. (b) Experimental environment image.
Figure 8. Experimental setup. (a) Device setup image. (b) Experimental environment image.
Entropy 24 01700 g008
Figure 9. Overall performance. (a) Overall performance of evaluation metrics. (b) Overall performance of confusion matrix.
Figure 9. Overall performance. (a) Overall performance of evaluation metrics. (b) Overall performance of confusion matrix.
Entropy 24 01700 g009
Figure 10. The comparison results of drinking category detection performance using different ANN layers.
Figure 10. The comparison results of drinking category detection performance using different ANN layers.
Entropy 24 01700 g010
Figure 11. The comparison results of drinking category detection performance using different nodes of ANN layers.
Figure 11. The comparison results of drinking category detection performance using different nodes of ANN layers.
Entropy 24 01700 g011
Figure 12. The comparison results of drinking category detection performance using different loss functions.
Figure 12. The comparison results of drinking category detection performance using different loss functions.
Entropy 24 01700 g012
Figure 13. The comparison results of drinking category detection performance using different detection models.
Figure 13. The comparison results of drinking category detection performance using different detection models.
Entropy 24 01700 g013
Table 1. Time–frequency domain statistics feature interpretations.
Table 1. Time–frequency domain statistics feature interpretations.
IDInterpretation
STD [37,38,39]The standard deviation of CSI measurements. Calculate the square of the difference between
the CSI measurements and their means, and then calculate the square root of its arithmetic mean.
RMS [37,40]The root-mean-square of CSI measurements. Calculate the mean of the square
sum of the CSI measurements and square it.
KP [36,37,38,41]The Kurtosis of CSI measurements. Calculates the fourth central moment for the CSI
measurements and is divided by the second central moment squared.
SF [37]The form factor of CSI measurements. Calculates the ratio of the root-mean-square
and rectified mean of the CSI measurements.
CF [37,40]The crest factor of CSI measurements. Calculates the ratio of the maximum value
and root-mean-square of the CSI measurements.
MF [37]The mean frequency of CSI measurements. Calculate the frequency of CSI and calculate its mean.
FC [37]The frequency center of CSI measurements. Calculate the frequency of CSI and calculate its median.
RMSF [37]The root-mean-square frequency of CSI measurements. Calculate the frequency of CSI and calculate its RMS.
STDF [37]The standard deviation frequency of CSI measurements. Calculate the frequency of CSI and calculate its STD.
Xr [42]The denominator of clearance factor of CSI measurements. Calculate the square root of
the absolute value of the CSI measurements; then, calculate its mean and square it.
pk [43]The peak of CSI measurements. Calculate the difference
between the maximum and minimum of the CSI measurements.
I [40,43]The impulse factor of CSI measurements. Calculates the
ratio of the peak and rectified mean of the CSI measurements.
L [43]The clearance factor of CSI measurements. Calculates the
ratio of the peak and Xr of the CSI measurements.
E [36,38,39,41]The time domain energy of CSI measurements. Calculate the sum of
absolute values of the CSI measurements.
p [44,45,46]The frequency of CSI measurements. Calculate frequency using Power Spectral Density.
Table 2. The results of hidden layer size.
Table 2. The results of hidden layer size.
Hidden Layer Size2345678910
accuracy0.86960.87420.86040.88410.87460.88630.88780.86040.8825
precision0.87380.87760.86370.88420.87930.88630.88630.86390.8865
recall0.86960.87420.86040.88410.87460.88630.88630.86040.8825
f1-score0.86960.87370.86000.88420.87930.88630.88780.86040.8820
Table 3. The results of the number of neurons in each hidden layer.
Table 3. The results of the number of neurons in each hidden layer.
Hidden Neuron Size1002003004005006007008009001000
accuracy0.89380.87580.84040.88670.91830.88040.87250.88790.84540.8900
precision0.89810.87520.84590.88880.92190.88390.87770.89210.85080.8942
recall0.89380.87580.84040.88670.91830.88040.87250.88790.84540.8900
f1-score0.89390.87520.84010.88610.91810.87970.87260.88770.84540.8900
Table 4. The results of the different loss functions.
Table 4. The results of the different loss functions.
Loss FunctionMAEMSESAESSECE
accuracy0.88790.88040.75830.77960.5408
precision0.89130.88520.76540.78580.5452
recall0.88790.88040.75830.77960.5408
f1-score0.88770.88000.75860.77880.5386
time complexity2.81255.26566.01562.64061.2969
Table 5. The results of different detection models.
Table 5. The results of different detection models.
Detection ModelSVMKNNRFANN
accuracy0.77670.72460.74920.8879
precision0.78300.72890.75430.8913
recall0.77670.72460.74920.8879
f1-score0.77580.72300.74820.8877
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Zhang, J.; Wang, Z.; Zhou, K.; Bai, R. A Novel Drinking Category Detection Method Based on Wireless Signals and Artificial Neural Network. Entropy 2022, 24, 1700. https://doi.org/10.3390/e24111700

AMA Style

Zhang J, Wang Z, Zhou K, Bai R. A Novel Drinking Category Detection Method Based on Wireless Signals and Artificial Neural Network. Entropy. 2022; 24(11):1700. https://doi.org/10.3390/e24111700

Chicago/Turabian Style

Zhang, Jie, Zhongmin Wang, Kexin Zhou, and Ruohan Bai. 2022. "A Novel Drinking Category Detection Method Based on Wireless Signals and Artificial Neural Network" Entropy 24, no. 11: 1700. https://doi.org/10.3390/e24111700

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop