# Improved Anomaly Detection by Using the Attention-Based Isolation Forest
## 6 Concluding Remarks
It is important to point out that small improvements were observed for many real datasets. However, with these improvements, ABIForest was able to detect additional anomalous instances that were not detected by the original iForest. Moreover, we applied the simplest form of an attention mechanism that used a contamination model to simplify computations. However, when anomalous instances are crucial for a certain application, the attention mechanism can be significantly improved by introducing additional learnable parameters that make the whole algorithm more accurate. The proposed simple attention-based model can be regarded as a first step in incorporating various forms of attention mechanisms into iForest. This aims to illustrate that this incorporation can be a prospective tool in the anomaly detection area of research. In spite of the disadvantages considered above, ABIForest can be viewed as the first version for incorporating an attention mechanism into iForest, which showed results that outperformed those of the original. Future modifications that resolve the above disadvantages are interesting directions for further research. We studied only the case of supervised learning. Prior labels provided by the isolation forest can be used to apply ABIForest. However, this approach has an obstacle, namely, it is not clear how to process instances that have been incorrectly labeled by the isolation forest. These instances will contribute to incorrect results of ABIForest. There is another idea of developing an unsupervised ABIForest. By using an attention mechanism, we can increase the distance between the threshold for the path length and the real path length of each instance in each tree. Then, attention weights will increase the distance for a new instance in order to make a more robust decision about the instance. In this case, the attention weights will make the anomaly detection procedure more robust. However, this is a task for further research and for developing modifications of iForest based on an attention mechanism. **Author Contributions:** Conceptualization, L.U. and A.K. ; methodology, L.U. and V.M. ; software, A.K. and A.A.; validation, A.A. and A.K. ; formal analysis, A.A. and L.U. ; investigation, A.K. and L.U. ; resources, A.A. and V.M. ; data curation, A.A.; writing--original draft preparation, L.U. and A.A.; writing--review and editing, A.K. and V.M. ; visualization, A.A.; supervision, L.U. ; project administration, V.M. ; funding acquisition, V.M. All authors have read and agreed to the published version of the manuscript. **Funding:** This research was partially funded by the Ministry of Science and Higher Education of the Russian Federation as part of the World-Class Research Center program: Advanced Digital Technologies (contract No. 075-15-2022-311, dated 20 April 2022). **Acknowledgments:** The authors would like to express their appreciation for the anonymous referees, whose very valuable comments improved the paper. **Institutional Review Board Statement:** Not applicable. **Informed Consent Statement:** Not applicable. **Data Availability Statement:** Not applicable. **Conflicts of Interest:** The authors declare no conflict of interest.