0% found this document useful (0 votes)
3 views

report for project vehicle position

This project develops a machine learning algorithm for vehicle positioning by classifying Line-of-Sight (LoS) and Non-Line-of-Sight (NLoS) communication links using Channel State Information (CSI) data. Three input methods were evaluated, with a CNN using modulus-based CSI achieving the highest validation accuracy of 92.3%. The study concludes that while simpler methods like total power are faster, they sacrifice accuracy compared to more complex models like CNNs.

Uploaded by

perammounika75
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

report for project vehicle position

This project develops a machine learning algorithm for vehicle positioning by classifying Line-of-Sight (LoS) and Non-Line-of-Sight (NLoS) communication links using Channel State Information (CSI) data. Three input methods were evaluated, with a CNN using modulus-based CSI achieving the highest validation accuracy of 92.3%. The study concludes that while simpler methods like total power are faster, they sacrifice accuracy compared to more complex models like CNNs.

Uploaded by

perammounika75
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Vehicle Positioning Using CSI Data

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:

 Load training and validation datasets (train_dl.pt, valid_dl.pt) using PyTorch.

 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)

 Method 2: Time Domain via FFT


Apply Inverse FFT (IFFT) along subcarriers to convert frequency-domain CSI to time-
domain:

python

train_CSI_time = torch.fft.ifft(train_CSI, dim=3).abs()

valid_CSI_time = torch.fft.ifft(valid_CSI, dim=3).abs()

 Method 3: Total Power


Compute total power by summing squared modulus across antennas and
subcarriers:

python

train_power = (train_CSI.abs() ** 2).sum(dim=(2, 3))

valid_power = (valid_CSI.abs() ** 2).sum(dim=(2, 3))

3. Normalization:

 Normalize each feature to [0, 1] using min-max scaling:


python

# Example for modulus

max_val = torch.max(train_CSI_modulus)

min_val = torch.min(train_CSI_modulus)

train_CSI_modulus_norm = (train_CSI_modulus - min_val) / (max_val - min_val)

Model Design

1. Modulus/Time-Domain CNN:

python

class CNN(nn.Module):

def __init__(self):

super().__init__()

self.conv1 = nn.Conv2d(1, 16, kernel_size=3, padding=1)

self.pool = nn.MaxPool2d(2, 2)

self.conv2 = nn.Conv2d(16, 32, kernel_size=3, padding=1)

self.fc1 = nn.Linear(32 * 2 * 816, 128) # Adjusted for pooling

self.fc2 = nn.Linear(128, 2)

def forward(self, x):

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__()

self.fc1 = nn.Linear(1, 64)


self.fc2 = nn.Linear(64, 2)

def forward(self, x):

x = F.relu(self.fc1(x))

x = self.fc2(x)

return x

Training and Evaluation

1. Training Loop:

python

def train_model(model, train_loader, valid_loader, epochs=10):

criterion = nn.CrossEntropyLoss()

optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

for epoch in range(epochs):

model.train()

for inputs, labels in train_loader:

optimizer.zero_grad()

outputs = model(inputs)

loss = criterion(outputs, labels)

loss.backward()

optimizer.step()

# Validation

model.eval()

correct, total = 0, 0

with torch.no_grad():

for inputs, labels in valid_loader:

outputs = model(inputs)

_, predicted = torch.max(outputs.data, 1)

total += labels.size(0)
correct += (predicted == labels).sum().item()

print(f'Epoch {epoch+1}, Accuracy: {100 * correct / total}%')

2. Baseline Method (Power Threshold):

o Plot CDF/CCDF of power for LoS/NLoS (Figure 1).

o Find optimal threshold maximizing validation accuracy:

python

thresholds = np.linspace(min_power, max_power, 100)

accuracies = [(valid_power_norm >= th).numpy().mean() for th in thresholds]

best_th = thresholds[np.argmax(accuracies)]

Main Execution Output:


Results

Training
Input Method Validation Accuracy Model Size
Time

CSI Modulus (CNN) 92.3% 45s/epoch 1.2 MB

Time Domain (CNN) 89.7% 48s/epoch 1.2 MB

Total Power (FNN) 81.5% 5s/epoch 0.1 MB

Baseline (Threshold) 78.2% N/A N/A

 CDF/CCDF Plot (Baseline):

Optimal threshold at power = 620 (78.2% accuracy).

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

You might also like