JayantOlhyan/SpoofSentinel-GNSS

GitHub: JayantOlhyan/SpoofSentinel-GNSS

一个基于物理原理的混合AI系统,结合XGBoost与时序Transformer检测GNSS导航欺骗攻击。

Stars: 0 | Forks: 0

# 🛰️ SpoofSentinel-GNSS [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Hackathon](https://img.shields.io/badge/Kaizen-2026-orange.svg)](https://github.com/JayantOlhyan/SpoofSentinel-GNSS) **SpoofSentinel-GNSS** 是一个高性能、基于物理原理的 AI 系统,旨在检测 GNSS(全球导航卫星系统)欺骗攻击。该系统结合了 **XGBoost** 的可解释性与 **Temporal Transformers** 的序列智能,能够实时识别微妙的信号操纵。 ## 📊 最终性能结果 | Model Component | Weighted F1 Score | Status | | :--- | :---: | :--- | | **XGBoost (Cross-Validation)** | **0.9102** | ✅ Baseline | | **Temporal Transformer** | **0.7845** | ✅ Seq. Intelligence | | **Hybrid Ensemble (Best)** | **0.8326** | 🚀 **Production Ready** | ## 🏗️ 系统架构 我们的混合架构同时利用了瞬时信号特性和时间依赖性。 ``` graph TD A[Raw GNSS Signals] --> B[Physics-Grounded Feature Engineering] B --> C[XGBoost Classifier] B --> D[Temporal Transformer] C --> E{Logistic Stacking Meta-Learner} D --> E E --> F[Threshold Tuning] F --> G[Timestamp Aggregation] G --> H[spoof_predicted.csv] ``` ## 🔬 核心创新:特征工程 我们不只使用原始数据,而是基于 GNSS 信号的物理原理来设计特征: * **⚡ 相关器对称性**:计算公式为 `(EC - LC) / (PC + 1e-9)`。真实信号是对称的;欺骗信号通常会扭曲相关峰值。 * **📡 多普勒方差**:追踪 `Carrier_Doppler_hz` 的突变,这对于真实卫星来说在物理上是不可能的。 * **⏱️ 时间残差**:将 `RX_time` 与卫星 `TOW`(周内时间)进行交叉参考。显著的漂移表明存在欺骗性时钟操纵。 * **🔗 相位跳变检测**:监视 `Carrier_phase` 的不连续性,以此揭示“跟踪-欺骗”攻击。 * **🌀 Z-Score 异常**:用于标记跨 PRN(伪随机噪声码)异常值的统计特征。 ## 🤖 混合模型细节 1. **XGBoost (Tabular)**:捕捉信号功率、相关器输出和多普勒频移之间的瞬时相关性。使用 SMOTE 处理类别不平衡。 2. **Temporal Transformer (Sequential)**:利用多头注意力机制分析每个 PRN 的 **10 步滑动窗口**,以检测细微的漂移模式。 3. **Stacked Ensemble**:一个 Logistic Regression 元学习器优化了两个模型之间的权衡,并针对 **Weighted F1 Score** 进行了调整。 ## 📈 可解释性 (SHAP 分析) 我们优先考虑 **Explainable AI (XAI)**,以了解信号被标记的*原因*。 | Feature Importance | Beeswarm Impact | | :---: | :---: | | ![Feature Importance](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/dfd58d6e8f020115.png) | ![Beeswarm Impact](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/fbadbac026020118.png) | ## 💻 快速开始 ### 1. 安装 ``` git clone https://github.com/JayantOlhyan/SpoofSentinel-GNSS cd SpoofSentinel-GNSS pip install -r requirements.txt ``` ### 2. 训练 将您的 `train.csv` 放入 `data/` 文件夹并运行: ``` python train.py ``` ### 3. 推理 生成您的竞赛提交文件: ``` python predict.py --test_path data/test.csv --submission_path data/submission_format.csv ``` ### 4. 实时仪表板 启动交互式 Streamlit 仪表板: ``` streamlit run dashboard.py ``` ## 📁 仓库结构 ``` SpoofSentinel-GNSS/ ├── data/ # Raw and processed datasets (git-ignored) ├── src/ # Modular implementation │ ├── feature_eng.py # Physics-grounded logic │ ├── models/ # XGBoost & Transformer modules │ └── utils.py # Helper functions ├── outputs/ # Saved models (.pkl, .pt) & SHAP plots ├── notebooks/ # Exploratory Data Analysis (EDA) ├── train.py # Main training pipeline ├── predict.py # Submission generation script └── dashboard.py # Streamlit interactive UI ``` ## 🛡️ 许可证 基于 **MIT License** 分发。更多信息请参阅 `LICENSE`。 **为 GNSS 反欺骗 AI 黑客马拉松 (Kaizen 2026) 开发**
标签:GNSS欺骗检测, Kubernetes, Python, SHAP可解释性, XGBoost集成学习, 人工智能, 信号处理, 凭据扫描, 卫星导航安全, 反欺骗系统, 异常检测, 数据科学, 无后门, 时序分析, 时空Transformer, 深度学习, 混合模型, 物理特征工程, 用户模式Hook绕过, 网络安全, 资源验证, 赛博物理系统, 逆向工具, 配置审计, 配置错误, 隐私保护, 黑客马拉松项目