Spaces:
Configuration error
Configuration error
File size: 4,245 Bytes
3c83d6f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | # π’ Indoor Localization and Navigation System



> A deep learning-based indoor positioning system with real-time A\* navigation, achieving **0β3 meter accuracy** β a significant improvement over existing methods.
---
## π Overview
Indoor localization is a challenging problem due to the lack of GPS signals inside buildings and complex environments with walls, obstacles, and interference. Many existing systems rely on signal strength, Wi-Fi fingerprints, or other heuristics, but these approaches often have limited accuracy, with errors ranging from **0 to 5 meters**.
This project builds upon the methodology proposed in the **WiDeep paper** with two key improvements:
1. β
Replaced the weighted-sum approach with a **trainable softmax-based layer** for position approximation.
2. β
Implemented a **grid-based mapping system** with the **A\* algorithm** for path planning and real-time navigation.
---
## π§ Approach
### Position Approximation
The core of the localization method is a custom Keras layer called **`PositionAproxmator`**:
- Takes a predefined list of possible positions in the environment (`PlacesPosition`).
- Learns a small **trainable offset weight** `W` for each position, allowing the model to refine predicted locations.
- Computes the final position via matrix multiplication of probabilities with `(PlacesPosition + W)`.
```python
import tensorflow as tf
from tensorflow import keras
class PositionAproxmator(keras.layers.Layer):
def __init__(self, PlacesPosition, name="PositionAproxmator"):
super(PositionAproxmator, self).__init__()
self.PlacesPosition = tf.constant(PlacesPosition, dtype=tf.float32, name="PlacesPositions")
def build(self, inputs_shape):
self.W = self.add_weight(
shape=(inputs_shape[1], 2),
trainable=True,
dtype=tf.float32,
name="PlacesWeight"
)
def call(self, Probilites):
return Probilites @ (self.PlacesPosition + self.W)
def get_config(self):
config = super().get_config()
config.update({"PlacesPosition": self.PlacesPosition})
return config
```
---
### πΊοΈ Mapping & Navigation
Once the position is estimated, the system uses a **grid-based map** of the environment and applies the **A\* algorithm** to plan the optimal path from the current location to a target β enabling real-time indoor navigation.
---
## π System Workflow
```
Input Probabilities
β
βΌ
Softmax Layer β Normalizes probabilities
β
βΌ
PositionAproxmator β PlacesPosition + learned W offsets
β
βΌ
Predicted (x, y) Position
β
βΌ
Grid Map Representation
β
βΌ
A* Path Planning
β
βΌ
Navigation Instructions / Path
```
---
## π Results
| System | Error Range |
|----------------|-------------|
| **My System** | **0 β 3 m** |
| WiDeep Paper | 0 β 5 m |
By integrating mapping and A\* navigation, the system also generates accurate indoor routes, making it practical for real-world applications.
---
## π οΈ Tech Stack
| Category | Tools / Libraries |
|----------------------|------------------------------------------|
| Language | Python 3.10 |
| Deep Learning | TensorFlow / Keras |
| Data Processing | NumPy, Pandas |
| Visualization | Matplotlib, Seaborn |
| Navigation | Custom Grid Map + A\* Algorithm |
---
## π Future Work
- [ ] Real-time deployment on mobile devices
- [ ] Multi-floor building support
- [ ] Sensor fusion: Bluetooth, UWB, IMU
- [ ] Dynamic obstacle avoidance
---
## π¬ Contact
Feel free to reach out for collaborations, discussions, or contributions! |