<figure><img src="image_1.png" /></figure>

HAL
open science

# Improved Method for Modeling in Capacitive Grain Moisture Sensor

Yang Liu, Cheng Xinrong, Mu Haomiao, Song Yuyao

► To cite this version:

Yang Liu, Cheng Xinrong, Mu Haomiao, Song Yuyao. Improved Method for Modeling in Capacitive Grain Moisture Sensor. 8th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2014, Beijing, China. pp.144-150, 10.1007/978-3-319-19620-6_18. hal-01420225

HAL Id: hal-01420225

https://inria.hal.science/hal-01420225

Submitted on 20 Dec 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Improved Method for Modeling in Capacitive
Grain Moisture Sensor

Yang Liu¹, Cheng Xinrong¹*, Mu Haomiao², Song Yuyao³

(1. China Agricultural University, Beijing 100083, China)

**Abstract:** Food is the material basis of human survival, food quality directly related to people's survival and life. Grains as the main food supply, its quality is also essential. Grain moisture of grain stored is an extremely important influence on the main character. However, the ambient temperature and the degree of compaction of grains have a strong nonlinear relationship between the analytic expression and difficult. Therefore the improved BP neural network was used to solve this problem. With improved orthogonal-optimizing method, the study showed that while the RBF nerve network's weighing factors were obtained, the numbers of hidden units could be acquired. This method could avoid too few nerve elements that would result in low accuracy, or too many nerve elements that will result in "over learnt". This method had been approved for its advantages over the ordinary methods with laboratory tests on grains of wheat, rice, corn, etc. Experimental results showed that application of the improved BP model, the measurement accuracy of wheat increased 62.0%, corn increased measurement accuracy of 66.2%, rice increased 66.7% accuracy

**Keywords:** Grain, Moisture, Improved BP Neural Network, Orthogonal-optimizing Method.

**Introduction**

Food is the material basis of human existence, food quality is directly related to the survival and life of the people. Our country is a large agricultural country, China's grain output this year to nearly 500 million tons [1-3], in order to ensure the safe storage of grain, grain moisture should be slowed down to safe storage standards by timely grain drying after it is harvested.

There are factors affecting the use of capacitive moisture sensors measure the grain moisture, which is why the causes of error are more complicated. Major source of error for the sample moisture content is uneven, the error ambient temperature, humidity, dust, electromagnetic interference, and the introduction of mechanical vibration generated when the error detection data for the operation. The traditional model of polynomial curve fitting is established through extensive testing and observation, and the need to adopt three more times to fit the experiment, and the adaptability of the model is not strong, fitting accuracy is not high [4-7].

Artificial neural network is a kind of imitation of biological information processing system of brain structure and function, compared with polynomial fitting, and its advantage is that it does not have to learn to be established, including the elimination of non-target parameters including analytic function [9-10]. Neural network learning samples are usually provided by the multi-dimensional calibration
experimental data. In recent years, BP artificial neural network algorithms have been
used to implement the non-linear fitting of measurement data and temperature
compensation.

**1. Probe Structure**

This paper focuses on the neural network in moisture data acquisition system calibration advantages, you first need to set up the hardware for measurement. The capacitive sensor construction is shown in Fig1. In the sensing electrode and the drive electrode of the back surface of the substrate protective electrode is provided, the potential of the guard electrode and the sensing electrode, so as to reduce interference and parasitic capacitance.

<figure><img src="image_3.png" /><figcaption>Fig.1 Flat plate capacitive sensor</figcaption></figure>

Where d is the width of the driving electrodes, referred to as a very wide; q is the
distance between the two sensing electrodes, referred to as the pole pitch; drive plate
and the distance between the sensor plate, L is the length of driving electrode and the
sensing electrode, H is the measured depth. Sensing electrodes during installation,
and grain drying machinery combined into one, thus, it can be considered the width of
the sensing electrode is infinite.

Because of the protection of the electrodes, the driving and sensing electrodes
between the power line affected by the shape, assuming a power line between the two
electrodes of an arc or elliptical arc curve to calculate the curve of the fringe field
capacitance of the capacitor, there is clearly a large error. Therefore, for the capacitor
shown in Fig 1, directly calculate the capacitance is very difficult to resolve.

In the experiment, the sensor plate is placed in a grounded container, using the
measurement method given volume.

**2. Neural Network Design**

**2.1. BP Neural Network**

BP (Back Propagation) network was proposed in 1986 by a team of scientists led by Rumelhart and McCelland. It is a training multilayer feedforward network that was
widely used according to a former error back propagation algorithm for. BP neural
network topology includes the input layer (input), hidden layer (hide layer) and output
layer (output layer).

BP algorithm learning is composed by the forward spread of propagation and reverse spread of propagation. Learning process first began in forward propagation part in the information input by the input layer to the output layer hidden layer processing, this communication process with no influence each layer neurons, each neuron state on its next level only neurons affected state. If the result is not up to the expected output layer value, the learning process into reverse propagation part, even if the output error is returned to the original connection path to modify the weights of each layer neurons, the error signal continues to spread after the minimum [11-14].

<figure><img src="image_4.png" /><figcaption>Fig.2 BP neural network model structure</figcaption></figure>

## 2.2 BP Neural Network Model

The advantages of the network is that its generalization capabilities BP on nonlinear mapping ability and it has been proven the typical three-layer BP network model can be any rational function approximation theory. So the paper has designed a 3-layer BP network modeling functions to achieve the experimental data approximate relationship that mathematical modeling through BP network, handling the relationship between capacitance values, the standard temperature and moisture values. Model structure is shown in Fig 2.

This experiment has two inputs (temperature, capacitance value) an output (grain moisture content). So the input layer design two neurons, respectively temperature and capacitance values. The output layer is a neuron for moisture content. For the hidden layer structure, after repeated experiments, the choice of the two hidden layers is better. The transfer function between the layers by Elman network design, the transfer function is Sigmod functions.

The neural network is being learned after the establishment of BP neural network in Matlab. The convergence is achieved after 89 iterations [15-17]. It was shown in Fig 3.
<figure><img src="image_5.png" /><figcaption>Fig.3 Neural network fitting surface</figcaption></figure>

At the end of the training, the right network matrix:

$$w\{1,1\} = \begin{bmatrix} -0.2811 & -6.8660 \\ 0.1665 & -0.2048 \end{bmatrix} \qquad (1)$$

$$w\{2,1\} = \begin{bmatrix} -4.8079 & -4.8944 \end{bmatrix} \qquad (2)$$

Network threshold value:

$$b1 = \begin{bmatrix} 8.1423 & 0.7191 \end{bmatrix} \qquad (3)$$

$$b2 = \begin{bmatrix} 7.2273 \end{bmatrix} \qquad (4)$$

## 2.3 OLS Algorithm

Structure optimization of neural networks (ie, the number of hidden nodes selection) is always a difficulty. Hidden nodes numbers in the network structure are commonly large and easily make the network produce over study. OLS method in each orthogonal should use "a contribution to the new interest" criteria Orthogonal, when the OLS meet certain precision, the algorithm terminates, the number of orthogonal vector is then hidden layer nodes. OLS orthogonal method is generally used for the traditional Gram-Schmidt due to the shortcomings of traditional Gram-Schmidt rounding errors large [18-21]. So Gram-Schmidt method to further optimize the modified hidden layer network structure.

Modified Gram-Schmidt method makes the triangular matrix elements are not in columns but by line basis, so rounding error will be smaller.

The calculation steps are:

(1) So that the number of samples equal to the number of hidden nodes N, when t = 1, calculate the

$$[err]_k^{(t)} = g_k^2 / (d^T d) \quad (k=1,2,L,N) \qquad (5)$$
(2) Find

$$[err]_{k_1}^{t} = \max([err]_{k}^{t}, I \le k \le N)$$

to select

$$q_1 = q_k,$$

repeat the cycle when t = h when looking for:

$$[err]_{k_h}^{t} = \max([err]_{k}^{t}, 1 \le k \le N, k \ne k_1, \dots, k \ne k_{h-1}) \quad (6)$$

(3) Select

$$q_h = q_{k_h},$$

when t=$P_s$, if

$$1 - \sum_{i=1}^{P_s} [err]_i < \rho,$$

then ends.

For the hidden layer optimized points. Where in the selected tolerance, it is a parameter related to the degree of accuracy and the final balance of network complexity.

### 3. Confirmatory Analysis

To verify the data fusion technology and improved BP algorithm proposed to improve the detection accuracy of grain moisture effects on wheat, corn, rice cereal made three common detection comparative experiments.

First make learning samples produced three samples, then using conventional BP neural network, improved BP neural network method for data fusion calculations. The error range is shown in Table 1.

<table><caption>Tab1. The error range of measuring wheat, corn, rice in three methods</caption><thead><tr><th rowspan="2">Method</th><th colspan="3">Method error range (%)</th></tr><tr><th>Wheat</th><th>Corn</th><th>Rice</th></tr></thead><tbody><tr><td>Data fusion algorithm<br>is not used</td><td>-4.9-5</td><td>-6-6.8</td><td>-4.6-4.8</td></tr><tr><td>Regular BP algorithm</td><td>-4-3.8</td><td>-2.8-5.3</td><td>-2.4-3.9</td></tr><tr><td>Improved BP<br>algorithm</td><td>-1.6-1.9</td><td>-2.3-1.3</td><td>-1.3-1.6</td></tr></tbody></table>
In rice, for example, the neural network after the training is completed, the drawing of the surface shown in Fig 3, x-axis represents the temperature, y-axis represents the capacitance value, z-axis represents the water content.

We randomly selected verification test data set 283, and a capacitance value corresponding to the temperature obtained by the sensor device using the standard method from the standard moisture content of grain, and the temperature and the capacitance values into the computer, has been used by BP neural network output, the results shown in Fig 4.

<figure><img src="image_6.png" /><figcaption>Fig.4 Neural networks and test point fitting surface</figcaption></figure>

Can be seen from Fig 4, the dot is measured by standard methods until a point substantially falls on the neural network generated by the fitting surfaces, after the conclusion of the data processing by the neural network after fitting of the aqueous and the moisture content ratio obtained by the standard method with a significant decrease in the average error, improve the measurement accuracy of 62.0% wheat, maize improved accuracy of 66.2%, to improve the accuracy of 66.7% rice, control accuracy can be achieved drying tower requirements.

## 4. Conclusion

The data confusion method of Radial Basis Function (RBF) nerve network is adopted in this study. With improved orthogonal-optimizing method, the study shows, while the RBF nerve network's weighing factors are obtained, the numbers of hidden units can be acquired. This method can avoid too few nerve elements that will result in low accuracy, or too many nerve elements that will result in "over learnt". This method has been approved for its advantages over the ordinary methods with laboratory tests on grains of wheat, rice, corn, etc.
References

[1].Zhao Jianjun,Zhao Yuchun. The Study on the Classification of Maize Drying Characteristics and Moisture Content Intelligent Forecast[D]. Mechanical and Electronic Engineering of Northeastern University,2006.

[2].He Jinbang. Grain Dry Machinery of Present Situation Development and Tendency in China [C].Chinese Society of Agricultural Engineering,1993,252—259.

[3].Qi Zhigao,Li Qian. The Factors Influencing Safety of Grain Storage[J]. Grain Storage,2006,35 (1):3-6.

[4].Zhang Shengquan. Measurement Method of Moisture Content in Food Product [J]. Machinery for Cereals Oil and Food Processing.2005(2):66-69.

[5].Zhai Baofeng, Bai Yuan. Design of Capacitor Moisture Detector for Cereal [J]. Journal of Liao Ning Institute of Technology.2003,23(1):34-39.

[6].Yang Liu, Yang Minghao. Research on Online Grain Moisture Monitoring System [D].College of Information and Electrical Engineering, China Agricultural University.2009.

[7].Zhang Baoju, Lei Qing, Li Gang,More. Noninvasive Measurement of the Human RBC Concentration Based on BP NN Mode [J]. Spectroscopy and Spectral Analysis.2012, 9.

[8].Hu Jinbin, Tang Xuqing, BP Algorithm and its Application in Artificial Neural Network [J].Information Technology,2004,28(4):1-4.

[9].Hardy R. Multiquadric Equations of Topography and Other Irregular Surfaces[J]. Journal of Geophysics Research,1987,1905-1915.

[10].Harder R, Desmarais R. Interpolation using surface splines[J]. J. Aircraft,1972,9:189-191.

[11].Moody J, Darken C. Fast learning in networks of locally-turned processing units[J]. Neural computation,1989,1(2):281-294.

[12].Yan Pingfan, Zhang Changshui. Artificial Neural Networks and Evolutionary Computing[M].Tsinghua University Press,2002.

[13].Billings S, Zheng G.L. Radial basis function network configuration using genetic algorithms. Neural Networks, 1995,8(6):877-890.

[14].Zhi Huiqiang, Niu Kun, Tian Liang, More. A Comparative Study on BP Network and RBF Network in Function Approximation [J].Bulletin of Science and Technology,2005,21(2):193-197.

[15].Dong Changhong. MATLAB Neural Network and Application[M].National Defence Industry Press,2005.

[16].Du Xinhui, Li Xiaojing, Cui Jianwei. Application of Subtractive Clustering Method in Medium and Long-Term Electric Load Forecasting [J]. Journal of Taiyuan University of Technology,2008,36:165-167.

[17].Gao Juan. Artificial Neural Network Theory and Simulation Examples[M].China Machine Press,2007,55-58.

[18].Zhu Daqi, Shi Hui. The Principle and Application of Artificial Neural Network[M]. Science Press,2006,129.

[19].Xu Lina. Neural Network Control[M]. Publishing House of Electronics Industry,2003.

[20].Huang Haifeng. Application of RBF Neural Network to Gas Load Forecasting [J]. GuangDong Building Materials,2007,5.182-184.

[21].Liu Jinjun. Study on RBF Neural Network Improvement and its Applications[D]. LanZhou University,2008.