Skip to content

dheerusri324/SystemAnomalyMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 System Anomaly Monitor 🚨🧠

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.


🔍 What This Project Does

  • 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

🧠 Architecture Overview

Frontend (JavaFX)

  • Live system metrics dashboard
  • Confidence-based alerts
  • Suspicious vs High-risk states
  • User feedback buttons (True / False)

Backend (Python)

  • 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.


🧩 Versions & Evolution

v1 – Metrics Viewer

  • Basic system metric collection
  • JavaFX dashboard

v2 – ML-Based Anomaly Detection

  • Isolation Forest model
  • Real-time anomaly detection
  • Automatic data logging

v3 – User Feedback System

  • True / False anomaly buttons
  • Feedback logging to CSV
  • Foundation for adaptive learning

v4 – Intelligent Alerts

  • Confidence-based anomaly scoring
  • Suspicious vs High-risk alerts
  • Cooldown logic to prevent alert spam
  • Explainability (why an alert occurred)

v5 – Fully Autonomous Adaptive System ✅

  • Feedback-aware retraining
  • Adaptive contamination tuning
  • Live model updates without restart
  • Background retrain thread
  • Clean architecture (config + utils)
  • No manual scripts required

🔁 How Learning Works (v5)

  1. System detects anomaly with confidence score
  2. User labels alert as TRUE or FALSE
  3. Feedback is logged
  4. Background retrain thread:
    • Adjusts contamination based on false-alarm rate
    • Retrains Isolation Forest
    • Hot-swaps model in memory
  5. System behavior adapts to user preferences

This is online, feedback-driven learning without deep learning overhead.


🧰 Tech Stack

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

📦 Repository Structure

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.


⚙️ Requirements

  • Java 17+
  • Maven (or mvnw)
  • Python 3.8+ (3.11 recommended)

Python dependencies:

  • numpy
  • pandas
  • scikit-learn
  • psutil
  • joblib

🚀 How to Run

1. Start Python Server

python anomaly_server.py

2. Start JavaFX App

Run Launcher or MainApp from IDE or packaged JAR.


🎯 Why This Project Matters

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.


🧠 Interview Narrative (v5)

“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.”


📌 Author

Bala Dheeraj Chennavaram
Undergraduate | AI & ML Enthusiast
Vasavi College of Engineering


📜 License

MIT License © 2025 Bala Dheeraj Chennavaram

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors