Skip to content

πŸ” Network Security Threat Detection | End-to-End MLOps Pipeline πŸš€ An end-to-end production-grade ML pipeline for Network Intrusion Detection, integrating modern MLOps tools β€” MLflow, DVC, Docker, GitHub Actions, and Dagshub. Tracks data, automates training, logs experiments, and enables full CI/CD + containerised deployment.

Notifications You must be signed in to change notification settings

Ananddd06/Network_Security_end_to_end_Mlops_DVC_Mlflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

77 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Network Security πŸ›‘οΈ | End-to-End MLOps Pipeline πŸš€

Welcome to the Network Security Threat Detection project β€” an end-to-end implementation of a production-grade ML pipeline integrating modern MLOps tools including MLflow, DVC, Docker, GitHub Actions, CI/CD, and Dagshub.

πŸ’‘ Designed for real-world use cases like intrusion detection using machine learning β€” deployable, trackable, reproducible, and scalable!


πŸ“Š Problem Statement

In this project, we tackle the problem of network intrusion detection using ML algorithms. Our goal is to build a pipeline that:

  • Ingests network traffic data
  • Preprocesses and extracts meaningful features
  • Trains a model to classify normal vs suspicious activity
  • Deploys the model with full CI/CD and MLOps support

πŸ§ͺ ML Pipeline Components

πŸ› οΈ Data Versioning with DVC

  • βœ… Tracks raw and processed datasets
  • βœ… Pipeline defined in dvc.yaml
  • βœ… Remote storage: DagsHub

πŸ§ͺ Experiment Tracking with MLflow

  • 🎯 Log metrics, parameters, and artifacts
  • πŸ“Š Compare multiple models & runs visually
  • 🧠 Integrate with sklearn pipeline easily

🐳 Containerization with Docker

  • Reproducible environments
  • Easy deployment across dev/stage/prod

πŸ”„ CI/CD with GitHub Actions

  • Every push or PR triggers:
    • βœ… Code linting
    • βœ… Unit tests
    • βœ… DVC pipeline execution
    • βœ… MLflow tracking
    • βœ… Docker build & push

πŸ“‘ Deployment Ready

  • Containerized inference API (FastAPI or Flask)
  • Ready for deployment on AWS/GCP/Azure or Heroku

πŸš€ Tools & Technologies Used

Category Tools
πŸ‘¨β€πŸ’» Programming Python, Pandas, NumPy, Scikit-learn
πŸ“¦ ML Lifecycle MLflow, DVC, Dagshub, Hydra
🧱 MLOps/CI-CD GitHub Actions, Docker, YAML, Pytest
🌐 Visualization Matplotlib, Seaborn, MLflow UI
πŸ” Version Control Git, GitHub

βš™οΈ Run the Project Locally

# 1. Clone the repo
git clone https://github.com/yourusername/network-security-mlops.git
cd network-security-mlops

# 2. Set up DVC
dvc pull   # Pull data from remote storage
dvc repro  # Reproduce the entire pipeline

# 3. Track experiments
mlflow ui  # Launch MLflow dashboard at http://127.0.0.1:5000

# 4. Build Docker container
docker build -t network-mlops-app .
docker run -p 8000:8000 network-mlops-app

πŸ“Š Dataset Used

This is the dataset used to build and train the machine learning model in this project.
Download it from the link below:

Download Dataset


πŸ“ˆ MLflow Example Output

  • πŸ”’ Accuracy, Precision, Recall, ROC Curve
  • πŸ“ Model artifact: RandomForestClassifier.pkl
  • πŸ“Š Visual run comparison dashboard

Monitoring and Experiment Tracking

For seamless monitoring of the project’s DVC pipelines and MLflow experiments, kindly visit the Dagshub repository linked below:

πŸ”— View Dagshub Repository

πŸ“· MLflow Tracking UI

Here's a preview of how the experiments and metrics are logged in MLflow:

Mlflow Comparision

πŸ” Model Metrics

Below is the Models metrics That have used in this model traning

Model Metrics

πŸ“Š Comparision Charts

Below is a visualization of metrics like accuracy, precision, recall over different runs:

MLflow Charts

πŸ” DVC Pipeline from Dagshub

DVC pipeline stages and tracking interface hosted on Dagshub:

DVC Pipeline

🚧 CI/CD Pipeline (GitHub Actions)

.github/workflows/mlops.yml
Runs the full pipeline on every push:

  • βœ… Lint + Tests
  • βœ… DVC repro
  • βœ… MLflow log
  • βœ… Docker image push

🧠 Future Improvements

  • ✨ Add LSTM or Deep Learning models
  • πŸ“¦ Convert to FastAPI microservice
  • πŸ” Add role-based access control for logs
  • πŸ“Š Grafana + Prometheus monitoring
  • ☁️ Deploy to AWS Sagemaker or GCP AI Platform
  • ✨ CICD Pipeline

⭐️ Show your support

If you liked this project, please consider giving it a ⭐️ and sharing with others!

πŸ›‘οΈ Empowering network security with reproducible ML pipelines!


πŸ–₯️ Model Deployment Options

Choose either of the following options to serve your trained model:

🎨 Streamlit Dashboard

  • An interactive web interface to test your model
  • Upload CSV or manually enter input features
  • See predictions live, with metrics and visualizations
streamlit run src/app_streamlit.py

πŸš€ Flask API

  • A production-grade REST API endpoint to serve predictions
  • Send POST requests with JSON payload
  • Easily integrate with any web or mobile frontend
python src/app_flask.py

πŸ’‘ Whether you're demoing the model in a web dashboard (Streamlit) or deploying via API (Flask), this project gives you flexibility to move fast in any real-world environment.



πŸ§ͺ DEMO & Practice

This project structure and workflow was inspired by Krish Naik sir’s teachings on practical MLOps and end-to-end ML deployment.

πŸ’‘ I’ve extended and personalized it with full MLOps integration, CI/CD, and deployment options for real-world use cases in Network Security.

πŸ§‘β€πŸ« Demo Guidance:

You can also explore Krish Naik’s YouTube tutorials on:

  • DVC + MLflow
  • MLOps project pipelines
  • Dockerized ML apps
  • Streamlit deployment
  • GitHub Actions for CI/CD

▢️ Practice this project hands-on by cloning and running each stage step-by-step.
Contributions are welcome to enhance this open-source solution further!


πŸ’¬ β€œLearning by doing is the fastest path to mastery.” β€” Thanks to Krish Naik sir for being a constant inspiration to ML learners.


About

πŸ” Network Security Threat Detection | End-to-End MLOps Pipeline πŸš€ An end-to-end production-grade ML pipeline for Network Intrusion Detection, integrating modern MLOps tools β€” MLflow, DVC, Docker, GitHub Actions, and Dagshub. Tracks data, automates training, logs experiments, and enables full CI/CD + containerised deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages