MamNet: A Novel Hybrid Model for Time-Series Forecasting and Frequency Pattern Analysis in Network Traffic

Yujun Zhang, Runlong Li, Xiaoxiang Liang, Xinhao Yang, Tian Su, Bo Liu, Yan Zhou

Abstract

The abnormal fluctuations in network traffic may indicate potential security threats or system failures. Therefore, efficient network traffic prediction and anomaly detection methods are crucial for network security and traffic management. This paper proposes a novel network traffic prediction and anomaly detection model, MamNet, which integrates time-domain modeling and frequency-domain feature extraction. The model first captures the long-term dependencies of network traffic through the Mamba module (time-domain modeling), and then identifies periodic fluctuations in the traffic using Fourier Transform (frequency-domain feature extraction). In the feature fusion layer, multi-scale information is integrated to enhance the model’s ability to detect network traffic anomalies. Experiments conducted on the UNSW-NB15 and CAIDA datasets demonstrate that MamNet outperforms several recent mainstream models in terms of accuracy, recall, and F1-Score. Specifically, it achieves an improvement of approximately 2% to 4% in detection performance for complex traffic patterns and long-term trend detection. The results indicate that MamNet effectively captures anomalies in network traffic across different time scales and is suitable for anomaly detection tasks in network security and traffic management.

Introduction

Network traffic is characterized by a high degree of complexity, often containing both long-term trends—such as gradual growth in a user base—and strict periodic patterns, such as daily peaks or weekly backups. Traditional modeling approaches often struggle with this dual nature. Recurrent Neural Networks (LSTMs/GRUs) frequently suffer from vanishing gradients over long sequences, while Transformers, despite their effectiveness, incur quadratic computational complexity ($O(n^2)$), making them computationally expensive for real-time backbone monitoring.

Furthermore, most models operate exclusively in the time domain. However, many network anomalies, such as DDoS attacks or port scanning, exhibit distinct periodic signatures that are more easily identified in the frequency domain. To address these challenges, we introduce MamNet, a hybrid architecture designed to bridge the efficiency and domain gaps in network traffic analysis.

Methodology

The MamNet Architecture

MamNet utilizes an encoder-decoder framework designed to process traffic data through two parallel analytical lenses: time-domain modeling and frequency-domain extraction.

The MamNet architecture integrates Mamba blocks (MB) for time-domain modeling and Fourier transform blocks for frequency-domain analysis.

As shown in the architecture diagram, the model consists of three primary components:

  1. Mamba Module (Time-Domain): Instead of the self-attention mechanism used in Transformers, MamNet employs a State-Space Model (SSM) approach via Mamba blocks (labeled as 'MB' in the architecture). This allows the model to capture long-range dependencies with linear complexity $O(n)$, significantly reducing memory overhead and latency.
  2. Fourier Transform Module (Frequency-Domain): The model applies a Fourier Transform to the raw traffic data to extract periodic features. This allows the system to identify the underlying cycles of the network and detect deviations from regular rhythmic patterns that might signify an attack.
  3. Weighted Fusion Layer: Features from both domains are integrated using a learnable weighted fusion mechanism: $z_t = \alpha \cdot x_t + \beta \cdot X(t)$. This enables the model to dynamically prioritize either temporal or spectral information based on the specific traffic pattern encountered.

Frequency Pattern Analysis

By transforming time-series data into the frequency domain, MamNet can isolate specific frequencies associated with normal network behavior. When an anomaly occurs, such as a high-frequency burst from a DDoS attack, the magnitude at specific frequency coordinates shifts, providing a clear signal for detection that might be obscured in a noisy time-domain signal.

Signal analysis demonstrating the transition from time-domain waveforms to frequency-domain magnitude peaks, facilitating periodic pattern detection.

Experimental Evaluation

Datasets and Preprocessing

The model was evaluated on two benchmark datasets: UNSW-NB15, which contains modern network traffic and various attack types (DDoS, Scanning, Backdoors), and CAIDA, representing real-world internet backbone traffic. To ensure robust training, the researchers utilized SMOTE (oversampling) to address class imbalances and Recursive Feature Elimination (RFE) to isolate the most relevant traffic metrics.

Performance Results

MamNet demonstrated superior performance across several key metrics compared to mainstream models like Autoformer, N-BEATS, and FlowForecaster:

  • Accuracy: Achieved 96.32% on the UNSW-NB15 dataset.
  • Error Reduction: Reduced Mean Absolute Error (MAE) and Mean Squared Error (MSE) by 10-25%.
  • Efficiency: Inference latency was measured at just 20ms, compared to approximately 50ms for Transformer-based models. Furthermore, the model consumed only 16GB of VRAM, a significant reduction from the 20-24GB required by traditional LSTM/GRU models.

Discussion and Future Work

A key insight from this research is that linear scaling is essential for real-time applications. The shift to Mamba's linear complexity allows for high-speed monitoring without sacrificing the depth of analysis. Additionally, ablation studies confirmed that the Fourier module is critical for detecting periodic attacks; removing it specifically degraded the model's security performance.

MamNet also showed remarkable robustness to topology shifts. When network nodes were added or removed, MamNet’s accuracy dropped by only ~2%, whereas Transformer-based models saw performance degradation of 5-6%.

Future work will focus on incorporating external context, such as scheduled maintenance logs or global threat intelligence feeds, to further reduce false positives. Additionally, we aim to optimize the model for highly volatile software-defined networks (SDN) and investigate its efficacy against "low-and-slow" attacks designed to mimic normal periodic traffic.

Summary updated

Abstract

The abnormal fluctuations in network traffic may indicate potential security threats or system failures. Therefore, efficient network traffic prediction and anomaly detection methods are crucial for network security and traffic management. This paper proposes a novel network traffic prediction and anomaly detection model, MamNet, which integrates time-domain modeling and frequency-domain feature extraction. The model first captures the long-term dependencies of network traffic through the Mamba module (time-domain modeling), and then identifies periodic fluctuations in the traffic using Fourier Transform (frequency-domain feature extraction). In the feature fusion layer, multi-scale information is integrated to enhance the model’s ability to detect network traffic anomalies. Experiments conducted on the UNSW-NB15 and CAIDA datasets demonstrate that MamNet outperforms several recent mainstream models in terms of accuracy, recall, and F1-Score. Specifically, it achieves an improvement of approximately 2% to 4% in detection performance for complex traffic patterns and long-term trend detection. The results indicate that MamNet effectively captures anomalies in network traffic across different time scales and is suitable for anomaly detection tasks in network security and traffic management. Future work could further optimize the model structure by incorporating external network event information, thereby improving the model’s adaptability and stability in complex network environments.
BibTeX
@inproceedings{zhang2025mamnet,
  author = {Yujun Zhang and Runlong Li and Xiaoxiang Liang and Xinhao Yang and Tian Su and Bo Liu and Yan Zhou},
  title = {{MamNet: A Novel Hybrid Model for Time-Series Forecasting and Frequency Pattern Analysis in Network Traffic}},
  booktitle = {ICCK},
  year = {2025},
  doi = {10.62762/tis.2025.347925},
}
Figure