## 4 Experimental Environment and Methodology in Smart Farming Environment
### Results  
Figure 9 provides an overview of the model's classification performance by displaying the confusion matrix, a tool used to evaluate prediction accuracy across different categories. The experimental results were evaluated using this confusion matrix, from which we identified true positive (_TP_), true negative (_TN_), false positive (_FP_), and false negative (_FN_) values. These values were then used to calculate accuracy, precision, recall, and the F1 score, providing a comprehensive assessment of the model's effectiveness.  
Figure 8: Semantic segmentation of time-series data.  
Figure 7: Results of state classification.  
The metrics used to assess the model's effectiveness are described as follows:  
* **Accuracy**: The proportion of correct predictions among the total predictions, calculated as follows: \[\text{Accuracy}=\frac{TP+TN}{TP+TN+FP+FN}\]
* **Precision**: The ratio of true positive predictions to all positive predictions, calculated as follows: \[\text{Precision}=\frac{TP}{TP+FP}\]
* **Recall (or Sensitivity)**: The proportion of actual positive instances correctly identified as positive, calculated as follows: \[\text{Recall}=\frac{TP}{TP+FN}\]
* **F1 Score**: The harmonic mean of precision and recall, calculated as follows: \[\text{F1 Score}=2\times\frac{\text{Precision}\times\text{Recall}}{\text{ Precision}+\text{Recall}}\]  
These metrics provide a comprehensive view of the model's performance and its effectiveness in classification tasks for smart farming applications. Table 1 summarizes the evaluation metrics for each class.  
The proposed model achieved an accuracy rate of 89.07%. However, due to data imbalance, this metric alone does not fully reflect the model's performance across all classes. While the model demonstrated high precision for abnormal classes, it was less precise for the normal (non-anomalous) class. Additionally, while recall accuracy was high for the normal class, it was relatively lower for the irrigation class. The F1 score was moderately accurate for the irrigation and normal classes but showed superior performance for the  
Figure 9: Confusion matrix for model performance.  
abnormal class. To enhance overall model performance, particularly in correctly classifying the normal class, further strategies, such as additional data collection and model fine-tuning, are necessary.  
Figure 10 illustrates the impact of labeling errors on model performance by comparing the manually labeled data with the predicted labels. This figure highlights the discrepancies occurring from manual labeling, such as missing segments and misclassifications, which can reduce accuracy and consistency in large-scale time-series data. The top graph shows the manually labeled data, with the black sections indicating missing labels and some irrigation segments incorrectly labeled as normal. These issues illustrate the challenges of manual labeling for large-scale time-series data. In the bottom graph, the proposed algorithm correctly differentiates between normal and irrigation events, emphasizing its potential for automated and accurate labeling.