AI system to detect cyber threats using ML (Regression + Classification) π₯ AI Cyber Risk Detection System
An advanced Machine Learning project that detects potential cyber threats and assigns a risk score based on network behavior.
π Overview
This project combines Machine Learning and Cybersecurity concepts to analyze network activity and classify whether it is normal or malicious.
It uses:
- Regression β to calculate a risk score
- Classification β to detect attack vs normal behavior
π§ Concepts Used
- Linear Regression (from scratch)
- Softmax / Logistic Regression
- Gradient Descent Optimization
- Cross Entropy Loss
- Data Preprocessing & Normalization
- Confusion Matrix Evaluation
π Dataset
- KDD Cup 99 Intrusion Detection Dataset
- Loaded using Scikit-learn
βοΈ Features
- Detects cyber attacks from network data
- Generates a numerical risk score
- Classifies traffic as Normal / Attack
- Provides simple explanations for predictions
- Visualizes:
- Training loss curves
- Confusion matrix
- Risk distribution
π Sample Output
Risk Score: 78
Risk Level: ATTACK
Reasons:
- High data transfer
- Unusual traffic pattern
π Project Structure
smart-risk-intelligence-system/ β βββ src/ β βββ preprocessing.py β βββ regression.py β βββ classification.py β βββ evaluation.py β βββ explainability.py β βββ output/ β βββ graphs/ β βββ main.py βββ README.md
-
Install dependencies: pip install numpy matplotlib scikit-learn
-
Run the project: python main.py
π Output Graphs
The system automatically saves graphs in: output/graphs/
- Regression Loss Curve
- Classification Loss Curve
- Confusion Matrix
- Risk Score Distribution
π‘ Future Improvements
- Real-time network monitoring
- Integration with security tools
- Deployment as a web app
- Advanced anomaly detection
π¨βπ» Author
DataX_Soham
β If you like this project
Give it a star on GitHub!