Visible light positioning method based on data enhancement and neural network
By adopting data augmentation technology and deep learning models in visible light positioning systems, the challenges of data acquisition and processing are solved, efficient training and precise positioning are achieved, and suitable for applications in complex indoor environments.
Patent Information
- Application Number
- CN202411487934.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-04-08
AI Technical Summary
Existing visible light positioning systems have challenges in data acquisition and processing, especially the significant changes in data distribution and characteristics at different inclination angles, resulting in the need of a large amount of training data to ensure positioning accuracy, and deep learning algorithms are difficult to balance between training efficiency and prediction accuracy.
The visible light positioning method based on data augmentation and neural network is adopted to generate tilt state data through the Lambert model, build a synthetic data set, and use the normalized training data to train the deep learning model, including the input layer, the hidden layer and the output layer. The hidden layer contains three layers of QRNN and one fully connected layer. The optimizer uses Adam, with a learning rate of 0.015, the QRNN layer uses 24 neurons, and the training batch size is 256.
Reliance on large-scale training data is reduced, the system's training and inference speed is improved, the positioning accuracy and robustness are enhanced, and it is suitable for applications in more practical scenarios.
Smart Images

Figure CN119779288A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visible light positioning, and in particular to a visible light positioning method based on data enhancement and neural network. Background Art
[0002] At present, indoor positioning technologies mainly include wireless local area network (WLAN), Bluetooth, radio frequency identification (RFID) and ultra-wideband (UWB) technologies. Most of these technologies require the installation of a large number of access points (AP) or dedicated signal transmission devices, which greatly increases the cost of the system. Visible light positioning (VLP) technology has the advantages of low cost, high accuracy, strong real-time performance and anti-electromagnetic interference, and can also meet the dual needs of lighting and positioning at the same time. In the VLP system, LED lights not only play the role of lighting, but also undertake key positioning functions. Each LED light is encoded to emit a unique light signal, which contains relevant information such as the location of the light. When the mobile device carried by the user (such as a smartphone or a dedicated positioning receiver) receives these light signals, the light sensor in the device will capture these coded signals. Next, the device will use a specific decoding algorithm to parse the location information in the signal to determine its spatial position relative to the LED light.
[0003] If the signals of multiple LED lights are received at the same time, the device can process the signals comprehensively through triangulation or other positioning algorithms to accurately calculate the three-dimensional position of the device in the entire indoor environment. This process involves technologies such as signal modulation and demodulation, light intensity measurement and analysis, and complex spatial positioning algorithms. The synergy of these technologies enables the VLP system to achieve high-precision positioning in complex indoor environments while avoiding the electromagnetic interference problems faced by traditional radio wave positioning systems. Due to the fixed position and stable light source characteristics of LED lights, the positioning results of the VLP system also have high stability and reliability. This makes the VLP system have broad application prospects in complex indoor scenes such as hospitals, shopping malls, libraries, and underground garages.
[0004] At present, visible light positioning systems have encountered many challenges in practical applications, one of the most significant issues is data acquisition and processing. When deep learning algorithms are used for indoor positioning, they often need a large amount of training data to support the model's learning process to ensure the accuracy of their predictions. However, when the receiving device is at different tilt angles, the distribution and characteristics of the data will change significantly. In order for the neural network to accurately predict the position of the receiver in different postures, a large amount of training data needs to be collected and labeled. This has seriously hindered the promotion and use of VLP technology to a certain extent. At present, most fingerprint regeneration methods rely on the energy radiated by multiple LED lights, which requires a dedicated modulation circuit for the light source. In actual scenarios, it is difficult to deploy so many modulation devices in large or complex buildings, so many research works are still limited to laboratory environments.
[0005] At the algorithm level, the VLP system also faces performance bottlenecks. Although convolutional neural networks (CNN) and recurrent neural networks (RNN) perform well in image processing and sequence prediction tasks, in the application of VLP systems, they often find it difficult to maintain high training efficiency while ensuring high prediction accuracy.
[0006] To solve these problems, future work needs to innovate in data regeneration methods and deep learning algorithms. Specifically, it is necessary to explore more efficient data enhancement techniques to reduce the reliance on large-scale training data; secondly, to develop lightweight deep learning models that are more suitable for VLP systems, so as to improve the training and reasoning speed of the system while ensuring positioning accuracy. These improvements will not only improve the performance of existing systems, but will also help promote the widespread application of VLP technology in more practical scenarios. Summary of the invention
[0007] The purpose of the present invention is to provide a visible light positioning method based on data enhancement and neural network, which is a novel visible light positioning method based on data enhancement technology and neural network.
[0010] The present application provides a visible light positioning method based on data enhancement and neural network, the method comprising the following steps:
[0008] Step 1, collecting training data in the indoor space to be positioned; the training data includes: optical power data at different tilt angles under multiple azimuths collected by the receiver, the azimuth and tilt angle of the receiver, and the coordinates of the receiver.
[0011] Step 2, generate tilt state data using the data of different azimuth angles in the horizontal state through the Lambertian model; then construct a synthetic data set; each set of fingerprints in the synthetic data set is saved in the order of optical power data, receiver azimuth and tilt angle, and receiver coordinates.
[0012] Step 3: Normalize the training data and then train the deep learning model.
[0013] Step 4: Use the trained deep learning model to analyze the optical signal to complete the positioning of the receiver.
[0014] Furthermore, in step 3, mean-variance is used for normalization.
[0015] Furthermore, in step 3, the deep learning model includes an input layer, a hidden layer, and an output layer; the input layer adjusts the data according to the format required by the model; the hidden layer contains three layers of QRNN and one fully connected layer, which extracts the features of the input data through nonlinear changes to achieve effective modeling of the input data; the output layer converts the representation of the hidden layer into the output form required by the model.
[0016] Furthermore, the deep learning model parameters are as follows: the convolution window width is 3; the Adam optimizer is selected, and the learning rate is 0.015; the QRNN layer uses 24 neurons; the batch size for training the DQRNN model is 256.
[0017] The beneficial effects of the present invention are as follows: the present invention provides a visible light positioning method based on data enhancement and neural network, which is an indoor visible light positioning technology based on deep learning; the present invention installs a single LED lamp as a light source in the indoor space to be positioned, obtains light signals through multiple photodetectors on the receiver, and uses a trained deep learning model to analyze the light signals, thereby completing the positioning of the receiver. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Shown is a flowchart of the visible light positioning method of the present invention.
[0019] Figure 2 Shown is a schematic diagram of a visible light positioning system model constructed according to an embodiment of the present invention.
[0020] Figure 3 Shown is a schematic diagram of the three-dimensional structure of the receiver of the present invention.
[0021] Figure 4 Shown is a structural block diagram of the receiver of the present invention.
[0022] Figure 5 Shown is a schematic diagram of the geometric dimensions of five photodiodes of the present invention.
[0023] Figure 6 Shown is a circuit diagram of the optical signal receiving circuit of the present invention.
[0024] Figure 7 Shown is a circuit diagram of a signal processing circuit provided by the present invention.
[0025] Figure 8 Shown is a circuit diagram of a filter circuit provided by the present invention.
[0026] Fig. 9 The figure shows the corresponding relationship between the pulse and the steering gear rotation angle of the present invention.
[0027] Fig.10 Shown is a schematic diagram of the light source direct illumination model of the present invention.
[0028] Fig.11 Shown is a schematic diagram of the structure of the two methods of synthesizing data sets in the present invention.
[0029] Fig.12 Shown is a schematic diagram of the quasi-recurrent neural network structure.
[0030] Fig.13 Shown is a schematic diagram of the structure of the deep learning model of the present invention.
[0031] Fig.14 The prediction results of the DQRNN model using three optimizers, Adam, Adagrad and RMSprop, at different learning rates are shown in Figure 2.
[0032] Fig.15 Shown is a graph showing the results of the influence of the number of neurons of the present invention.
[0033] Fig.16 Shown are the relative errors between different generated data of the present invention and the experimental data.
[0034] Fig.17 The positioning test result diagram of the present invention is shown.
[0035] Fig.18 Shown is a statistical diagram of the positioning error distribution under different data sets of the present invention.
[0036] Fig.19 Shown is a cumulative distribution diagram of positioning error of the present invention.
[0037] Figure 3 In the figure, a frame 1, a rotating table 2, a rotating drive 3, a first circuit board 4, a rotating support seat 5, a power supply device 6, a second circuit board 7, an infrared receiver 8, a single chip microcomputer 9, and a WiFi communication module 10. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] The present invention provides a visible light positioning method based on data enhancement and neural network, which is an indoor visible light positioning technology based on deep learning. The present invention installs a single LED lamp as a light source in the indoor space to be positioned, obtains light signals through multiple photodetectors on the receiver, and uses a trained deep learning model to analyze the light signals, thereby completing the positioning of the receiver.
[0040] like Figure 1 The figure shows a flowchart of the visible light positioning method of the present invention. The method of the present invention mainly comprises the following steps:
[0041] Step 1, collecting training data in the indoor space to be positioned; the training data includes: optical power data at different tilt angles under multiple azimuths collected by the receiver, the azimuth and tilt angle of the receiver, and the coordinates of the receiver.
[0042] Step 2, generate tilt state data using the data of different azimuth angles in the horizontal state through the Lambertian model; then construct a synthetic data set; each set of fingerprints in the synthetic data set is saved in the order of optical power data, receiver azimuth and tilt angle, and receiver coordinates.
[0043] Step 3: Normalize the training data and then train the deep learning model.
[0044] Step 4: Use the trained deep learning model to analyze the optical signal to complete the positioning of the receiver.
[0045] The present invention is described below with actual examples to illustrate the specific content of the method of the present invention.
[0046] The present invention builds a visible light positioning system model in an actual shopping mall environment, and implements the method of the present invention in the system model. The specific scheme is as follows.
[0047] like Figure 2 The figure shows a schematic diagram of a visible light positioning system model constructed by an embodiment of the present invention. The visible light positioning system model constructed by the present invention includes an indoor space, which is a rectangular space with a length of 3.6m, a width of 2.2m, and a height of 2.8m. In order to determine the position coordinates in the model space, the following is established: Figure 2The coordinate system shown in the figure uses a vertex O on the ground in the space as the origin, the length direction as the y-axis, the width direction as the x-axis, and the direction perpendicular to the ground as the z-axis. In this way, the position coordinates of any point in the space can be determined. In addition, on the ground in the space, 15cm×15cm grid units are divided by horizontal grid lines and vertical grid lines with an interval of 15cm. The vertices of the grid units are used as training points, and the interval between training points is 15cm×15cm; the test point grid size is set to 10cm×10cm.
[0048] The system model also needs to be configured with a light source, a receiver that can move in space, and a host computer; the host computer has a deep learning model.
[0049] like Figure 2 As shown in , a light source, i.e., an LED lamp, is set in the center of the top surface of the indoor space, and the LED lamp irradiates vertically downward. The spatial coordinates of the LED lamp are (1.8m, 1.1m, 2.8m). An infrared transmitter for sending position information is also installed in the center of the top surface of the indoor space.
[0050] like Figure 3 FIG. 1 is a schematic diagram of the three-dimensional structure of the receiver of the present invention. Figure 4 FIG. 1 is a block diagram of the structure of the receiver of the present invention. Figure 3 As shown in the figure, the receiver of the present invention mainly includes a frame 1, a rotating table 2, a rotating drive 3, a first circuit board 4, a rotating support seat 5, a power supply device 6, and a second circuit board 7; wherein, five photodetectors are arranged on the first circuit board 4, specifically five photodiodes (PD), respectively represented as PD 1 , PD 2 , PD 3 , PD 4 , PD 5 In a specific embodiment, the photodiode (PD) is of model 2CU84 and has a size of 6 mm. The first circuit board 4 is also provided with an optical signal receiving circuit, a signal amplifying circuit, and an infrared receiver 8; the second circuit board 7 is provided with a single chip microcomputer 9 and a WiFi communication module 10.
[0051] The structure and connection relationship of each functional unit in the receiver are introduced in detail below.
[0052] like Figure 3 As shown in the figure, a rotating table 2 is arranged on the frame 1, and a rotating drive 3 is connected to the lower surface of the rotating table 2, and the rotating table 2 is driven to rotate by the rotating drive 3. In a specific embodiment, the rotating drive 3 adopts a high-precision steering gear, the steering gear model is DS3218, and the steering gear accuracy is 0.52°. A first circuit board 4 that can adjust the inclination is arranged on the upper surface of the rotating table 2. Specifically, Figure 3As shown in FIG. 1 , two rotating support seats 5 are symmetrically arranged on the upper surface of the rotating platform 2, and the first circuit board 4 is rotatably connected between the two rotating support seats 5; the first circuit board 4 can adjust the tilt angle. Five coplanar photodiodes (PDs) are installed on the upper surface of the first circuit board 4, namely, PD 1 , PD 2 , PD 3 , PD 4 , PD 5 , where PD 1 Set at the center of the first circuit board 4 as the center PD; PD 2 , PD 3 , PD 4 , PD 5 PD 1 The ring array is arranged around PD1 as the center of the circle, and serves as branch PDs.
[0053] Figure 5 The figure shows the geometric dimensions of the five photodiodes of the present invention. As shown in the figure, in order to avoid mutual interference between the PDs after the receiver is tilted, the distance L between the center PD and the branch PD is set to 0.03m after testing. j It is the angle between the line connecting the center PD and the branch PD and the positive half axis of the x-axis, and the angles between the branch PDs are all 90°.
[0054] like Figure 6 FIG. 1 is a circuit diagram of an optical signal receiving circuit of the present invention. Figure 6 As shown in , the optical signal circuit is composed of 5 sampling branches, each of which is composed of a photodiode and a sampling resistor. In the optical signal receiving circuit, when the optical signal passes through the photodiode, the photodiode converts the optical signal into an electrical signal, and the generated current passes through the sampling resistor, thereby generating a voltage proportional to the light intensity at both ends of the sampling resistor. However, the voltage signal obtained by the photodiode conversion is very weak and needs to be amplified. For this reason, a signal amplification circuit is also provided on the first circuit board 4 of the present invention.
[0055] like Figure 7 FIG. 1 is a circuit diagram of a signal amplifying circuit of the present invention. Figure 7 As shown in the figure, the present invention uses two operational amplifiers of model LM358 to build a two-stage operational amplifier to achieve signal amplification. After testing, the gain of the amplifier circuit is 87 times.
[0056] Furthermore, the signal may be interfered by voltage instability or other circuits during the transmission process of the circuit, resulting in unstable received signals. Therefore, a filter circuit is further provided in the embodiment of the present invention.
[0057] like Figure 8The figure shows a circuit diagram of a filter circuit provided by the present invention. In this embodiment, an RC low-pass filter is used; its cut-off frequency is 100Hz. Since the electrical signal after PD conversion is very weak, if the signal after PD conversion is directly filtered, the original signal will be lost. Therefore, in the circuit of the present invention, amplification must be performed before filtering.
[0058] like Figure 3 As shown in FIG. 4 , an infrared receiver 8 is also mounted on the first circuit board 4. In a specific implementation manner, the model of the infrared receiver 8 is HX1803.
[0059] like Figure 3 As shown in FIG, a second circuit board 7 and a power supply device 6 are also installed on the frame 1, and a single-chip microcomputer 9, a WiFi communication module 10, and a steering gear control circuit are arranged on the second circuit board 7.
[0060] The voltage signal processed by the filter circuit is transmitted to the single-chip microcomputer 9, and the analog-to-digital converter (ADC) in the single-chip microcomputer 9 converts the signal into a digital signal. Then, the DMA channel in the single-chip microcomputer 9 automatically transfers these data to the specified memory address. Since DMA can complete the data transmission process without occupying CPU resources, the response speed and real-time performance of the system are further improved. This method greatly simplifies the data processing process, reduces the burden on the processor, and enables the system to run stably in more complex application scenarios. This method can achieve continuous and efficient data reading, which is particularly suitable for application scenarios that require real-time monitoring and analysis of optical signals.
[0061] The relationship between the ADC register value D and the voltage conversion value V is shown in the following formula a: V=(3.3*D) / 2 12 (Formula a).
[0062] The conversion relationship between power value P and voltage value is shown in the following formula b: P=(V / K f ) 2 / R s (Formula b).
[0063] In formula b, K f is the gain of the amplifier and filter circuit, R s is the sampling resistor value.
[0064] The steering gear control of the present invention is as follows:
[0065] The steering gear control circuit generates a PWM wave of a specified pulse width by using the timer and PWM generator in the single chip microcomputer 9. The PWM waves of different pulse widths are used to control the steering gear. Fig. 9The figure shows the corresponding relationship between the pulse and the rotation angle of the servo of the present invention. The present invention generates a PWM signal by setting the STM32 timer. First, the PWM signal is configured to 50Hz for the automatic reload register (TIMx ARR) and the comparison register (TIMx CCR) register. Next, the PWM mode is initialized and the control signal is generated by setting the period and duty cycle of the timer. The duty cycle varies between 0.5ms and 2.5ms, corresponding to the minimum and maximum positions of the servo.
[0066] In the present invention, the receiver is integrally mounted on a movable trolley, which is convenient for moving the position in space, and the height of the receiver from the ground is 0.9m.
[0067] The working principle of the receiver of the present invention is as follows: the photodiode converts the collected optical signal into an electrical signal, which is then amplified by the signal amplifier circuit, filtered by the filter circuit, and then sent to the single-chip microcomputer 9; the analog-to-digital converter (ADC) in the single-chip microcomputer 9 converts the signal into a digital signal, and further converts it into optical power data. The receiver sends the collected optical power data and the receiver coordinates to the host computer through the USART interface and the TCP protocol. In order to ensure the efficient operation of the CPU as much as possible, the DMA method is also used for the sending and receiving of the data here. In the sending stage, the CPU stores the formatted JSON string in the specified variable, and the DMA controller automatically fills it into the DR register of the USART to realize the automatic sending of data. The host computer sends the steering gear control command to the receiver. The traditional byte-by-byte receiving method will frequently interrupt the normal operation of the CPU. In the receiving stage, the present invention uses a combination of idle interrupts and DMA to realize data reception. This method is to wait for a frame of data to be received before generating an interrupt flag, and then use DMA to save the received data to the corresponding variable, which greatly improves the data transmission efficiency.
[0068] The infrared transmitter is installed next to the LED light. The infrared transmitters installed in different areas have different ID codes. Each area has only one code. The infrared transmitter sends the code through the NEC protocol, and the ID code is between 0-255. The codes in different areas are different. The receiving end can obtain the corresponding ID code through the infrared receiver through the NEC protocol. The receiver can determine which LED is currently in the radiation range through the obtained ID code, that is, roughly locate.
[0069] The receiver sends the collected optical power information to the host computer software through the WiFi transmission circuit. The receiver's attitude information (azimuth, tilt angle) and the receiver's position are set by the host computer software according to the actual state of the receiver. The host computer software then forms a set of fingerprints with the currently collected optical power data, the current azimuth and tilt angle of the receiver, and the current position of the receiver. After all the training point data are collected, a complete training data set is formed.
[0070] Finally, after the deep learning algorithm is trained with the training data set, it uses the optical power data collected in real time for positioning, that is, precise positioning. The exact location of the receiver is located by combining rough positioning and precise positioning.
[0071] After the above system model is built, the method of the present invention is implemented; the specific steps are as follows.
[0072] Step 1: Collect training data in the indoor space to be positioned; the training data includes: optical power data at different tilt angles under multiple azimuths collected by the receiver, the azimuth and tilt angle of the receiver, and the coordinates of the receiver. The specific method is as follows:
[0073] In the indoor visible light positioning technology based on deep learning, a deep learning model is needed to identify complex patterns and features; in the present invention, the deep learning model determines the position of the receiver by analyzing the characteristics of the light signal, such as light intensity, angle, etc. In order to ensure that the deep learning model has high output accuracy, the deep learning model requires a large amount of training data for training. Specifically, it is necessary to collect enough data under different lighting conditions, receiving postures and locations. These data help the model learn the changes in light signals in different situations, thereby improving the accuracy and robustness of positioning.
[0074] The training data collection process is as follows: place the receiver at a certain training point, first fix the receiver to a certain azimuth, and then collect optical power data at different tilt angles. Then, change the azimuth to continue collecting optical power data at different tilt angles; and so on. That is, each training point collects optical power data at different tilt angles at multiple azimuths. Collect data from other training points. When collecting test point data, the azimuth and tilt angles of the receiver are randomly set once to simulate the random tilt state of the device during actual use. When collecting optical power data, the azimuth and tilt angles of the receiver in the corresponding posture, as well as the receiver coordinates, are recorded at the same time.
[0075] Step 2: Generate tilt state data using the data of different azimuth angles in the horizontal state through the Lambert model; then construct a synthetic data set. The specific method is as follows:
[0076] When the deep learning model predicts the position of the receiver in an inclined state (the inclined state here refers to the inclination of the first circuit board 4), the amount of training data required will increase significantly compared to the horizontal state. Due to the complex indoor environment, the optical power received by the receiver will be affected by scattering and noise. According to existing research, the received power of the line-of-sight (LOS) channel accounts for 95% of the total received power. Therefore, in the present invention, considering only the LOS channel condition, a data enhancement method based on the Lambert model is proposed to address the problem of large data collection workload. This method uses the optical power data of the receiver in a horizontal position, and generates optical power data in an inclined state through a data enhancement method based on the Lambert model, so as to reduce the workload of the data collection process.
[0077] The method of the present invention for generating tilt state data by using data of different azimuth angles in a horizontal state through a Lambertian model is as follows:
[0078] like Fig.10 Shown is a schematic diagram of the light source direct illumination model of the present invention. Fig.10 The figure shows that when the receiver is located at a certain point to be tested, the center PD 1 With a branch PD j Change in position during tilt. PD j , PD′ j With PD″ j (j≠1) represents PD j The position of the receiver in the initial state, horizontal rotation state and tilt state. 1 centered, PD j Relative to PD 1 The initial position vector The following formula 1 relationship is satisfied:
[0079] In formula 1, L is the outer PD j With Center PD 1 The distance between them, in the present invention, L = 0.03, θ j For PD j Initial placement angle. When the receiver is in the initial state, its LOS channel gain can be expressed by the following formula 2:
[0080] In formula 2, φ j is the emission angle of LED light, ψ j is the incident angle of the light, d j For LED and PD j The straight-line distance between them, A is the effective receiving area of PD, T s (ψ j) is the filter gain, G(ψ j ) is the concentrator gain, ψ c is the field of view of PD, m is the Lambertian order, and m = -ln2 / lncosφ 1 / 2 ,φ 1 / 2 is the half-power half-angle of the light source. In order to simplify the calculation, K is used to represent the constant coefficient in Formula 2, which is simplified as shown in Formula 3 below:
[0081] After the receiver is tilted, the position of each PD changes. The relationship between the vectors is used to calculate the cosine value of the LED emission angle and the PD incident angle after the change, as shown in the following formula 4:
[0082] In formula 4, Represents the unit normal vector of the LED light pointing vertically downward, represents the unit normal vector of the receiver in the initial state, and Represents the vector from LED to PD, Represents the vector from PD to LED, the two are equal in magnitude and opposite in direction, that is and When the receiver is in the initial state, the LED to PD j The LOS channel gain is expressed as follows:
[0083] The vector of LED pointing to each PD in formula 5 Decomposition into LED to PD 1 The vector and Two parts, as shown in Formula 6 and Formula 7 below:
[0084] In formula 7, (x r ,y r ,z r ) is the receiver center PD 1 Coordinates, (x t ,y t ,z t ) is the LED coordinate. When the receiver is in a tilted state, that is, when both α and β change, the distance from LED to PD″ j The LOS channel gain is expressed as follows:
[0085] in:
[0086] Since all PDs of the receiver are in the same plane, their normal vectors are the same, as shown in the following formula 11:
[0087] When the receiver is in a horizontal rotation state, that is, only α changes, and the tilt angle remains unchanged (β = 0), the LED to PD′ j The LOS channel gain is expressed as follows:
[0088] in:
[0089] H j (0), H′ j (0) and H″ j (0) respectively represent the PD of the receiver in different postures j The present invention uses the received optical power in the initial state and the horizontal rotation state to generate PD j The optical power after tilting is analyzed in simulation and experimental scenarios.
[0090] Method 1: When the receiver is in the initial state, PD j The optical power is The channel gain change is The tilted optical power data can be calculated by formula 14:
[0091] Method 2: PD j The optical power in the horizontal rotation state is The generated data can be obtained by formula 15:
[0092] The method for constructing the synthetic data set of the present invention is as follows:
[0093] The collected optical power data, receiver azimuth and tilt angles, and receiver coordinates are saved in sequence as a set of fingerprints. The synthetic dataset consists of two parts: one is the optical power data of the receiver at different azimuths in the horizontal state, and the other is the tilt state data generated by the Lambert model using the data at different azimuths in the horizontal state.
[0094] like Fig.11 Shown is a schematic diagram of the structure of the two methods of synthesizing data sets in the present invention. Fig.11 (a) is the synthetic dataset of method 1, and (b) is the synthetic dataset of method 2. Fig.11 In, P i,jIndicates the PD at the i-th test point j The optical power data collected in the initial state or horizontal rotation state, GP i,j Indicates the generated tilt state data. i ,y i is the coordinate of the center position of the receiver, N 1 N is the number of points to be measured in the initial state or horizontal rotation state. 2 is the number of generated points. The azimuth angle α of the receiver m The range is between 0-360°, and the sampling is performed at intervals of 20°, so m = 18. Tilt angle β n It can be freely changed between 0-30°, with an interval of 10°, so n = 3. In the synthetic data set constructed using method 1, the measured data accounted for about 2%, reducing the collection workload by 98%. In the synthetic data set constructed using method 2, the measured data accounted for 25% of the total, which can reduce the workload by 75%.
[0095] Step 3: Use training data to train the deep learning model. The specific method is as follows:
[0096] First, the description of the related prior art is as follows:
[0097] Recurrent Neural Network (RNN) is a type of deep learning model used to process sequence data. Its core feature is the introduction of a cyclic structure that enables the network to maintain information transmission at different time steps. However, traditional RNNs may face the problem of gradient vanishing or gradient exploding when facing long sequences. In order to solve this problem, some improved RNN structures, such as long short-term memory networks (LSTM) and gated recurrent units (GRU), have been gradually introduced to improve the performance of the model when processing long sequences.
[0098] In 2016, James Bradbury of the United States proposed the Quasi-Recurrent Neural Network (QRNN). Compared with LSTM and GRU, QRNN has the advantages of high computational efficiency, strong ability to capture long-distance dependencies, and relatively few parameters. Its design was inspired by the advantages of CNN in capturing local features and RNN in modeling sequence dependencies. QRNN has a neural sequence modeling method with parallel convolutional layers, which can effectively utilize input sequence information.
[0099] like Fig.12 The following is a schematic diagram of the quasi-recurrent neural network structure. The QRNN consists of two parts. The first part is the convolution operation unit. For an input sequence X=(x 1 , x 2 , …, x T ), that is, each vector x iThe dimension is n. After passing through m convolution filters, a sequence Z with a dimension of T×m is output. 1 , z 2 , …, z T ), where each vector z j The dimension becomes m, as shown in Formula 16: Z = tanh(W z *X) (Formula 16).
[0100] QRNN uses the gate function to obtain the sequence vector required by the pooling layer, but it uses convolution internally to replace the linear operation in the LSTM gate function. The calculation method of its forget gate F and output gate o is shown in Formula 17 and Formula 18: F=σ(W f *X) (Formula 17). O=σ(W o *X) (Formula 18).
[0101] In formulas 16, 17, and 18, W z , W f , W o They are all convolution filters with dimensions of k×m×n. * represents the convolution operation between matrices. Tanh(x) and σ(x) are activation functions, and their expressions are shown in the following formulas 19 and 20 respectively:
[0102] Assume that the convolution filter width is k, that is, the convolution operation spans k in the sequence dimension. The QRNN output state sequence and the forget gate and output gate outputs can be calculated by the following formula:
[0103] The second part of QRNN performs pooling so that the memory cell state is updated at different times through gate control to maintain the contextual relevance between sequences. The memory cell update method is expressed as the following formula 24: c t =f t ⊙c t-1 +(1-f t )⊙z t (Formula 24).
[0104] In formula 24, ⊙ is element-wise multiplication. The final output state of QRNN is obtained by combining the output gate and the current memory cell state, which is expressed as follows in formula 25: h t =o t ⊙c t (Formula 25).
[0105] The training data provided by the present invention includes optical power data, receiver azimuth angle, and tilt angle, but these data are not of the same order of magnitude. If these data are directly input into the model for training, the model may converge slowly and be unstable. To this end, the present invention first normalizes the training data. Specifically, the present invention uses mean-variance for normalization, and its expression is as follows: Formula 26:
[0106] In formula 26, P r ′ is the normalized data, P r is the original data, μ and σ are P r The mean and standard deviation of .
[0107] In order to understand the performance of the network model and positioning system in more detail, it is necessary to select objective and quantifiable indicators for evaluation. In prediction problems, the mean square error (MSE) is usually used as the loss function, which is expressed as the following formula27:
[0108] In formula 27, N is the number of sample points, (x i ,y i ) is the actual position of the point to be measured, The model predicts the position. MSE is an important indicator for evaluating the difference between the predicted value and the true value. The smaller it is, the closer the model prediction result is to the real data. MSE can be reduced by optimizing the model hyperparameters to improve the prediction accuracy. After the model training is completed, in order to evaluate its overall positioning performance, it is necessary to calculate the average positioning error (APE) between the real coordinates and the predicted coordinates, which intuitively reflects the performance of the model in the overall positioning task. APE can be expressed by formula 28:
[0109] The present invention establishes a deep learning model (DQRNN) based on the prior art. Fig.13 The figure shows the structure of the deep learning model (DQRNN) of the present invention. The model mainly consists of three parts, namely the input layer, the hidden layer and the output layer. The input layer adjusts the data according to the format required by the model; the hidden layer contains three layers of QRNN and one fully connected layer, which extracts the features of the input data through nonlinear changes to achieve effective modeling of the input data; the output layer converts the representation of the hidden layer into the output form required by the model. In the present invention, 2.4×10 4 The simulated data are used for training and testing to find the most suitable hyperparameters for the model.
[0110] The present invention first studies the influence of convolution window width on the model, and the results are shown in Table 1 below.
[0111] Table 1. Statistics of the impact of convolution window width on the model.
[0112] The present invention tests different convolution window widths, as shown in Table 1. The wider the convolution window width, the more efficient it is in capturing patterns and regularities in the sequence, thus achieving better results when processing sequence tasks. In order to balance the dual indicators of model prediction ability and training time, the convolution window width in the present invention is 3, that is, k=3.
[0113] The influence of the optimizer and the learning rate on the model of the present invention is studied as follows.
[0114] Adam, Adagrad, and RMSprop are all adaptive learning rate optimizers that can adaptively adjust the learning rate to prevent parameter oscillation or divergence. Fig.14 The prediction results of the DQRNN model using three optimizers, Adam, Adagrad and RMSprop, at different learning rates are shown in Figure 1. When the model uses the Adam optimizer and the learning rate is 0.015, the model loss and APE are the smallest.
[0115] like Fig.15 The figure shows the effect of the number of neurons in the present invention. The more neurons there are, the stronger the network's expression ability is, which helps to improve the model's fitting ability. Fig.15 It can be found that as the number of neurons in each layer increases, the average error of the prediction results continues to decrease, while the maximum error rebounds. This is because when the number of neurons in the neural network is too large, the model is too complex and overfitting occurs, resulting in a decrease in the prediction accuracy of the model. In the present invention, the QRNN layer uses 24 neurons.
[0116] The batch size affects the training speed and generalization ability of the neural network. As shown in Table 2 below, as the batch size increases, the training time of the model is also shortened accordingly. Considering the prediction performance and training efficiency of the model, the batch size of the DQRNN model trained in the present invention is 256.
[0117] Table 2. Statistical table of the impact of batch size on accuracy.
[0118] Table 3 below is a statistical table showing the effect of the selection of the number of network layers on the accuracy in the present invention.
[0119] Table 3. The impact of different number of layers on accuracy.
[0120] Networks with more layers have stronger representation and learning capabilities, but they also increase training complexity and possible overfitting risks. As shown in Table 3, as the number of QRNN layers increases, the prediction accuracy of the model is also continuously improved, but the corresponding model training time also increases. The present invention selects a 3-layer QRNN network to form a DQRNN model. After analyzing the key hyperparameters, a set of parameter settings that perform well in multiple indicators are finally determined, as shown in Table 4 below.
[0121] Table 4. DQRNN model parameters.
[0122] Furthermore, the present invention uses a common RNN network to form a structure similar to the DQRNN model and tests its performance. As can be seen from Table 5 below, the model composed of QRNN uses relatively few parameters to obtain the best positioning effect. Compared with other RNNs, the QRNN network has a stronger ability in feature extraction and can more effectively extract key features from data. Therefore, the QRNN network is selected to form the DQRNN model in the positioning system.
[0123] Table 5. Positioning effects of different RNN layers
[0124] Simulation and experimental results.
[0125] Simulation space model such as Figure 2 As shown in , the LED light is located directly above the center of the area, and the receiver consists of 5 coplanar PDs. Some simulation parameters are listed in Table 6 below.
[0126] Table 6. Simulation parameter table.
[0127] Table 7 below shows the statistical table of positioning results under different data sets.
[0128] Table 7. Statistics of positioning results under different data sets.
[0129] From Table 7, we can see that after the DQRNN model was trained with different data sets, the average values of the prediction results of the two models were not much different and both increased slightly with the increase in height, but both remained within 2.3 cm. In the ideal Lambert model, these two data sets can provide reliable and consistent results. However, as the height of the receiver increases, the fluctuation range of the maximum value of the prediction result increases. This is because when the receiver is located at some edge training points, the receiver is at a higher height and tilted, so that the incident angle of the light is greater than the field of view angle of the PD itself, resulting in the loss of features of some edge training points, thereby increasing the error of the prediction result.
[0130] Table 8 below shows the distribution statistics of the prediction errors of the model when using different data sets.
[0131] Table 8. Distribution statistics of prediction errors of the model when using different data sets.
[0132] Table 8 shows the results of the cumulative distribution function (CDF) of positioning errors at various heights using different data sets. Through analysis, whether using standard data or synthetic data, 90% of the positioning results of the network model at different heights are concentrated within 0.03m to 0.04m. This shows that in the ideal Lambertian model, using synthetic data can also obtain similar and stable results to standard data.
[0133] The present invention analyzes the collected experimental data and the data generated by different Lambertian enhancement algorithms to find the potential errors in the experiment, which is crucial for the training of neural networks. Fig.16 Shown are the relative errors between different generated data of the present invention and the experimental data. Fig.16 (a) shows the data generated by method 1. Fig.16 (b) shows the data generated by method 2. Fig.16 The relative error between the experimental data and the generated data of different methods is shown in . It can be expressed by formula 29:
[0134] In formula 29, P gen represents generated data, P realrepresents experimental data, and R represents relative deviation. As can be seen from the figure, the data generated by method one has a larger deviation than that of method two. In method one, the small amount of data collected by the receiver in the initial state cannot fully reflect the actual situation in the experiment, resulting in a large deviation in the generated data. In method two, the data collected by the receiver in a horizontally rotated state can capture the subtle differences in the experiment, thereby reducing the deviation between the data. Due to the severe attenuation of light intensity in the edge area, the data generated by different methods all have large deviations at the edge. The light in the center area is relatively sufficient, and the deviation between the data is small.
[0135] The data deviations at different tilt angles are shown in Table 9 below. As the tilt angle of the receiver increases, the deviation between the generated data and the experimental data increases accordingly. The data deviations at different azimuth angles are shown in Table 10 below. As the azimuth angle of the receiver increases, the data deviation does not show obvious regular changes. However, due to the change in the position of the PD after the receiver rotates, some data deviations are large. Compared with other PDs, the data deviations of PD2 and PD4 are larger. The data enhancement method based on the Lambert model is more sensitive to the vertical changes in the position of the PD.
[0136] Table 9. Deviation statistics between data at different tilt angles.
[0137] Table 10. Deviation statistics between data at different azimuth angles.
[0138] The positioning results are analyzed as follows:
[0139] The present invention uses experimental data and synthetic data to train the DQRNN model, and then performs positioning tests on 172 test points. Fig.17 The positioning test result diagram of the present invention is shown. Fig.17 (a) shows the test results of the experimental dataset. Fig.17 (b) shows the test results of synthetic dataset 1. Fig.17 (c) The test results on synthetic dataset 2 are shown. Fig.18 The figure shows the distribution statistics of positioning errors under different data sets of the present invention. Fig.18 (a) shows the distribution statistics of positioning error under the experimental data set. Fig.18 (b) shows the distribution statistics of positioning error under synthetic dataset 1. Fig.18 (c) shows the distribution statistics of positioning error under synthetic dataset 2.
[0140] Fig.17In (a), the positioning results based on experimental data are shown, with an APE of 0.12m and a maximum positioning error of 0.68m. Fig.17 (b) shows the positioning result using synthetic dataset 1, with an APE of 0.73m and a maximum positioning error of 1.49m. Fig.17 (c) shows the positioning results using synthetic dataset 2, with an APE of 0.33m and a maximum positioning error of 0.94m. Fig.18 The distribution of positioning errors when using different data is shown in Figure 2. Among the positioning results of different data, the positioning error at the edge of the area is larger. On the one hand, the light intensity in the edge area is weaker than that in the center area, and on the other hand, the field of view of the tilted receiver in the edge area is limited, resulting in fluctuations in the received data, which leads to a decrease in positioning accuracy.
[0141] Fig.19 The figure shows the cumulative distribution diagram of the positioning error of the present invention. Fig.19 (a) is the cumulative distribution diagram of the positioning error of the experimental data set. Fig.19 (b) is the cumulative distribution diagram of the positioning error of synthetic dataset 1. Fig.19 (c) is the cumulative distribution diagram of positioning error of synthetic dataset 2. Fig.19 The positioning performance of the DQRNN model using different data sets is shown. After the model was trained with the experimental data set, 90% of the prediction errors of the DQRNN algorithm were less than 0.23m, while the errors of the GRU, LSTM and SRU methods under the same conditions were less than 0.33m, 0.36m and 0.63m respectively. After training with synthetic data set 1, 90% of the prediction errors of the DQRNN algorithm were less than 0.98m, while the errors of the other methods were less than 1.1m, 1.08m and 1.34m respectively. After training with synthetic data set 2, 90% of the errors of the DQRNN algorithm were less than 0.49m, and the errors of the other methods under the same conditions were less than 0.58m, 0.69m and 0.84m respectively. After comparison, the DQRNN algorithm is superior to other similar RNN algorithms in terms of positioning accuracy, with higher accuracy and stability.
[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A visible light positioning method based on data enhancement and neural network, characterized in that: The method comprises the following steps: Step 1, collecting training data in the indoor space to be positioned; the training data includes: optical power data at different tilt angles at multiple azimuths collected by the receiver, the azimuth and tilt angle of the receiver, and the coordinates of the receiver; Step 2, using the data of different azimuth angles in the horizontal state to generate tilt state data through the Lambertian model; then constructing a synthetic data set; each set of fingerprints in the synthetic data set is saved in the order of optical power data, receiver azimuth and tilt angle, and receiver coordinates; Step 3, normalize the training data and then train the deep learning model; Step 4: Use the trained deep learning model to analyze the optical signal to complete the positioning of the receiver.
2. The visible light positioning method based on data enhancement and neural network according to claim 1, characterized in that: In step 3, mean-variance is used for normalization.
3. The visible light positioning method based on data enhancement and neural network according to claim 1, characterized in that: In step 3, the deep learning model includes an input layer, a hidden layer, and an output layer; the input layer adjusts the data according to the format required by the model; the hidden layer contains three layers of QRNN and one fully connected layer, which extracts the features of the input data through nonlinear changes to achieve effective modeling of the input data; the output layer converts the representation of the hidden layer into the output form required by the model.
4. The visible light positioning method based on data enhancement and neural network according to claim 3 is characterized in that: The deep learning model parameters are as follows: the convolution window width is 3; the Adam optimizer is selected, and the learning rate is 0.015; the QRNN layer uses 24 neurons; the batch size for training the DQRNN model is 256.