# 6G Technology for Indoor Localization by Deep Learning with Attention Mechanism
## 1 Introduction
In 2021, [PERSON] had effectively improved accuracy by imputting hybrid fingerprints into deep learning [18]. In 2022, [PERSON] used signal fingerprints combined with backpropagation neural networks for positioning. They developed genetic algorithms to optimize network weights to obtain better results than existing K-nearest neighbor algorithms [19]. Later on, [PERSON] proposed a composite fingerprinting method to process heterogeneous devices. Experiments in real environments had improved positioning accuracy [20]. In 2023, [PERSON] proposed an indoor Wi-Fi localization scheme by extracting the spatial and temporal features of the signal. Numerical results showed that reconstruction was improved significantly by a fusion neural network [21]. In the same year, a technique by combining an autoencoder learning machine with a two-dimensional CNN was proposed by [PERSON]. This method achieved higher accuracy in both positioning and floor estimation [22]. In 2024, [PERSON] proposed a novel deep-learning model that incorporated two types of attention mechanisms to improve the training scheme. This technique exhibited more than a 20% improvement in positioning accuracy while maintaining a relatively low computational complexity [23]. In 2024, [PERSON] developed a low-cost indoor mobile positioning system on a 5G downlink multibeam signal. A mobile positioning root-mean-square error below 1.5 m was obtained on various floor levels [24]. Regarding high-frequency millimeter-wave and terahertz positioning, [PERSON], in 2020, utilized the Signal-to-Noise Ratio (SNR) of spatial beams at 60 GHz as sample fingerprints and deployed Residual Neural Networks for positioning. This method reduced errors to about 20 cm [25]. In 2021, a structured intra-attention bidirectional recurrent deep learning method was proposed to solve the terahertz indoor localization problem. Simulation results demonstrated that the 3D localization accuracy in the metrics of mean distance error was within 0.25 m for Non-Line-of-Sight cases [26]. In 2022, [PERSON] proposed a solution for the localization problem for IEEE 802.11 ay WLAN systems based on signal processing and machine learning in indoor scenarios. This method achieved an accuracy of 99% at an SNR of 18 dB [27]. In 2024, [PERSON] proposed multiple tiny neural networks trained in a self-supervised manner to localize a mobile millimeter wave client. Simulations showedthat the approach outperformed both geometric localization schemes and the use of a single neural network [28]. Most current research focuses on 5G rather than 6G system positioning and meter-level and centimeter-level accuracy achievement. Higher precision can enable different services and derive more business opportunities [1; 2; 3]. This paper improves positioning accuracy for the 120-134 GHz frequency band of 6G using channel state information fingerprinting combined with neural networks. The distinctive features of this work include the following:  
1. The Shooting and Bouncing Rays (SBR) tracing technique has been developed to calculate the CSI for 6G terahertz communications. 2. We evaluate the performance of CNN-based models with and without the integration of spatial and channel attention mechanisms. 3. We demonstrate potential improvements in positioning precision and reliability by applying advanced attention mechanisms with neural networks. 4. We conduct extensive performance analysis for terahertz indoor localization in a typical environment. The theoretical formulation for the channel modeling and indoor positioning system is presented in Section 2. In Section 3, the CNN with attention mechanism is described. Numerical results are shown in Section 4. Section 5 is the conclusion.