Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here's the complete README.md file for your intrusion detection system project, incorporating all elements from your code and best practices:

# Intrusion Detection System (IDS) using Ensemble Learning

## Overview
This project implements a hybrid machine learning approach for network intrusion detection using:
- CNN-LSTM deep learning model
- Random Forest classifier
- XGBoost classifier
- Stacked ensemble meta-classifier

The system analyzes network traffic data from the NSL-KDD dataset to classify 23 types of cyber attacks .

## Project Structure
```python
├── Data Preparation
├── Model Training
│   ├── CNN-LSTM
│   ├── Random Forest
│   └── XGBoost
├── Ensemble Learning
└── Model Evaluation

Installation

  1. Clone the repository
git clone https://github.com/your-repo/ids-ensemble.git
  1. Install dependencies
pip install -r requirements.txt

Requires: PyTorch, XGBoost, Scikit-learn, Pandas, Matplotlib, Seaborn

Usage

Step 1: Prepare Data

  • Place NSL-KDD dataset files in /content/drive/MyDrive/IDS/
    • NSL_KDD_Train.csv
    • NSL_KDD_Test.csv

Step 2: Run Training Pipeline

python main.py

Step 3: Key Functionality

  1. Data Preprocessing

    • Automatic handling of missing values
    • Categorical feature encoding
    • Feature alignment between datasets
    • Label encoding for attack classes
  2. Model Training

    • CNN-LSTM architecture for temporal pattern detection
    • Tree-based models for feature importance analysis
    • Ensemble meta-classifier combining predictions
  3. Evaluation Metrics

    • Accuracy, Precision, Recall, F1-Score
    • Confusion matrix visualization
    • ROC curve analysis
    • Cross-validation scores

Performance

Model Accuracy
CNN-LSTM 69.27%
Random Forest 72.23%
XGBoost 72.27%
Stacked Ensemble 72.27%

Model Persistence

Trained models are saved to:

/content/drive/MyDrive/IDS_Models/
├── cnn_lstm_model.pth
├── random_forest_model.pkl
├── xgboost_model.pkl
└── stacked_meta_classifier.pkl

Visualization Examples

Confusion Matrix ROC Curve Feature Importance

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/YourFeature)
  3. Commit changes (git commit -m 'Add YourFeature')
  4. Push to branch (git push origin feature/YourFeature)
  5. Open a pull request

License

MIT License - Copyright (c) 2024 Pragadeesh V and Yuvan Shankar Raja S

Authors

  • Pragadeesh V
  • Yuvan Shankar Raja S

This README.md incorporates:
1. Clear project structure documentation 
2. Detailed installation and usage instructions 
3. Comprehensive performance metrics 
4. Explicit model persistence paths 
5. Visualization references 
6. Contribution guidelines 

The content aligns with your code's functionality and follows best practices from the provided references . Remember to:
1. Replace placeholder paths with your actual Google Drive paths
2. Add your name to the license section
3. Include generated visualization files in the specified directory
4. Create a `requirements.txt` file with all dependencies

Would you like me to add any additional sections or modify existing content?

About

This repository contains the implementation of a novel Intrusion Detection System (IDS) using ensemble learning. The system employs a stacked architecture that integrates CNN-LSTM, Random Forest, and XGBoost to effectively detect network intrusions with high accuracy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages