
본 연구는 적대적 공격에 강인한 딥러닝 아키텍처를 제안하여 5G 실내 측위의 보안 및 프라이버시 문제를 해결합니다. Sec5GLoc은 채널 임펄스 응답(CIR) 핑거프린팅과 도착 시간 차(TDoA) 피처 및 알려진 앵커 위치를 결합하며, 하이브리드 CNN과 멀티-헤드 어텐션 네트워크가 이를 처리합니다. 이 설계는 위치 스푸핑 및 적대적 신호 변조와 같은 위협에 대한 견고성을 향상시킵니다.
그림 1. 적대적 신호 교란 및 물리 계층 위협 하에서 안전하고 강인한 5G 측위의 문제 정식화.
|
그림 2. Sec5GLoc 모델: 공유 CNN을 사용하여 CIR 피처를 추출하고, 앵커 위치와 TDoA 피처를 임베딩한 뒤 어텐션을 통해 융합한 다음, 회귀 헤드를 통해 위치를 예측합니다.
|
이 프로젝트는 채널 임펄스 응답(CIR)을 포함하는 공개 5G 실내 측위 데이터셋을 사용합니다. 이 데이터셋은 약 1,200m² 규모의 대형 산업용 창고 환경에서 8개의 고정 5G 앵커와 사용자 장치의 업링크 전송을 사용하여 수집되었습니다. 주요 특징은 다음과 같습니다:
다른 저자들이 수집한 원본 데이터셋은 여기에서 확인할 수 있습니다: [5G 채널 임펄스 응답 데이터셋]
split_dataset.py 스크립트는 원본 training.csv(주로 NLOS 데이터 포함)에서 특정 학습 및 테스트 분할을 생성하는 데 사용됩니다:
training_NLOS.csv: 원본 training.csv의 90%로, Sec5GLoc 모델 및 어블레이션 학습에 사용됩니다.test_NLOS.csv: 원본 training.csv의 10%로, 기존에 본 (NLOS) 분포에 대한 테스트에 사용됩니다.test_LOS-NLOS.csv: 원본 데이터셋 제공자로부터 받은 별도의 파일로, LOS와 NLOS 조건이 혼합된 궤적을 포함하며, 오직 training_NLOS.csv만으로 학습된 모델에게는 보지 못한 환경/분포를 나타냅니다.Sec5GLoc/
├── dataset/ # Dataset files (anchors.txt, original CSVs)
│ ├── anchors.txt
│ ├── training.csv # Original full NLOS training data from dataset provider
│ └── test_LOS-NLOS.csv # Original mixed LOS/NLOS test data from dataset provider
├── dataset_splits/ # Generated by split_dataset.py
│ ├── training_NLOS.csv
│ └── test_NLOS.csv
├── knn_model_files/ # Output from baseline_knn.py (train mode)
│ ├── knn_model.joblib
│ ├── knn_model.best_params.json
│ ├── knn_model.outer_cv_metrics.json
│ └── logs/
├── knn_test_results/ # Output from baseline_knn.py (test mode)
│ ├── knn_test_predictions.csv
│ ├── knn_test_metrics.json
│ └── logs/
├── tdoa_baseline_results/ # Output from baseline_tdoa_multilateration.py
│ ├── predictions_loss_linear_weights_False.csv
│ ├── predictions_loss_linear_weights_False_metrics.json
│ └── logs/
├── sec5gloc_checkpoints/ # Output from train.py (Sec5GLoc models)
│ ├── checkpoints/
│ │ ├── model_best.pth.tar
│ │ ├── checkpoint.pth.tar
│ │ ├── training_history.json
│ │ └── logs/
│ └── ... (other runs for ablations, etc.)
├── sec5gloc_predictions/ # Output from test.py (Sec5GLoc benign evaluation)
│ ├── test_results/
│ │ ├── predictions_score1_normal.csv (for test_NLOS.csv)
│ │ ├── metrics_score1_normal.json
│ │ ├── predictions_score2_normal.csv (for test_LOS-NLOS.csv)
│ │ ├── metrics_score2_normal.json
│ │ └── logs/
├── sec5gloc_attack_results/ # Output from test_attack_noise_drop_anchor.py
│ ├── test_results/
│ │ ├── predictions_score2_spoofing_attention_main.csv
│ │ ├── metrics_score2_spoofing_attention_main.json
│ │ ├── predictions_score2_noise_attention_main_sigma0.5.csv
│ │ ├── ... (other attack results) ...
│ │ └── logs/
├── figures/ # Output from plot.py
│ ├── figure1_cdf.pdf
│ └── ...
├── dataset.py # Dataset loading and preprocessing utilities
├── model.py # Sec5GLoc model architecture
├── train.py # Script for training Sec5GLoc
├── test.py # Script for testing Sec5GLoc (benign conditions, ablations)
├── test_attack_noise_drop_anchor.py # Script for testing Sec5GLoc under attacks
├── split_dataset.py # Script to split original data into train/test CSVs
├── baseline_knn.py # k-NN fingerprinting baseline script
├── baseline_tdoa_multilateration.py # Geometric TDoA multilateration baseline script
├── plot.py # Script for generating plots from prediction files
├── Sec5GLoc_env.yml # Python package dependencies
└── README.md # This file
1. 저장소 클론:
git clone https://github.com/sec5gloc/Sec5GLoc.git
cd Sec5GLoc
2. Python 환경 생성:
가상 환경(예: Conda 또는 venv) 사용을 권장합니다. 환경을 설정하려면 Sec5GLoc_env.yml 파일을 사용할 수 있습니다:
# Using Conda
conda env create -f Sec5GLoc_env.yml
conda activate <your-environment-name>
4. 데이터셋 다운로드:
training.csv, test_LOS-NLOS.csv, anchors.txt)을 다운로드합니다.dataset/ 디렉토리에 넣습니다.1. 데이터셋 분할 준비(최초 1회 설정):
원본 training.csv(NLOS 전용)는 NLOS 평가를 위해 학습 파일과 분리된(held-out) 테스트 파일로 분할해야 합니다.
python split_dataset.py --input-csv-file dataset/training.csv --output-dir dataset_splits --train-output-name training_NLOS.csv --test-output-name test_NLOS.csv --test-split-ratio 0.1 --seed 42
이렇게 하면 dataset_splits/training_NLOS.csv(원본 training.csv의 90%)와 dataset_splits/test_NLOS.csv(원본 training.csv의 10%)가 생성됩니다.
2. Sec5GLoc 모델 학습:
train.py를 사용하여 주요 Sec5GLoc 모델 또는 그 어블레이션을 학습합니다. 이 스크립트는 dataset_splits/training_NLOS.csv를 사용하고 이를 다시 학습 및 검증 세트로 분할합니다.
python train.py \
--data-dir ./ \
--full-dataset-csv dataset_splits/training_NLOS.csv \
--val-split-ratio 0.1 \
--checkpoint-dir ./sec5gloc_checkpoints/Sec5GLoc_full_model_run1 \
--epochs 100 \
--batch-size 128 \
--lr 1e-4 \
--patience-early-stop 20 \
--seed 42 \
# --no-attention # For non-attention ablation
# --no-tdoa # For non-TDoA ablation
# --no-anchor-pos # For non-anchor-pos ablation (implies --no-tdoa for some features)
# --gpu 0 # Specify GPU ID, or -1 for CPU
체크포인트와 로그는 지정된 --checkpoint-dir에 저장됩니다.
3. Sec5GLoc 평가(정상 조건):
test.py를 사용하여 학습된 Sec5GLoc 모델을 다양한 테스트 세트에서 평가합니다.
score1: dataset_splits/test_NLOS.csv(기존에 본 분포)에서 평가합니다.score2: dataset/test_LOS-NLOS.csv(보지 못한 분포, LOS/NLOS 혼합)에서 평가합니다.python test.py \
--checkpoint ./sec5gloc_checkpoints/Sec5GLoc_full_model_run1/model_best.pth.tar \
--test-set score2 \
--data-dir ./ \
--output-dir ./sec5gloc_predictions/results_Sec5GLoc_full_model_run1_on_LOSNLOS \
--batch-size 256
# --gpu 0
예측 CSV와 메트릭 JSON 파일은 --output-dir에 저장됩니다.
4. Sec5GLoc 평가(공격 상황):
test_attack_noise_drop_anchor.py를 사용하여 견고성을 평가합니다.
# Example: Spoofing attack
python test_attack_noise_drop_anchor.py \
--checkpoint ./sec5gloc_checkpoints/Sec5GLoc_full_model_run1/model_best.pth.tar \
--test-set score2 \
--data-dir ./ \
--output-dir ./sec5gloc_attack_results/results_Sec5GLoc_full_model_run1_spoofing \
--spoofing-attack
# --guiding-attention-checkpoint <path_if_main_model_is_no_attention>
# Example: Noise attack
python test_attack_noise_drop_anchor.py \
--checkpoint ./sec5gloc_checkpoints/Sec5GLoc_full_model_run1/model_best.pth.tar \
--test-set score2 \
--data-dir ./ \
--output-dir ./sec5gloc_attack_results/results_Sec5GLoc_full_model_run1_noise_s0.3 \
--noise-attack \
--noise-sigma 0.2
# Example: Drop influential anchor
python test_attack_noise_drop_anchor.py \
--checkpoint ./sec5gloc_checkpoints/Sec5GLoc_full_model_run1/model_best.pth.tar \
--test-set score2 \
--data-dir ./ \
--output-dir ./sec5gloc_attack_results/results_Sec5GLoc_full_model_run1_drop_influential \
--drop-influential-anchor-attack
5. 베이스라인 모델 실행:
k-NN 핑거프린팅:
python baseline_knn.py --mode train \
--data-dir ./ \
--train-file dataset_splits/training_NLOS.csv \
--model-output-dir ./knn_model_files \
--seed 42
test_NLOS.csv):
python baseline_knn.py --mode test \
--data-dir ./ \
--test-file dataset_splits/test_NLOS.csv \
--model-output-dir ./knn_model_files \
--test-results-dir ./knn_test_results/NLOS
test_LOS-NLOS.csv):
python baseline_knn.py --mode test \
--data-dir ./ \
--test-file dataset/test_LOS-NLOS.csv \
--model-output-dir ./knn_model_files \
--test-results-dir ./knn_test_results/LOS-NLOS
기하 기반 TDoA 다변측량:
test_NLOS.csv에서:
python baseline_tdoa_multilateration.py \
--data-dir ./ \
--file dataset_splits/test_NLOS.csv \
--output-dir ./tdoa_baseline_results/NLOS \
6. 플롯 생성:
plot.py를 수정하여 원하는 예측 CSV 파일(예: Sec5GLoc 또는 베이스라인의 결과)과 해당 실제 위치(ground truth) CSV를 지정합니다.
python plot.py
그림은 figures/ 디렉토리에 저장됩니다.
Sec5GLoc 모델(model.py)은 다음으로 구성됩니다:
보안 강화의 핵심 측면은 TDoA와 앵커 위치가 가능하게 하는 본질적인 기하학적 일관성 검사와, 어텐션 메커니즘이 비정상적이거나 손상된 앵커 신호의 가중치를 낮출 수 있는 능력입니다.
정상 조건(LOS/NLOS 혼합 - test_LOS-NLOS.csv):
표 1. 정상 조건에서 Sec5GLoc와 베이스라인의 성능 비교
정상 조건(NLOS - test_NLOS.csv):
공격에 대한 견고성(test_LOS-NLOS.csv 서브셋 기준):
그림 3. 혼합 LOS/NLOS 조건의 테스트 환경에서 가장 영향력이 큰 앵커를 대상으로 한 스푸핑 공격 하에 Sec5GLoc의 평균 측위 오차 히트맵.
|
|
논문에 보고된 모든 실험에 대한 사전 학습 모델 체크포인트와 상세 예측/메트릭 파일은 여기에서 찾을 수 있습니다: [모델 및 결과 링크]
링크에는 다음이 포함됩니다:
Sec5GLoc_checkpoints/: 학습된 Sec5GLoc 모델(전체 모델 및 어블레이션).K-NN_baseline/: 저장된 k-NN 모델, 해당 파라미터 및 테스트 결과.TDOA_baseline_results/: TDoA 베이스라인의 예측 CSV 및 메트릭.Sec5GLoc_predictions/: 정상 조건에서 Sec5GLoc 및 어블레이션의 예측 CSV 및 메트릭.Sec5GLoc_attacks_noise_drop_anchor_results/: 다양한 공격 하에서 Sec5GLoc의 예측 CSV 및 메트릭.이 코드를 사용하거나 본 연구를 참조할 경우, 아래 논문을 인용해 주시기 바랍니다:
test_LOS-NLOS.csv에서:
python baseline_tdoa_multilateration.py \
--data-dir ./ \
--file dataset/test_LOS-NLOS.csv \
--output-dir ./tdoa_baseline_results/LOS-NLOS \
| 방법 (시나리오) | 성능 지표 | |||
|---|---|---|---|---|
| 평균 오차 (m) | 중앙 오차 (m) | 75번째 백분위수 오차 (m) | 90번째 백분위수 오차 (m) | |
| 주요 결과 | ||||
|---|---|---|---|---|
| Sec5GLoc (NLOS) | 0.34 | 0.28 | 0.43 | 0.61 |
| Sec5GLoc (LOS/NLOS) | 0.58 | 0.46 | 0.75 | 1.19 |
| 베이스라인 | ||||
| K-NN 핑거프린팅 (NLOS) | 0.67 | 0.13 | 0.75 | 1.99 |
| K-NN 핑거프린팅 (LOS/NLOS) | 3.31 | 2.67 | 4.49 | 7.45 |
| 기존 TDoA (NLOS) | 2.39 | 1.97 | 3.11 | 4.59 |
| 기존 TDoA (LOS/NLOS) | 2.25 | 1.83 | 2.94 | 4.31 |