This project is an end-to-end Machine Learning pipeline designed to detect and analyze network security threats using structured data. It follows industry-standard MLOps practices, including modular architecture, configuration-driven pipelines, logging, exception handling, experiment tracking, and model evaluation.
The project is built to demonstrate real-world ML engineering skills expected in interviews and production environments.
- End-to-End Machine Learning Pipeline
- Modular & Scalable Codebase
- MLOps Best Practices
- Configuration-Driven Architecture
- Data Validation & Drift Detection
- Feature Engineering & Preprocessing
- Model Training, Evaluation & Selection
- Hyperparameter Tuning (GridSearchCV)
- Experiment Tracking (MLflow)
- Custom Exception Handling & Logging
- Production-Ready Folder Structure
To build a robust machine learning system that:
- Ingests raw network data
- Validates schema and detects data drift
- Performs feature transformation and preprocessing
- Trains and evaluates multiple ML models
- Tracks experiments and metrics
- Selects and saves the best-performing model
network_security/
│
├── main.py
├── artifacts/
├── config/
│ ├── schema.yaml
│ └── config.yaml
├── networksecurity/
│ ├── components/
│ │ ├── data_ingestion.py
│ │ ├── data_validation.py
│ │ ├── data_transformation.py
│ │ ├── model_trainer.py
│ │ └── model_evaluation.py
│ ├── pipeline/
│ │ └── training_pipeline.py
│ ├── utils/
│ │ └── common.py
│ ├── logger/
│ └── exception/
├── notebooks/
├── requirements.txt
└── README.md
- Reads raw CSV data
- Splits into train & test datasets
- Stores artifacts in timestamped directories
- Schema validation using
schema.yaml - Checks column names, data types
- Detects data drift using statistical tests
- Generates drift report
- Handles missing values using KNNImputer
- Feature scaling and preprocessing via pipelines
- Saves transformed train/test arrays (
.npy) - Saves preprocessing object for reuse
- Trains multiple regression/classification models
- Uses GridSearchCV for hyperparameter tuning
- Cross-validation based model selection
-
Evaluates models using metrics like:
- R² Score
- Accuracy / Precision / Recall (if applicable)
-
Compares against baseline model
- Tracks parameters, metrics, and models using MLflow
- Stores experiment history for reproducibility
- Scikit-learn Pipelines
- KNN Imputation
- Feature Scaling
- Hyperparameter Tuning
- Cross Validation
- Train-Test Split
- R² Score
- Mean Squared Error (optional)
- Model Comparison Metrics
- Python 3.8+
- Scikit-learn
- Pandas & NumPy
- MLflow
- YAML Configuration Files
- Logging & Exception Handling
git clone <repo-url>
cd network_securitypython -m venv venv
venv\Scripts\activatepip install -r requirements.txtpython main.pymlflow uiThen open browser at:
http://13.201.174.16:8080
- Modular Code Structure
- Reusable Components
- Config-Driven Design
- Robust Error Handling
- Detailed Logging
- Scalable Architecture
- Explained full ML lifecycle
- Prevented data leakage (fit on train only)
- Used pipelines for reproducibility
- Applied hyperparameter tuning
- Used MLflow for experiment tracking
- Designed scalable, maintainable ML system
- Environment variables for managing secrets and credentials
- IAM roles instead of hardcoded AWS access keys
- Secure access control for MongoDB Atlas
- AWS S3 bucket policies for controlled and restricted access
- Separation of configuration, secrets, and code
- Logging without exposing sensitive information
- Production-ready Machine Learning pipeline
- End-to-end MLOps workflow demonstration
- Network security threat detection systems
- Cloud-based ML systems
- Resume and portfolio project for ML / MLOps roles
- Interview-ready real-world ML engineering example
MLflow, AWS Deployment, ETL Pipelines, MongoDB Atlas, EC2 Instance, Docker, Amazon ECR, AWS S3 Buckets, MLOps, Cloud Computing, Machine Learning, DevOps, Network Security, Data Validation, Model Monitoring
SARWAGYA SHAH
Machine Learning Engineer | Data Scientist
GitHub: (https://github.com/SARWAGYASHAH) LinkedIn:(https://www.linkedin.com/in/sarwagyashahonline/)
⭐ If you find this project useful, consider giving it a star and feel free to connect!
SARWAGYA SHAH Machine Learning Engineer | Data Scientist
⭐ If you like this project, give it a star and feel free to connect!