ANÁLISIS COMPARATIVO DEL RENDIMIENTO DE MODELOS DE APRENDIZAJE AUTOMÁTICO PARA LA DETECCIÓN DE
INTRUSIONES USANDO EL DATASET CIC-IDS2017
resistencia al sobreajuste y eficiencia computacional, lo que lo hace adecuado para desplegar
sistemas IDS basados en aprendizaje automático en redes reales, entornos donde la correlación
entre variables es alta.
Palabras clave: aprendizaje automático, ciberseguridad, CIC-IDS2017, detección de intrusiones,
Random Forest, tráfico de red
ABSTRACT: The increase in technological infrastructure, cyber threats, and network traffic
volume has made intrusion detection a critical component of cybersecurity. Therefore, this
study conducted a comparative evaluation of the performance of the Random Forest, Support
Vector Machine, and Naive Bayes algorithms with respect to traffic classification. The CIC-
IDS2017 dataset was used as an experimental framework, employing a quantitative
experimental approach. Benign traffic, DDoS attacks, and PortScans were analyzed, working
with over one million records, which underwent cleaning, numerical transformation, and
imputation of missing data. Subsequently, 300,000 records were selected to train the models
and evaluate them using metrics such as accuracy, precision, recall, and F1 score. Additionally,
the interaction and importance of variables, confusion matrices, and the correlation between
network traffic characteristics were assessed. The results showed that Random Forest
performed best, achieving an accuracy of nearly 99.98% and demonstrating a high capacity for
differentiating traffic. Support Vector Machine, on the other hand, achieved an accuracy of
approximately 80.74%, with limitations in identifying PortScan attacks. In contrast, Naive Bayes
registered the lowest performance with an accuracy of 44.62%, demonstrating difficulties
working with complex datasets and correlated variables. Feature importance analysis revealed
that variables related to traffic volume, packet size, and the statistical behavior of transmissions
are key to distinguishing traffic types. These findings demonstrate that Random Forest is the
most balanced option: it combines high generalization capacity, resistance to overfitting, and
computational efficiency, making it suitable for deploying machine learning-based IDS systems
in real-world networks, environments where the correlation between variables is high.
Keywords: machine learning, cybersecurity, CIC-IDS2017, intrusion detection, Random Forest,
network traffic
INTRODUCCIÓN
El crecimiento de las infraestructuras tecnológicas y la dependencia de estas en sectores
estratégicos como salud, finanzas, industria y educación ha permitido la exposición a amenazas
cibernéticas. Actualmente, los ataques informáticos son más sofisticados, dinámicos y
automatizados, afectando de manera importante a la confidencialidad, integridad y
disponibilidad de la información. Por lo que la detección temprana de actividades maliciosas es
una necesidad prioritaria dentro de la ciberseguridad moderna (1,2).
En este contexto, los Sistemas de Detección de Intrusiones (IDS) cumplen un rol fundamental en
la identificación de comportamientos anómalos dentro de las infraestructuras de red.
Tradicionalmente, estos sistemas han utilizado mecanismos basados en firmas y reglas
315