# 🏒 Indoor Localization and Navigation System ![Project Status](https://img.shields.io/badge/status-active-brightgreen) ![Python Version](https://img.shields.io/badge/python-3.10-blue) ![TensorFlow](https://img.shields.io/badge/tensorflow-2.13-orange) > 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!