A Grain Moisture Detection Method Based on ESP32-CSI

A Grain Moisture Detection Method Based on ESP32-CSI

Click the Blue Text | Follow Us

DOI:10.3969/j.issn.1671-7775.2024.04.008
Open Science (Resource Service) Identifier (OSID):A Grain Moisture Detection Method Based on ESP32-CSI
Citation Format:Gao Xiangshang, Yang Weidong, Shen Erbo. A Grain Moisture Detection Method Based on ESP32-CSI[J]. Journal of Jiangsu University (Natural Science Edition), 2024, 45(4): 426-433.
Funding Project:Henan Provincial Natural Science Outstanding Youth Fund Project (222300420004); National Natural Science Foundation Project (62172141, 61772173); Henan Provincial Major Public Welfare Project (201300210100); Henan Provincial Research Excellence Project for Overseas Students (21240003)
Author Introduction:
Gao Xiangshang (1997—), male, from Zhoukou, Henan, master’s student ([email protected]), mainly engaged in research on IoT and deep learning.
Yang Weidong (1977—), male, from Zhengzhou, Henan, professor, doctoral supervisor ([email protected]), mainly engaged in research on vehicular networks and information security..

A Grain Moisture Detection Method Based on ESP32-CSI

Gao Xiangshang1, Yang Weidong1,2,3, Shen Erbo1
(1. College of Information Science and Engineering, Henan University of Technology, Zhengzhou, Henan 450001, China; 2. Henan Key Laboratory of Grain Photoelectric Detection and Control, Henan University of Technology, Zhengzhou, Henan 450001, China; 3. Key Laboratory of Grain Information Processing and Control of Ministry of Education, Henan University of Technology, Zhengzhou, Henan 450001, China)
Abstract: To achieve low-cost, fast, and accurate measurement of grain moisture, miniaturized channel state information (CSI) acquisition devices were used for grain moisture detection. Two feature selection algorithms, random forest and principal component analysis, were employed to extract the feature subcarriers of the CSI amplitude index, and the moisture levels of ten types of grains were classified based on the selected feature subcarriers. Considering the limitations of power consumption and computational power in future mobile applications, a broad learning system (BLS) with a relatively simple structure, fast computation speed, and lower computational requirements was selected for processing CSI data, and its performance was compared with that of traditional convolutional neural networks (CNN) in terms of accuracy and training time. Finally, enhancement nodes in the BLS were dynamically increased. Experimental results showed that the principal component analysis (PCA) algorithm maximally eliminated redundant information in the CSI data. Compared with the CNN, the BLS achieved not only faster speeds but also better accuracy, thus the PCA-BLS combination obtained the best classification results; although increasing the number of enhancement nodes extended the training time, it also improved recognition accuracy to some extent.
Keywords: grain moisture; channel state information; miniaturization; amplitude; broad learning system
A grain moisture detection method based on ESP32-CSI
GAO Xiangshang1, YANG Weidong1,2,3, SHEN Erbo1
(1. College of Information Science and Engineering, Henan University of Technology, Zhengzhou, Henan 450001, China; 2. Henan Key Laboratory of Grain Photoelectric Detection and Control, Henan University of Technology, Zhengzhou, Henan 450001, China; 3. Key Laboratory of Grain Information Processing and Control of Ministry of Education, Henan University of Technology, Zhengzhou, Henan 450001, China)
Abstract To realize fast and accurate measurement of grain moisture with low cost, the miniaturized channel state information (CSI) acquisition equipment was used for grain moisture detection. Two feature selection algorithms of random forest and principal component analysis were adopted to extract the feature subcarriers of the CSI amplitude index, and the ten kinds of grain moisture were classified based on the selected feature subcarriers. Considering that the application in the mobility scene was limited by power consumption and arithmetic power, the breadth learning system with simple structure, fast operation speed and low arithmetic power requirement was selected for processing CSI data and was compared with the traditional convolutional neural network (CNN) in terms of accuracy and training time. The enhancement nodes of the broad learning system (BLS) were dynamically increased. The experimental results show that the principal component analysis (PCA) algorithm maximally eliminates the redundant information in the CSI data. Compared with the CNN, the BLS can achieve faster speed and better accuracy. Therefore, the PCA-BLS combination achieves the best classification results. Increasing the number of enhancement nodes can increase the training time, but the recognition accuracy is improved to some extent.
Key words grain moisture; channel state information; miniaturization; amplitude; broad learning system
Classification Number: TP391
Document Mark Code: A
Article Number: 1671-7775(2024)04-0426-08
Received Date: 2023-11-01
Grain security is an important foundation for national security. If the supply of grain cannot be guaranteed, the development of the country will be constrained. China is an agricultural country, and the Chinese have a particularly strong sentiment towards grain. The issue of grain security has been highly valued by the party and the state for many years. The available arable land area in China is limited, and it is difficult to further increase the total grain output, so reducing post-harvest losses of grain is particularly important. To reduce grain losses, we must start with grain storage. Every year, tens of thousands of tons of grain are wasted during storage due to pests, mildew, and other factors[1]. To achieve safe grain storage, it is necessary to have a comprehensive grasp of grain conditions so that measures can be taken to avoid grain losses. Among the many indicators of grain conditions, the moisture content of grain is one of the most important indicators. Excessively high moisture content can easily lead to grain mildew and also increase grain temperature, causing more extensive damage. Traditional methods for measuring grain moisture, such as halogen grain moisture meters, can achieve high accuracy, but the detection process is time-consuming and labor-intensive, and cannot perform online measurements. Insertion-type grain moisture meters can achieve real-time detection, but their results are greatly affected by environmental factors such as temperature, making it impossible to accurately measure the moisture content of grain. Therefore, accurately and in real-time measuring the moisture content of grain is an important guarantee for grain storage safety.
In recent years, sensing technologies based on channel state information (CSI) have developed significantly and have been widely applied in fall detection[2], gesture recognition[3], grain moisture detection[4], and grain pest detection[5]. The aforementioned CSI-based research mostly relies on Intel 5300 network cards or Atheros series wireless network cards for data collection, which have relatively high equipment costs, large size, and are inconvenient to carry, making large-scale promotion and application difficult. The equipment for collecting CSI needs to be miniaturized and low-cost to provide possibilities for widespread application. The ESP32 chip just meets these requirements, with a single chip cost of less than 20 yuan, and it can obtain rich CSI data at the terminal by simply flashing specific firmware.
To solve the above problems, this paper uses the low-power, miniaturized ESP32 chip to sense different moisture levels in wheat, using both suspended and inserted methods for CSI data collection; using random forest (RF) and principal component analysis (PCA) feature extraction algorithms to select feature subcarriers, applying broad learning system (BLS) and convolutional neural network (CNN) methods for grain moisture recognition to obtain the optimal model for moisture recognition; improving the BLS network by dynamically increasing its enhancement nodes to further improve moisture detection accuracy through improved network models.

1 Related Work

1.1 Traditional Grain Moisture Measurement Methods

According to measurement technology, existing grain moisture detection technologies can be divided into drying methods, resistance methods[6], capacitance methods[7], microwave methods[8], friction resistance methods[9], acoustic methods[10], neutron methods[11], etc. The drying method is the method for measuring grain moisture in national standards, which completely evaporates the moisture from the sample in an electric oven at 105 °C, and the moisture content can be calculated from the mass reduction of the sample. This method is very accurate but time-consuming and not suitable for online moisture detection. For the resistance method, Liu Hongliang et al.[6] designed a resistance-type grain moisture meter based on a resistance frequency conversion circuit and a temperature compensation circuit. First, the sample is crushed by a mechanical sampler, and then its resistance is measured. The measured resistance signal is converted into a frequency signal through the resistance frequency conversion circuit, and the grain moisture is measured by measuring frequency. This improves the transmission and anti-interference capabilities of the measurement signal. For the capacitance method, Li Jingxuan et al.[7] designed a cylindrical capacitor-based grain moisture measurement device, obtaining a highly accurate capacitance calculation formula through exploratory experiments with single variables, enabling accurate and rapid detection of grain moisture. For the microwave method, Li Xingning et al.[8] designed a grain moisture microwave detection system using a 9.5 GHz microwave generator, arranging microwave sensors using a transmission measurement method. This method is less affected by environmental factors and achieves non-destructive, non-intrusive online continuous grain moisture detection. For the friction resistance method, Gan Fuhang et al.[9] developed an online grain moisture detection instrument based on friction resistance and an electromechanical sensor. This device studies the relationship between grain scattering and the friction coefficient, which is significantly affected by the moisture content, thus deriving the correlation between friction resistance and moisture content. This method is simple, has few interference factors, and can adapt to harsh working conditions. For the acoustic method, Fang Jianjun[10] studied acoustic methods suitable for online moisture measurement, exploring the relationship between grain moisture and sound pressure level and frequency. Research shows that there is a linear relationship between sound pressure level and grain moisture in the range of 10 to 20 kHz. For the neutron method, Yang Yueqian et al.[11] studied the feasibility of online measurement of grain moisture content in frozen and flowing states. The study found that the higher the grain moisture content, the faster the fast neutrons are slowed down, and the smaller the radius of the “thermal neutron cloud ball,” resulting in a higher thermal neutron density. The neutron counting ratio varies with the grain volume moisture content depending on the grain variety, so pre-treatment work must be done for each batch of material when using the neutron method to measure grain moisture content. Microwave, acoustic, and neutron methods have advantages of high accuracy, fast detection speed, non-destructive measurement, and non-invasive measurement. Moreover, they can easily measure the moisture inside the grain, but these measurement devices are often complex and costly.

1.2 Wireless Sensing Moisture Measurement Methods

Currently, the wireless sensing field is rapidly developing, and many studies have been conducted on moisture measurement methods based on wireless sensing. Literature [12] employed RFID wireless sensing technology to perceive soil moisture in each pot of plants in a greenhouse, sticking two RFID tags on each pot and using an Impinj Speedway R420 reader to read the tags. By measuring the differential minimum response threshold, changes in soil moisture can be reflected. Experiments show that this system can achieve 90% accuracy within a 5% error. Literature [13] designed and implemented the Wi-Fruit system, which measures the moisture and soluble solids of different fruits using CSI. This system is unaffected by the size, type, or shape of the fruit and is robust to environmental changes. Experimental verification shows that the root-mean-square error reaches 0.319. Literature [14] proposed a non-destructive wheat moisture detection system, Wi-Wheat, based on commercial WiFi, using the Intel 5300 network card for CSI collection, applying PCA to extract features from CSI amplitude and phase difference, and using support vector machine (SVM) classification for wheat moisture detection, with Gaussian radial basis function (RBF) as the kernel function for the SVM. Experimental results show that Wi-Wheat can achieve high classification accuracy in both line-of-sight and non-line-of-sight scenarios. The aforementioned wireless sensing moisture technologies provide some ideas for the experimental design in this paper.

1.3 ESP32-CSI-Based Sensing System

Literature [15] proposed a convenient collection method for CSI based on ESP32 and conducted a series of experiments, such as corridor experiments[16], placing the transmitter and receiver of the ESP32 on the same side of the wall to detect the presence of people on the other side of the wall and determine their walking direction. Literature [17] conducted experiments on soil, detecting soil moisture and soil composition, which is of great significance for the implementation of precision agriculture. Literature [18] used the ESP32-CSI collection tool to detect crowds, achieving not only accurate counting but also crowd localization, verifying the high accuracy of the ESP32-CSI collection tool in scene perception. Literature [19] used ESP32-CSI to detect liquid levels, achieving 90% accuracy. This device will be applied in medical infusion liquid level detection and smart home fields. In summary, the use of ESP32 for CSI collection has applications in multiple fields, confirming the feasibility of this low-cost device for obtaining CSI. This paper applies the ESP32-CSI collection tool to grain moisture detection, aiming to achieve low-cost, fast detection of grain moisture.

2 Feasibility Analysis

2.1 CSI-Based Sensing Theory

The propagation of wireless signals usually does not travel in a straight line from the transmitter to the receiver; the received signals are generally the superposition of multipath signals formed by reflections, diffractions, and scatterings from surrounding obstacles, which is known as the multipath effect. The physical space affects the propagation of wireless signals, and thus the affected wireless signals can be used to reflect the physical environment they pass through, which is the principle of wireless sensing[20]. Whether it is human motion, position, or surrounding environment, all can modulate the wireless signal, forming periodic or time-varying signals. Analyzing such modulated signals can infer the environment through which the signal has propagated. Received signal strength (RSS) has been used in various sensing applications[21], but its coarse granularity and high variability are not suitable for precise sensing in environments rich in multipath effects. Compared with RSS, CSI can distinguish multipath components to a certain extent. The advantage of CSI lies in its provision of channel information for each subcarrier, characterizing the frequency-selective fading characteristics of WiFi channels. At the same time, CSI contains amplitude and phase information for each subcarrier, providing richer frequency domain information. Therefore, this paper uses CSI for grain moisture detection.
In recent years, orthogonal frequency division multiplexing (OFDM) technology combined with multiple input multiple output (MIMO) technology has formed the core technology of the new generation of wireless local area networks. In wireless signals modulated using OFDM, the total spectrum is divided into multiple orthogonal subcarriers, and the amplitude and phase information of each subcarrier can be viewed as a set of samples of the channel frequency response (CFR) spectrum. Literature [22-23] utilized Intel 5300 and Atheros series wireless network cards to achieve output of a set of CSI from each received data packet. Literature [15] shows that after writing specific firmware into the ESP32 WiFi module, CSI can be obtained from the terminal.
CSI can be represented as
H(fk)=‖H(fk)‖ej∠H(fk),
(1)
where: H(fk) represents the CSI of the subcarrier with a central frequency of fk, ‖H(fk)‖ and ∠H(fk) represent the amplitude and phase of the kth subcarrier respectively. In this paper, both the transmitter and receiver use single antennas, operating in the 2.4 GHz band and 20 MHz bandwidth, collecting 64 subcarriers, of which 52 are non-empty. Amplitude A and phase Φ can be calculated using the following formula:
A Grain Moisture Detection Method Based on ESP32-CSI
(2)

2.2 Related Algorithm Theory

2.2.1 Feature Selection
CSI provides rich subcarrier information, but also increases the complexity of data analysis. If certain subcarriers are simply selected at random, the conclusions drawn are often unreliable and do not maximize the information contained in the CSI. Therefore, a suitable method is needed to reduce data volume while minimizing the loss of feature information.
There are many algorithms for feature selection; this paper employs RF and PCA feature selection algorithms to screen feature subcarriers from CSI data. RF is a supervised machine learning algorithm based on multiple decision trees, capable of analyzing complex classification features and also serving as a feature selection method. RF builds multiple decision trees and combines them to obtain more accurate predictions. The “randomness” is reflected in two aspects: first, randomly selecting samples, i.e., sampling from the original dataset with replacement to obtain a sub-dataset; second, randomly selecting features, where the sub-dataset randomly selects a certain number of subsets from all original features to then select the optimal features from the already selected feature subsets. Each selected data subset and feature subset forms a decision tree, ultimately resulting in the random forest algorithm.
PCA is an unsupervised linear dimensionality reduction algorithm widely used in data reduction, visualization, and compression. It maps high-dimensional data to mutually orthogonal low-dimensional spaces based on the maximum variance theory, and the transformed data is called principal components. The essence of PCA is to find some projection directions that maximize the variance of data in these projection directions, and these projection directions are mutually orthogonal, i.e., it is the process of finding new orthogonal bases, calculating the variance of the original data projected onto these orthogonal bases; the larger the variance, the more information is contained in the corresponding orthogonal base. The larger the eigenvalue of the original data covariance matrix, the larger the corresponding variance, and the more information is contained in the projection on the corresponding eigenvector. Conversely, if the eigenvalue is small, it indicates that the information contained in the projection on these eigenvectors is minimal, and thus the data corresponding to small eigenvalues can be deleted to achieve dimensionality reduction.
2.2.2 BLS Algorithm Principle
Broad learning is a new type of machine learning algorithm based on the traditional random vector functional link neural network (RVFLNN). Unlike directly using inputs and establishing enhancement nodes in RVFLNN, BLS constructs mapping as inputs and builds mapping features, merging the hidden layer and output layer of RVFLNN, transforming the originally hidden-layer-containing neural network structure into a linear system with only input and output. BLS first performs random feature mapping on the original input data and enhances the feature mapping to obtain feature nodes and enhancement nodes. The input layer is composed of both feature nodes and enhancement nodes, connecting the input layer to the output layer, and then using ridge regression to solve the pseudo-inverse to obtain the connection weights between the input layer and output layer. Since all connection weights are randomly generated and remain fixed during the generation of feature and enhancement nodes, only the connection weights between the input layer and output layer need to be determined. BLS adopts a single hidden layer neural network structure that differs from traditional deep structures. When accuracy is insufficient, traditional deep neural networks increase the number of network layers and adjust the number of parameters, while BLS adds nodes horizontally. When new nodes are added, BLS does not need to start learning from scratch; it only needs to adjust the weights related to the new nodes, significantly improving the model’s training speed. This algorithm features a simple structure and efficient computation, and has been applied in image recognition, automation control, fault diagnosis, and localization.
The basic structure of BLS is shown in Figure 1.
A Grain Moisture Detection Method Based on ESP32-CSI
Figure 1 Structure of the Broad Learning System
In Figure 1, the input dataset X contains N samples with M dimensions, Y is the output matrix of RN×C.
By generating n feature nodes from the input dataset, the ith group of feature nodes Zi can be represented as
Zi=φi(XWfi+bfi),i=1,2,…,n,
(3)
where: Wfi and bfi are randomly generated; φ is the mapping function. Representing all feature nodes as Zn=[Z1,Z2,…,Zn], the mth group of enhancement nodes can be represented as
Hm=φm(ZnWem+bem).
(4)
Thus, the broad learning model can be represented as
Y=[Z1,Z2,…,Zn|φ(ZnWe1+be1),…,φ(ZnWem+bem)]=
[Z1,Z2,…,Zn|H1,H2,…,Hm]Wm=
[Zn|Hm]Wm,
(5)
where: Wm=[Zn|Hm]+Y, Wm is the connection weight of the broad structure.
2.2.3 CNN Algorithm Structure
CNN is a supervised learning-based machine learning model with strong adaptability, adept at mining local features of data, capable of extracting global training features and classifying them. Its weight-sharing structured network is more similar to biological neural networks, achieving good results in pattern recognition and other fields. In this paper, 8,000 data packets of each moisture type were selected for model training, with 2,000 data packets used for model validation. Each training session selects 10 data packets, and 10 feature subcarriers are chosen from each data packet, forming a 10×10×1 matrix as the input layer of the CNN model. The structure of the CNN network is shown in Figure 2. The input data first passes through a convolutional layer with 2 convolution kernels of size 8; to keep the dimensions the same after passing through the convolutional layer, the padding parameter is set to “same”; then the data passes through a third convolution layer with a convolution kernel of size 16; to compress the data flow dimensions, in the third convolution layer, padding is set to “valid,” reducing the data flow dimension to 5; finally, the data passes through the last convolution layer with a convolution kernel of size 16, with padding set to “same.” ReLU activation function layers are added between each convolution layer to ensure sparsity in the network, reduce the interdependencies between parameters, and alleviate overfitting. The data is then flattened and passed through two fully connected layers, outputting in Softmax probability form, with the number of output neurons equal to the number of moisture types in wheat. When the error decreases to a point where it no longer changes, the current training stops, and the CNN network model is saved for online testing.
A Grain Moisture Detection Method Based on ESP32-CSI
Figure 2 CNN Network Structure

3 Grain Moisture Detection Method

3.1 Moisture Detection System Structure

The system mainly includes three steps: CSI acquisition, feature subcarrier selection, and moisture recognition. In the CSI acquisition phase, two ESP32-WiFi chips are used, one as the transmitter powered directly by a 5 V power adapter, and the other as the receiver connected to a computer via USB to save the received CSI locally. In the CSI analysis phase, the original real and imaginary data are first converted to phase and amplitude, then the RF and PCA algorithms are used to select feature subcarriers from the original data, and finally, moisture modeling analysis is performed based on the selected feature subcarriers. The broad learning system is applied to moisture modeling, and its timeliness and accuracy are compared with those of traditional convolutional neural networks. Experimental results show that the RF method can maximally eliminate redundant information in the original data, while BLS can achieve better accuracy and shorter training time compared to CNN. The structural model of this system is shown in Figure 3.
A Grain Moisture Detection Method Based on ESP32-CSI
Figure 3 System Structural Model

3.2 Experimental Scheme Design

First, prepare wheat with different moisture contents, weighing several portions of wheat and dividing them into 10 parts. The original moisture content is measured using a halogen moisture meter (Figure 4a). By calculating, the amount of water to be added to each sample is determined, and the required amount of water is evenly sprayed on the wheat, sealing and letting it sit for a month to allow the wheat to fully absorb moisture, ultimately obtaining samples with 10 different moisture contents (as shown in Figure 4b), and the final moisture content of each sample is measured using the halogen moisture meter.
A Grain Moisture Detection Method Based on ESP32-CSI
Figure 4 Experimental Device and Materials
During data collection, two forms are adopted: one is to directly insert the ESP32 chip into the grain (Figure 5a), ensuring that most signals pass through the grain to be received; the other is to suspend the ESP32 chip above the sample (Figure 5b), in which case the signal reaches the receiver after reflecting off the grain.
A Grain Moisture Detection Method Based on ESP32-CSI
Figure 5 Data Collection Methods
During the data collection process, the samples are surrounded by absorbing sponge, which can reduce background noise and eliminate clutter interference, thus improving detection accuracy. Additionally, during the experiment, personnel movement should be avoided to further reduce interference. Mark the sample and the position of the chip to ensure that each sample is placed in the same position to eliminate errors caused by positional differences. Under suspended conditions, the chip is kept 15 cm away from the grain surface, and the amount of sample loaded must be consistent to maintain a consistent distance between the chip and the grain surface, preventing distance factors from affecting the signal.
The data processing hardware consists of a server equipped with Ubuntu 20.04, with an Intel(R) Xeon(R) Gold 6132 processor, 14 cores, 64 GB of memory, and a 500 GB solid-state hard drive, using Python for coding.

4 Experimental Results

4.1 Feature Subcarrier Selection

CSI data is presented in complex form, containing two parameters: amplitude and phase information. Experiments found that the amplitude parameter has strong intuitive regularity and is easy to calculate, while the phase information is significantly affected by frequency offset, leading to noticeable phase jumps or shifts. Therefore, the RF and PCA algorithms are used to select feature subcarriers based on amplitude information, and they are ranked according to importance, selecting the 10 subcarriers with higher contributions for subsequent moisture recognition. The feature subcarrier selection is shown in Figure 6. After analyzing the selected feature subcarriers, it was found that the overlap rate of subcarrier numbers selected by the two feature selection algorithms reached 80%, proving the credibility of the results from both selection algorithms.
A Grain Moisture Detection Method Based on ESP32-CSI
Figure 6 Feature Subcarrier Selection
For wheat with a moisture mass fraction of 7.3%, 100 data packets were selected, and the 5 subcarriers with higher contributions were plotted. The different subcarriers selected by the two feature selection algorithms are represented by dashed lines, as shown in Figure 7. From the figure, it can be seen that among the 5 subcarriers with higher contributions, only one is different.
A Grain Moisture Detection Method Based on ESP32-CSI
Figure 7 Subcarrier Amplitude

4.2 Moisture Recognition

4.2.1 Combination with Initial Network Structure
The selected feature subcarriers are combined with classification algorithms to obtain the best grain moisture content discrimination model. During the experiment, the initial value of the BLS network model was set to 10×10 feature nodes and 300 enhancement nodes for testing. The test results of different feature selection algorithms combined with the same classification algorithm are shown in Table 1. From Table 1, it can be seen that when different feature subcarrier selection algorithms (RF, PCA) are combined with the same classification algorithm, the PCA algorithm achieves a higher accuracy, and also reduces training time compared to RF, indicating that PCA maximally eliminates redundant information while retaining useful information. When the same feature subcarrier selection algorithm is combined with different classification algorithms (CNN, BLS), the BLS algorithm not only achieves faster convergence but also obtains higher accuracy than CNN.
Table 1 Test Results of Different Feature Selection Algorithms Combined with Classification Algorithms
A Grain Moisture Detection Method Based on ESP32-CSI
4.2.2 Combination with Improved Broad Learning
From the above experimental results, it can be seen that the combination of PCA and BLS algorithms can achieve higher accuracy and faster convergence speed. However, the accuracy of the experimental results is still unsatisfactory, and some improvements are made to the BLS algorithm. The initial number of enhancement nodes in BLS is increased from 300 to 500, while keeping the number of feature nodes unchanged, dynamically increasing 50 enhancement nodes each time, with the feature selection algorithm set to PCA and the data collection method using insertion. The test results are shown in Table 2.
Table 2 Results of Dynamically Increasing 50 Enhancement Nodes
A Grain Moisture Detection Method Based on ESP32-CSI
From the experimental results, it can be seen that increasing the number of enhancement nodes can improve classification accuracy, but when the number of nodes increases from 450 to 500, the increase in accuracy is no longer significant, indicating that at this point, relying on increasing the number of enhancement nodes no longer improves accuracy. However, as the number of enhancement nodes increases, the training time also increases. Therefore, when the number of enhancement nodes is 450, a high accuracy can be obtained while considering speed.
From the above experimental results, it is clear that when the data collection method is insertion-based, the accuracy obtained is generally higher than that of the suspended method. The reason is that direct insertion for sample detection reduces external interference to a certain extent, allowing the signal to mostly reach the receiver through transmission, thus maximizing the reflection of sample information, whereas the suspended method can only receive signals reflected from the sample, which provides very limited information. Additionally, there is a distance between the antenna and the sample, making the signal susceptible to external interference during propagation. In the BLS algorithm, increasing the number of enhancement nodes can improve the accuracy of results to some extent. In summary, using the insertion-based CSI collection method, combined with the PCA-BLS discrimination model, is the optimal approach for grain moisture detection based on ESP32-CSI.

5 Conclusion

This study verifies the feasibility of grain moisture detection based on ESP32-CSI, while applying broad learning to the processing of CSI data, achieving the PCA-BLS optimal discrimination model. By analyzing the data using two feature subcarrier selection algorithms (RF, PCA) and two feature classification algorithms (CNN, BLS), it was found that the PCA algorithm can maximally eliminate redundant information in CSI, and the BLS algorithm outperforms the CNN algorithm in feature classification accuracy and speed. Thus, the PCA-BLS discrimination model can yield optimal results. Although dynamically increasing the number of enhancement nodes in the BLS system extended the training time, it also improved recognition accuracy to some extent. Experimental results indicate that the ESP32-CSI system can achieve low-cost and portable CSI acquisition, and the broad learning system performs excellently in processing CSI data. In the future, this system’s rapid and convenient grain moisture detection technology will play an important role in the construction of unattended grain depots.
References
[1] Guo Qinghua. Breaking through bottlenecks is the key to reducing farmers’ grain storage losses[J]. Grain Issues Research, 2021(4): 27-30.
[2] Ran Yaxin, Yu Jiang, Chang Jun, et al. A method of fall detection based on CSI[J]. Journal of Yunnan University (Natural Sciences Edition), 2020, 42(2): 220-227.
[3] Wang Zhi, Chang Jun. CSI cross-domain gesture recognition method based on 3D convolutional neural network[J]. Computer Science, 2021, 48(8): 322-327.
[4] Yang Weidong, Wang Xinyu, Song Aixin, et al. Wi-Wheat: contact-free wheat moisture detection with commodity WiFi[C]∥IEEE International Conference on Communications, 2018: 1-6.
[5] Shan Shaowei, Yang Weidong, Xiao Le, et al. Wi-Pest: a method for detecting stored grain pests based on CSI[J]. Journal of the Internet of Things, 2020, 4(4): 51-61.
[6] Liu Hongliang, Wang Wangping. Development of resistance type grain moisture detector[J]. Light Industry Science and Technology, 2014, 30(7): 72-73.
[7] Li Jingxuan, Leng Wenxiu. Study on determination of grain moisture content based on cylindrical capacitor[J]. Physics and Engineering, 2019, 29(2): 100-105.
[8] Li Xingning, Liu Rongjin, Chen Zhen, et al. Research and design of grain moisture microwave detection system[J]. Science & Technology Information, 2017, 15(18): 2.
[9] Gan Fuhang, Liu Chaoxin, Zhang Weihua, et al. Development of grain moisture detecting instrument based on friction resistance method[J]. Journal of Agricultural Mechanization Research, 2018, 40(1): 91-95.
[10] Fang Jianjun. Acoustic methods for online measurement of moisture content in grains[J]. Journal of North China University of Technology, 2000, 12(1): 57-60.
[11] Yang Yueqian, Wang Jianping, Wang Chengzhi. Study on on-line measurement of grain moisture content by neutron gauge[J]. Transactions of the Chinese Society of Agricultural Engineering, 2000, 16(5): 99-101.
[12] Wang J, Chang L Q, Aggarwal S, et al. Soil moisture sensing with commodity RFID systems[C]∥Proceedings of the 18th International Conference on Mobile Systems, 2020: 273-285.
[13] Liu Y T, Jiang L D, Kong L H, et al. Wi-Fruit: see through fruits with smart devices[J]. Proceedings of ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, 2021, 5(4): 1-29.
[14] Steven M H, Bulut E. Lightweight and standalone IoT based WiFi sensing for active repositioning and mobility[C]∥21st International Symposium on a World of Wireless, 2020: 277-286.
[15] Steven M H, Bulut E. Adversarial occupancy monitoring using one-sided through-wall WiFi sensing[C]∥IEEE International Conference on Communications, 2021: 1-6.
[16] Steven M H, Erdag D, Bulut E. Towards dense and scalable soil sensing through low-cost WiFi sensing networks[C]∥2021 IEEE 46th Conference on Local Computer Networks, 2021: 549-556.
[17] Choi H, Fujimoto M, Matsui T, et al. Wi-CaL: WiFi sensing and machine learning based device-free crowd counting and localization[J]. IEEE Access, 2022, 10: 24395-24410.
[18] Ma H J, Zhang Y G, Hong X Y, et al. A method of identifying water level information through WiFi signal[C]∥2021 Photonics & Electromagnetics Research Symposium, 2021: 1739-1744.
[19] Yu G, Zhu Y N, Li J, et al. WiMate: location-independent material identification based on commercial WiFi devices[C]∥2021 IEEE Global Communications Conference, 2021: 1-6.
[20] Amartansh D, Sood P, Santos J, et al. An enhanced approach to imaging the indoor environment using WiFi RSSI measurements[J]. IEEE Transactions on Vehicular Technology, 2021, 70(9): 8415-8430.
[21] Daniel H, Hu W J, Sheth A, et al. Tool release: gathering 802.11n traces with channel state information[J]. ACM Sigcomm Computer Communication Review, 2011, 41(1): 53.
[22] Li Z J, Xie Y X, Li O, et al. Recitation: rehearsing wireless packet reception in software[C]∥Proceedings of the 21st Annual International Conference on Mobile Computing and Networking, 2015: 291-303.
[23] Ye Rongke, Kong Qingchen, Li Daoliang, et al. Shrimp freshness detection method based on broad learning system[J]. Spectroscopy and Spectral Analysis, 2022, 42(1): 164-169.
(Editor: Zhu Zhenxue)
Dear friends, the source PDF of the article can be downloaded by clicking “Read the Original” on our journal’s website.
Like + Look, Let’s Keep Going ↓↓↓

Leave a Comment