- Dr. Seyedmostafa Safavi
- Chee Zhung Ong
- Sze Shun Low
- Wenn Yeow Russell Chan
- Zhi Hong Yip
This project presents a lightweight Random Forest (RF) model for network intrusion detection, designed to balance high detection accuracy with low computational cost. The model performs efficiently even in real-time and resource-constrained environments, making it suitable for modern cybersecurity systems.
DOI: [XXXXXXX]
- Loads datasets:
UNSW_NB15_training-set.csvUNSW_NB15_testing-set.csv
- Removes unnecessary columns:
id,attack_cat - Encodes labels:
0→ Normal1→ Attack
- Categorical features encoded using LabelEncoder
- Numerical features standardized using StandardScaler
- Applies SMOTE (Synthetic Minority Over-sampling Technique)
to balance Normal and Attack samples.
- Uses GridSearchCV for optimal hyperparameter selection
- Trains each model on the SMOTE-balanced dataset
- Includes baseline and tuned models for comparison
Each model is evaluated using:
- Accuracy
- Precision
- Recall
- F1-Score
✅ Confusion Matrices are plotted for visual comparison.
✅ A combined bar chart summarizes all test metrics.
- Trained models saved in the
/modelsdirectory as.pklfiles - Encoders and scalers stored for easy reuse during deployment
- Generates visual comparisons of model performance
- Includes confusion matrices and bar charts for clarity
git clone https://github.com/hadeswithming23/UNSWDLI.git
cd UNSWDLIpip install -r requirements.txtstreamlit run unsw_app.pyThen open your browser and go to: http://localhost:8501