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!
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
- β Tracks raw and processed datasets
- β
Pipeline defined in
dvc.yaml - β Remote storage: DagsHub
- π― Log metrics, parameters, and artifacts
- π Compare multiple models & runs visually
- π§ Integrate with sklearn pipeline easily
- Reproducible environments
- Easy deployment across dev/stage/prod
- Every
pushorPRtriggers:- β Code linting
- β Unit tests
- β DVC pipeline execution
- β MLflow tracking
- β Docker build & push
- Containerized inference API (FastAPI or Flask)
- Ready for deployment on AWS/GCP/Azure or Heroku
| 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 |
# 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
This is the dataset used to build and train the machine learning model in this project.
Download it from the link below:
- π’ Accuracy, Precision, Recall, ROC Curve
- π Model artifact: RandomForestClassifier.pkl
- π Visual run comparison dashboard
For seamless monitoring of the projectβs DVC pipelines and MLflow experiments, kindly visit the Dagshub repository linked below:
Here's a preview of how the experiments and metrics are logged in MLflow:
Below is the Models metrics That have used in this model traning
Below is a visualization of metrics like accuracy, precision, recall over different runs:
DVC pipeline stages and tracking interface hosted on Dagshub:
.github/workflows/mlops.yml
Runs the full pipeline on every push:
- β Lint + Tests
- β DVC repro
- β MLflow log
- β Docker image push
- β¨ 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
If you liked this project, please consider giving it a βοΈ and sharing with others!
π‘οΈ Empowering network security with reproducible ML pipelines!
Choose either of the following options to serve your trained model:
- 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
- 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.
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.
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
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.



