# Hybrid Sensing Platform for IoT-Based Precision Agriculture
## 3 Materials and Methods
### Data Analysis for Improving the Quality of Aerial Sensor Observations
#### 3.2.2 Data Analytic Models for Validation and Calibration  
The HSP uses statistical models and supervised machine learning techniques to validate and calibrate aerial data based on ground-based data. In this paper, we consider the following three techniques.  
Pearson correlation (Equation (1)) is used to determine the strength of the linear relationship between two data sets. In our research, these data sets are ground-based and aerial data.  
\begin{table}
\begin{tabular}{l l} \hline
**Observation Context** & **Observation Context Variables** \\ \hline UAV Characteristics & Vibration, Altitude, Acceleration, UAV Cyclone \\ Environmental Characteristics & Overcast, Rain, Wind Speed, Wind Gust, Solar Radiation \\ \hline \end{tabular}
\end{table}
Table 2: Observation contexts and related variables.  
\[r=\frac{\Sigma(x_{i}-\bar{x})(y_{i}-\bar{y})}{\sqrt{\Sigma(x_{i}-\bar{x})^{2} \Sigma(y_{i}-\bar{y})^{2}}} \tag{1}\]  
Pearson correlation analysis provides correlation coefficient values between \(-1\) and \(+1\). In Equation (1), \(r\) stands for the correlation coefficient, \(x_{i}\) equals the values of the \(x\)-variable in a sample, \(\bar{x}\) equals the mean of the values of the \(x\)-variable, \(y_{i}\) equals the values of the \(y\)-variable in a sample, and \(\bar{y}\) equals the mean of the values of the \(y\)-variable. The correlation coefficient values that are closer to 1 indicate a stronger linear relationship between two data sets. We use Pearson correlation to analyse the validity of aerial data by determining the strength of the aerial data's linear relationship with ground-based data.  
Linear regression (Equation (2)) is a supervised machine learning model that can be used to both validate and calibrate the aerial data based on ground-based data. From a validation perspective, the linear regression R\({}^{2}\) value, known as the coefficient of determination, provides a goodness-of-fit measure, which indicates the strength of the relationship between two data sets, which are known as the predictor data set and target data set. The R\({}^{2}\) value is between 0 and 1 and the values which are closer to 1 indicate stronger goodness-of-fit. This can be used to validate the aerial data in comparison with ground-based data. In addition, a linear regression line equation can be used to calibrate the aerial data.  
\[y=bx+a \tag{2}\]  
This equation enables us to predict the target data (ground-based data) based on a predictor variable (aerial data). In the linear regression equation above, \(y\) is the value that we try to predict, which is the ground-based value; \(b\) is the slope of the regression line; \(x\) is the independent variable used for prediction, which is the aerial value; and \(a\) represents the ground-based intercept. After obtaining the values of \(b\) and \(a\) in each experiment, the data points of the aerial data set are put into the equation to calibrate the aerial data by reducing their distance from the ground-based data.  
_Euclidean distance_ (Equation (3)) is used to determine the distance between aerial and ground-based data before and after calibration.  
\[d(p,q)=\sqrt{\sum_{i=1}^{n}(q_{i}-p_{i})^{2}} \tag{3}\]  
In Equation (3), \(p\) and \(q\) are two points in Euclidean n-space, \(q_{i}\) and \(p_{i}\) are Euclidean vectors, and \(n\) represents the n-space. The proposed validation and calibration techniques take UAV characteristic variables (discussed in Table 2) into account by validating and calibrating the aerial data based on ground-based data, which are not impacted by such UAV characteristics. Field experiments of the HSP using the discussed techniques for the validation and calibration of aerial data based on ground truth are presented in Section 4. The HSP aerial data validation and calibration process is presented next in Section 3.2.3.