# 信号目标智能识别系统 **Repository Path**: Hannah_M/Intelligent-Signal ## Basic Information - **Project Name**: 信号目标智能识别系统 - **Description**: No description available - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-01 - **Last Updated**: 2026-05-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # RadioML 2016 High-SNR CNN Classification This project trains a PyTorch 1D CNN on RadioML 2016 samples where `SNR > 5 dB`. It reads the common `RML2016.10a_dict.pkl` / `RML2016.10b.dat` pickle format, then writes training curves, classification metrics, confusion matrices, and accuracy grouped by SNR. ## Environment Use the requested Anaconda environment: ```powershell conda run -n py3.9 python --version ``` The script uses PyTorch, NumPy, pandas, scikit-learn, matplotlib, and seaborn. By default it applies per-sample IQ power normalization and uses GroupNorm in the CNN, which is more stable than BatchNorm for quick CPU smoke tests. ## Dataset Location Place the RadioML 2016 dataset here: ```powershell D:\Project\SC_demo\data\RML2016.10a_dict.pkl ``` If you use RadioML 2016.10B, this path is also fine: ```powershell D:\Project\SC_demo\data\RML2016.10b.dat ``` ## Run RadioML 2016.10A: ```powershell cd D:\Project\SC_demo conda run -n py3.9 python train_high_snr_cnn.py ` --data D:\Project\SC_demo\data\RML2016.10a_dict.pkl ` --out runs\high_snr_cnn_2016 ` --epochs 20 ` --batch-size 512 ``` RadioML 2016.10B: ```powershell conda run -n py3.9 python train_high_snr_cnn.py ` --data D:\Project\SC_demo\data\RML2016.10b.dat ` --out runs\high_snr_cnn_2016b ` --epochs 20 ` --batch-size 512 ``` For a quick smoke test: ```powershell conda run -n py3.9 python train_high_snr_cnn.py ` --data D:\Project\SC_demo\data\RML2016.10a_dict.pkl ` --out runs\smoke_high_snr_2016 ` --epochs 3 ` --max-samples 12000 ``` ## Outputs The output folder contains: - `best_model.pt`: best checkpoint selected by validation accuracy. - `training_history.csv`, `accuracy_curve.png`, `loss_curve.png`. - `classification_report.csv`: per-class precision, recall, and F1. - `confusion_matrix.csv`, `confusion_matrix.png`, `confusion_matrix_normalized.png`. - `accuracy_by_snr.csv`, `accuracy_by_snr.png`: performance for each retained high-SNR value. - `summary.json`: overall accuracy, macro F1, weighted F1, and best/worst SNR. ## How To Read The Results Use `overall_accuracy` and `weighted_f1` for headline performance. Use `macro_f1` to judge whether harder modulation classes are being handled fairly. The normalized confusion matrix is the best place to inspect which modulations are confused, especially pairs such as `QAM16/QAM64`, `AM-DSB/WBFM`, or `QPSK/8PSK`. For the `SNR > 5 dB` subset, the retained SNR values are usually `6, 8, 10, 12, 14, 16, 18 dB`. ## Frontend Demo The demo uses a separated frontend and backend: - Backend: `backend/main.py`, FastAPI inference API. - Frontend: `frontend/index.html`, static upload page. - Model: `runs/high_snr_cnn_2016/best_model.pt`. Start the backend: ```powershell cd D:\Project\SC_demo conda run -n py3.9 uvicorn backend.main:app --host 127.0.0.1 --port 8000 ``` Start the frontend static server in another terminal: ```powershell cd D:\Project\SC_demo\frontend conda run -n py3.9 python -m http.server 5500 --bind 127.0.0.1 ``` Then open `http://127.0.0.1:5500` in the browser. Supported upload file formats are `.npy`, `.csv`, `.txt`, `.dat`, and `.json`. The uploaded file should contain one IQ sample shaped `(2, 128)`, `(128, 2)`, or a flat list of `256` values. Create a sample upload file from the dataset: ```powershell conda run -n py3.9 python scripts\create_sample_signal.py ` --data D:\Project\SC_demo\data\RML2016.10a_dict_optimized.pkl ` --out D:\Project\SC_demo\data\sample_signal.npy ` --mod BPSK ` --snr 18 ```