Discrete Hopfield neural network based indoor Wi-Fi localization using CSI

The fingerprint indoor localization method based on channel state information (CSI) has gained widespread attention. However, this method fails to provide a better localization effect and higher localization accuracy due to poor fingerprint accuracy, unsatisfactory classification and matching effect, and vulnerability to environmental impacts. In order to solve the problem, this paper proposes a CSI fingerprint indoor localization method based on the Discrete Hopfield Neural Network (DHNN). The method mainly consists of off-line and on-line phases. At the off-line phase, a low-pass filter is applied to conduct a preliminary processing on the fingerprint information of each reference point, and then, phase difference is adopted to correct the fingerprint data of all reference points. In this way, the quality of fingerprint data is improved, hence avoiding problems such as indoor environmental changes and multipath effect of signals, etc. in which impact the fingerprint data. Finally, the characteristic fingerprint database is established after acquiring relatively accurate fingerprint data. At the on-line phase, to maintain the consistency of data, the data of each reference point in the fingerprint database is set as an attractor. Meanwhile, the localization information of the test point is processed to make convergence judgment through DHNN. Eventually, the localization result is obtained. The experimental results show that the localization accuracy with a median error of 1.6 m can be achieved through the proposed method in the experimental environment. Compared with similar methods, it has a higher stability which can significantly reduce the cost of manpower and time.


Introduction
With the increasing popularity of location-based service (LBS), the demand for localization-based services in life is also increasing [1]. In the outdoor environment, GPS, GLONASS, BeiDou Satellite Navigation System, and other mature satellite localization systems are widely used, which can provide convenience for people to acquire more accurate localization and navigation services [2].
However, in the indoor environment, the satellite localization system fails to work effectively due to its weak satellite signals and the inability to penetrate buildings. Therefore, it is a new challenge for the current indoor localization technology to study the indoor localization system with higher accuracy, better reliability, and lower cost.
In recent years, the widespread popularity of indoor Wi-Fi has given rise to various indoor localization technologies based on Wi-Fi [3], which includes localization based on the received signal strength indication (RSSI) and channel state information (CSI). Particularly, Horus [4] system adopts RSS data to estimate position with a probabilistic approach. However, in the indoor environment, due to the influence of obstacles, RSSI will produce a certain deviation and be easily affected by other signals and indoor multipath effects. Therefore, RSSI fails to provide sufficient accurate and reliable indoor localization [5]. For Wi-Fi signals using IEEE 802.11n communications protocol, it can obtain CSI in orthogonal frequency division multiplexing (OFDM) subcarriers by modifying the wireless network card driver [6]. CSI resolved from the physical layer can describe the channel characteristics and state between the signal transmitter and the receiver [7]. Compared with RSSI, CSI has a certain multipath resolution and can sense weak fluctuations of signals on the propagation path. CSI also has a higher sensitivity, a wider sensing range, and stronger sensing reliability [7][8][9][10]. Of course, CSI can also be used in more fine-grained detection, such as gesture recognition using CSI and sleep monitoring using CSI [11,12].
Generally speaking, according to the principle of location, indoor localization technology based on Wi-Fi can be divided into localization based on the propagation model and localization based on the fingerprint [13]. The localization based on the propagation model needs to establish an accurate channel model to estimate the distance between the target and each AP (access point). However, the physical model differs greatly from the actual environment and some interference factors are not considered to some extent, so the localization effect is often less than that of the fingerprint localization method [14]. When it comes to the fingerprint-based localization, such as Array-Track [15], the coverage is largely enhanced with the multi-input multi-output (MIMO) technology, and then AoA is derived by using the MUSIC algorithm. The fingerprint localization method can reduce the impact on the localization accuracy caused by the change of the actual environment. However, in some indoor fingerprint localization methods, the problems such as poor fingerprint accuracy, low classification effect, and susceptibility to environmental impact make it difficult to provide better localization effect and higher localization accuracy. In recent years, KNN, support vector machine (SVM), and other machine learning methods have been widely used in indoor location based on the fingerprint. However, KNN needs to store all training values, and the sample size is large [16]. Support vector machines need to balance the randomness of data with corresponding kernel functions, which leads to high computational complexity [17].
The fingerprint-based localization method has been widely used in indoor localization systems because it does not need to understand the relationship between distance and signal and has a relatively high accuracy [18][19][20][21][22].
The localization process of the general fingerprintbased indoor localization method is divided into two phases, namely an off-line phase and an on-line phase. The off-line phase usually collects signals in an indoor environment. In a Wi-Fi environment, the information normally collected is RSSI and CSI, and then the corresponding fingerprint information is obtained from a known reference point to construct a fingerprint database. RADAR [23] is an initial location fingerprinting system that measures RSS for multiple base stations and builds an off-line radio map. SVR [24] select RSS as sample data and filtered analyze in the off-line. The on-line phase usually uses some classification-matching algorithm to match the data acquired from the unknown location with the data in the fingerprint library to achieve the purpose of localization. FIFS [25] scheme uses the weighted average CSI values to improve the performance of the RSS-based method.
Since RSSI is susceptible to multipath effects in the environment and can only provide coarse-grained information, it cannot meet the current high-precision positioning requirements. Therefore, most of the current Wi-Fi-based indoor positioning methods collect data to select CSI. DeepFi [26] chooses to use deep learning to train the collected CSI in the off-line. In BiLoc [27], the authors developed a deep learning-based algorithm to exploit bimodal data. Both the estimated angle of arriving (AOA) and average amplitudes of two adjacent antennas are used as location features for building the fingerprint database. In this paper [28], the authors provided quantitative and visual explanations for the DNN learning process as well as the critical features that the DNN has learned during the process. Our work is different from the above system. In the off-line phase, we preprocessed the data and improved the accuracy of the fingerprint library.
However, in traditional CSI-based fingerprint indoor localization method, the problems such as poor fingerprint accuracy, low classification matching effect, and susceptibility to environmental impact make it unable to provide better localization effect and higher localization accuracy. The amplitude and phase information in the CSI can best reflect the position characteristics. In the indoor localization research based on CSI, some researches only process the amplitude information and ignore the phase information. Some localization methods only include the original phase information and do not process the phase information, but the original phase information cannot describe the corresponding position information well, and include the position information some noise effects due to the environment. Therefore, it cannot reflect the integrity of the data, and the comprehensiveness of location information is also missing. At the same time, the single experimental environment cannot reflect the robustness of the positioning method.
Combining with the problems existing in the above methods, and in order to achieve high accuracy and reliability of indoor location, this paper proposes a CSI fingerprint indoor localization method based on Discrete Hopfield Neural Network (DHNN). DHNN has an associative memory function, which forms a memory by learning the sample, inputs the unknown sample and forms the output of a sample stored in the network, thereby identifying the unknown sample. The first step of the method presented in this paper is preprocessing the collected data. The original data contains some redundant data (Outlier) and noise as well as some data affected by the multipath effect. After preprocessing redundant data and removing some noise, the accurate CSI was obtained. Secondly, with the phase difference correction method, the features of the position information of each reference point (known locations) can be expressed, and the data that does not conform to the feature can be removed by the method, so that the fingerprint information of each reference point can be relatively accurate. Because this article sets DHNN network according to the asynchronous mode, so the state of the network does not change anymore starting from the initial state and after going through the finite recursion, and DHNN network eventually converges to an attractor. If the location information input in the on-line stage cannot converge to the same constant (attractor) as the network in the off-line stage after the finite recursion, the location information is proved to be inaccurate. Otherwise, the attractor can be used to determine and use location information for locating. In the on-line phase, the data in the fingerprint database in the off-line phase will be set as attractors, the real-time collected data will be used as input after the same processing as in the off-line phase, and DHNN will be used for convergence judgment to finally determine the localization result [29][30][31][32][33][34][35][36][37]. The experimental results show that the DHNN-based CSI fingerprint indoor localization method has higher stability and localization accuracy than similar methods.
The contributions of this paper are summarized as follows: (1) The design uses a combination of low-pass filter and phase difference correction to process the fingerprint information, ensuring the accuracy of the fingerprint data and greatly reducing the localization error. (2) It is proposed to set the reference point data in the fingerprint database as attractors. After recursion for many times, it can be determined whether the attractors converged in the on-line stage are the same as those converged in the off-line stage, which can ensure a significant improvement in localization accuracy. (3) In order to verify the effectiveness of the proposed method, several mature methods are compared from the aspects of actual localization effect, localization accuracy, and error analysis. Experimental results show that the proposed method is superior to the existing methods.
The rest of the paper is organized as follows. Section 2 describes the preliminary work. Section 3 illustrates details on the DHNN model design. Section 4 introduces the experimental environment and analyzes the performance of this method through experiments, compares it with other mature indoor localization methods. Meanwhile, error analysis is added to analyze the influence of different factors on localization accuracy from different stages, thus demonstrating the effectiveness of the proposed method. Finally, the work is concluded in Section 6.

System overview
The core of the DHNN-based CSI fingerprint indoor localization method lies in the processing of fingerprint data in the off-line phase and the convergence of DHNN in the on-line phase to determine the relationship between CSI information and the position of the localization point. The overall localization process is shown in Fig. 1.
The whole localization process includes the off-line phase and the on-line phase: (1) Off-line phase Data acquisition: The wireless access point sends continuous data packets to the PC terminal, collects CSI data of all reference points, and obtains an initial data set.
Filter of low-pass filter: The initial data set contains some redundant data and noise as well as some data affected by the multipath effect. The redundant data and some noise can be removed by using a low-pass filter to obtain the relatively accurate CSI.
Phase difference correction: The existing CSI data also contain some noise and data affected by the multipath effect. The feature of the position information of each reference point can be expressed by phase difference correction, and the data that does not conform to the feature can be removed, so that the fingerprint information of each reference point will be more accurate.
Construction of fingerprint database: The CSI of each reference point processed above is used as the localization fingerprint information to construct a fingerprint database.
(2) On-line phase Attractor setting: The CSI of each reference point of the off-line phase fingerprint database is set as an attractor. The setting of attractor provides a basis for convergence judgment of DHNN network.
Data acquisition: The wireless access point sends continuous data packets to the PC and collects CSI data of the test localization.
DHNN network convergence judgment (localization): The CSI data of the test point is input into the DHNN network, and convergence judgment is made with the data in attractor (fingerprint database) to finally obtain the localization result.
In the process of data acquisition, sending continuous data packets until the environment is stable can effectively reduce the impact of instantaneous changes in the environment on the localization results.

Low-pass filter processing
Because of the complexity of the indoor environment and the fine granularity of CSI, CSI collected in indoor environment usually contains noise and some redundant data due to the multipath effect. In the experimental environment, it is a stable environment when there are no people moving around and no other obstacles in the experimental area. When there are people walking around and multiple obstacles are placed in the experimental area, it is an interference environment. It can work under line of sight (LOS) and non-line of sight (NLOS) conditions. As shown in Fig. 2, there is a large gap between the data in different environments. Figure 2 a shows that the image of the experimental data is relatively smooth and regular in a relatively stable environment. Figure 2 b shows the data in the case of large environmental interference, which obviously has more redundant data. Therefore, it is necessary to select data collection under a stable environment. The low-pass filter allows signals below the cut-off frequency to pass and blocks signals above the cut-off frequency. Some noise frequencies in the room are much higher than those of people walking. So, for the collected CSI, this paper uses Butterworth low-pass filter to filter noise [38]. According to needs, different cut-off frequencies must be set, assuming that the walking speed is about 1 m/s, and AP works at a frequency of 5.765 GHz, according to wavelength ¼ wave speed frequency , thenλ ¼ u f ¼ 3Ã10 8 m=s 5:765Ã10 9 Hz ¼ 0:052 m . Due to the need to collect fingerprint information of each reference point, this paper can only calculate the corresponding wavelength and frequency according to the minimum walking speed of indoor people, and will try its best to wait for testers to collect data when they are stable at a certain reference point during the real measurement, thus ensuring the data quality.

Phase difference correction
To ensure the effect of phase difference correction, when the reference point is selected firstly, four different direction data are selected and acquired under the same reference point. As shown in Fig. 3, at the same point, the tester stood facing north, east, south, and west and collected corresponding data.
Secondly, for the position information of the same reference point, if there is a big difference between the four directions after processing, data will be collected again to ensure that the position information of each reference point is relatively accurate. Phase difference of the 3 antennas in a random reference point is shown in Fig. 4. The calculation algorithm at the same reference point used in this paper is shown in Algorithm 1: The phase difference under different reference points is also different, which provides more effective information for better distinguishing different reference points. According to the literature [39,40], effective motion information is obtained by linearly changing all subcarriers and the phase difference between the two antennas. After the linear change, the phase shift caused by the clock skew and unknown constant can be eliminated, while the phase information that is relatively disordered after the difference between the two antennas will be distributed and concentrated. For the indoor localization method, the clock skew has a great influence on the personnel detection in the moving condition, but due to the influence of some uncertain factors in the selection of reference points and the data acquisition process, the phase will shift. For the same reference point, the difference between two antennas can not only use different data to do the corresponding antenna difference, but also can do the difference for different antennas in the same data. Similarly, for different reference points, corresponding methods can also be used to correct the data. As shown in Fig. 5, two different reference points are randomly selected for sampling. (a), (b), (c) respectively represents the phase difference between the antennas corresponding to the two reference points. The calculation algorithm at different reference points used in this paper is shown in Algorithm 2:

DHNN model design
DHNN is a single-layer network with a total of neurons.
The weights of DHNN are not obtained through repeated learning, but are calculated according to certain implementation rules to change the state of the network. The topological structure of DHNN is shown in Fig. 6. DHNN is characterized in that the output x i of any neuron is fed back to all neurons x j as input through connection weights ω ij . Each neuron can receive the feedback from other neurons in order to make the output of each neuron restrict each other. At the same time, each neuron is set with a threshold T j to reflect the control of input noise, and the whole DHNN can be recorded as N = (W, T). The whole set of neuron states constitutes a state X = [x 1 , x 2 , ⋯, x n ] T of the recurrent network, and its input is the initial value of the state of the network, which is recorded as X(0) = [x 1 (0), x 2 (0), ⋯x n (0)] T . Under the excitation of external input, the whole network moves from the initial state to the dynamic evolution process, during which the state of each neuron in the network is constantly changing, and the change law follows Eq.(1): Wheref(⋅)stands for the transfer function, and DHNN's transfer function often uses the sign function: In Eq. (2), the net input is: For the whole DHNN, there are ω ii = 0, ω ij = ω ji in general. When the network is stable, the state of each neuron no longer changes, and the stable state at this time is the output of the entire network, expressed as: limXðtÞ t→∞ .
DHNN is a network that is capable of storing several preset stable points. In operation, when an initial input is applied to the network, the entire network feeds back its output as the next input, and the input of each neuron does not include self-feedback. After several cycles, if the network structure meets certain conditions, the network will eventually stabilize at a predetermined stable point. If the state of the network meets X = f(W ⋅ X − T), X is called the attractor of the network, that is, the state X when the network reaches stability, it is called the attractor of the network. For DHNN network, if the state of the network is adjusted in the asynchronous mode (only one neuron at a time performs state adjustment while the state of other neurons remains unchanged) and the connection weight matrix W is a symmetric matrix, the entire network will eventually converge to an attractor in any initial state. If the state of the network is adjusted in a synchronous mode (all neurons adjust the state at the same time) and the connection weight matrix W is a non-negative fixed symmetric matrix, the network will eventually converge to an attractor in any initial state.
In this paper, after filtering and phase difference, the data of each reference point correction are taken as the attractor of DHNN, and the data of real-time position is taken as the input of DHNN network, and finally the localization result is determined after the convergence judgment. To verify the feasibility, this paper assumes that the network works in an asynchronous mode and defines the energy function of the network as: If the variant of network energy is ΔE , and the variant of network state is ΔX, there is: Fig. 6 The topological structure of DHNN From Eqs. (4) and (5): If performed asynchronously, then there is only one neuron adjusting state at t time. If the neuron is j, then: Turn Eq. (8) into Eq. (7), and there is Because there is no self-feedback in the neurons, there is ω jj = 0, From Eqs. (2) and (3): According to the analysis, there are three situations: After verification, it is found that there would be ΔE(t) ≤ 0 in any case, the energy is always decreasing or unchanged during the dynamic evolution of the network, and eventually the network will converge to a constant. That is, when the network operates in an asynchronous manner and connects weight matrix W as a symmetric matrix, the network will eventually converge to an attractor. What is similar is that if the network state is adjusted in a synchronous manner and the connection of weight matrix W is a non-negative definite matrix, it can be deduced that: Based on the previous verification, it can be found that −Δx j (t) ⋅ net j (t) ≤ 0, and W is a non-negative fixed symmetric matrix; then ΔE(t) ≤ 0 there is, and E(t) will eventually converge to a constant value.
From the above, the real-time CSI is adopted in this paper as the input of DHNN network. The network starts from the initial state X(0). If the state of the network does not change after the finite recursions, that is X(t + 1) = X(t), then the network is stable. If the network is stable, it can converge from any initial state to a steady state. No matter the network works in synchronous or asynchronous mode, when the energy is finally stable to a constant, this constant corresponds to the minimum state of network energy and also to the attractor in the network. In certain cases, if W cannot be guaranteed as a non-negative definite symmetric matrix, the network will have self-sustaining oscillations. In the experiments, the DHNN ought to be designed to work asynchronously, and the fingerprint database of each reference point ought to be set as the attractor respectively and calculate the weight of the test point data and then input to the network; each time there is only one neuron state adjustments, the status of other neurons remains the same; after comparing one by one, the estimated position information will be obtained. The processed CSI data in the off-line stage will be set as the attractor of the whole DHNN network, and the processed CSI data in the on-line stage will be set as the initial state of the DHNN network. After the finite recursion, the network will eventually converge to a steady state, that is, a constant. At this moment, if the constant matches the data in the fingerprint database, the localization is then proved to be successful, and the corresponding location information is returned; otherwise, the localization is unsuccessful. Due to the small amount of collected CSI data and the preliminary processing, the data are basically consistent. Therefore, the stop mechanism of the network does not take into account. When the data volume is large enough and the experimental environment is complex, it is necessary to consider whether the network can complete the recursive convergence to the attractor within a certain time. If not, the stop mechanism is introduced to increase the positioning efficiency. Compared with others, it has higher stability and produces less localization errors than the operation of synchronous mode.

Experiment setup
The schematic diagram of the experimental environment is shown in Fig. 7a, and the whole indoor environment is 10.01× 6.90 m 2 . The laboratory environment is relatively empty, and the multipath effect is small, which is referred to as "stable" environment in the subsequent verification experiment. In this paper, 25 grid areas are set up to divide the experiment area into 5 × 5, a total of 25 squares. Each square area is 0.8 m. On the left of the experimental area, there is a workbench, and a desktop computer on the workbench with an Intel 5300 network card, a CPU of Intel Core i3-4150, and an operating system of Ubuntu11.04. Access point (AP) is placed on the workbench on the right side of the experimental area. At the end of the AP, there is a router with model TL-WDR5300. The two workbenches are the same height. During the experiment, the device is set as AP mode and the working frequency as 5.765 GHz. Similarly, this paper chose the conference room as a comparative (2020) 2020:76 experimental environment. As is shown in Fig. 7b, the whole indoor environment is 12.01 × 6.90 m 2 . The conference room has many obstacles and strong multipath effect, so it is recorded as the "interference" environment in the subsequent verification experiments. Figure 8 is the floor plan of the two scenarios. The blue dots represent the reference points for off-line data collection.

Experimental analysis
In this paper, three representative indoor comparison methods, DeepFi [26], SVR [24], and BiLo c [27] are selected to make comparison with the proposed method. DeepFi and SVR are similar to the methods proposed in this paper because they both include the off-line training phase and the current localization phase. The difference is that DeepFi chooses to use deep learning to train the collected CSI, and then uses the greedy algorithm to calculate the weights layer by layer. SVR selects RSS as sample data and filters analysis. In BiLoc [27], the authors developed a deep learning-based algorithm to exploit the bimodal data. Both the estimated angle of arriving (AOA) and average amplitudes of two adjacent antennas are used as location features for building the fingerprint database. In this paper, two methods are reproduced in the same experimental environment and compared with the DHNN method. The localization accuracy mentioned in this paper is the average localization accuracy obtained after the experiment. Ten groups were set up for the experiment, and each group was recorded for 10 times to record whether the localization was successful. During the experiment, a square (0.8 m) is taken as the error allowable range, that is, the localization error within 0.8 m means localization success. Otherwise, the localization failure is recorded. As shown in Fig. 9, in a stable environment, all the four methods have a relatively high localization accuracy rate.
Because of the construction of the fingerprint database, deep learning and neural network algorithms are adapted to process and model the data, and the sample number of fingerprint database is larger and the accuracy is higher compared with other two methods. Due to the introduction of AOA and deep learning algorithm, the localization accuracy of BiLoc is higher than that of DHNN. However, under the interference environment, all four methods were affected to different degrees. Among them, SVR is most seriously affected, and the accuracy of localization is reduced to less than 30%. Because of the interference caused by other signals and the multipath effect, RSS information is vulnerable to environmental changes and fluctuates greatly. Therefore, its accuracy decreases greatly. The accuracy was reduced to below 50% with the method DeepFi, BiLoc, and the method proposed in this paper, but they are better than the SVR method because those methods use CSI as fingerprint information, regarding localization, a more finegrained CSI is needed to improve accuracy. On the other hand, although CSI information will change greatly due to environmental interference, since both methods adopt feature classification, it can reduce the impact of environmental changes on the of localization accuracy. In both environments, DeepFi is similar to the algorithm proposed in this paper. This is because DeepFi has collected large amounts of data, improved the cost and complexity of localization, and has built a relatively accurate localization fingerprint database of large data volumes. BiLoc needs to accurately measure AOA and CSI data. Although it can obtain high localization accuracy, it increases the workload. However, the method used in this paper is more lightweight in information collection, and it is easier to achieve a more accurate localization effect. As shown in Fig. 10, in the case of small data collection, the algorithm proposed in this paper can achieve higher localization accuracy compared with the other three methods. Figure 11 shows the localization errors with the four localization methods. It can be manifested from the figure that the median localization error with the SVR method is 2 m, the median localization error with the DeepFi method is 1.71 m, and the median localization error with the BiLoc method is 1.52 m. The median localization error with the proposed method in this paper is 1.6 m. Therefore, the method proposed in this paper is superior to the other two methods. However, AOA is not added to the fingerprint data because it is slightly inferior to BiLoc.

Influence of the number of reference points on experimental performance
For the same experimental area, the selection of reference points is also crucial. In this paper, by using the experimental environment, we designed and compared the errors in the indoor localization of DeepFi, SVR, BiLoc, and the localization method proposed in this paper. By using these 4 methods, Fig. 12 respectively shows the localization accuracy in 9, 16, 25, and 36 reference point. It can be seen that the higher the number of reference points, the higher the accuracy of localization. However, due to the limitations of localization areas and the complexity of sampling and data processing, this paper did not select more reference points to improve the localization accuracy. Figure 13 a and b respectively show the cumulative distribution of localization errors of four localization methods when the number of reference points is 9 and 36. It can be seen from Fig. 13a that when the number of reference points is 9, the localization error of more than 80% using the proposed method in this paper is within the range of 2.6 m, while the localization error using the DeepFi method, SVR method, and BiLoc method are 3.2 m, 3.7 m, and 2.9 m respectively. When the number of reference points is 36, as shown in Fig.  13b, the localization error of more than 80% of the points with the proposed method in this paper is within 2.1 m, and the localization errors with the DeepFi method, SVR method, and BiLoc method are 2.8 m, 3.3 m, and 1.8 m respectively. Therefore, with the increase of the number of reference points, the localization accuracy of the localization method will be improved. At the same time, the improvement range is different.
In summary, this paper selects 25 reference points to mesh the experimental area. The advantage of the method proposed in this paper lies in less-collective sample information and the data processing in the early stage only needs filtering and phase correction, which does not require a large amount of time to collect data samples and build models through learning. This way will greatly reduce the time cost in the off-line phase and reduce the workload meanwhile to ensure better localization performance.

The effect of repeat count on localization performance
Sampling repeat count is significant to the localization effect of the whole system. The data collected once by the same reference point is not accurate because of contingency. However, repeated collection and processing will obtain more accurate location information and provide high-quality data for localization. In order to verify the influence of sampling repetition rate on localization performance, this paper designed a number of experiments, analyzed the data from sample 1 to samples 8 respectively, as shown in Fig. 14.
After data fitting, it can be approximately obtained that the sampling quantity is inversely proportional to the average error. As shown in Fig. 15, the more the sampling times, the higher the localization accuracy and the smaller the average error, but eventually it remains stable. When the sampling amount reaches a certain value, the localization accuracy and error will remain basically unchanged.
Under the premise of increasing no complexity of data processing, in this paper, the sampling frequency (4 times) of relatively gentle localization accuracy and average error change is selected, which can help to improve the localization accuracy, the advantage of the proposed  method is less-collective information, and in the early stage of data processing, only filtering and phase correction are required, and there is no need to take a lot of time to collect data samples and build models through learning, which greatly saves time in the off-line phase.

Impact of data quality on localization performance
In the off-line phase, the collected data are filtered and corrected for phase difference, the redundant data and noise are removed, the quality of the fingerprint database is guaranteed, and the location information of the attractor in the on-line phase is provided with higher quality. To analyze the impact of data quality on localization performance, this paper designed two comparison experiments to compare and analyze the impact of data quality.
In experiment A, the collected data is not filtered and phase difference correction is also not conducted in the offline phase to build the fingerprint database, and the data of each reference point is directly used as the attractor.
In experiment B, the collected data were processed in the off-line phase according to the method proposed in this paper, after processing, information of each reference point was taken as the attractor. The impact of data quality on localization accuracy is shown in Fig. 16 and Fig. 17. Results show that experiment A, whether in a stable environment or in interference environment, localization accuracy is no more than 40%, and the localization accuracy in experiment B is much higher than that of experiment A in stable environment and interference environment, which also proves the necessity of filtering and phase correction of the collected data in this paper. If the data is not processed, the localization accuracy will be greatly reduced.

Conclusions
In this paper, a CSI fingerprint indoor localization method based on DHNN is proposed in view of poor accuracy of fingerprint data, low effect of matching based on classification, and vulnerability to environmental impacts. The CSI is preliminarily processed using low-pass filter in the off-line phase, and then, the fingerprint data of all reference points are corrected by phase difference, so as to improve the quality of fingerprint data and obtain a relatively accurate feature fingerprint database. In the on-line phase, the data of each reference point in the fingerprint database is set as an attractor to maintain the consistency of the data. At the same time, the location information in the on-line phase is judged using DHNN network for convergence. Finally, the localization results are obtained, and the localization method is verified and compared with experiments. The comprehensive experimental results show that compared with some current fingerprint indoor localization methods, this method has higher localization accuracy and lower requirements on data quantity. Moreover, future researches will focus on improving localization accuracy and reducing data volume.
Abbreviations DHNN: Discrete Hopfield Neural Network; CSI: Channel state information; LBS: Location-based service; AP: Access points Authors' contributions XHT has contributed towards the algorithms, the analysis, and written the paper. XCD has proofread the paper several times and provided guidance throughout the whole preparation of the manuscript. ZJH and JJR have conceived and designed the experiments. All authors read and approved the final manuscript.