netspy is a futuristic, high-performance system monitoring dashboard that leverages Machine Learning (Isolation Forests) to detect and alert you to anomalous spikes in Network, CPU, and RAM usage in real-time. Built with a sleek "Cyberpunk Dark" aesthetic, it transforms raw system metrics into actionable intelligence.
Lead Architect: Shubhechchha Basu
Contributor: Bratik Mukherjee ( Bimbok )
Unlike traditional monitors that use fixed thresholds (e.g., "alert at 90%"), netspy uses an Ensemble of Decision Trees (Isolation Forest) to learn your system's "normal" behavior.
- Multi-Dimensional Analysis: Evaluates raw values, velocity (rate of change), and trend-deviance.
- Adaptive Learning: The models retrain themselves every 60 seconds to adapt to your current workflow.
- Persistent Intelligence: Trained models are cached using
pickle(platform-aware:.cache/netspyon Linux,AppDataon Windows) to stay smart across restarts.
Experience fluid, real-time telemetry with custom-tuned Matplotlib integration.
- Liquid Smooth Graphs: 40ms update cycles (~25-30 FPS) with a 120-point high-resolution buffer.
- Neon Area Fills: Dynamic glowing fills that change color (Cyan to Anomaly Red) based on AI predictions.
- Data Smoothing: Simple Moving Average (SMA) filtering to eliminate "jitter" while preserving spike detection.
A dedicated analyzer module that goes beyond simple bandwidth tracking:
- Protocol Distribution: Visualizes TCP vs. UDP traffic ratios using live bar charts.
- Top Remote Endpoints: Ranks the top 8 IP addresses your device is communicating with.
- Active Node Detection: Automatically identifies and tracks the primary active network interface (WLAN, Ethernet, etc.).
A bespoke UI built for clarity and impact:
- Rounded Geometry: Custom-engineered
RoundedFramecomponents for a modern, hardware-appliance look. - Sidebar Navigation: Seamlessly switch between System Overview, Network, CPU, and RAM clusters.
- Session Stats: Tracks Peak Speed, Average Load, Total Data Consumed, and Session Uptime.
The project follows a strict modular architecture for scalability:
main.py: The lightweight entry point.src/core/monitor.py: The "Brain." Handlespsutildata gathering, feature engineering, and the AI training/prediction pipeline.src/ui/:dashboard.py: Main container and navigation controller.styles.py: Centralized theme engine (colors, fonts, radii).components/: Reusable widgets like theSidebarandRoundedFrame.views/: Feature-specific screens (Home, Network, CPU, RAM, Analyzer).
- Python 3.12+
- Pip (Python package manager)
- Clone the repository:
git clone https://github.com/youruser/netspy.git cd netspy - Install dependencies:
pip install -r requirements.txt
python main.pyThe AIResourceMonitor doesn't just watch the numbers; it extracts a 3-feature vector for every step:
-
Current Value (
$x$ ): The raw metric. -
Velocity (
$\Delta x$ ): How fast the value is rising or falling. -
Trend (
$x - \bar{x}$ ): How far the current value is from the 60-second moving average.
These features are fed into an Isolation Forest. In high-dimensional space, "normal" points cluster together. Anomalies (spikes) are easily "isolated" by the trees, allowing the system to flag them instantly.
Distributed under the MIT License. See LICENSE for more information.




