# Research on Wi-Fi Fingerprint Database Construction Method Based on Environmental Feature Awareness
## 4 Results
### Comparative Experiments  
To validate the superiority of the environmental feature perception model, we conducted a series of comparison experiments. We compared the model's performance against convolutional neural network (CNN) and recurrent neural network (RNN) models, as well as the deep convolutional neural network AlexNet. Second, we assessed accuracy. Although accuracy is typically used in classification tasks, our goal here is to predict continuous values rather than discrete categories. Therefore, we defined a set of thresholds; if the error between the predicted and actual values falls below these thresholds, the prediction is considered \"accurate\". This process is expressed as follows:  
\[\mathbf{Accuracy}=\frac{1}{\boldsymbol{n}}{\sum_{i=1}^{n}\boldsymbol{I}(| \boldsymbol{\hat{y}_{i}}-\boldsymbol{y}_{i}|<\epsilon)}, \tag{5}\]  
where \(\boldsymbol{n}\) is the total sample size, \(\boldsymbol{I}\) is the indicator function, \(\boldsymbol{\hat{y}_{i}}\) denotes the predicted value, \(\boldsymbol{y}_{i}\) denotes the actual value, and \(\epsilon\) denotes the error threshold. The performance of the four models in terms of accuracy at different thresholds is shown in Table 3. \begin{table}
\begin{tabular}{c c c c c c} \hline  & \(\epsilon\) & **AlexNet** & **Environmental Feature Sensing Model** & **RNN** & **CNN** \\ \hline Accuracy (train) & 5 & 100\% & 100\% & 41.04\% & 100\% \\ Accuracy (test) & 5 & 100\% & 100\% & 42.37\% & 100\% \\ Accuracy (train) & 2 & 82.96\% & 82.99\% & 19.79\% & 82.86\% \\ Accuracy(test) & 2 & 81.75\% & 82.08\% & 20.63\% & 81.84\% \\ Accuracy (train) & 0.5 & 49.39\% & 55.38\% & 3.21\% & 10.29\% \\ Accuracy(test) & 0.5 & 48.92\% & 54.73\% & 3.38\% & 10.76\% \\ \hline \end{tabular}
\end{table} 
Table 3: Comparison of model accuracy. Figure 6: Loss curve diagram. Smaller thresholds allow for better differentiation between high-precision models and more general ones, helping to accurately assess each model's strengths and weaknesses. As shown in the table, most models fit the data well when error conditions are more relaxed. However, the environmental feature-aware model consistently demonstrates a clear advantage across different thresholds, particularly when the thresholds are small. This indicates that the model is more sensitive to minor changes in the data and can accurately reflect these changes, showcasing a strong generalization ability. The environmental feature-aware model maintains a high level of accuracy even under more stringent error conditions, highlighting its superior accuracy and robustness in capturing complex patterns and features within the data. We used three evaluation metrics to assess the performance of the environment-aware models on the same dataset. First, the standard deviation between the predicted and actual values was measured using the root mean square error (RMSE). RMSE is particularly sensitive to outliers, with larger values indicating greater prediction errors for the model. Third, the coefficient of determination (R-squared) was used to measure the model's ability to explain the variance in the target variable. R-squared ranges from 0 to 1, with values closer to 1 indicating a stronger explanatory power of the model. The results of these two evaluation metrics for the four models on the same dataset are presented in Table 4.  
Figure 7 illustrates the comparison between the predicted and actual values for the three models after training. In the graph, the blue line represents the actual values, while the red, orange, and green lines represent the predicted values of the convolutional neural network model, the recurrent neural network model, and the environmental feature perception model, respectively. From the figure, we can observe that the predicted values of the CNN model generally fit the actual values well, with minimal differences in most instances.