# Construction and Completion of the Knowledge Graph for Cow Estrus with the Association Rule Mining
## 5 Validation of Association Rules
### Evaluation Metrics and Experimental Comparison
For precision, the precision of estrus identifi  
Figure 11: Performance comparison of knowledge-graph-based and association-rule-based methods validated by Boolean functions across data sizes. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Data Size** & **Accuracy** & **Precision** & **Recall** & **F1 Score** \\ \hline
200 & 0.85 & 0.85 & 0.90 & 0.85 \\
500 & 0.84 & 0.84 & 0.88 & 0.84 \\
1000 & 0.86 & 0.86 & 0.87 & 0.86 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Performance metrics across different data sizes. higher when using the strong association rules, indicating a reduction in false positives. Regarding recall, the recall improved with the introduction of strong association rules, indicating a reduction in false negatives. The F1 score, which balances precision and recall, was also higher for the knowledge-graph-based approach with strong association rules. These results clearly demonstrate that the knowledge-graph-based approach, enhanced with strong association rules, outperformed the initial approach in terms of accuracy, precision, recall, and F1 score. The improvement in performance was consistent across different dataset sizes, indicating the robustness and effectiveness of the enhanced approach in accurately identifying edrus in cows. To assess the effectiveness of the association rules in detecting abnormal edrus, we conducted a comparative experiment involving four distinct approaches: the Iforest-OCSVM model with association rule-based feature weighting, the standard Iforest-OCSVM without feature weighting, the Iforest-OCSVM model with association rule-based feature weighting excluding the Lift metric, and the Iforest-OCSVM model with CNN-based feature extraction. This experiment was conducted on a dataset comprising 1000 samples. The outcomes, as detailed in Table 8, revealed that the Iforest-OCSVM model augmented with association-rule-based feature weighting achieved superior performance over the other models across accuracy, precision, recall, and F1-score metrics. These findings underscore the significant contribution of integrating association rules with feature weighting to enhance the detection of abnormal edrus, and also demonstrate the potential of CNN-based feature extraction for improving model performance. The results presented in Table 10 demonstrate that the Iforest-OCSVM model enhanced with association-rule-based feature weighting outperformed the standard model across all evaluation metrics. Specifically, the weighted model exhibited improvements of 5% in accuracy, 6% in precision, 7% in recall, and 6% in F1-score over the unweighted counterpart. These enhancements underscore the substantial benefit of integrating association-rule-based feature weighting, which refined the model's ability to effectively detect abnormal edrus, as shown in Figure 12.  
Additionally, the model excluding the Lift metric from the association-rule-based feature weighting also showed competitive performance, achieving 0.90 in accuracy and 0.84 in F1-score. This suggests that while the Lift metric contributed to the model's performance, its exclusion did not significantly diminish the model's effectiveness. The CNN model's lower accuracy in detecting cow edrus was mainly due to its limited feature extraction capability for non-image data, its model complexity leading to overfitting, and inadequate data preprocessing. In contrast, association rules exceled by effectively capturing relationships between features, providing interpretable and actionable insights, and enhancing the robustness and completeness of the knowledge graph. These advantages make association rules a more suitable approach for this specific application.