# Grain Moisture Sensor Data Fusion Based on Improved Radial Basis Function Neural Network

Liu Yang, Gang Wu, Yuyao Song, Lanlan Dong

► To cite this version:

Liu Yang, Gang Wu, Yuyao Song, Lanlan Dong. Grain Moisture Sensor Data Fusion Based on Improved Radial Basis Function Neural Network. 6th Computer and Computing Technologies in Agriculture (CCTA), Oct 2012, Zhangjiajie, China. pp.99-108, 10.1007/978-3-642-36137-1_13 . hal-01348220

HAL Id: hal-01348220

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

Submitted on 22 Jul 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_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Grain Moisture Sensor Data Fusion Based on Improved
Radial Basis Function Neural Network

Liu Yang, Gang Wu, Yuyao Song, Lanlan Dong

¹College of Engineering,

China Agricultural University,
Beijing, 100083, China

zhijunr@gmail.com, {yangliu,maozhihuai} @ cau.edu.cn

²Department of Research & Development

Beijing Beiyi Innovation Vacuum Technology CO.Ltd
Beijing, 102600, China

Donglanlan2005@126.com

**Abstract.**Difficulty was known to get satisfactory measurement effect on precision in capacitive grain's moisture measurement due to many influencing factors, such as temperature, species, compaction and so on. The data confusion method of Radial Basis Function (RBF) nerve network is adopted. With improved orthogonal optimal method, the RBF nerve network's weight factors can be obtained. This method can avoid artificially selected the number of hidden units, which can cause low learn precision or over learn. Tests showed that the improved RBF network algorithm reduces the network structure, greatly enhances the learning speed of calculation. By using of the improved RBF nerve network, the precision for wheat's moisture measurement has been improved.

**Keyword:** Radial Basis Function Neural Network, moisture measurement, k-means clustering, hidden layer neuron.

# 1 Introduction

There are some methods for grain moisture measurement, e.g. resistance measuring, capacitance measuring, measuring with Infrared Radiation, micro wave, neutron spectrum, NMR, etc [1~3]. The advantages of low cost, high sensibility, wide dynamic range and simplicity for real time measuring make the capacitive moisture meter as one of the common method used for grain moisture measurement. The Dielectric Constant (DC) of
dry grain is 2~5, while the DC for pure water is 81. As the moisture in the tested sample grows, the DC value also grows. This is the basis for Capacitive Moisture Meter (CMM) measuring [4].

Different type of grain has different DC. The CMM measuring is affected by sample's temperature, category and compactness. The conventional way of measuring the capacitive moisture only measures the capacitor value to get the moisture level, which is not accurate. Temperature compensation for the moisture measuring is actually to solve the accuracy problem by multi-sensor information fusion.

There are a number of methods for such data fusion applied in industrial technology, e.g. Multi-dimensional Regression Analysis, Bayesian Derivation, Artificial Neural Network, D-S Theory and Fuzzy Set Theory. It is as important academically as it is practically to get the best data fusion based on different models.

In recent years, the BP Neural Network has been used for linearization or temperature compensation for measured data. Same as the other forward network algorithms, BP Neural Network algorithm can be trapped by local optimum. In late 80's last century, J. Mody [5] and C. Darken [6] proposed the Radial Basis Function (RBF) Neural Network [7~9]. RBF Network has a character called optimal approximation, which will avoid local optimum trap during network establishing. This makes RBF a more effective and fast responding neural network, with a strong nonlinear processing capability. It is presented here the mathematical model for RBF Neural Network applied on grain moisture measuring.

# 2 Structure of RBF Neural Network For Grain Moisture Measuring

## 2.1 Structure of Neural Network

There are a few major factors affecting the measuring accuracy of grain moisture: the ambient temperature, the testing frequency and the compactness of the grain. This model composes by input layer, hidden layer and output layer. The input layer has 3 neurons, the hidden layer has *I* neurons, the output layer has one neuron. The neural network topology is shown in Figure 1.
<figure><img src="image_2.png" /><figcaption>■ Fig. 1. RBF network structure of moisture measurement system.</figcaption></figure>

## 2.2 Mathematics Model

The input vector is $X = [x_1, x_2, x_3]$; $x_1, x_2, x_3$ are temperature, frequency and compactness. The output vector is $Y = y$, $y$ is grain moisture.

RBF network hidden layer output (the $i$th node):

$$u_i = \varphi(\|X - t_i\|). \qquad (1)$$

In the sentence, RBF function ($\varphi$) is Gauss function, $t_i$ is the centre of $i$th hidden node, $\|\cdot\|$ is Euclidean Norm.

From the mathematical model, it is known that:

$$y = \sum_{i} w_{i}u_{i} - \theta. \qquad (2)$$
In the sentence, $w_i$ is the ith connection weight between the ith output $u_i$ and the system output $y$, $\theta$ is respectively the neurons threshold of output.

$W$, as a Vector with $I$ dimensions, is given by weights matrix composed of output connection weights:

$$W = [w_1, w_2, \cdots w_i \cdots w_I]. \qquad (3)$$

To get RBF network for a measuring system, which has $N$ groups of inputs and outputs, can be described in mathematical model as: to get the optimum weights matrix $W$ so as to achieve minimum error between output of RBF network and the expected output of the samples. The target function is:

$$\min \quad B = \frac{1}{2} \sum \|d_k - Y_k\|^2 = \frac{1}{2} \sum_{k=1}^{N} (d_k - y_k)^2. \quad (4)$$

$Y_k$ is $k$th output vector of RBF network, $d_k$ is $k$th expected output vector of training samples.

## 3 Training Algorithm of RBF Neural Network

There are 2 stages for this algorithm. Stage 1 is to determine the centre of the radial primary function for the hidden layer; stage 2 is the get the optimum weights matrix from nonlinear programming model. The method that the centre is chose randomly, selected by self-organization and K-means clustering algorithm are methods that determine the centre of the radial primary function. Comparing to the other methods, K-means clustering algorithm has a advantage that it can reduce the sample space by automatically classifying the sample space to $k$ classes, automatically getting the centre of the radial primary function for every class. The stage 2 of K-means clustering algorithm get the weight vector by Orthogonal Least Squares (OLS), but small $k$ may lead to bad accuracy; big $k$ will lead to bad accuracy and complex network. The improved RBF network OLS algorithm is proposed to solve this problem in the text.

### 3.1 Conventional RBF Network Algorithm

Three parameters are needed to be computed and learned: center vector in basis function, variance vector and weight value matrix.

1) Calculating the Centre Vector in the Basis Function: K-means clustering algorithm can calculate the centre vector in the basis function as follows:
First, initializing cluster centre. Select *I* different samples randomly from training samples set as the centre vector *t*<sub>*i*</sub>(0), (*i* = 1, 2, ..., *I*) according to experience, and make the iteration step *n*=0.

Second, input training samples $\mathbf{X}_k$ randomly.

Third, find the clustering centre $i(\mathbf{X}_k)$ that has minimum distance with $\mathbf{X}_k$. In another word, making

$$i(\mathbf{X}_k) = \arg \min_{i} \|\mathbf{X}_k - \mathbf{t}_i(n)\| \quad (i = 1, 2, \dots, I) \quad (5)$$

In the sentence, $\mathbf{t}_i(n)$ is *i*th centre vector of *n*th iteration basis function.

Fourth, adjust the centre vector of basis function according to the follow method.

$$\mathbf{t}_i(n+1) = \begin{cases} \mathbf{t}_i(n) + \eta[\mathbf{X}_k(n) - \mathbf{t}_i(n)] & i = i(\mathbf{X}_k) \\ \mathbf{t}_i(n) & \text{other} \end{cases} \quad (6)$$

In the sentence, $\eta$ is a step and $0 < \eta < 1$.

At last, judge whether all training samples are learned and distribution don't change. If so, calculation is over, or making $n = n + 1$, turning to second step. Final $\mathbf{t}_i(i = 1, 2, \dots, I)$ is the final *i*th centre vector of the basis function.

2) *Calculating the Variance:* The approximate formula that calculate the variance is as follow when Gaussian function is selected as RBF function:

$$\sigma_1 = \sigma_2 = \dots = \sigma_I = \frac{D_{\max}}{\sqrt{2I}} \quad (7)$$

In the sentence, *I* is the number of hidden node, and $D_{\max}$ is maximum distance between centres selected.

3) *Calculating the weight vector:* OLS and Givens OLS are the general methods to calculating the weight vector $\mathbf{W}$.

## 3.2 Improved RBF Network OLS Algorithm

Structural optimization in network is a difficult. The general structure has large numbers of hidden nodes and leads to over-learn. The general orthogonal method is the traditional Gram-Schmidt which has rounding error. The hidden network structure is optimized with the improved method in the article.

*I* eigenvectors are obtained by K-mean clustering [10]. Suppose the output testing samples column vector is:

$$\mathbf{d} = [d_1, d_2, \dots, d_I]. \quad (8)$$
The hidden layer output vector is:

$$ U = [u_1, u_2, \cdots, u_I]^T. \qquad (9) $$

The expected output vector can be expressed by hidden layer function output vector:

$$ d = UW + E. \qquad (10) $$

In the sentence, E is error vector.

Make U as orthogonal triangular factorization with Gram-Schmidt orthogonal algorithm [11]: $U = QR$. (11)

The elements in upper triangular matrix R are computed in row but not in line in improved Gram-Schmidt method which lead to lower rounding error. For details, viewing $q_I$ as the result of $u_I$, at the same time $u_2, \cdots, u_I$ minus the parallel component of $u_I$ in advanced:

$$ \left\{ \begin{array}{l} R_{11} = u_{11}, q_I = u_I / \|R_{11}\| \\ R_{1j} = q_I^T u_j, u_j^{(I)} = u_j - q_I R_{1j} \quad 2 \le j \le I \end{array} \right. \qquad (12) $$

After the computation, $u_2^{(I)}, u_3^{(I)}, \cdots, u_I^{(I)}$ are orthogonal with $q_I$.

Then, Ortho-normalized $u_2^{(I)}: u_3^{(I)}, \cdots, u_I^{(I)}$ minus the parallel component of $u_2^{(I)}$:

$$ \left\{ \begin{array}{l} R_{22} = u_{22}^{(1)}, q_2 = u_2^{(1)} / \|R_{22}\| \\ R_{2j} = q_2^T u_j^{(1)}, u_j^{(2)} = u_j^{(1)} - q_2 R_{2j} \quad 3 \le j \le I \end{array} \right. \qquad (13) $$

Thus, $u_3^{(2)}, \cdots, u_I^{(2)}$ are orthogonal with $q_1, q_2$. Repeating the steps, the orthogonal matrix $Q$ and upper triangular matrix $R$ are obtained.

The structure network is optimized with improved Gram-Schmidt method and detail solving process is designed in the article. The improved optimized network structure is obtained by sentence (10):

$$ d^T d \approx \sum_{i=1}^{I} g_i^2 + E^T E. \qquad (14) $$

In the sentence, $\sum_{i=1}^{I} g_i^2 = G^T G$

$$ G = (g_1, g_2, \cdots, g_i, \cdots, g_I) = RW \approx Q^T d $$

Suppose the compression ratio is:

$$ [err]_i = g_i^2 / d^T d \quad 1 \le i \le I. \qquad (15) $$

Above result show that as the rounding error is lower in the improved Gram-Schmidt, the numbers of the hidden layer nodes can be computed precisely. The computation amount is decreased and over learned problem is avoided.
# 4 Data Analysis and Processing

Comparing experiments have been done to verify the function of the improved RBF algorithm[13~14] in this article, which is supposed to achieve higher moisture detecting accuracy.

BP network, traditional RBF network and improved RBF methods are used to compare for data fusion process.

300 groups of wheat samples are prepared for the experiments. Among which, 250 samples are used for learning algorithm, and 50 groups are used for measuring.

## 4.1 Compare the Measuring Results With the Method of Improved RBF to That With Method Without Data-fusion Process

Testing values and standard values of the two methods are listed in the Table 1 and 2.

<table><caption>**Table 1.** Compare the Standard Values to the Results Processed without Data Fusion</caption><thead><tr><th>No.</th><th>y (%)</th><th>d (%)</th><th>Error (%)</th><th>No</th><th>y (%)</th><th>d (%)</th><th>Error (%)</th></tr></thead><tbody><tr><td>1</td><td>6.29</td><td>6.2</td><td>1.5</td><td>9</td><td>14.02</td><td>14.5</td><td>-3.3</td></tr><tr><td>2</td><td>7.26</td><td>7.1</td><td>2.2</td><td>10</td><td>14.74</td><td>15.2</td><td>-3.0</td></tr><tr><td>3</td><td>8.15</td><td>8.3</td><td>-1.8</td><td>11</td><td>15.55</td><td>16.1</td><td>-3.4</td></tr><tr><td>4</td><td>8.82</td><td>9.0</td><td>-2.0</td><td>12</td><td>18.41</td><td>17.7</td><td>4.0</td></tr><tr><td>5</td><td>10.02</td><td>10.2</td><td>-1.8</td><td>13</td><td>19.72</td><td>19.0</td><td>3.8</td></tr><tr><td>6</td><td>10.78</td><td>11.0</td><td>-2.0</td><td>14</td><td>21.19</td><td>20.3</td><td>4.4</td></tr><tr><td>7</td><td>12.67</td><td>12.3</td><td>3.0</td><td>15</td><td>6.60</td><td>6.5</td><td>1.6</td></tr><tr><td>8</td><td>14.02</td><td>13.6</td><td>3.1</td><td>16</td><td>7.45</td><td>7.3</td><td>2.1</td></tr></tbody></table>

<table><caption>**Table 2.** Compare the Standard Values to the Results Processed By Improved RBF Neural Network</caption><thead><tr><th>No.</th><th>y (%)</th><th>d (%)</th><th>Error (%)</th><th>No</th><th>y (%)</th><th>d (%)</th><th>Error (%)</th></tr></thead><tbody><tr><td>1</td><td>6.29</td><td>6.2</td><td>1.45</td><td>9</td><td>14.56</td><td>14.5</td><td>0.41</td></tr><tr><td>2</td><td>7.12</td><td>7.1</td><td>0.28</td><td>10</td><td>15.43</td><td>15.2</td><td>1.51</td></tr><tr><td>3</td><td>8.32</td><td>8.3</td><td>0.24</td><td>11</td><td>16.44</td><td>16.1</td><td>2.11</td></tr><tr><td>4</td><td>9.03</td><td>9.0</td><td>0.33</td><td>12</td><td>17.66</td><td>17.7</td><td>-0.26</td></tr><tr><td>5</td><td>10.22</td><td>10.2</td><td>0.20</td><td>13</td><td>18.96</td><td>19.0</td><td>-0.21</td></tr><tr><td>6</td><td>10.20</td><td>11.0</td><td>1.82</td><td>14</td><td>20.50</td><td>20.3</td><td>0.99</td></tr><tr><td>7</td><td>12.68</td><td>12.3</td><td>3.09</td><td>15</td><td>6.61</td><td>6.5</td><td>1.69</td></tr><tr><td>8</td><td>13.19</td><td>13.6</td><td>-3.01</td><td>16</td><td>7.34</td><td>7.3</td><td>0.55</td></tr></tbody></table>

The Tables show that with the method without data-fusion, the error is ±5.0%. With the method of improved RBF, the error is reduced to ±1.9%.
## 4.2 Compare the Measuring Results with the Method of Improved RBF to that with BP Network Method

Figure 2 shows the compared curves of the measuring result using two methods. The solid line and dotted line show respectively the measuring error made by the improved RBF method, and that made by BP network method[15~16].

The maximum error and minimum error is respectively ±1.9% and ±0.2% when measuring with the improved RBF method. The maximum error and minimum error is respectively ±4.0% and ±0.3% when measuring with the BP network method.

<figure><img src="image_3.png" /><figcaption>■ Fig. 2. Comparison of measure results between textual algorithms to BP neural network algorithms.</figcaption></figure>

## 4.3 Compare the Measuring Results with the Method of Improved RBF to that with Regular RBF Method

Computational scales for these two methods are compared with the same initial conditions. The initial conditions are: three input variables and one output variable with 300 learning samples. The conventional algorithm takes the same feature samples as one group by clustering algorithm, reducing the hidden nodes from 250 to 164. The improved Gram-Schmidt method[17~18] is used to solve network weight and confirm the numbers of the hidden nodes automatically, reducing the hidden nodes to 56.
Figure 3 shows the compared curves of the measuring result using two methods. The solid line and dotted line show respectively the measuring error made by the improved RBF method and regular RBF method.

The maximum error range error is respectively ±1.9% and ±3.1% when measuring with the improved RBF method and regular RBF method.

<figure><img src="image_4.png" /><figcaption>■ Fig. 3. Comparison of measure results between textual algorithms to RBF network algorithms.</figcaption></figure>

## 5 Conclusion

The data fusion method of RBF neural 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 number of hidden units can be acquired. This method can avoid too few nerve elements that will result has been approved for its advantages over the ordinary methods with laboratory tests on grain of wheat, rice, corn, etc[19~20].

## References

1. Zhaosheng Teng, et al: Study of New Instrument for Quick Measuring Moisture Content of Cereals. Journal of HuNan University Nayural Sciences. vol. 26, no. 3, 61--65 (1999)

2. Weidong Cheng, et al: An On-line Measurement and Monitoring System of Grain Moistureduring Drying Process, Transactions of the Chinese Society of Agricultural Machinery. vol. 31, no. 2, 54-55 (2000)
3. Zhengdong Yuan, et al: Fast Neutron Water-Content Mater. Nuclear Electronics & Detection Technology. vol. 19, no. 1 (1999)

4. Baofeng Zhai and Qiuyan Chen: Data Processing of Moisture Content Measurement Based on Data Fusion. Journal of Liaoning Institute of Technology. vol. 26, no. 3, 158-160 (2006)

5. Hardy. R: Multiquadric Equations of Topography and Other Irregular Surfaces. Journal of Geophysics Research. 1905-1915 (1987)

6. Harder. R and Desmarais. R: Interpolation using surface splines. J. Aircraft. 9, 189-191 (1972)

7. Moody. J and Darken. C: Fast learning in networks of locally-turned processing units. Neural computation. vol. 1, no. 2, 281-294 (1989)

8. Pingfan Yan and Changshui Zhang: Artificial Neural Networks and Evolutionary Computing. Beijing: Tsinghua University Press (2002)

9. Billings. S and Zheng. G.L: Radial basis function network configuration using genetic algorithms. Neural Networks, vol. 8, no. 6, 877-890 (1995)

10. Jinjun Liu: Study on RBF Neural Network Improvement and its Application, Lanzhou: Lanzhou University (2008)

11. Youdu Huan, Cheng'en Di and shixin Zhu: Matrix Theory and its Application. HeFei: University of Science and Technology of China Press (2005)

12. Changjun Zhu, Xiujuan Zhao: RBF algorithm and its Application in Multi-Reach Water Quality Simulation. College of Urban Construction Hebei University of Engineering Handan (2009)

13. Xinxin Wang, Huicheng Lai: An Improved RBF Algorithm for Text Classification. Communication Technology. Vol. 44, No. 12, 156-158 (2011)

14. Bin Li, Xiaoping Lai: An Improved GGAP-RBF Algorithm and Its Application to Function Approximation. Vol. 20, No. 2, pp. 231-235 (2007)

15. Chenye Qiu, Xingquan Zuo, Chunlu Wang, Jianping Wu: A BP neural network based information fusion method for urban traffic speed estimation, School of Computer. Beijing University of Posts and Telecommunications. vol. 8, No. 1, 77-83 (2010)

16. Qiang Fu, Guoliang Li, Zilong Wang: Method of Chaotic Prediction Based on Wavelet BP Network and Its Application, Journal of Systems Science and Information, Vol. 6, No. 1, 55-61 (2008)

17. Tao Zhao, Jun Liu, Xuebin Chi: Gram-Schmidt Algorithm and Its Parallel Implementation. Microelectronics & Computer. Vol. 9, No.9, 137-140 (2007)

18. Vanderstraeten D.: An accurate parallel block Gram-Schmidt algorithm without reorthogonalization, Numer[J]. Linear Algebra 7(4):219~236 (2000)

19. Liu Yang, Yongjun Zheng, Zhijie Jiang, and Zhijun Ren.: Improvement of the Capacitive Grain Moisture Sensor. Beijing Jiaotong Vocational Technical University. (2011)

20. Zhentao Li, Yang Zhang, Limei Zhang: Grain Moisture Sensors on Line. Journal of Liaoning University. Vol. 33, No. 3, 241-245 (2006)