*Article* **Hierarchical Anomaly Detection Model for In-Vehicle Networks Using Machine Learning Algorithms**

### **Seunghyun Park and Jin-Young Choi \***

School of Cybersecurity, Korea University, Seoul 02841, Korea; cloakingmode@korea.edu

**\*** Correspondence: choi@formal.korea.ac.kr

Received: 13 June 2020; Accepted: 13 July 2020; Published: 15 July 2020

**Abstract:** The communication and connectivity functions of vehicles increase their vulnerability to hackers. The unintended failure and malfunction of in-vehicle systems caused by external factors threaten the security and safety of passengers. As the controller area network alone cannot protect vehicles from external attacks, techniques to analyze and detect external attacks are required. Therefore, we propose a multi-labeled hierarchical classification (MLHC) intrusion detection model that analyzes and detects external attacks caused by message injection. This model quickly determines the occurrence of attacks and classifies the attack using only existing classified attack data. We evaluated the performance of the model by analyzing its learning space. We further verified the model by comparing its accuracy, F1 score and data learning and evaluation times with the two layers multi-class detection (TLMD) and single-layer multi-class classification (SLMC) models. The simulation results show that the MLHC model has the highest F1 score of 0.9995 and is 87.30% and 99.92% faster than the SLMC and TLMD models in terms of detection time, respectively. Consequently, the proposed model can classify both the type and existence or absence of attacks with high accuracy and can be used in interior communication environments of high-speed vehicles with a high throughput.

**Keywords:** controller area network; intrusion detection system; in-vehicle network security; machine learning; hierarchical approach; anomaly detection; MLHC
