report for project vehicle position
report for project vehicle position
Introduction
This project is about design of a simple machine learning algorithm for vehicle positioning, and
project focuses on classifying Line-of-Sight (LoS) and Non-Line-of-Sight (NLoS) communication links
using Channel State Information (CSI). The dataset contains complex-valued CSI matrices collected
from an underground parking lot, with labels indicating positional coordinates and LoS/NLoS status.
Three input methods are compared: CSI modulus, time-domain CSI (via FFT), and total CSI power. A
neural network-based approach is implemented for classification, and results are evaluated for
accuracy and efficiency.
Data Preprocessing
1. Data Loading:
Extract CSI matrices and LoS/NLoS labels (third column of the label vector).
2. CSI Processing:
Method 1: Modulus
Compute absolute values of complex CSI matrices:
python
train_CSI_modulus = torch.abs(train_CSI)
valid_CSI_modulus = torch.abs(valid_CSI)
python
python
3. Normalization:
max_val = torch.max(train_CSI_modulus)
min_val = torch.min(train_CSI_modulus)
Model Design
1. Modulus/Time-Domain CNN:
python
class CNN(nn.Module):
def __init__(self):
super().__init__()
self.pool = nn.MaxPool2d(2, 2)
self.fc2 = nn.Linear(128, 2)
x = self.pool(F.relu(self.conv1(x)))
x = self.pool(F.relu(self.conv2(x)))
x = torch.flatten(x, 1)
x = F.relu(self.fc1(x))
x = self.fc2(x)
return x
2. Power-Based FNN:
python
class FNN(nn.Module):
def __init__(self):
super().__init__()
x = F.relu(self.fc1(x))
x = self.fc2(x)
return x
1. Training Loop:
python
criterion = nn.CrossEntropyLoss()
model.train()
optimizer.zero_grad()
outputs = model(inputs)
loss.backward()
optimizer.step()
# Validation
model.eval()
correct, total = 0, 0
with torch.no_grad():
outputs = model(inputs)
_, predicted = torch.max(outputs.data, 1)
total += labels.size(0)
correct += (predicted == labels).sum().item()
python
best_th = thresholds[np.argmax(accuracies)]
Training
Input Method Validation Accuracy Model Size
Time
Discussion
Modulus vs. Time Domain: Modulus slightly outperforms time-domain CSI, likely due to
retained frequency-domain patterns.
Power Threshold: Simpler but less accurate, as power alone cannot capture spatial features.
Efficiency: FNN with power input trains faster but sacrifices accuracy. CNNs are slower but
more effective.
7. Conclusion
The CNN using modulus-based CSI achieved the highest accuracy (92.3%). Time-domain CSI showed
comparable performance, while total power provided a lightweight but less accurate alternative.
Future work could explore hybrid models or advanced architectures like LSTMs