Skip to content

This repository contains a project for detecting anomalies in network traffic using machine learning-based algorithms. The project demonstrates the application of various machine learning models to identify unusual patterns or anomalies in network traffic, which could be indicative of security threats such as intrusions or malware activity.

Notifications You must be signed in to change notification settings

cavadibrahimli1/Anomaly-Detection-in-Networks-Traffic-Scenarios-Using-ML-Based-Algorithms

Repository files navigation

Network Anomaly Detection System

Python TensorFlow OMNeT++ INET License

Build Status Code Coverage Documentation


Enterprise-Grade Network Anomaly Detection System
Leveraging Machine Learning & OMNeT++ for Advanced Network Security


🎯 Overview

A cutting-edge network anomaly detection system that combines advanced machine learning algorithms with OMNeT++ simulation capabilities. Our system focuses on robust data collection and analysis, with a planned evolution towards real-time detection and dynamic adaptation capabilities.

System Architecture

graph TD
    A[Data Collection Layer] --> B[Preprocessing Engine]
    B --> C[Feature Extraction]
    C --> D[ML Pipeline]
    D --> E[Anomaly Detection]
    
    subgraph "Data Processing"
        B --> F[Data Cleaning]
        F --> G[Feature Engineering]
        G --> H[Data Validation]
    end
    
    subgraph "ML Components"
        D --> I[Model Training]
        I --> J[Model Validation]
        J --> K[Model Deployment]
    end
Loading
🌟 Key Features & Capabilities
Feature Current Status Future Goal Implementation Details
Data Collection βœ… Operational Enhanced real-time capabilities Custom packet capture, PCAP analysis, Traffic sampling
ML Processing βœ… Offline Analysis Real-time processing TensorFlow-based models, Scikit-learn pipelines
OMNeT++ Integration πŸ”„ Basic Setup Full real-time integration Custom modules, Network scenarios
Adaptation πŸ“Š Static Models Dynamic network-agnostic models Transfer learning, Online adaptation
Visualization πŸ“ˆ Basic Metrics Interactive real-time dashboards Grafana integration, Custom dashboards

πŸš€ Development Status

Current Implementation

  • βœ… Data Collection Framework
    • Network packet capture system
    • Protocol-specific preprocessing
    • Advanced feature extraction
    • Data validation pipeline
  • βœ… ML Model Implementation
    • Supervised learning models
    • Anomaly detection algorithms
    • Model validation framework
    • Performance monitoring
  • βœ… OMNeT++ Foundation
    • Network topology modeling
    • Traffic pattern simulation
    • Basic integration framework
    • Custom module development

Future Roadmap (2024)

  • 🎯 Enhanced Accuracy (Q1)
    • Deep learning integration
    • Feature selection optimization
    • Ensemble model implementation
    • Cross-validation framework
  • πŸ”„ Dynamic Adaptation (Q2)
    • Network-agnostic detection
    • Real-time model updates
    • Transfer learning capabilities
    • Adaptive thresholding
  • ⚑ Real-time Integration (Q3)
    • OMNeT++ real-time processing
    • Live traffic analysis
    • Interactive visualization
    • Performance optimization

Development Phases

Phase Status Deliverable Weight Documentation
Research Proposal βœ… Proposal Document 10% View
Simulation Tools Study βœ… Technical Report 10% View
Network Design βœ… Design Document 20% View
Simulation Experiments βœ… Results Report 20% View
Research Article βœ… IEEE Paper 20% View
Final Presentation βœ… Presentation 20% View

πŸ’‘ Technical Implementation

Dynamic Adaptation Framework
class DynamicNetworkDetector:
    """
    Advanced network anomaly detection with dynamic adaptation capabilities.
    Supports real-time model updates and network-agnostic detection.
    """
    def __init__(self, config: Dict[str, Any]):
        self.base_model = self._initialize_model(config)
        self.network_profiles: Dict[str, NetworkProfile] = {}
        self.adaptation_metrics: List[AdaptationMetric] = []
        self.feature_extractors: Dict[str, FeatureExtractor] = {}

    async def adapt_to_network(self, network_type: str) -> bool:
        """
        Dynamically adjust model parameters based on network characteristics.
        
        Args:
            network_type: Type of network to adapt to
            
        Returns:
            bool: Success status of adaptation
        """
        try:
            profile = self.network_profiles.get(network_type)
            if not profile:
                profile = await self._create_network_profile(network_type)
            
            return await self._adapt_model_parameters(profile)
        except AdaptationError as e:
            logger.error(f"Adaptation failed: {e}")
            return False

    async def update_model_realtime(self, new_data: NetworkData) -> ModelUpdateResult:
        """
        Update model in real-time with streaming network data.
        
        Args:
            new_data: New network data for model update
            
        Returns:
            ModelUpdateResult: Results of model update
        """
        validation_result = await self._validate_data(new_data)
        if validation_result.is_valid:
            return await self._update_model(new_data)
        return ModelUpdateResult(success=False, error=validation_result.error)
OMNeT++ Integration
/**
 * Real-time anomaly detection module for OMNeT++
 * Supports live traffic analysis and model adaptation
 */
class RealTimeAnomalyDetector : public cSimpleModule {
protected:
    virtual void initialize() override;
    virtual void handleMessage(cMessage *msg) override;
    
private:
    // Core components
    std::unique_ptr<MLModel> anomalyModel;
    std::unique_ptr<DataProcessor> streamProcessor;
    
    // Configuration
    DetectorConfig config;
    
    // Performance monitoring
    Statistics stats;
    
    // Helper methods
    void processPacket(Packet *packet);
    void updateModel(const DataBatch& batch);
    void reportAnomaly(const AnomalyEvent& event);
};

πŸ“Š System Performance

Current Metrics

Metric Performance Details
Model Accuracy 95% Tested on standard network datasets
False Positive Rate <1% With current threshold settings
Data Processing Offline Batch processing of network data
Analysis Latency ~500ms Average processing time per batch
Supported Protocols TCP/IP, UDP Basic protocol analysis

Target Specifications

Metric Goal Timeline
Real-time Accuracy >98% Q2 2024
Processing Latency <100ms Q3 2024
Adaptation Time <1s Q2 2024
Network Coverage Universal Q4 2024
Protocol Support All major Q3 2024

Research Team


Batu Burgu

Javad Ibrahimli

Kerem Karadeniz
ID: 0402010098 ID: 040210932 ID: 0402110049

πŸ“« Connect With Us

GitHub Issues GitHub Discussions


About

This repository contains a project for detecting anomalies in network traffic using machine learning-based algorithms. The project demonstrates the application of various machine learning models to identify unusual patterns or anomalies in network traffic, which could be indicative of security threats such as intrusions or malware activity.

Topics

Resources

Security policy

Stars

Watchers

Forks