Frequency-Selective Memory Networks for Adaptive Signal Processing - Source Code and Datasets
收藏资源简介:
FSM-Net: Dual-Path Signal Classification with Learned Frequency Decomposition This repository provides the complete Python implementation and experimental framework for FSM-Net (Frequency-Selective Memory Network), a neural architecture that learns to decompose signals into task-relevant spectral components through end-to-end gradient optimization. The accompanying paper proposes a learnable STFT-based frequency gating mechanism, dual-pathway LSTMs with asymmetric memory dynamics, and an attention-based adaptive fusion module for time-series classification tasks. Contents FSM-Net.py: Single-file implementation (~1,600 lines) containing the full FSM-Net architecture, five baseline models (Standard LSTM, 1D-CNN, CNN-LSTM, Transformer, SincNet), dataset loaders, training/evaluation pipelines, ablation studies, loss-weight sensitivity analysis, noise robustness evaluation, and publication-quality figure generation (Figures 2–7 in the paper). Datasets: CWRU Bearing Fault Diagnosis dataset (12 kHz, 4-class), Paderborn University Bearing dataset (64 kHz, 3-class), and MIT-BIH Arrhythmia dataset (360 Hz, binary classification). Key Features Learnable frequency decomposition via trainable gating networks applied to STFT coefficients, discovering task-optimal spectral boundaries without manual specification. Dual-pathway LSTM processing with distinct dynamics for target signal enhancement and interference suppression. Context-aware adaptive fusion with multi-head attention for dynamic combination of pathway outputs. Comprehensive benchmarking against five baselines under identical training protocols and data splits. Systematic ablation, hyperparameter sensitivity (λ_s and λ_r), and noise robustness experiments across SNR levels from clean to −5 dB. Physically interpretable learned gate patterns that align with known bearing characteristic frequencies (BPFO ≈ 107 Hz, BPFI ≈ 162 Hz) without geometric priors. Reported Results FSM-Net achieves 97.74% (CWRU), 92.61% (Paderborn), and 96.54% (MIT-BIH) accuracy, consistently outperforming all frequency-unaware baselines across all three datasets. Requirements Python 3.8+, PyTorch, NumPy, SciPy, scikit-learn, matplotlib, seaborn, pandas, tqdm. How to Reproduce Place the dataset files in the paths specified in the dataset configuration section of FSM-Net.py (or modify the paths accordingly). Run python FSM-Net.py to execute the full experimental pipeline, including training all models, ablation studies, and figure generation. Results and figures will be saved to the output directory.
FSM-Net:基于可学习频率分解的双路径信号分类模型 本仓库提供了FSM-Net(Frequency-Selective Memory Network,频率选择记忆网络)的完整Python实现与实验框架。该神经架构可通过端到端梯度优化,将信号分解为与任务相关的频谱分量。配套论文提出了一种可学习的基于短时傅里叶变换(Short-Time Fourier Transform, STFT)的频率门控机制、具备非对称记忆动态的双路径长短期记忆网络(Long Short-Term Memory, LSTM),以及适用于时序分类任务的注意力自适应融合模块。 ### 内容说明 FSM-Net.py:单文件实现(约1600行代码),包含完整的FSM-Net架构、5种基线模型(标准LSTM、一维卷积神经网络1D-CNN、CNN-LSTM、Transformer、SincNet)、数据集加载器、训练/评估流程、消融实验、损失权重敏感性分析、噪声鲁棒性评估,以及可生成符合出版标准的图表(对应论文中的图2至图7)。 数据集:涵盖凯斯西储大学轴承故障诊断数据集(CWRU Bearing Fault Diagnosis dataset,12 kHz,4分类)、帕德博恩大学轴承数据集(Paderborn University Bearing dataset,64 kHz,3分类)以及MIT-BIH心律失常数据集(MIT-BIH Arrhythmia dataset,360 Hz,二分类)。 ### 核心特性 1. 可学习频率分解:通过应用于STFT系数的可训练门控网络,无需手动指定频谱边界即可挖掘任务最优的频谱分界。 2. 双路径LSTM处理:采用差异化动态机制分别实现目标信号增强与干扰抑制。 3. 上下文感知自适应融合:借助多头注意力实现路径输出的动态组合。 4. 全面基准测试:在统一训练协议与数据划分规则下,与5种基线模型进行对比评估。 5. 系统性消融实验、超参数敏感性(λ_s与λ_r)分析,以及从干净信号到-5 dB信噪比(Signal-to-Noise Ratio, SNR)全区间的噪声鲁棒性实验。 6. 具备物理可解释性的学习门控模式:无需几何先验,即可与已知的轴承特征频率(外圈故障特征频率BPFO ≈ 107 Hz、内圈故障特征频率BPFI ≈ 162 Hz)对齐。 ### 实验结果 FSM-Net在CWRU、帕德博恩与MIT-BIH三个数据集上的准确率分别达到97.74%、92.61%与96.54%,在所有数据集上均持续优于所有未考虑频率信息的基线模型。 ### 依赖环境 Python 3.8及以上版本、PyTorch、NumPy、SciPy、scikit-learn、matplotlib、seaborn、pandas、tqdm。 ### 复现步骤 1. 将数据集文件放置于FSM-Net.py中数据集配置模块指定的路径(或根据实际情况修改路径)。 2. 运行`python FSM-Net.py`即可执行完整实验流程,包括所有模型的训练、消融实验与图表生成。 3. 实验结果与图表将保存至输出目录。



