# Application of Deep Convolutional Neural Networks and Smartphone Sensors for Indoor Localization
## 5 Discussion  
In this research, We present an indoor localization approach which uses a smartphone based multi-sensor fusion to locate a pedestrian indoors. The proposed approach is tested on Galaxy S8 and LG G6 to show its device independence. We have presented a deep learning based convolutional neural network (CNN) to recognize the indoor scene. CNN achieves a prediction accuracy of 91.04% for scene recognition. The recognized scene is further used to narrow down the search space in a magnetic database which is used for localization. We introduced a modified K nearest neighbor (mKNN) approach for indoor localization as well. The KNN approach experiences higher errors when used with magnetic database due to the magnetic signature similarity at various locations. Contrary to KNN which utilizes only the similarity of user sample and magnetic database, mKNN takes into account both similarity as well as spatial closeness to perform the localization. The mKNN along with the scene recognition model helps to achieve a higher localization accuracy. A multi-sensor fusion approach is used to refine the localization accuracy. Pedestrian dead reckoning (PDR) data is used to this end. Location calculated from magnetic database is fused with PDR location using an extended Kalman filter (EKF). The proposed approach is able to achieve an accuracy of 1.08 m irrespective of the smartphone used for localization. The approach shows a similar performance using two different devices, i.e., Galaxy S8, and LG G6. Two important factors evaluated in this study are: Impact of using magnetic patterns rather than the magnetic intensity on heterogeneous devices and role of scene recognition to improve the localization accuracy. For first factor, we perform localization with magnetic patterns, and MFP technique and compare their performance. MFP is affected when different smartphones are used while magnetic patterns show very small change in localization accuracy when different smartphones are used. The impact of scene recognition is analyzed by performing localization without the scene information. Results demonstrate that without scene recognition the mean error increases by a factor of 10.03 and 10.62 for Galaxy S8 and LG G6, respectively. So both scene recognition and magnetic patterns play very important role to increase the localization accuracy. In any case, image based scene recognition is vulnerable to bad light conditions and camera image resolution which can limit its full functionality.  
The proposed approach is energy efficient as well, as it does not use Wi-Fi data for localization, and relies on a single image to recognize the indoor scene. The labor survey can be reduced by adopting the crowdsourcing based data collection to build the magnetic database. The crowdsourcing can also help to increase the image training data for CNN classifier as well. Our future work includes the adoption of the proposed approach for localization in complicated environments including shopping malls, and train stations, etc. Scene recognition under varying light conditions is under research as well.