# FSM-Net: Dual-Path Signal Classification with Learned Frequency Decomposition

**Version 2.0** — Revised release accompanying the paper resubmission to *Signal, Image and Video Processing* (Springer-Nature).

---

## Overview

FSM-Net (Frequency-Selective Memory Network) is a neural architecture that learns to decompose time-series signals into target and interference spectral components through end-to-end gradient optimization. The architecture combines:

- A **learnable per-bin frequency gate** (3-layer MLP with sigmoid output) operating on STFT magnitudes — unconstrained, going beyond parametric band-pass shapes such as SincNet.
- An **explicit asymmetric dual-pathway design**: target and interference branches each carry a bidirectional LSTM, with the interference branch additionally scaled by a learnable suppression factor σ(λ_s).
- An **attention-based adaptive fusion** module with a context vector that captures both correlation (⊙) and contrast (−) between the two pathways, refined by multi-head self-attention.

Across three datasets — CWRU, Paderborn University, and MIT-BIH — and against eight baselines (Standard LSTM, 1D-CNN, CNN-LSTM, Transformer, SincNet, WDCNN, MA1DCNN, LiConvFormer), FSM-Net achieves **97.74 % / 92.61 % / 96.54 %** test accuracy. The contribution is not the highest clean accuracy but two complementary properties: physically interpretable spectral decompositions (the gate suppresses BPFO/BPFI bins and concentrates on the 3–6 kHz resonance band, autonomously rediscovering the envelope-analysis principle of bearing diagnosis) and substantially better noise robustness (at 15 dB SNR FSM-Net retains 86.8 % while SincNet collapses to 10.1 %).

---

## Repository Structure

```
FSM-Net_V2/
├── README.md                    ← this file
├── CHANGELOG.md                 ← V1 → V2 changes (point-by-point response to reviewers)
├── LICENSE                      ← MIT
├── requirements.txt             ← Python dependencies
│
├── FSM-Net.py                   ← main training / evaluation script
│
├── data/                        ← preprocessed data splits
│   ├── cwru/                    ← Case Western Reserve University bearing dataset
│   ├── paderborn/               ← Paderborn University bearing dataset
│   └── mitbih/                  ← MIT-BIH arrhythmia dataset
│
├── results/                     ← all experiment outputs
│   ├── all_results.json         ← complete numerical results (4.8 MB)
│   ├── training_log.txt         ← full stdout log of training runs
│   ├── figure2_performance_comparison.png
│   ├── figure3_frequency_analysis.png
│   ├── figure4_training_curves.png
│   ├── figure5_ablation_study.png
│   ├── figure6_loss_sensitivity.png
│   ├── figure7_noise_robustness.png
│   └── figure8_tsne.png
│
└── manuscript/                  ← LaTeX source of the published article
    ├── fsm_net_springer.tex
    ├── supplementary.tex
    ├── references.bib
    └── figures/
```

---

## Quick Start

### Environment

Python 3.10+ on Linux/Windows. Tested on:

- Windows 10, Anaconda env `fsm-net`, PyTorch 2.1, CUDA 12.1
- Ubuntu 22.04, PyTorch 2.1, CUDA 12.1

### Install dependencies

```bash
pip install -r requirements.txt
```

Main dependencies: `torch>=2.0`, `numpy`, `scipy`, `scikit-learn`, `matplotlib`, `seaborn`, `pandas`, `tqdm`.

### Run a single experiment

```bash
python FSM-Net.py --dataset cwru --model fsm_net
```

### Reproduce all results in the paper

```bash
python FSM-Net.py --reproduce-all
```

This launches the full benchmark grid (3 datasets × 9 models + ablations + loss sweep + noise sweep + t-SNE), takes approximately 6–8 hours on a single RTX 3090. Outputs are written to `results/`.

---

## Cite

If you use this code, please cite:

```bibtex
@article{liu2026fsmnet,
  title  = {FSM-Net: Dual-Path Signal Classification with Learned Frequency Decomposition},
  author = {Liu, Jie and Qiu, Weijian and Wu, Zhuohong},
  journal = {Signal, Image and Video Processing},
  year   = {2026},
  publisher = {Springer Nature},
  note   = {Submission ID 47179688-9946-4e50-9253-491e1868b322}
}
```

---

## Funding

This work was supported by:

- Key Project of China Coal Technology & Engineering Group Corp. (Grant No. 2024-TD-ZD003-03)
- Self-initiated Project of Shanxi Tiandi Coal Mining Machinery Co., Ltd. (Grant No. M2025-JS03-R)

## Authors

- **Jie Liu** (corresponding author) — `liujieccteg@outlook.com`
  Shanxi Tiandi Coal Mining Machinery Co., Ltd.
- **Weijian Qiu** — Shanxi Tiandi Coal Mining Machinery Co., Ltd.
- **Zhuohong Wu** — CCTEG Taiyuan Research Institute Co., Ltd.

## License

MIT. See `LICENSE` for details. Datasets retain their original licenses (CWRU: public domain; Paderborn: research-use; MIT-BIH: PhysioNet ODC license).
