A real-time, adaptive JavaFX + Python system that monitors CPU, memory, disk, network, and process activity and detects anomalous behavior using Machine Learning (Isolation Forest) and human feedback.
This project evolved from a basic anomaly detector into a fully autonomous, feedback-aware monitoring system that learns what this user considers normal.
- Monitors system metrics in real time
- Detects anomalies using Isolation Forest
- Uses confidence-based alerts (not just true/false)
- Explains why an anomaly was raised
- Learns from user feedback (TRUE / FALSE)
- Automatically retrains itself while running
- Requires no manual training scripts in v5
- Live system metrics dashboard
- Confidence-based alerts
- Suspicious vs High-risk states
- User feedback buttons (True / False)
- TCP socket server
- Isolation Forest (scikit-learn)
- Feedback-aware retraining loop
- Background cleanup & retrain threads
Java ↔ Python communication is handled via TCP sockets for low-latency inference.
- Basic system metric collection
- JavaFX dashboard
- Isolation Forest model
- Real-time anomaly detection
- Automatic data logging
- True / False anomaly buttons
- Feedback logging to CSV
- Foundation for adaptive learning
- Confidence-based anomaly scoring
- Suspicious vs High-risk alerts
- Cooldown logic to prevent alert spam
- Explainability (why an alert occurred)
- Feedback-aware retraining
- Adaptive contamination tuning
- Live model updates without restart
- Background retrain thread
- Clean architecture (config + utils)
- No manual scripts required
- System detects anomaly with confidence score
- User labels alert as TRUE or FALSE
- Feedback is logged
- Background retrain thread:
- Adjusts contamination based on false-alarm rate
- Retrains Isolation Forest
- Hot-swaps model in memory
- System behavior adapts to user preferences
This is online, feedback-driven learning without deep learning overhead.
| Component | Technology |
|---|---|
| Frontend UI | JavaFX |
| Backend | Python |
| ML Model | Isolation Forest (scikit-learn) |
| Metrics | psutil |
| Data | pandas, CSV |
| Concurrency | Python threading |
| Bridge | TCP socket + JSON |
| Build | Maven |
SystemAnomalyMonitor
├─ src
│ ├─ main
│ │ ├─ java/com/dheeraj/systemanomalymonitor
│ │ ├─ resources/com/dheeraj/systemanomalymonitor
│ │ └─ python
│ │ ├─ anomaly_server.py
│ │ ├─ feedback_trainer.py
│ │ ├─ feature_utils.py
│ │ ├─ config.yaml
│ │ ├─ feedback_log.csv
│ │ ├─ system_metrics.csv
│ │ └─ iforest_model.joblib
├─ pom.xml
├─ .gitignore
└─ README.md
Large artifacts (CSV, joblib) should be gitignored in real deployments.
- Java 17+
- Maven (or mvnw)
- Python 3.8+ (3.11 recommended)
Python dependencies:
- numpy
- pandas
- scikit-learn
- psutil
- joblib
python anomaly_server.py
Run Launcher or MainApp from IDE or packaged JAR.
This project demonstrates:
- Applied Machine Learning
- Human-in-the-loop learning
- Real-time systems design
- Clean architecture evolution
- Practical handling of false positives
It is intentionally simple, explainable, and interview-safe.
“I started with pure ML anomaly detection, but users hated false alarms.
By v5, the system learns from user feedback, adapts its sensitivity automatically, explains its decisions, and retrains live without downtime.”
Bala Dheeraj Chennavaram
Undergraduate | AI & ML Enthusiast
Vasavi College of Engineering
MIT License © 2025 Bala Dheeraj Chennavaram