WO2024077449A1 - 用于定位的模型的训练方法、定位方法、电子设备及介质 - Google Patents

用于定位的模型的训练方法、定位方法、电子设备及介质 Download PDF

Info

Publication number
WO2024077449A1
WO2024077449A1 PCT/CN2022/124418 CN2022124418W WO2024077449A1 WO 2024077449 A1 WO2024077449 A1 WO 2024077449A1 CN 2022124418 W CN2022124418 W CN 2022124418W WO 2024077449 A1 WO2024077449 A1 WO 2024077449A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
positioning
visible light
neural network
model
Prior art date
Application number
PCT/CN2022/124418
Other languages
English (en)
French (fr)
Inventor
周妍
庄园
杨先圣
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2022/124418 priority Critical patent/WO2024077449A1/zh
Publication of WO2024077449A1 publication Critical patent/WO2024077449A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling

Definitions

  • the present application relates to the technical field of electronic equipment, and in particular to a training method for a model used for positioning, a positioning method, an electronic device and a medium.
  • the receiving device 100 shown in FIG1 is in an indoor space 200.
  • the indoor space 200 includes five LED lights: LED1 to LED5, and a three-dimensional space coordinate system can be established based on the indoor space 200.
  • the receiving device 100 can receive the transmission signals of the five LED lights at the current position (x, y, z), and process the received information to obtain the strength of the five transmission signals, and obtain the current position coordinates of the receiving device according to the strength of the transmission signals and the Lambert model.
  • the Lambertian model in the current visible light positioning technology based on light intensity does not take into account the impact of ambient light, noise, different LED lights, etc. on the positioning results, and the positioning accuracy is low.
  • the embodiments of the present application provide a training method for a model for positioning, a positioning method, an electronic device and a medium, which solve the technical problem that the Lambertian model under different calibration ambient lights in the visible light-based positioning technology is not universal.
  • an embodiment of the present application provides a training method for a model for positioning, comprising: obtaining multiple visible light data collected at multiple positions under different ambient light, wherein each visible light data includes light data from different visible light sources; using each visible light data, the position information corresponding to each visible light data, and the ambient light identifier of the ambient light corresponding to each visible light data as training data samples, and inputting them into a first neural network model to train the first neural network model to obtain a second neural network model.
  • the first neural network model is the neural network model in the following embodiments
  • the second neural network model is the positioning model in the following embodiments.
  • each visible light data may be mixed light data of all visible light sources received at a certain position at a certain moment.
  • the parameters in the first neural network model are initialized parameters.
  • the training data samples are input into the first neural network model for training.
  • the parameters of the first neural network model can be optimized based on the training data samples to obtain the second neural network model.
  • the first neural network model can learn the influence of different ambient light on the visible light data, the relationship between the visible light data at the same position, and the correspondence between the feature data of the visible light data and the position information, and the visible light data and the corresponding position relationship are modeled to obtain a second neural network model that can suppress the influence of ambient light on the positioning results and has a higher positioning accuracy.
  • the model training method for positioning collects visible light data under different ambient light conditions to train the first neural network model, and the obtained second neural network model can be applied to positioning under various complex ambient light interferences.
  • the second neural network model is trained using visible light data under different ambient light conditions, the influence of ambient light can be suppressed, and the positioning accuracy is higher.
  • the second neural network model in the embodiment of the present application can be applied to positioning scenarios including multiple visible light sources, including but not limited to environments where satellite signals are weak, such as underground, indoors, and outdoors with many obstructions.
  • the visible light source may include LED lamps, energy-saving lamps, incandescent lamps, and other light sources that can emit visible light signals.
  • the position information corresponding to the visible light data is the coordinates of the position of the visible light data obtained by taking a preset position in the positioning scene as the origin of the spatial coordinate system.
  • a plurality of visible light data under different ambient light at each position collected at a plurality of positions is obtained, including: obtaining the visible light data at each position collected at a plurality of positions under preset ambient light; and performing data enhancement on the visible light data to obtain a plurality of visible light data under different ambient light at each position.
  • the influence of different ambient lights on visible light sources is similar and obeys the Lambert model, but there is inconsistency in the scale of the Lambert model.
  • the RSS data under other ambient light environments can be obtained. There is no need to build a data collection environment for multiple ambient lights. Only by enhancing the visible light data under a certain ambient light, visible light data under different ambient lights can be obtained, saving time and effort.
  • the relationship between different ambient lights and positioning results is learned, which can eliminate the influence of ambient light on the positioning results and obtain a high-precision second neural network model that is independent of ambient light.
  • each visible light data, the position information corresponding to each visible light data, and the ambient light identification of the ambient light corresponding to each visible light data are used as training data samples, including: separating the light data corresponding to different visible light sources in the visible light data to obtain a first RSS data sample corresponding to each visible light data, the first RSS data sample including multiple first RSS data corresponding to different visible light sources; each first RSS data sample, the position information corresponding to each first RSS data sample, and the ambient light identification corresponding to each first RSS data sample are used as training data samples.
  • the first neural network model includes a first neural network sub-module and a second neural network sub-module; each visible light data, the position information corresponding to each visible light data, and the ambient light identification of the ambient light corresponding to each visible light data are used as training data samples and input into the first neural network model, including: each first RSS data sample, the position information corresponding to each first RSS data sample, and the ambient light identification corresponding to each first RSS data sample are used as training data samples and input into the first neural network sub-module, wherein the first neural network sub-module takes RSS data from different visible light sources under any ambient light at any position as input, and takes weights corresponding to each RSS data as output; based on the weights corresponding to each RSS data in the first RSS data sample output by the first neural network sub-module, the RSS data in the first RSS data sample is weighted to obtain a second RSS data sample; each second RSS data sample, the position information corresponding to each second RSS data sample, and the ambient light identification corresponding to each second
  • the first neural network sub-module learns the mapping relationship between the light data received from different visible light sources and the error between the calculated distance between the visible light source and the position of the received data and the actual distance, and obtains the weights of the light data of different visible light sources based on the visible light data.
  • the second neural network sub-module relies more on the light data of visible light sources that are closer to the position where the visible light data is received, which can reduce the influence of noise on the positioning results of the second neural network model and improve the positioning accuracy.
  • the first neural network submodule includes an attention mechanism.
  • the first neural network submodule is a multilayer perceptron with an attention mechanism.
  • the second neural network submodule includes a long short-term memory network layer and a fully connected layer.
  • the method further includes: optimizing parameters of the second neural network model based on the predicted positioning data output by the second neural network model and the actual position data corresponding to the predicted positioning data.
  • optimizing the parameters of the second neural network model includes: based on the predicted positioning data and the actual position data, using a loss function to determine the error between the predicted positioning data and the actual position data; and optimizing the parameters of the second neural network model based on the error.
  • the loss function is expressed by the following formula:
  • represents the regularization adjustment coefficient of the regularization term
  • N represents the number of visible light sources
  • d j represents the distance between the position corresponding to the visible light data calculated based on the Lambert model and the j-th visible light source
  • RSS j represents the light data corresponding to the j-th visible light source
  • represents the channel noise, and the channel noise is Gaussian noise.
  • the traditional loss function may cause the second neural network model to overfit, which in turn will affect the stability of the second neural network model.
  • the anti-interference ability i.e., robustness
  • At least some of the multiple positions correspond to the same motion trajectory.
  • the visible light data in the training data sample can be the visible light data of multiple positions of the device in different motion trajectories
  • the training data can include the visible light data, the time corresponding to the visible light data, the position corresponding to the visible light data, etc.
  • the first neural network model can include a neural network model that can process time series data and spatial data, such as a recurrent neural network model (RNN), LSTM, etc.
  • RNN recurrent neural network model
  • Such a neural network model can not only learn the influence of different ambient light on visible light data, the influence between different visible light light sources, and the correspondence between visible light data and position, but also learn the relationship between visible light data corresponding to continuous positions on a continuous motion trajectory, for example, the relationship between the continuous change of visible light data at adjacent positions, and then the positioning model can also use the learned relationship between visible light data corresponding to continuous positions as a constraint condition for the distance between the visible light source and the device. Furthermore, the positioning accuracy of the trained second neural network model is higher.
  • the visible light data in the training data sample may be visible light data of any discrete multiple positions in the positioning scene.
  • an embodiment of the present application provides a training device for a positioning model, comprising: a data acquisition module, for acquiring a plurality of visible light data collected at a plurality of positions under different ambient light at each position, wherein each visible light data comprises light data from a different visible light source;
  • the model training module is used to input each visible light data, the position information corresponding to each visible light data and the ambient light identification of the ambient light corresponding to each visible light data as training data samples into the first neural network model to train the first neural network model and obtain the second neural network model.
  • an embodiment of the present application provides a positioning method, including: acquiring collected measured visible light data; inputting the measured visible light data into a second neural network model trained by the training method of the model for positioning according to the first aspect above, and outputting a predicted position corresponding to the measured visible light data.
  • an embodiment of the present application provides a positioning device, comprising: a data acquisition module for acquiring collected measured visible light data; a positioning module for inputting the measured visible light data into a second neural network model trained by the training method of the model for positioning according to the first aspect above, and outputting a predicted position corresponding to the measured visible light data.
  • an embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; one or more memories storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device executes the method of the first aspect or the third aspect mentioned above.
  • an embodiment of the present application provides a computer-readable storage medium having instructions stored thereon, and when the instructions are executed on a computer, the computer executes the method of the first aspect or the third aspect mentioned above.
  • an embodiment of the present application provides a computer program product, including a computer program/instruction, which implements the method of the first aspect or the third aspect when executed by a processor.
  • FIG1 shows an indoor positioning scene diagram provided by an embodiment of the present application
  • FIG2 is a schematic diagram of a Lambertian model provided in an embodiment of the present application.
  • FIG3 is a schematic diagram showing a framework of an attention mechanism provided in an embodiment of the present application.
  • FIG4 is a schematic diagram showing the internal structure of an LSTM unit provided in an embodiment of the present application.
  • FIG5 a is a schematic diagram showing a process of a fingerprint-based visible light positioning technology
  • FIG5b and FIG5c are schematic diagrams showing a process of a visible light positioning technology based on a geometric method
  • FIG5 d is a schematic diagram showing a process of a visible light positioning technology
  • FIG6a is a graph showing the relationship between RSS and distance provided in an embodiment of the present application.
  • FIG6 b is a graph showing the relationship between RSS and distance under the interference of artificial light provided in an embodiment of the present application.
  • FIG6 c is a curve diagram showing the relationship between RSS and distance without artificial light interference provided by an embodiment of the present application.
  • FIG6 d is a comparison diagram of the relationship curves between RSS and distance with and without artificial light interference provided by an embodiment of the present application.
  • FIG7 is a schematic diagram showing a flow chart of a positioning method provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of a data collection scenario in an embodiment of the present application.
  • FIG9 is a schematic diagram showing a flow chart of an offline training process and an online positioning process provided in an embodiment of the present application.
  • FIG10 is a diagram showing a process of learning/calculating the signal-to-noise ratio and weights at some moments provided in an embodiment of the present application;
  • FIG. 11a to FIG. 11c are schematic diagrams of trajectories collected under different ambient lights provided in an embodiment of the present application.
  • FIG. 12a to FIG. 12b are schematic diagrams showing positioning results under interference from artificial light sources provided in an embodiment of the present application.
  • FIG. 13a to FIG. 13b are schematic diagrams showing comparison of positioning results under interference of artificial light sources provided in an embodiment of the present application.
  • FIG. 14a to FIG. 14b are schematic diagrams showing positioning results under the interference of sunlight source provided in an embodiment of the present application.
  • FIG. 15a to FIG. 15b are schematic diagrams showing comparison of positioning results under the interference of sunlight source provided in an embodiment of the present application.
  • FIG16 is a schematic diagram of a program module of a model training device for positioning provided in an embodiment of the present application.
  • FIG. 17 is a schematic diagram of a program module of a positioning device provided in an embodiment of the present application.
  • FIG. 18 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
  • RSS Received Signal Strength
  • RSS is the strength of the signal sent by the transmitter and received by the receiving device.
  • RSS is the visible light signal strength of the LED light received by the receiving end.
  • the RSS data of the receiving device 100 is the RSS data of the receiving signal from each LED light received by the receiving device 100.
  • the Lambert model is a light diffuse reflection model that describes an ideal diffuse reflection surface. In the visible light positioning system, it is generally believed that LED lamps conform to the Lambert model, as shown in Figure 2. In the Lambert model, assuming that the distance d i between the receiving device 100 and the LED lamp is known, the RSS of the received signal of the receiving device 100 is related to multiple factors such as the radiation angle ⁇ of the LED lamp radiation transmission signal and the incident angle ⁇ of the receiving device receiving signal. The specific relationship can be expressed as the following formula:
  • Pi ( ⁇ , ⁇ ) represents the RSS of the visible light radiated by the i-th LED lamp received by the receiving device 100
  • mi represents the relevant parameters of the chip of the i-th LED lamp
  • M represents the relevant parameters of the chip of the receiving device 100
  • AR represents the effective receiving area of the receiving device 100
  • P Ti represents the power of the i-th LED lamp
  • Ts ( ⁇ ) represents the optical filtering gain of the receiving device 100
  • g( ⁇ ) represents the optical concentrator gain of the receiving device 100.
  • a and b are Lambertian parameters obtained by simplifying multiple parameters in formula (1).
  • the attention mechanism selectively focuses on a portion of all data when processing data, ignoring other visible data.
  • the attention mechanism can quickly extract important features of the data (i.e., attention values).
  • FIG3 shows a schematic diagram of the framework of an attention mechanism.
  • Q is a matrix composed of queries of input data in the attention mechanism, and each element in Q represents the query value of each input vector, such as q1, q2, q3, q4, etc.
  • K is a matrix composed of keys of all input vectors in the attention mechanism, and each element in K represents the key value of each input vector, such as k1, k2, k3, k4, etc. in FIG3
  • V is a matrix composed of values of all input vectors in the attention mechanism, and each element in V represents the value of each input vector, such as v1, v2, v3, v4, etc. in FIG3.
  • each key will have a corresponding value, forming a data pair for each input vector.
  • the calculation process of the attention mechanism is to calculate the correlation between the matrix Q and the matrix K, obtain the weight coefficient of each key corresponding to the value in the matrix K, and then perform weighted summation on multiple values to obtain the final matrix A.
  • Each element in the matrix A represents the attention value (Attention value) of each element in the input data, such as Av1, Av2, Av3, Av4, etc. in Figure 3.
  • LSTM Long Short Term Memory
  • LSTM includes multiple hidden layers (hereinafter referred to as LSTM units), each LSTM unit can correspond to the data input/output at a moment, and the short-term memory of each unit (i.e., the hidden state, denoted as h) can be transmitted between hidden layers, and the long-term memory (i.e., the cell state, denoted as c) can also be transmitted, where h can also be used as the output of the LSTM unit.
  • LSTM can learn the input RSS data to obtain the feature data of each RSS data.
  • the LSTM is expanded at different times to obtain a schematic diagram of the internal structure of some LSTM units as shown in FIG4.
  • LSTM unit 401 can receive c t-1 and h t-1 output by LSTM unit 402 at the previous moment and x t input at the tth moment.
  • LSTM unit 401 can selectively forget c t-1 of the previous unit through each calculation module in the unit, selectively memorize x t and h t-1 input to LSTM unit 401, and determine c t and h t output by the unit based on the results of selective memorization and selective forgetting.
  • the forgetting gate ft in the selective forgetting process, can be generated based on the input xt and ht-1 combined with the sigmoid function (i.e., ⁇ in Figure 4) to control the selective forgetting of ct -1 of the previous LSTM unit, i.e., ft *ct -1 ; in the selective memory process, the selection gate it can be obtained based on the input xt and ht-1 combined with the sigmoid function, and the candidate memory learned based on the tanh function in the unit is selected through the selection gate it .
  • the sigmoid function i.e., ⁇ in Figure 4
  • the result of selective memory can be added to the result of selective forgetting to obtain the output c t of the unit.
  • the output gating o t can be obtained based on the input x t and h t-1 combined with the sigmoid function, and the output gating is used to filter all the memories learned by the unit (after the output c t is converted by the tanh function) to obtain the output h t of the unit.
  • FC fully connected
  • the photo diode In the visible light positioning system based on RSS, the photo diode (PD) is generally used as the signal receiving module of the receiving device.
  • the receiving device responds to the visible light signal received from the LED light, obtains the received signal, modulates the received signal, and then determines the position of the receiving device in the room based on the modulation results of multiple LED lights.
  • the existing visible light positioning technology based on RSS is time-consuming and labor-intensive to collect data, and does not take into account the influence of ambient light, noise, LED lights, etc. on the positioning results, and the positioning accuracy is low.
  • a fingerprint-based visible light positioning technology is used to determine the location of the receiving device 100 by collecting the location fingerprint (such as RSS data) of each sampling point in the scene and the visible light signal actually received by the receiving device 100 .
  • the fingerprint-based visible light positioning technology can include two steps: offline database construction and online positioning.
  • the map of the indoor space 200 can be divided into N grids, and the grid size can be determined according to the user positioning accuracy.
  • the position coordinates of each grid and the RSS data of the light data emitted by the LED lamp received by the receiving device 100 are collected, and the fingerprint library 501 is established according to each position coordinate and multiple RSS data corresponding to each position coordinate.
  • the measured RSS data of the receiving device 100 is matched with multiple groups of RSS data in the fingerprint library 501 through a matching algorithm, and the position of the grid corresponding to the group of RSS data with the highest matching degree is determined as the position of the receiving device 100.
  • the matching algorithm may include:
  • (1) Euler distance matching method that is, by calculating the Euler distance between the measured RSS data and the RSS data in the fingerprint library 501, a group of RSS data in the fingerprint library 501 with the smallest Euler distance to the measured RSS data is determined, and the position coordinates corresponding to the group of RSS data are determined to be the actual coordinates of the receiving device 100.
  • the Euler distance can be determined by the following formula:
  • i represents the fingerprint number corresponding to different grids in the database
  • j represents the modulation frequency or number of the LED lamp
  • ⁇ i,j is the RSS data of the LED lamp with the jth modulation frequency or number received by the grid with fingerprint number i in the database
  • ⁇ o,j is the RSS data of the receiving signal from the LED lamp with the jth modulation frequency or number received by the receiving device 100.
  • Deterministic matching method that is, using the k-Nearest Neighbor (k-NN) algorithm to determine the k RSS data closest to the measured RSS data, and determine that the position coordinates among the k nearest RSS data that correspond to the same position coordinates the most times are the measured coordinates.
  • k-NN k-Nearest Neighbor
  • the fingerprint-based visible light positioning technology requires a large amount of data to establish the fingerprint library 501, and the grid division needs to be very fine to obtain a more accurate positioning result. This technology is time-consuming and labor-intensive.
  • a visible light positioning technology based on a geometric method which calculates the distance between the receiving device 100 and multiple LED lights through the Lambertian model to achieve the positioning of the receiving device 100.
  • the distances between LED1, LED2, LED3 and the receiving device 100 can be calculated based on the RSS data of each LED light received by the receiving device 100 using the formula (2) above, and d1, d2 and d3 are completed respectively. Then, a circle is drawn with the three calculated distances as the radius and the corresponding LED light as the center, and the point where the three circles intersect is determined to be the position of the receiving device 100.
  • the position coordinates of the receiving device 100 can be obtained by solving the following equation:
  • the circles corresponding to the three LED lights may intersect in an area, such as the area S in FIG. 5c , and the above equation cannot obtain the coordinates of the receiving device 100, or the z coordinate of the receiving device 100 is unknown, and a sphere needs to be drawn with the LED light as the center.
  • the three spheres may intersect in a three-dimensional space, and more visible light emitted by LED lights is needed to determine the position of the receiving device 100.
  • a visible light positioning technology based on learning is provided in some embodiments.
  • the learning-based visible light positioning technology can include two stages: fingerprint collection and online positioning.
  • fingerprint collection and online positioning does not require gridding of indoor maps.
  • the collected fingerprints such as multiple position coordinates in different motion trajectories and the corresponding RSS data at the position, are used as training data and input into the neural network for error calculation and network parameter optimization.
  • the neural network can include a fully connected layer, a convolutional neural network that can process spatial data, a recurrent neural network that can process time series data, a graph neural network that can learn topological structures, etc.
  • the RSS data collected by the receiving device 100 is input into the trained neural network to obtain the predicted position of the receiving device 100.
  • the above-mentioned learning-based visible light positioning technology can quickly solve the predicted position coordinates of the receiving device 100 through a neural network.
  • the solution process is relatively simple and the solved position coordinates are relatively specific.
  • the light signal received by the receiving device 100 includes not only the light signal emitted by the LED lamp, but also the ambient light. This technology does not take into account the influence of ambient light on visible light positioning, and the positioning accuracy is low.
  • a visible light positioning technology is provided to suppress the influence of ambient light on the positioning results by mapping the measured RSS data into the calibration environment of the Lambertian model.
  • the relationship g N (I) between the ambient light intensity and the RSS data of the receiving device 100 is fitted.
  • the relationship g N (I) can be expressed as the following formula:
  • P r,i,N represents the RSS data of the i-th LED lamp
  • I represents the ambient light intensity
  • I th represents the ambient light intensity at the saturation critical point.
  • the ambient light intensity I collected by the receiving device 100 can be transformed by fast Fourier transform (FFT) to obtain the RSS data P r,i,N of each LED lamp, and then the ambient light intensity I and the RSS data P r,i,N are input into the parameter adjustment module 511 to adjust the parameters of the Lambert model, and the adjusted parameters a1 and b1 are applied to the Lambert model 512. Then, based on the RSS data of the receiving signal from each LED lamp received by the receiving device 100, the Lambert model 512 is used to calculate the distance di between the i-th LED lamp and the receiving device 100, thereby realizing the positioning of the receiving device 100.
  • FFT fast Fourier transform
  • the above method also has ambient light in the calibration environment, and the ambient light in different calibration environments is different.
  • the above method cannot eliminate the influence of the ambient light in the calibration environment on the Lambertian parameters by fitting the relationship g N (I), and the Lambertian model under different calibration ambient lights cannot be universal.
  • the model training method for positioning includes: obtaining RSS data and corresponding positions under different ambient lights, as training data, inputting into a neural network model (i.e., a first neural network model), using the neural network model to learn the impact of different ambient lights on RSS data, learning the relationship between RSS data at the same position, and learning the correspondence between feature data and position, modeling the relationship between RSS data and corresponding position, and obtaining a positioning model (i.e., a second neural network model) that can suppress the impact of ambient light on positioning results and has a higher positioning accuracy.
  • a neural network model i.e., a first neural network model
  • the positioning model i.e., a second neural network model
  • the RSS data received by the receiving device of the visible light receiving module can be input into the positioning model as input data, and the positioning model can output the predicted position of the receiving device.
  • the model training method for positioning collects RSS data under different ambient light conditions to train the neural network model, and the obtained positioning model can be applied to the positioning of the receiving device under various complex ambient light interferences.
  • the positioning model is trained with RSS data under different ambient light conditions, the influence of ambient light can be suppressed, and the positioning accuracy is higher.
  • the positioning model in the embodiment of the present application can be applied to positioning scenarios including multiple visible light sources, including but not limited to environments where satellite signals are weak, such as underground, indoors, and outdoors with many obstructions.
  • the visible light sources include LED lamps, energy-saving lamps, incandescent lamps, and other light sources that can emit visible light signals.
  • the RSS data under different ambient light conditions can be the data obtained by separating the received data from different LED lights in the received data collected by the receiving device and extracting the corresponding RSS data, and the RSS data of multiple visible light sources at the same position under the same ambient light can be used as an RSS data sample. Furthermore, the RSS data sample, the corresponding position, and the corresponding ambient light can be used as a training data sample in the training data, and the training data composed of multiple training data samples can be input into the neural network model for training.
  • the modulation frequency of the visible light signal of the visible light source may be used as an identifier of the visible light source, and then, FFT may be used to separate the light data of different visible light sources.
  • the neural network model can learn relevant knowledge of the Lambertian model and locate the position of the visible light source in the scene.
  • the process of learning the neural network model can be understood as the process of optimizing the parameters of the neural network model.
  • the neural network model can include but is not limited to FC layer, convolutional neural network model, recurrent neural network model, graph neural network model, pulse neural network model, etc.
  • the RSS data used as training data may be the RSS data of multiple positions of the receiving device in different motion trajectories, and the training data may include RSS data, the time corresponding to the RSS data, the position corresponding to the RSS data, etc.
  • the neural network model may include a neural network model capable of processing time series data and spatial data, such as a recurrent neural network model (RNN), LSTM, etc.
  • Such a neural network model can not only learn the influence of different ambient light on RSS data, the influence between different LED lights, and the correspondence between RSS data and position, but also learn the relationship between RSS data corresponding to continuous positions on a continuous motion trajectory, for example, the relationship between the continuous changes of RSS data at adjacent positions, and then the positioning model can also use the learned relationship between RSS data corresponding to continuous positions as a constraint condition for the distance between the visible light source and the receiving device. Furthermore, the positioning accuracy of the positioning model obtained by training is higher.
  • the neural network model may also include a neural network model layer for mapping the feature data output by the above-mentioned neural network model capable of processing time series data and spatial data, such as a recurrent neural network model (RNN), LSTM, etc., to the corresponding position, such as an FC layer.
  • a neural network model layer for mapping the feature data output by the above-mentioned neural network model capable of processing time series data and spatial data, such as a recurrent neural network model (RNN), LSTM, etc.
  • RNN recurrent neural network model
  • LSTM recurrent neural network model
  • the neural network model also includes an attention mechanism. Furthermore, before inputting the training data into the neural network model for training, the attention mechanism can be used to learn the mapping relationship between the RSS data in the training data and the error between the distance observation value obtained based on the Lambert model and the measured distance value, and determine the attention value of each RSS data based on the mapping relationship.
  • the error is related to the interference of noise, ambient light, etc. during the transmission of the visible light signal.
  • Figure 6a shows the relationship curve between the transmission distance of the visible light signal and the corresponding RSS data and the relationship curve between the transmission distance of various noise signals and the corresponding RSS data in some embodiments.
  • the noise includes thermal noise, shot noise and additive white Gaussian noise that interfere with the transmission of the visible light signal.
  • the RSS of the noise does not change with the distance, and the signal-to-noise ratio decreases with the increase of the distance.
  • the signal-to-noise ratio can reflect the accuracy of the distance calculated by the Lambert model to a certain extent.
  • the distance between the LED lamp and the PD of the receiving device calculated based on the Lambert model can be The error between the actual distance d between the LED lamp and the PD of the receiving device is expressed as the following formula:
  • is the channel noise
  • the attention mechanism can be used to learn the mapping relationship between RSS data and error, and the attention value determined based on the mapping relationship can be used as the weight of each RSS data. After weighting each RSS data by the attention value, it is input into the neural network model for training. Compared with directly inputting the RSS data into the neural network model for training, it can reduce the impact of noise on the positioning results and improve the positioning accuracy.
  • the electronic device for training the positioning model and the receiving device in the online positioning stage can be the same device.
  • the electronic device includes a visible light receiving module.
  • the electronic device and the receiving device can be different devices, wherein the electronic device is used to train the positioning model, and obtain the RSS data received by the receiving device 100 in the online positioning stage, input it into the positioning model, obtain the position of the receiving device 100 and send it to the receiving device.
  • the electronic device can also send the trained positioning model to the receiving device 100, and the receiving device can collect RSS data in the online positioning stage and use the positioning model to determine its own position.
  • the relationship between the distance between the LED lamp and the receiving device 100 and the corresponding RSS data can be as shown in Figures 6b to 6c.
  • FIG6b shows the relationship curve between the distance between the LED lamp and the receiving device 100 and the corresponding RSS data based on the Lambert model with artificial light ring interference, including the relationship curve obtained by actual measurement (the curve corresponding to the real in FIG6b) and the relationship curve calculated by the Lambert model (the curve corresponding to the ideal in FIG6b).
  • FIG6c shows the relationship between the distance between the LED lamp and the receiving device 100 and the corresponding RSS data based on the Lambert model without artificial light interference, including the relationship curve obtained by actual measurement (the curve corresponding to the true value in FIG6c) and the relationship curve calculated by the Lambert model (the curve corresponding to the predicted value in FIG6c). It can be seen from FIG6b and FIG6c that the influence of different ambient light on the LED lamp is similar.
  • RSS data under a certain ambient light environment can be obtained, and RSS data under different ambient lights can be constructed through data enhancement.
  • the enhanced RSS data, the RSS data under the calibration environment, and the corresponding positions are used as training data.
  • the loss function of the positioning model can be constructed based on the predicted position obtained by the trained positioning model and the corresponding true position, and the error back propagation is performed based on the loss function to optimize the parameters of the positioning model.
  • the instability caused by random errors can be minimized in the traditional loss function, for example, by adding a regularization term related to the distance error to the loss function. It is understandable that the traditional loss function may cause overfitting of the positioning model. Back propagation is performed based on the updated loss function to optimize the parameters of the positioning model, which can enhance the anti-interference ability (i.e., robustness) of the positioning model.
  • FIG. 7 a flowchart of a positioning method provided in an embodiment of the present application is shown. It is understood that the execution subject in FIG. 7 is an electronic device. It is understood that the implementation of the present application is described by taking the PD receiving visible light as being located in an electronic device as an example. In other embodiments, the PD may be located in other visible light receiving devices outside the electronic device.
  • the method includes:
  • the RSS data measured under different ambient light conditions can be the data obtained by separating the received data from different LED lights in the received data collected by the receiving device and extracting the corresponding RSS data, and the RSS data of multiple visible light sources at the same position under the same ambient light can be used as an RSS data sample. Furthermore, the RSS data sample, the corresponding position, and the corresponding ambient light can be used as a training data sample in the training data, and the training data composed of multiple training data samples can be input into the neural network model for training.
  • the modulation frequency of the visible light signal of the LED lamp may be used as the identification of the LED lamp, and then, FFT may be used to separate the received data of different LED lamps.
  • RSS data under different ambient light conditions can be obtained by performing data enhancement on RSS data under a certain ambient light condition.
  • the RSS data of the i-th position obtained under a certain ambient light can be expressed as: Wherein, N represents the number of LED lights in the test environment. In this embodiment, N is 5. j represents the position number corresponding to the RSS data. (x j , y j ) represents the position coordinates corresponding to the RSS data. Indicates the RSS data of LED light numbered i received at position numbered j.
  • data enhancement of the above RSS data may include: generating a random parameter ⁇ (0, ⁇ ], where ⁇ is a preset value and can be adjusted according to actual conditions.
  • is a preset value and can be adjusted according to actual conditions.
  • initializing the neural network model can be to set the initial parameters of each key node in the neural network model.
  • the neural network model can learn the relevant knowledge of the Lambert model and the position of the LED light in the positioning scene.
  • the neural network model may include but is not limited to FC layer, convolutional neural network model, recurrent neural network model, graph neural network model, pulse neural network model, etc.
  • the RSS data used as training data may be the RSS data of multiple positions of the PD in different motion trajectories, and each training data sample in the training data may include an RSS data sample, a time corresponding to the RSS data sample, a position corresponding to the RSS data sample, etc.
  • the neural network model in step 702 may include a neural network model capable of processing time series data and spatial data, such as a recurrent neural network model (RNN), LSTM, etc.
  • RNN recurrent neural network model
  • Such a neural network model can not only learn the spatial features of the training data, such as the impact of different ambient lights on the RSS data, the relationship between the RSS data at the same position (i.e., the correlation between different LED lights), and the correspondence between the feature data and the position, but also learn the spatial features of the training data related to time, such as the relationship between the RSS data corresponding to the continuous positions on the continuous motion trajectory, etc.
  • the positioning model can also use the learned relationship between the RSS data corresponding to the continuous positions as a constraint condition for the distance between the LED light and the PD. Therefore, the positioning accuracy of the trained positioning model is higher.
  • FIG8 is a schematic diagram of a data collection scenario in an embodiment of the present application.
  • the electronic device including the PD can be placed on the movable robot 802 to collect the received data collected at multiple positions when the movable robot moves along the trajectory 803, where each circle can correspond to a position point.
  • position point 8041, position point 8042 and position point 8043 are three consecutive position points on trajectory segment 804, and the received data collected at position point 8041, position point 8042 and position point 8043 are continuously changing and have a certain correlation. Then, the RSS data corresponding to position point 8041, position point 8042 and position point 8043, and the position and time corresponding to the RSS data are input into the neural network model for training, and the neural network model can learn the change relationship of such RSS data. When performing position prediction, the learned change relationship can be used as a constraint condition for the distance between the LED lamp and the PD.
  • the neural network model also includes a neural network model layer, such as an FC layer, which can be used to map the feature data output by the above-mentioned neural network model capable of processing time series data and spatial data, such as a recurrent neural network model (RNN), LSTM, etc., to the corresponding position.
  • a neural network model layer such as an FC layer
  • RNN recurrent neural network model
  • LSTM recurrent neural network model
  • the feature data and the corresponding position can be input into the initial FC layer, and the initial FC layer can learn the corresponding relationship between the feature data and the position, and train the FC layer of the positioning model.
  • the neural network model also includes an attention mechanism. It can be understood that the error between the distance observation value obtained by the Lambert model and the measured distance value is related to the interference of noise, ambient light, etc. in the transmission process of the visible light signal. The farther the visible light source, such as an LED lamp, is from the receiving device, the greater the influence of ambient light and noise on the visible light signal emitted by the LED lamp, and the lower the distance accuracy calculated based on the Lambert model.
  • the attention mechanism can be used to learn the mapping relationship between the RSS data in the training data and the distance observation value obtained based on the Lambert model and the measured distance value, and the value of the attention of each RSS data is determined based on the mapping relationship.
  • each RSS data can be weighted by the attention value and input into the LSTM layer for training, which can reduce the influence of noise on the output of the feature data of the LSTM layer, and obtain the feature data of the RSS data with smaller error.
  • the attention mechanism may be a multilayer perceptron (MLP) with an attention mechanism.
  • MLP may include an input layer, an output layer, and a hidden layer connecting the input layer and the output layer.
  • the input layer is used to obtain the input RSS data
  • the hidden layer is used to learn the correlation between the input RSS data and the error between the distance observation value and the measured distance value, obtain the attention value of the RSS data, and output the attention value through the output layer.
  • the attention value output by the output layer can be converted to between (0, 1) through a softmax function to obtain the weight of each RSS data.
  • the neural network model may include an LSTM layer and an FC layer.
  • Inputting the training data into the neural network model may include: dividing the RSS data samples corresponding to the same ambient light and motion trajectory in the training data into a training data subset, and inputting the RSS data in each training data subset into the LSTM layer in chronological order for training.
  • the LSTM units can learn the relationship between each RSS data at the same moment in the RSS data samples at different moments, and the characteristic relationship between the RSS data samples at multiple moments.
  • the LSTM units can strengthen and optimize the memory of the learned relationship between each RSS data at the same moment, the characteristic relationship between the RSS data samples at multiple moments, and learn the relationship between the RSS data under different ambient light, so as to train and obtain an LSTM layer that is independent of ambient light and can extract the characteristic data of RSS data.
  • the characteristic data output by the LSTM layer and the position corresponding to each characteristic data can be used as the input data of the FC layer.
  • the FC layer learns the relationship between the characteristic data and the position, and obtains the FC layer that can map the characteristic data of RSS data to the position in the positioning scene.
  • the neural network model may further include an attention mechanism.
  • the attention mechanism may be used to learn the mapping relationship between the RSS data in the training data and the error between the distance observation value obtained based on the Lambert model and the measured distance value, and determine the attention value of each RSS data based on the mapping relationship.
  • the attention mechanism can be an MLP with an attention mechanism.
  • the MLP can obtain RSS data samples, and learn the correlation between the RSS data samples and the errors between the distance observation values and the measured distance values obtained by the Lambert model, and obtain an MLP that can calculate the attention values of each RSS data in the RSS data samples.
  • the LSTM layer can convert the attention values output by the MLP through a softmax function to obtain the weights of each RSS data.
  • the weights of the RSS data can be used to weight the corresponding RSS data to reduce the influence of noise and other interferences on the training of the LSTM layer. That is, before the LSTM is trained, data preprocessing can be performed through MLP, softmax function, etc., and the weighted RSS data can be used as training data for LSTM training.
  • the above-mentioned conversion of the attention value output by the MLP through the softmax function to obtain the weight of each RSS data, and using the weight of the RSS data to weight the corresponding RSS data can be achieved through other data preprocessing modules instead of the LSTM layer for data processing, and the present application does not impose any restrictions on this.
  • the RSS data to be located is the received data received by the PD of the electronic device during the online positioning stage, and the received data is separated and processed based on the identification of different LED lights to obtain the RSS data corresponding to each LED light in the positioning space.
  • the modulation frequency of the LED lamp is used as the identification of each LED lamp.
  • the received data can be separated by FFT to obtain the RSS data corresponding to each LED lamp.
  • the positioning model can use the attention mechanism to calculate the attention value of the RSS data corresponding to different LED lights in the RSS data to be located, and convert the attention value into the weight of each RSS data through the softmax function.
  • the positioning model can input the weighted RSS data into the trained LSTM layer, calculate the feature data of the weighted RSS data, and map the RSS data to a certain position in the positioning space through the FC layer to obtain the predicted position of the RSS data to be located.
  • steps 701 to 703 are the offline training process in the positioning method provided by the embodiment of the present application
  • steps 704 and 705 are the online positioning process in the positioning method provided by the embodiment of the present application.
  • the embodiment of the present application may be a model training method for positioning including the above steps 701 to 703, and in other embodiments, the embodiment of the present application may be a positioning method including the above steps 704 to 705. In other embodiments, the embodiment of the present application may be a positioning method including the above steps 701 to 705. This application is not limited to this.
  • the positioning method provided in the embodiment of the present application collects RSS data under different ambient light conditions to train a neural network model, and the obtained positioning model can be applied to the positioning of receiving devices under various complex ambient light interferences.
  • the positioning model is trained using RSS data under different ambient light conditions, the influence of ambient light can be suppressed, and the positioning accuracy is higher.
  • part of the RSS data in the training data and the corresponding real position can be used as optimization data to optimize the trained positioning model.
  • the optimization data can be input into the trained positioning model, and the predicted position and the corresponding real position obtained can be used to construct a loss function of the positioning model, and error back propagation can be performed based on the loss function to optimize the parameters of the positioning model.
  • the constructed loss function can be expressed by the following formula:
  • pi represents the real position of PD
  • i-th predicted position determined by the positioning model
  • the instability caused by random errors can be minimized in the traditional loss function, for example, by adding a regularization term related to the distance error to the loss function. It is understandable that the traditional loss function may cause the positioning model to overfit, which will affect the stability of the positioning model. Back propagation based on the updated loss function can be performed to optimize the parameters of the positioning model, which can enhance the anti-interference ability (i.e., robustness) of the positioning model.
  • the constructed wheel function with the regularization term added can be expressed by the following formula:
  • is the regularization adjustment coefficient of the regularization term
  • N is the number of LED lights
  • dj represents the distance between PD and the jth LED light calculated based on the Lambert model
  • RSSj is the RSS data corresponding to the jth LED light received by PD
  • represents the channel noise
  • ⁇ N( ⁇ , ⁇ ) is Gaussian noise, the mean and variance of Gaussian noise can be estimated from the RSS data.
  • FIG. 9 a schematic diagram of the process of an offline training process and an online positioning process provided by an embodiment of the present application is shown. It can be understood that the dotted arrows indicate the data flow direction of the offline training process, the thin solid arrows indicate the data flow direction of the online positioning process, and the thick solid arrows indicate the common data flow direction of the offline training process and the online positioning process.
  • the weight learning module 930, the interference suppression module 940 and the error calculation module 950 constitute a neural network model; in the online positioning process, the weight learning module 930, the interference suppression module 940 (and the error calculation module 950) constitute a positioning model.
  • the offline training process includes:
  • the signal receiving module (offline) 910 obtains the PD receiving value 911 (i.e., the PD receiving data mentioned above) through the PD.
  • the signal receiving module (offline) 910 can separate the receiving data corresponding to different LED lights in the PD receiving value through FFT to obtain the RSS data 912 of each LED light.
  • the signal receiving module (offline) 910 can also expand the RSS data under a single ambient light through data enhancement to obtain the expanded RSS data 913.
  • the signal receiving module (offline) 910 can input the RSS data 912 and the expanded RSS data 913 as training data into the signal-to-noise ratio (SNR) calculation unit 931 of the weight learning module 930 and the noise characteristic learning unit 941 of the interference suppression module.
  • SNR signal-to-noise ratio
  • the SNK calculation unit 931 can calculate the signal-to-noise ratio of the training data, and input the calculated signal-to-noise ratio into the attention layer 932 together with the training data as the query of the attention layer 932, learn the mapping relationship between the RSS data and the distance observation error, and the attention layer 932 can output the attention value of each RSS data in the training data.
  • the distance observation error is the error between the observed distance between the LED light and the PD calculated using the Lambert model and the actual distance.
  • the attention layer 932 can input the output attention value into the noise characteristic learning unit 941.
  • the noise characteristic learning unit 941 can convert the attention value of each RSS data into the weight of each RSS data. For example, the attention value is converted to between (0, 1) through a softmax function, etc. In addition, the noise characteristic learning unit 941 can use the calculated weight to weight the RSS data in the training data, and input the weighted RSS data into the LSTM layer 942.
  • the LSTM layer 942 can learn the relationship between the RSS data at the same time in the weighted training data, the characteristic relationship between the RSS data samples at multiple times, the relationship between the RSS data under different ambient light, the change relationship of the RSS data at different positions on the same motion trajectory, etc., and optimize the parameters of the LSTM layer 942.
  • the LSTM layer 942 can output the RSS data and the characteristic data of the corresponding position, and input the characteristic data into the FC layer 943.
  • the FC layer 943 may learn the mapping relationship between the feature data of the RSS data and the feature data of the corresponding position, and optimize the parameters of the FC layer.
  • the noise characteristic learning unit 941, LSTM layer 942 and FC layer 943 of the interference suppression module, and the parameters of the attention layer 932 of the weight learning module 930 can be optimized based on the back propagation of the loss error calculated by the error calculation module 930.
  • the error calculation module 930 can construct a loss function 953 based on the position 951 predicted by the positioning model output by the FC layer and its corresponding real position 952.
  • the loss function can be, for example, a loss function corresponding to formula (7) or formula (8).
  • the error calculation module 930 can minimize the loss function to obtain a loss error 954, and reversely propagate the loss error layer by layer to optimize the aforementioned neural network model layer and improve the positioning accuracy.
  • the online positioning process includes:
  • the signal receiving module (online) 920 obtains the PD receiving value 921 (i.e., the PD receiving data mentioned above) through the PD.
  • the signal receiving module (online) 920 can separate the receiving data corresponding to different LED lights in the PD receiving value through FFT to obtain the RSS data 922 of each LED light.
  • the signal receiving module (online) 920 can input the RSS data 922 into the signal-to-noise ratio (SNR) calculation unit 931 of the weight learning module 930 and the noise characteristic learning unit 941 of the interference suppression module.
  • SNR signal-to-noise ratio
  • the SNK calculation unit 931 may calculate the signal-to-noise ratio of the RSS data 922, and input the calculated signal-to-noise ratio as the query of the attention layer 932 together with the RSS data 922 into the attention layer 932, and output the attention value of each RSS data in the RSS data 922.
  • the attention layer 932 may input the output attention value into the noise characteristic learning unit 941.
  • the noise characteristic learning unit 941 may convert the attention value of the RSS data into the weight of the RSS data 922. For example, the attention value is converted to between (0, 1) by a softmax function, etc. Furthermore, the noise characteristic learning unit 941 may weight the RSS data 922 using the calculated weight, and input the weighted RSS data into the LSTM layer 942.
  • the LSTM layer 942 may perform calculations based on the input weighted RSS data, output feature data of the RSS data, and input the feature data into the FC layer 943 .
  • the feature data of the RSS data can be mapped to the position space in the positioning scene to obtain the predicted position corresponding to the RSS data 922 .
  • the attention layer may be an MLP
  • the PD reception value may be reception data of multiple position points collected along the PD motion trajectory.
  • the PD reception value may be input into the weight learning module 930 and the interference suppression module 940 in chronological order to perform signal-to-noise ratio and weight learning/calculation.
  • FIG10 shows a process diagram of signal-to-noise ratio and weight learning/calculation at some moments provided in an embodiment of the present application.
  • the RSS data corresponding to each LED light can be obtained through FFT transformation, and the RSS data after FFT is respectively input into the SNK calculation unit 931 and the input noise characteristic learning unit 941.
  • the SNK calculation unit 931 can obtain the signal-to-noise ratio of the RSS data through the spectrum diagram after FFT, and input the signal-to-noise ratio and RSS data into the MLP to learn the mapping relationship between the signal-to-noise ratio and the RSS data, so as to obtain the attention value of the RSS data.
  • the noise characteristic learning unit 941 may convert the attention value of the received RSS data into the weight of the RSS data, weight the RSS data, and input the weighted RSS data into the LSTM layer.
  • the positioning model trained by the offline training method in Figure 9 can obtain a positioning model that is more trustworthy of the RSS data of the LED lamp closest to the PD through the weight learning module 930 and the noise characteristic learning unit 941, which can effectively suppress noise interference and reduce the impact of the RSS data corresponding to the interfered LED lamp on the predicted position.
  • a positioning model that can effectively suppress ambient light interference can be obtained, and high-precision positioning can be achieved under complex ambient lights.
  • by adding an error regularization term to the error function constructed by the error calculation module 950 the robustness of the positioning model when encountering Gaussian noise can be enhanced, and the stability of the positioning model is higher.
  • the positioning environment of the positioning scene in Figure 1 is taken as an example, combined with a specific test environment and test data for explanation.
  • the environment for collecting training data is set up to obtain a positioning environment in the positioning scene in Figure 1.
  • the positioning space in Figure 1 is an empty room with a size of 5*5*2.6m 3.
  • the transmitting device of the visible light signal composed of LED lights, (STM32) processors, and pulse width modulation (PWM) modules is installed on the top of the positioning space in Figure 1, and there are 5 transmitting devices in total.
  • the LED light is used as a visible light source, and its power is 10W.
  • the visible light signals emitted by the LED lights of the transmitting device are modulated at 1756.1kHz, 2571kHz, 3137.3kHz, 4235.3kHz and 4864.9kHz, respectively, and the coordinates of the transmitting device are (0.26, 0.66, 2.6), (4.61, 0.67, 2.6), (4.57, 4.25, 2.6), (0.18, 4.25, 2.6), (2.45, 2.49, 2.6) respectively.
  • the trajectory data of the visible light signal interfered by sunlight, interfered by artificial light sources, and only LED lights are collected.
  • the RPD reception values of two trajectories are collected under the ambient light interfered by sunlight and artificial light sources, respectively, and the trajectories are shown in Figures 11a and 11b.
  • the PD reception values of three trajectories are collected in the environment with only visible light signals of LED lights, and the trajectories are shown in Figure 11c.
  • the above-collected data is used as training data, and the training method of steps 701 to 703 in Figure 7 is used for training to obtain a positioning model.
  • some real trajectories are also collected in the embodiment of the present application, and positioning is performed using the positioning model to obtain a predicted trajectory composed of the predicted position output based on the RSS data collected from the real trajectory.
  • the details are as follows:
  • trajectory corresponding to the true value in Figure 12a there are the actual trajectory of trajectory 1 collected under the interference of artificial light source (i.e., the trajectory corresponding to the true value in Figure 12a), the positioning trajectory corresponding to the RSS data of trajectory 1 output by the positioning model provided in an embodiment of the present application (i.e., the trajectory corresponding to the positioning model in Figure 12a), and the predicted trajectory corresponding to the RSS data of trajectory 1 output by a traditional visible light positioning method (such as a geometry-based visible light positioning method, etc.) (the trajectory corresponding to the traditional positioning in Figure 12a).
  • a traditional visible light positioning method such as a geometry-based visible light positioning method, etc.
  • trajectory diagrams of the real trajectory of trajectory 2 collected under the interference of artificial light source i.e., the trajectory corresponding to the true value in Figure 12b
  • the positioning trajectory corresponding to the RSS data of trajectory 2 output by the positioning model provided in an embodiment of the present application i.e., the trajectory corresponding to the positioning model in Figure 12b
  • the predicted trajectory corresponding to the RSS data of trajectory 2 output by the traditional positioning method the trajectory corresponding to the traditional positioning in Figure 12b.
  • the relationship comparison curve of trajectory 1 in Figure 13a and the relationship comparison curve of Figure 13b can be drawn respectively.
  • ME is the mean error (Mean Error, ME)
  • RMSE is the root mean square error (Root Mean Square Error, RMSE)
  • 50% and 90% mean that the positioning error is 50% and 90% respectively.
  • trajectory corresponding to the true value in Figure 14a there are the actual trajectory of trajectory 1 collected under the interference of sunlight source (i.e., the trajectory corresponding to the true value in Figure 14a), the predicted trajectory corresponding to the RSS data of trajectory 1 output by the positioning model provided in an embodiment of the present application (i.e., the trajectory corresponding to the positioning model in Figure 14a), and the predicted trajectory corresponding to the RSS data of trajectory 1 output by the traditional positioning method (i.e., the trajectory corresponding to the traditional positioning in Figure 14a).
  • trajectory diagrams of the real trajectory of trajectory 2 collected under the interference of sunlight i.e., the trajectory corresponding to the true value in Figure 14b
  • the predicted trajectory corresponding to the RSS data of trajectory 2 output by the positioning model provided in an embodiment of the present application i.e., the trajectory corresponding to the positioning model in Figure 14b
  • the trajectory corresponding to the RSS data of trajectory 2 output by the traditional positioning method i.e., the trajectory corresponding to the traditional positioning in Figure 14b.
  • the relationship between the ranging error and the cumulative error (CDF) between the positioning trajectory output by the positioning model in the embodiment of the present application and the actual trajectory, as well as the relationship between the predicted trajectory output by the traditional positioning method and the actual trajectory, can be plotted as the relationship comparison curve of trajectory 1 in Figure 15a and the relationship comparison curve of Figure 15b respectively.
  • ME is the mean error (Mean Error, ME)
  • RMSE is the root mean square error (Root Mean Square Error, RMSE)
  • 50% and 90% mean that the positioning error is 50% and 90% respectively.
  • the positioning errors of the 50% and 90% positioning models are 10.9 cm and 23.55 cm respectively, which are 71.39% and 57.22% lower than the 50% and 90% positioning errors of the traditional positioning method of 38.8 cm and 55 cm respectively.
  • the average positioning error of the positioning model is 12.48 cm, which is 68.60% lower than the 39.07 cm of the traditional positioning method. Similar improvements are also obtained in the data corresponding to the trajectories under other ambient light interference.
  • the positioning model trained by the positioning model training method provided in the embodiment of the present application can effectively suppress the interference of ambient light and noise, and has higher positioning accuracy compared to the traditional positioning method.
  • the embodiment of the present application provides a model training device for positioning.
  • the model training device 1600 for positioning includes: a data acquisition module 1601 and a model training module 1602 .
  • the data acquisition module 1601 is used to acquire a plurality of visible light data collected at a plurality of positions under different ambient light at each position, wherein each visible light data includes light data from a different visible light source.
  • the model training module 1602 is used to input each visible light data, the position information corresponding to each visible light data and the ambient light identification of the ambient light corresponding to each visible light data as training data samples into the first neural network model to train the first neural network model and obtain the second neural network model.
  • the above-mentioned data acquisition module 1601 is equivalent to the signal receiving module (offline) 910 of the offline training process in the above-mentioned Figure 9, and the model training module 1602 is equivalent to the weight learning module 930, interference suppression module 940 and error calculation module 950 of the offline training process in Figure 9.
  • the embodiment of the present application provides a positioning device.
  • the positioning device 1700 includes: a data acquisition module 1701 and a positioning module 1702 .
  • the data acquisition module 1701 is used to obtain the collected measured visible light data.
  • the positioning module 1702 is used to input the measured visible light data into the second neural network model trained by the model training device 1600 for positioning in Figure 16 above, and output the predicted position corresponding to the measured visible light data.
  • FIG18 shows a hardware block diagram of an electronic device 100 that applies the method provided in an embodiment of the present application.
  • the electronic device 100 can be used to run the instructions related to the positioning method provided in the embodiment of the present application.
  • similar components have the same reference numerals.
  • the electronic device 100 may include a processor 110, a power module 140, a memory 180, a camera 170, a mobile communication module 130, a wireless communication module 120, a sensor module 190, an audio module 150, an interface module 160, a button 101, and a display screen 102, etc.
  • the memory 180 can be used to store the instructions related to the page display method provided in the embodiment of the present application and the intermediate data files generated when the processor executes the instructions.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the electronic device in the embodiment of the present application can be a mobile phone including a PD, a portable android device (PAD), a personal digital assistant (PDA), a handheld device with a wireless communication function, a computing device, a vehicle-mounted device or a wearable device, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving, a wireless terminal in remote medical, a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in a smart city (smart city), a wireless terminal in a smart home (smart home) and other devices, and can also be an on-chip integrated chip including a PD and a processor.
  • the form of the electronic device in the embodiment of the present application is not specifically limited.
  • the processor 110 may include one or more processing units, for example, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor DSP, a microprocessor (MCU), an artificial intelligence (AI) processor, or a processing module or processing circuit of a programmable logic device (Field Programmable Gate Array, FPGA).
  • processing units can be independent devices or integrated in one or more processors.
  • a storage unit can be set in the processor 110 for storing instructions and data.
  • the storage unit in the processor 110 is a cache memory 180.
  • the processor can be used to execute the relevant method instructions in Figure 7 or Figure 9 provided in the embodiment of the present application.
  • the power module 140 may include a power source, a power management component, etc.
  • the power source may be a battery.
  • the power management component is used to manage the charging of the power source and the power supply of the power source to other modules.
  • the power management component includes a charging management module and a power management module.
  • the charging management module is used to receive charging input from the charger; the power management module is used to connect the power source, the charging management module and the processor 110.
  • the power management module receives input from the power source and/or the charging management module, and supplies power to the processor 110, the display screen 102, the camera 170, and the wireless communication module 120.
  • the mobile communication module 130 may include, but is not limited to, an antenna, a power amplifier, a filter, an LNA (Low noise amplifier), etc.
  • the mobile communication module 130 may provide a solution for wireless communications including 2G/3G/4G/5G, etc., applied to the electronic device 100.
  • the mobile communication module 130 may receive electromagnetic waves through an antenna, filter, amplify, and process the received electromagnetic waves, and transmit them to a modulation and demodulation processor for demodulation.
  • the mobile communication module 130 may also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through an antenna.
  • at least some of the functional modules of the mobile communication module 130 may be disposed in the processor 110.
  • Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), Bluetooth (BT), global navigation satellite system (GNSS), wireless local area networks (WLAN), near field communication (NFC), frequency modulation (FM) and/or field communication (NFC), infrared technology (IR), etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA wideband code division multiple access
  • TD-SCDMA time-division code division multiple access
  • LTE long term evolution
  • Bluetooth Bluetooth
  • global navigation satellite system GNSS
  • WLAN wireless local area networks
  • NFC near field communication
  • FM frequency modulation
  • NFC infrared technology
  • IR infrared technology
  • GNSS can include the global positioning system (GPS), the global navigation satellite system (GLONASS
  • the wireless communication module 120 may include an antenna, and transmit and receive electromagnetic waves via the antenna.
  • the wireless communication module 120 may provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100.
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared
  • the mobile communication module 130 and the wireless communication module 120 of the electronic device 100 may also be located in the same module.
  • the display screen 102 is used to display a human-computer interaction interface, images, videos, etc.
  • the display screen 102 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc.
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED active-matrix organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc.
  • the sensor module 190 may include a proximity light sensor, a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
  • the audio module 150 is used to convert digital audio information into analog audio signal output, or convert analog audio input into digital audio signal.
  • the audio module 150 can also be used to encode and decode audio signals.
  • the audio module 150 can be arranged in the processor 110, or some functional modules of the audio module 150 can be arranged in the processor 110.
  • the audio module 150 can include a speaker, an earpiece, a microphone, and an earphone interface.
  • the camera 170 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it onto the photosensitive element.
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP (Image Signal Processing) to convert it into a digital image signal.
  • the electronic device 100 can achieve the shooting function through the ISP, the camera 170, the video codec, the GPU (Graphic Processing Unit), the display screen 102 and the application processor.
  • the interface module 160 includes an external memory interface, a universal serial bus (USB) interface, and a subscriber identification module (SIM) card interface.
  • the external memory interface can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface to implement a data storage function.
  • the universal serial bus interface is used for the electronic device 100 to communicate with other electronic devices.
  • the subscriber identification module card interface is used to communicate with a SIM card installed in the electronic device 10010, for example, to read a phone number stored in the SIM card, or to write a phone number into the SIM card.
  • the electronic device 100 further includes a button 101, a motor, an indicator, etc.
  • the button 101 may include a volume button, an on/off button, etc.
  • the motor is used to make the electronic device 100 produce a vibration effect, for example, when the user's electronic device 100 is called, it vibrates to prompt the user to answer the call of the electronic device 100.
  • the indicator may include a laser indicator, a radio frequency indicator, an LED indicator, etc.
  • references to "one embodiment” or “an embodiment” in the specification mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least one exemplary implementation or technology disclosed in the present application.
  • the appearance of the phrase “in one embodiment” in various places in the specification does not necessarily all refer to the same embodiment.
  • the present application also discloses a device for performing the operations in the text.
  • the device can be constructed specifically for the required purpose or it can include a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer.
  • a computer program can be stored in a computer-readable medium, such as, but not limited to, any type of disk, including a floppy disk, an optical disk, a CD-ROM, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an EPROM, an EEPROM, a magnetic or optical card, an application-specific integrated circuit (ASIC) or any type of medium suitable for storing electronic instructions, and each can be coupled to a computer system bus.
  • the computer mentioned in the specification may include a single processor or may be an architecture involving multiple processors for increased computing power.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

本申请涉及电子设备技术领域,具体涉及一种用于定位的模型的训练方法、定位方法、电子设备及介质。其中该方法包括:获取在多个位置处采集的各位置处不同环境光下的多个可见光数据;将各可见光数据、各可见光数据对应的位置信息以及各可见光数据对应的环境光的环境光标识作为训练数据样本,输入第一神经网络模型,以对第一神经网络模型进行训练,得到第二神经网络模型。由此,本申请实施例提供的用于定位的模型训练方法,得到的第二神经网络模型可以应用于多种复杂的环境光干扰下的定位。并且,第二神经网络模型由于是采用不同环境光下的可见光数据训练得到的,可以抑制环境光影响,定位精度更高。

Description

用于定位的模型的训练方法、定位方法、电子设备及介质 技术领域
本申请涉及电子设备技术领域,具体涉及一种用于定位的模型的训练方法、定位方法、电子设备及介质。
背景技术
随着定位技术的发展,电子设备可以满足室内和地下等多种应用场景的定位需求。对于室内和地下等卫星信号微弱的定位场景,为了同时满足定位的精度以及定位技术的成本,可以采用基于发光二极管(Light Emitting Diode,简称LED)灯的可见光定位技术。目前的可见光定位技术中,一般通过朗伯模型,对光强和距离之间的映射关系进行建模,进而实现对目标接收设备位置的估计。
例如,图1所示的接收设备100处于室内空间200中。在室内空间200中包括五个LED灯:LED1~LED5,并且可以基于室内空间200建立三维空间坐标系。接收设备100可以在当前位置(x,y,z)接收五个LED灯发射信号,并对接收到的信息进行处理,得到五个发射信号的强度,并根据发射信号的强度,并根据朗伯模型求得接收设备的当前位置坐标。
但是,目前的基于光强的可见光定位技术中的朗伯模型未考虑环境光、噪声、不同LED灯等对定位结果的影响,定位准确性较低。
发明内容
本申请实施例提供了一种用于定位的模型的训练方法、定位方法、电子设备及介质,解决基于可见光的定位技术中在不同标定环境光下的朗伯模型无法通用的技术问题。
第一方面,本申请实施例提供了一种用于定位的模型的训练方法,包括:获取在多个位置处采集的各位置处不同环境光下的多个可见光数据,其中每个可见光数据包括来自不同可见光光源的光数据;将各可见光数据、各可见光数据对应的位置信息以及各可见光数据对应的环境光的环境光标识作为训练数据样本,输入第一神经网络模型,以对第一神经网络模型进行训练,得到第二神经网络模型。
可以理解,第一神经网络模型即下文实施例中的神经网络模型,第二神经网络模型即下文实施例中的定位模型。
可以理解,每个可见光数据可以为在某一个时刻在某一个位置接收到的所有可见光光源的混合的光数据。
可以理解,第一神经网络模型中的各参数为初始化后的参数,将训练数据样本输入第一神经网络模型进行训练,可以为基于训练数据样本,对第一神经网络模型的各参数进行优化,可以得到第二神经网络模型。在对第一神经网络模型的各参数进行优化时,可以为第一神经网络模型学习不同环境光对可见光数据的影响、学习同一位置的可见光数据之间的关系,并学习可见光数据的特征数据与位置信息的对应关系,对可见光数据与对应的位置关系进行建模,得到能够抑制环境光对定位结果影响的、定位精度较高的第二神经网络模型。
本申请实施例提供的用于定位的模型训练方法,通过采集不同环境光下的可见光数据,对第一神经网络模型进行训练,得到的第二神经网络模型可以应用于多种复杂的环境光干扰下的定位。并且,第二神经网络模型由于是采用不同环境光下的可见光数据训练得到的,可以抑制环境光影响,定位精度更高。
可以理解,本申请实施例中的第二神经网络模型,可以应用于包括多个可见光光源的定位场景中, 包括但不限于地下、室内、遮挡物较多室外等卫星信号较弱的环境中。其中的可见光光源可以包括LED灯、节能灯、白炽灯等能够发射可见光信号的光源。
在上述第一方面的一种可能的实现中,可见光数据对应的位置信息是以定位场景中预设位置为空间坐标系原点,得到的可见光数据的位置的坐标。
在上述第一方面的一种可能的实现中,获取在多个位置处采集的各位置处不同环境光下的多个可见光数据,包括:获取预设环境光下在多个位置采集到的各位置处的可见光数据;对可见光数据进行数据增强,得到各位置处不同环境光下的多个可见光数据。
可以理解,不同环境光对可见光光源的影响关系是相似的,服从朗博模型,但是存在朗博模型尺度上的不一致,对某一环境光下的可见光数据进行数据增强,例如对RSS数据乘以一个系数,可以得到其他环境光环境下的RSS数据。无需对多种环境光的数据采集环境进行搭建,仅通过对某一环境光下的可见光数据进行数据增强,即可以得到不同环境光下的可见光数据,省时省力。并且,基于神经网络的学习方法,学习不同环境光与定位结果的关系,可以消除环境光对定位结果的影响,得到与环境光无关的高精度的第二神经网络模型。
在上述第一方面的一种可能的实现中,将各可见光数据、各可见光数据对应的位置信息以及各可见光数据对应的环境光的环境光标识作为训练数据样本,包括:将可见光数据中对应于不同可见光光源的光数据进行分离,得到各可见光数据对应的第一RSS数据样本,第一RSS数据样本中包括对应不同可见光光源的多个第一RSS数据;将各第一RSS数据样本、各第一RSS数据样本对应的位置信息以及各第一RSS数据样本对应的环境光标识作为训练数据样本。
在上述第一方面的一种可能的实现中,第一神经网络模型包括第一神经网络子模块和第二神经网络子模块;将各可见光数据、各可见光数据对应的位置信息以及各可见光数据对应的环境光的环境光标识作为训练数据样本,输入第一神经网络模型,包括:将各第一RSS数据样本、各第一RSS数据样本对应的位置信息以及各第一RSS数据样本对应的环境光标识作为训练数据样本,输入第一神经网络子模块其中,所述第一神经网络子模块以任一位置的任一环境光下的来自不同可见光光源的RSS数据为输入,以各RSS数据对应的权重为输出;基于所述第一神经网络子模块输出的所述第一RSS数据样本中各RSS数据对应的权重,对第一RSS数据样本中的RSS数据进行加权,得到第二RSS数据样本;将各第二RSS数据样本、各第二RSS数据样本对应的位置信息以及各第二RSS数据样本对应的环境光标识,输入第二神经网络子模块。
可以理解,不同的可见光光源由于与待定位的可见光数据的位置之间的距离不同,则在可见光数据在环境中的传输过程中的信噪比也不同,可见光数据受到的环境光中的噪声的影响也是不同的,通过第一神经网络子模块学习接收到的不同可见光光源的光数据,与计算出的可见光光源和接收数据的位置的距离和真实距离之间的误差的映射关系,得到基于可见光数据的不同可见光光源的光数据的权重,使得第二神经网络子模块在进行训练时,更依赖于距离接收可见光数据的位置更近的可见光光源的光数据,可以减少噪声等对第二神经网络模型的定位结果的影响,提高定位精度。
在上述第一方面的一种可能的实现中,第一神经网络子模块包括注意力机制。
在上述第一方面的一种可能的实现中,第一神经网络子模块为带注意力机制的多层感知机。
在上述第一方面的一种可能的实现中,第二神经网络子模块包括长短期记忆网络层和全连接层。
在上述第一方面的一种可能的实现中,上述方法还包括:基于第二神经网络模型输出的预测定位数据以及预测定位数据对应的真实位置数据,对第二神经网络模型的参数进行优化。
在上述第一方面的一种可能的实现中,对第二神经网络模型的参数进行优化包括:基于预测定位数 据以及真实位置数据,利用损失函数确定预测定位数据与真实位置数据之间的误差;基于误差对第二神经网络模型的参数进行优化。
在上述第一方面的一种可能的实现中,损失函数通过如下公式表示:
Figure PCTCN2022124418-appb-000001
其中,β表征了正则化项的正则化调节系数;N表征了可见光光光源的数量;d j表征了基于朗伯模型计算出的可见光数据对应的位置与第j个可见光光源之间的距离;RSS j表征了第j个可见光光源对应的光数据;ε表征了信道噪声,并且信道噪声为高斯噪声。
可以理解,传统损失函数可能会使得第二神经网络模型过度拟合,进而对第二神经网络模型的稳定性会产生影响,基于增加正则化项的损失函数进行反向传播,对第二神经网络模型的参数进行优化,可以增强第二神经网络模型的抗干扰能力(即鲁棒性)。
在上述第一方面的一种可能的实现中,多个位置中的至少部分位置对应于同一运动轨迹。
可以理解,在一些实施例中,作为训练数据样本中的可见光数据,可以为设备在不同运动轨迹的多个位置的可见光数据,训练数据中可以包括可见光数据、可见光数据对应的时间、可见光数据对应的位置等。进而,第一神经网络模型可以包括能够处理时序数据以及空间数据的神经网络模型,例如循环神经网络模型(Recurrent Neural Network,RNN),LSTM等,此类神经网络模型不仅可以学习不同环境光对可见光数据的影响、不同可见光光源之间的影响、可见光数据与位置的对应关系,还可以学习连续运动轨迹上的连续位置对应的可见光数据的关系,例如,相邻位置的可见光数据变化连续的关系,进而定位模型还可以将学习到的连续位置对应的可见光数据的关系,作为可见光光源与设备之间距离的约束条件。进而,训练得到的第二神经网络模型的定位精度更高。
在另一些实施例中,训练数据样本中的可见光数据,可以为定位场景中任一离散的多个位置的可见光数据。
第二方面,本申请实施例提供了一种用于定位的模型的训练装置,包括:数据获取模块,用于获取在多个位置处采集的各位置处不同环境光下的多个可见光数据,其中每个可见光数据包括来自不同可见光光源的光数据;
模型训练模块,用于将各可见光数据、各可见光数据对应的位置信息以及各可见光数据对应的环境光的环境光标识作为训练数据样本,输入第一神经网络模型,以对第一神经网络模型进行训练,得到第二神经网络模型。
第三方面,本申请实施例提供了一种定位方法,包括:获取采集到的实测的可见光数据;将实测的可见光数据输入上述第一方面的用于定位的模型的训练方法训练得到的第二神经网络模型,输出实测的可见光数据对应的预测位置。
第四方面,本申请实施例提供了一种定位装置,包括:数据采集模块,用于获取采集到的实测的可见光数据;定位模块,用于将实测的可见光数据输入上述第一方面的用于定位的模型的训练方法训练得到的第二神经网络模型,输出实测的可见光数据对应的预测位置。
第五方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;一个或多个存储器;一个或多个存储器存储有一个或多个程序,当一个或者多个程序被一个或多个处理器执行时,使得电子设备执行上述第一方面或第三方面的方法。
第六方面,本申请实施例提供了一种计算机可读存储介质,存储介质上存储有指令,指令在计算机 上执行时使计算机执行上述第一方面或第三方面的方法。
第七方面,本申请实施例提供了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现上述第一方面或第三方面的方法。
附图说明
图1所示为本申请实施例提供的一种室内定位场景图;
图2所示为本申请实施例提供的一种朗伯模型的示意图;
图3所示为本申请实施例提供的一种注意力机制的框架示意图;
图4所示为本申请实施例提供的一种LSTM单元的内部结构示意图;
图5a所示为一种基于指纹的可见光定位技术的流程示意图;
图5b和图5c所示为一种基于几何方式的可见光定位技术的流程示意图;
图5d所示为一种可见光定位技术的流程示意图;
图6a所示为本申请实施例提供的一种RSS与距离的关系曲线图;
图6b所示为本申请实施例提供的一种受人工光干扰的RSS与距离的关系曲线图;
图6c所示为本申请实施例提供的一种无人工光干扰的RSS与距离的关系曲线图;
图6d所示为本申请实施例提供的一种有无人工光干扰的RSS与距离的关系曲线的对比图;
图7所示为本申请实施例提供的一种定位方法的流程示意图;
图8所示为本申请实施例中的一种数据采集的场景示意图;
图9所示为本申请实施例提供的一种离线训练过程和在线定位过程的流程示意图;
图10所示为本申请实施例中提供的部分时刻的信噪比和权值学习/计算的过程图;
图11a至图11c所示为本申请实施例提供的采集到的不同环境光下的轨迹示意图;
图12a至图12b所示为本申请实施例提供的人工光源干扰下的定位结果示意图;
图13a至图13b所示为本申请实施例提供的人工光源干扰下的定位结果对比示意图;
图14a至图14b所示为本申请实施例提供的太阳光源干扰下的定位结果示意图;
图15a至图15b所示为本申请实施例提供的太阳光源干扰下的定位结果对比示意图;
图16所示为本申请实施例提供的一种用于定位的模型训练装置的程序模块示意图;
图17所示为本申请实施例提供的一种定位装置的程序模块示意图;
图18所示为本申请实施例提供的一种电子设备的硬件结构示意图。
具体实施方式
在介绍本申请实施例提供的定位方法之前,先对本申请实施例相关的概念术语进行介绍。
接收信号强度(Received Signal Strength,RSS),接收设备接收到的发送端发出的信号的强度。在可见光定位系统中,RSS即接收端接收到的LED灯的可见光信号强度。可以理解,在本申请实施例中,接收设备100的RSS数据为接收设备100接收到的来自各LED灯的接收信号的RSS数据。
朗伯模型(Lambert's Model),是一种描述理想漫反射表面的光照漫反射模型。在可见光定位系统中,一般认为LED灯符合朗伯模型,如图2所示。在朗伯模型中,假设接收设备100与LED灯之间的距离d i已知,接收设备100的接收信号的RSS与LED灯辐射发射信号的辐射角θ、接收设备接收信号的入射角ψ等多个因素有关,具体关系可以表征为下述公式:
Figure PCTCN2022124418-appb-000002
其中,P i(θ,ψ)表征了接收设备100接收到的第i个LED灯辐射的可见光的RSS,m i表征了第i个LED灯的芯片的相关参数,M表征接收设备100芯片的相关参数,A R表征接收设备100的有效接收面积,P Ti表征了第i个LED灯的功率,T s(ψ)表征了接收设备100光滤波增益,g(ψ)表征了接收设备100的光集线增益。
在可见光定位系统中,由于部分参数可以作为已知量,可以对上述公式(1)进行简化,得到表征RSS与接收设备100和LED灯之间距离的关系的函数,公式如下:
d i=a*RSS b  公式(2);
其中,a和b为对公式(1)中的多个参数进行简化后得到的朗伯参数。
注意力(Attention)机制,在进行数据处理时,会选择性地关注所有数据的一部分,忽略其他可见数据。通过注意力机制可以快速提取数据的重要特征(即注意力数值)。
例如,图3所示为一种注意力机制的框架示意图。如图3所示,Q为注意力机制中输入数据的查询(query)组成的矩阵,Q中的每个元素表示每个输入向量的query值,例如图3中的q1、q2、q3、q4等;K为注意力机制中所有输入向量的键(key)组成的矩阵,K中的每个元素表示每个输入向量的key值,例如图3中的k1、k2、k3、k4等;V为注意力机制中所有输入向量的值(value)组成的矩阵,V中的每个元素表示每个输入向量的数值,例如图3中的v1、v2、v3、v4等。其中,每个key会有对应的value,组成每个输入向量的数据对。
注意力机制的计算过程为,通过计算矩阵Q和矩阵K的相关性,得到矩阵K中每个key对应value的权重系数,然后对多个value进行加权求和,即得到了最终的矩阵A,矩阵A中每个元素表示输入数据中每个元素的注意力数值(Attention value),例如图3中的Av1、Av2、Av3、Av4等。
长短期记忆网络(Long Short Term Memory,LSTM)是一种循环神经网络。LSTM包括多个隐藏层(下文称LSTM单元),每个LSTM单元可以对应一个时刻的数据输入/输出,并且隐藏层之间可以传输各单元短期的记忆(即隐层状态(hidden state),表示为h),也可以传输长期的记忆(即细胞状态(cell state),表示为c),其中,h也可以作为LSTM单元的输出。在本申请实施例中,LSTM可以对输入的RSS数据进行学习,得到各RSS数据的特征数据。
在一些实施例中,按照不同时刻将LSTM进行展开,可以得到如图4所示的部分LSTM单元的内部结构示意图。以LSTM单元401为例,LSTM单元401可以接收前一个时刻的LSTM单元402输出的c t-1、h t-1以及第t个时刻的输入x t。LSTM单元401可以通过单元内的各计算模块,将前一个单元的c t-1进行选择性忘记,对LSTM单元401中输入的x t和h t-1进行选择性记忆,并基于选择性记忆各选择性忘记的结果确定该单元的输出的c t和h t
例如图4所示,在选择性忘记过程中,可以基于输入的x t和h t-1结合sigmoid函数(即图4中的σ),生成忘记门控f t,用于控制对前一个LSTM单元的c t-1进行选择性忘记,即f t*c t-1;在选择性记忆过程中,可以基于输入的x t和h t-1结合sigmoid函数得到选择门控i t,并通过选择门控i t对该单元中基于tanh函数学习到的候选记忆
Figure PCTCN2022124418-appb-000003
进行选择性记忆,即
Figure PCTCN2022124418-appb-000004
在输出过程中,可以将选择性记忆的结果添加至选择性忘记的结果中,得到该单元的输出的c t。对于输出的h t,可以基于输入的x t和h t-1结合sigmoid函数得到输出门控o t,并利用输出门控对该单元学习到的所有记忆(将输出的c t通过tanh函数进行转换后)进行筛选,得到该单元的输出h t
全连接(Fully Connected,FC)层,对前层的特征进行一个加权和,将特征空间的特征通过线性变换映射到样本标记空间。在本申请实施例中,FC可以将LSTM得到的特征,有特征空间映射到室内或地下的位置空间,得到接收设备100的位置。
在基于RSS的可见光定位系统中,一般将发光二极管(Photo Diode,PD)作为接收设备的信号接收模块,接收设备响应于接收到的来自LED灯的可见光信号,得到接收信号,并对接收信号进行调制,然后基于多个LED灯的调制结果确定接收设备在室内的位置。现有的基于RSS的可见光定位技术采集数据时耗时耗力,并且未考虑到环境光、噪声、LED灯等对定位结果的影响,定位精度较低。
例如,图5a中示出的一些实施例中,采用的基于指纹的可见光定位技术,通过收集场景中各采样点的位置指纹(例如RSS数据)以及接收设备100实际接收到的可见光信号,确定接收设备100所处的位置。
以室内场景中包括五个LED灯的可见光定位系统为例,基于指纹的可见光定位技术可以包括两个步骤:离线建库和在线定位。
离线建库阶段,可以将室内空间200的地图划分成N个网格,网格大小可以根据用户定位精度确定。采集各网格的位置坐标以及接收设备100接收到的LED灯发射的光数据的RSS数据,并根据各位置坐标和各位置坐标对应的多个RSS数据,建立指纹库501。
在线定位阶段,通过将接收设备100的实测的RSS数据与指纹库501中的多组RSS数据,通过匹配算法进行匹配,确定匹配度最高的一组RSS数据对应的网格的位置为接收设备100的位置。
其中,匹配算法可以包括:
(1)欧拉距离匹配法,即通过计算实测的RSS数据与指纹库501中的RSS数据的欧拉距离,确定指纹库501中与实测的RSS数据的欧拉距离最小的一组RSS数据,并确定该组RSS数据对应的位置坐标为接收设备100的实际坐标。
其中,欧拉距离可以通过以下公式确定:
Figure PCTCN2022124418-appb-000005
其中,i表示数据库中不同的网格对应的指纹编号,j表示LED灯的调制频率或编号,μ i,j为数据库中指纹编号为i的网格接收到的来自第j个调制频率或编号的LED灯的RSS数据,μ o,j为接收设备100接收到的来自第j个调制频率或编号的LED灯的接收信号的RSS数据。
(2)确定性匹配方法,即采用k-最邻近(k-Nearest Neighbor,k-NN)算法,确定与实测的RSS数据最邻近的k个RSS数据,并确定最邻近的k个RSS数据中,对应于同一位置坐标的次数最多的位置坐标为实测坐标。
(3)概率性匹配算法,在指纹库501中存储RSS数据的概率分布,然后使用贝叶斯算法计算出接收设备100的实际坐标。
(4)近邻算法,即通过确定与接收设备100最近的已知位置坐标的LED灯的可见光,确定接收设备100的实际坐标匹配于RSS数据最大的LED灯的位置坐标。若接收到的多个LED灯的RSS数据相同,则确定接收设备100位于多个LED灯之间。
可以理解,基于指纹的可见光定位技术,需要大量数据进行指纹库501的建立,并且,对于网格的划分需要十分精细,才能得到准确度更高的定位结果,该技术耗时耗力。
为了解决上述基于指纹的可见光定位技术的实现耗时耗力的问题,图5a和图5b示出的一些实施例中,提供了一种基于几何方式的可见光定位技术,该技术通过朗伯模型计算接收设备100与多个LED灯的距离,实现接收设备100的定位。
具体地,如图5b所示,假设所有LED灯在同一高度,并且接收设备100的z坐标已知,可以利用 上文中的公式(2),基于接收设备100接收到的各LED灯的RSS数据,计算LED1、LED2、LED3与接收设备100之间的距离,分别为完成d1、d2和d3,然后以计算出的三个距离为半径,以对应的LED灯为圆心,画圆,确定三个圆相交的点为接收设备100的位置。设接收设备100的位置坐标为(x,y),LED1的坐标为(x1,y1),LED2的坐标为(x2,y2),LED3的坐标为(x3,y3),则可以通过如下方程求解得到接收设备100的位置坐标:
Figure PCTCN2022124418-appb-000006
可以理解的是,三个LED灯对应的圆可以相交于一个区域,例如图5c中的区域S,则上述方程无法求得接收设备100的坐标,或者接收设备100的z坐标未知,则需要以LED灯为球心画球,三个球体可能相交于一个立体空间,则为了确定接收设备100的位置,需要更多的LED灯的发射的可见光。则为了计算接收设备100的位置坐标,可能需要对四元二次方程或四元三次方程等进行求解。
可以理解,上述基于几何方式的可见光定位技术,在计算接收设备100的位置坐标时求解过程十分复杂,且由于基于LED灯与接收设备100之间的距离求解出的交点可能会有多个或者为一个区域,无法得到具体的位置坐标。
为了解决上述基于几何方式的可见光定位技术位置坐标求解过程复杂且无法得到具体位置坐标的问题,在一些实施例中提供的一种基于学习方式的可见光定位技术。
具体地,与基于指纹的可见光定位技术的流程相似,基于学习方式的可见光定位技术可以包括指纹收集和在线定位两个阶段,但是该技术无需对室内地图进行网格划分,将收集到的指纹,例如不同运动轨迹中多个位置坐标以及在该位置对应的RSS数据,作为训练数据,输入神经网络中进行误差计算以及网络参数优化。
其中,可以根据不同的任务、数据特性选择或者组合不同的神经网络。例如,神经网络可以包括全连接层、可以处理空间数据的卷积神经网络、可以处理时序数据的循环神经网络、可以学习拓扑结构的图神经网络等。
在线定位阶段,将接收设备100采集到的RSS数据输入训练好的神经网络,可以得到接收设备100的预测位置。
可以理解,上述基于学习的可见光定位技术,通过神经网络可以快速求解出结合接收设备100的预测位置坐标,相比于基于几何方式的可见光定位技术,求解过程比较简单,求解出的位置坐标比较具体。但是,在可见光定位过程中,接收设备100接收到的光信号不仅包括LED灯的发射的光信号,还包括环境光,该技术未考虑到环境光对于可见光定位的影响,定位精度较低。
为了解决上述技术中环境光对定位结果的影响的问题,图5d示出的一些实施例中,提供了一种可见光定位技术,通过将实测的RSS数据映射到朗伯模型的标定环境中来抑制环境光对定位结果的影响。
具体地,如图5d所示,通过获取不同环境光强下的接收设备100的RSS数据,拟合出环境光强与接收设备100的RSS数据之间的关系g N(I),该关系g N(I)可以表示成如下公式:
Figure PCTCN2022124418-appb-000007
其中,P r,i,N表示了第i个LED灯的RSS数据,I表示了环境光强,I th表示了饱和临界点的环境光强。
在定位阶段,可以将接收设备100采集到的环境光强I经过快速傅里叶变换(fast Fourier transform,FFT)变换,得到各LED灯的RSS数据P r,i,N,然后将环境光强I和RSS数据P r,i,N输入参数调整模块511,对朗伯模型的参数进行调整,并将调整后的参数a1、b1应用到朗伯模型512,然后基于接收设备100接收到的来自各LED灯的接收信号的RSS数据,利用朗伯模型512计算得到第i个LED灯与接收设备100的距离di,进而实现接收设备100的定位。
可以理解,上述方法在标定环境中也存在环境光,不同标定环境的环境光不相同,上述方法中通过拟合关系g N(I)无法消除标定环境中环境光对朗伯参数的影响,不同标定环境光下的朗伯模型无法通用。
为了解决上述可见光定位技术在不同标定环境光下的朗伯模型无法通用的问题,本申请实施例提供了一种用于定位的模型训练方法。用于定位的模型训练方法包括:获取不同环境光下的RSS数据以及对应的位置,作为训练数据,输入神经网络模型(即第一神经网络模型)中,利用神经网络模型学习不同环境光对RSS数据的影响、学习同一位置的RSS数据之间的关系,并学习特征数据与位置的对应关系,对RSS数据与对应的位置关系进行建模,得到能够抑制环境光对定位结果影响的、定位精度较高的定位模型(即第二神经网络模型)。进而,可以将可见光接收模块的接收设备接收到的RSS数据作为输入数据输入定位模型,定位模型可以输出预测的接收设备的位置。
本申请实施例提供的用于定位的模型训练方法通过采集不同环境光下的RSS数据,对神经网络模型进行训练,得到的定位模型可以应用于多种复杂的环境光干扰下接收设备的定位。并且,定位模型由于采用不同环境光下的RSS数据进行训练,可以抑制环境光影响,定位精度更高。
可以理解,本申请实施例中的定位模型,可以应用于包括多个可见光光源的定位场景中,包括但不限于地下、室内、遮挡物较多室外等卫星信号较弱的环境中。其中的可见光光源包括LED灯、节能灯、白炽灯等能够发射可见光信号的光源。
可以理解,不同环境光下的RSS数据可以为对接收设备采集到的接收数据中的来自不同LED灯的接收数据进行分离,并提取对应的RSS数据后得到的数据,在同一环境光下的同一位置的多个可见光光源的RSS数据可以作为一个RSS数据样本。进而,可以将RSS数据样本、对应的位置、对应的环境光作为训练数据中的一个训练数据样本,将多个训练数据样本组成的训练数据输入神经网络模型进行训练。
在一些实施例中,可以将可见光光源的可见光信号的调制频率作为可见光光源的标识,进而,可以采取FFT将不同可见光光源的光数据进行分离。
可以理解,其中,神经网络模型可以学习有朗伯模型的相关知识,以及定位场景中的可见光光源的位置,神经网络模型学习的过程可以理解为对神经网络模型的参数优化的过程,神经网络模型可以包括但不限于FC层、卷积神经网络模型、循环神经网络模型、图神经网络模型、脉冲神经网络模型等。
在一些实施例中,作为训练数据的RSS数据,可以为接收设备在不同运动轨迹的多个位置的RSS数据,训练数据中可以包括RSS数据、RSS数据对应的时间、RSS数据对应的位置等。进而,神经网络模型可以包括能够处理时序数据以及空间数据的神经网络模型,例如循环神经网络模型(Recurrent Neural Network,RNN),LSTM等,此类神经网络模型不仅可以学习不同环境光对RSS数据的影响、不同LED灯之间的影响、RSS数据与位置的对应关系,还可以学习连续运动轨迹上的连续位置对应的RSS数据的关系,例如,相邻位置的RSS数据变化连续的关系,进而定位模型还可以将学习到的连续位置对应的RSS数据的关系,作为可见光光源与接收设备之间距离的约束条件。进而,训练得到的定位模型的定位精度更高。
进一步地,神经网络模型还可以包括用于将上述能够处理时序数据以及空间数据的神经网络模型, 例如循环神经网络模型(Recurrent Neural Network,RNN),LSTM等,输出的特征数据与对应的位置进行映射的神经网络模型层,例如包括FC层。具体地,可以将特征数据与对应的位置输入初始FC层,初始FC层可以学习特征数据与位置的对应关系,训练得到定位模型的FC层。
在一些实施例中,神经网络模型中还包括注意力机制。进而,在将训练数据输入神经网络模型进行训练之前,可以利用注意力机制,学习训练数据中RSS数据与基于朗伯模型得到的距离观测值和实测距离值之间的误差的映射关系,并基于该映射关系确定各RSS数据的注意力的数值。
其中,误差与可见光信号传输过程中的噪声、环境光等的干扰有关,可见光光源,例如LED灯,与接收设备距离越远,则LED灯发射的可见光信号受环境光以及噪声的影响越大,基于朗伯模型计算出的距离精度越低。例如,图6a示出了一些实施例中,可见光信号的传输距离与对应的RSS数据的关系曲线以及多种噪声信号的传输距离与对应的RSS数据的关系曲线。其中的噪声包括干扰可见光信号传输的热噪声、散粒噪声和加性高斯白噪声。由图6a可以看出,噪声的RSS不随距离发生改变,信噪比随距离增加而减小,信噪比可以在一定程度上反映出朗伯模型计算出的距离的精度。结合朗伯模型的公式(2),可以将基于朗伯模型计算出的LED灯与接收设备的PD之间的距离
Figure PCTCN2022124418-appb-000008
和LED灯与接收设备的PD之间的真实距离d之间的误差表示为下述公式:
Figure PCTCN2022124418-appb-000009
其中ε为信道噪声。
将上述公式进行泰勒展开,可以得到如下公式:
Figure PCTCN2022124418-appb-000010
其中,SNK表示信噪比,可见误差与真实距离d成正比,与信噪比成反比。因此,可以利用注意力机制,学习RSS数据与误差之间的映射关系,并基于映射关系确定的注意力的数值可以作为各RSS数据的权重,通过注意力数值对各RSS数据进行加权后,输入神经网络模型进行训练,相比于将RSS数据直接输入神经网络模型进行训练,可以减少噪声等对定位结果的影响,提高定位精度。
可以理解,在一些实施例中,本申请提供的定位方法中,训练定位模型的电子设备与在线定位阶段的接收设备可以为相同设备,此时,电子设备上包括可见光接收模块的。在其他实施例中,在一些实施例中,电子设备与接收设备可以为不同的设备,其中,电子设备用于训练定位模型,并获取接收设备100在线定位阶段接收到的RSS数据,将其输入定位模型,得到接收设备100的位置并发送至接收设备。或者,电子设备还可以将训练好的定位模型发送至接收设备100,接收设备可以在在线定位阶段采集RSS数据,并利用定位模型实现对自身位置的确定。
可以理解,在一些实施例中,对于不同标定环境下的朗伯模型,得到的LED灯与接收设备100的距离和对应的RSS数据之间的关系,可以如图6b至6c所示。
其中,图6b所示为基于有人工光环光干扰下的朗伯模型,得到的LED灯与接收设备100的距离和对应的RSS数据之间的关系曲线,包括实际测量得到的关系曲线(图6b中的real对应的曲线)以及朗伯模型计算得到的关系曲线(图6b中的ideal对应的曲线)。图6c所示为基于无人工光源光干扰的朗伯模型,得到的LED灯与接收设备100的距离和对应的RSS数据之间的关系,包括实际测量得到的关系曲线(图6c中的真值对应的曲线)以及朗伯模型计算得到的关系曲线(图6c中的预测值对应的曲线)。 由图6b和图6c可以看出不同环境光对LED灯的影响关系是相似的。
将图6b与图6c中的真值关系曲线绘制与统一坐标系下,得到如图6d所示的曲线图。可以看出,两种朗伯模型对应的关系曲线存在尺度上的不一致,对无人工光源光干扰的关系曲线进行数据增强(即对RSS数据乘以一个系数),两个关系曲线可以基本重合。因此可以通过对某一标定环境下采集的RSS数据的数据增强,得到其他环境光环境下的RSS数据。
因此,在一些实施例中,可以获取某一环境光环境下的RSS数据,通过数据增强的方式构建不同环境光下的RSS数据,将数据增强后的RSS数据、标定环境下的RSS数据以及对应的位置,作为训练数据。
可以理解,在一些实施例中,在定位模型的训练过程中,可以基于训练好的定位模型得到的预测位置与对应的真实位置,构建定位模型的损失函数,并基于损失函数进行误差反向传播,对定位模型的参数进行优化。进一步地,可以在传统损失函数中最小化随机误差带来的不稳定性,例如在损失函数中增加与距离误差相关的正则化项。可以理解,传统的损失函数可能会造成定位模型的过度拟合,基于更新后的损失函数进行反向传播,对定位模型的参数进行优化,可以增强定位模型的抗干扰能力(即鲁棒性)。
下面结合图7,以可见光光源为LED灯,接收设备通过PD接收可见光信号为例,对本申请实施例中的用于定位的模型训练方法进行详细介绍。
可以理解,在执行下述方法之前,需要先搭建RSS数据采集的环境,即在某一定位空间,例如图1的室内空间200中,安装多个LED灯,并标定LED灯的位置、高度以及PD的高度。为了便于描述,下文以安装5个LED灯为例。还需要设置LED灯的标识,例如调制频率,进而可以通过LED灯的标识将PD的接收数据中来自不同LED灯的数据进行分离,并提取得到不同LED灯对应的RSS数据。
如图7所示,为本申请实施例提供的一种定位方法的流程示意图。可以理解,图7中的执行主体为电子设备。可以理解,本申请实施中以接收可见光的PD位于电子设备为例进行介绍。在其他实施例中,PD可以位于电子设备外的其他可见光接收设备。
如图7所示,该方法包括:
701:获取不同环境光下实测的多个位置的RSS数据,并将获取的RSS数据、对应的位置以及对应的环境光作为训练数据。
可以理解,不同环境光下实测的RSS数据可以为对接收设备采集到的接收数据中的来自不同LED灯的接收数据进行分离,并提取对应的RSS数据后得到的数据,在同一环境光下的同一位置的多个可见光光源的RSS数据可以作为一个RSS数据样本。进而,可以将RSS数据样本、对应的位置、对应的环境光作为训练数据中的一个训练数据样本,将多个训练数据样本组成的训练数据输入神经网络模型进行训练。
在一些实施例中,可以将LED灯的可见光信号的调制频率作为LED灯的标识,进而,可以采取FFT将不同LED灯的接收数据进行分离。
在一些实施例中,不同环境光下的RSS数据,可以通过对某一环境光下的RSS数据进行数据增强得到。
例如,某一环境光下得到的第i个位置的RSS数据可以表示为:
Figure PCTCN2022124418-appb-000011
其中,N表示测试环境中的LED灯的数量,在本实施例中N为5,j表示RSS数据对应的位置编号,(x j,y j)表示RSS数据对应的位置坐标,
Figure PCTCN2022124418-appb-000012
表示在位置编号为j的位置接收到的编号为i的LED灯的RSS数据。
进而,对上述RSS数据进行数据增强可以包括:生成随机参数λ∈(0,α],其中α为预设的数值,可以根据实际情况进行调整。通过随机参数对上述RSS数据进行数据增强,可以得到其他环境光下的 RSS数据,例如
Figure PCTCN2022124418-appb-000013
可以随机生成多个λ,进而得到多中环境光下的RSS数据。
702:初始化神经网络模型。
可以理解,初始化神经网络模型可以为设置神经网络模型中各个关键节点的初始参数。其中,神经网络模型中可以学习有朗伯模型的相关知识,以及定位场景中的LED灯的位置。
可以理解,神经网络模型可以包括但不限于FC层、卷积神经网络模型、循环神经网络模型、图神经网络模型、脉冲神经网络模型等。
在一些实施例中,作为训练数据的RSS数据,可以为PD在不同运动轨迹的多个位置的RSS数据,训练数据中各个训练数据样本可以包括RSS数据样本、RSS数据样本对应的时间、RSS数据样本对应的位置等。进而,步骤702中的神经网络模型可以包括能够处理时序数据以及空间数据的神经网络模型,例如循环神经网络模型(Recurrent Neural Network,RNN),LSTM等,此类神经网络模型不仅可以学习训练数据在空间上的特征,例如不同环境光对RSS数据的影响、同一位置的RSS数据的之间的关系(即不同LED灯之间的相关关系)、特征数据与位置的对应关系,还可以学习训练数据与时间相关的空间特征,例如连续运动轨迹上的连续位置对应的RSS数据的关系等。
可以理解,由于相邻位置的RSS数据变化连续,进而定位模型还可以将学习到的连续位置对应的RSS数据的关系,作为LED灯与PD之间距离的约束条件。进而,训练得到的定位模型的定位精度更高。
例如,图8所示为本申请实施例中的一种数据采集的场景示意图。
如图8所示,室内空间801中预先安装有5个LED灯,可以将包括PD的电子设备置于可移动机器人802上,采集可移动机器人沿轨迹803运动时,在多个位置点采集到的接收数据,其中的每个圆可以对应一个位置点。
可以理解,以轨迹段804中的多个位置点为例,位置点8041、位置点8042和位置点8043为轨迹段804上连续的3个位置点,则在位置点8041、位置点8042和位置点8043采集的接收数据是连续变化的,存在一定的相关性。则将位置点8041、位置点8042和位置点8043对应的RSS数据、RSS数据对应的位置和时间输入神经网络模型进行训练,神经网络模型则可以学习此种RSS数据的变化关系,在进行位置预测时,可以将学习到的变化关系作为LED灯与PD之间距离的约束条件。
进一步地,神经网络模型还包括可以用于将上述能够处理时序数据以及空间数据的神经网络模型,例如循环神经网络模型(Recurrent Neural Network,RNN),LSTM等,输出的特征数据与对应的位置进行映射的神经网络模型层,例如包括FC层。具体地,可以将特征数据与对应的位置输入初始FC层,初始FC层可以学习特征数据与位置的对应关系,训练得到定位模型的FC层。
在一些实施例中,神经网络模型中还包括注意力机制。可以理解,通过朗伯模型得到的距离观测值和实测距离值之间的误差与可见光信号传输过程中的噪声、环境光等的干扰有关,可见光光源,例如LED灯,与接收设备距离越远,则LED灯发射的可见光信号受环境光以及噪声的影响越大,基于朗伯模型计算出的距离精度越低。训练数据输入LSTM层进行训练之前,可以利用注意力机制,学习训练数据中RSS数据与基于朗伯模型得到的距离观测值和实测距离值之间的误差的映射关系,并基于该映射关系确定各RSS数据的注意力的数值。其中,基于映射关系确定的注意力的数值可以作为各RSS数据的权重。进而,可以通过注意力数值对各RSS数据进行加权,输入LSTM层进行训练,可以减少噪声等对LSTM层的特征数据的输出的影响,得到误差更小的RSS数据的特征数据。
进一步地,在一些实施例中,注意力机制可以为带注意力机制的多层感知机(Multilayer Perceptron,MLP)。MLP可以包括输入层、输出层和连接输入层与输出层的隐藏层。输入层用于获取输 入的RSS数据,隐藏层用于学习输入的RSS数据与距离观测值和实测距离值之间的误差的相关性,得到RSS数据的注意力数值,并将注意力数值通过输出层进行输出。输出层输出的注意力数值可以通过softmax函数,将注意力数值转换至(0,1)之间,得到各RSS数据的权重。
703:将训练数据输入神经网络模型进行训练,得到定位模型。
可以理解,在一些实施例中,神经网络模型可以包括LSTM层以及FC层。将训练数据输入神经网络模型,可以包括:将训练数据中对应于同一环境光和运动轨迹的RSS数据样本划分为一个训练数据子集,并将各训练数据子集中的RSS数据按照时间顺序依次输入LSTM层进行训练。
例如,图4所示的LSTM层的各时刻对应的LSTM单元中,对于同一训练数据子集中的RSS数据样本,LSTM单元可以学习不同时刻的RSS数据样本中的同一时刻的各RSS数据的之间的关系、多个时刻的RSS数据样本之间的特征关系,对于不同训练数据子集的RSS数据,LSTM单元可以对学习到的同一时刻各RSS数据之间的关系、多个时刻的RSS数据样本之间的特征关系等进行强化记忆以及优化记忆等,并学习不同环境光下的RSS数据之间的关系,以训练得到与环境光无关的、能够提取RSS数据的特征数据的LSTM层。LSTM层输出的特征数据以及各特征数据对应的位置可以作为FC层的输入数据,FC层学习特征数据与位置之间的关系,得到能够将RSS数据的特征数据映射到定位场景中的位置的FC层。
在一些实施例中,神经网络模型还可以包括注意力机制。进而,训练数据输入LSTM层进行训练之前,可以利用注意力机制,学习训练数据中RSS数据与基于朗伯模型得到的距离观测值和实测距离值之间的误差的映射关系,并基于该映射关系确定各RSS数据的注意力的数值。
进一步地,在一些实施例中,注意力机制可以为带注意力机制的MLP。MLP可以获取RSS数据样本,并学习RSS数据样本与通过朗伯模型得到的距离观测值和实测距离值之间的误差之间的相关性,得到可以计算RSS数据样本中各RSS数据的注意力数值的MLP。进而,LSTM层可以对MLP输出的注意力数值通过softmax函数进行转换,得到各RSS数据的权重。并且,可以利用RSS数据的权重对对应的RSS数据进行加权,减少噪声等干扰LSTM层训练的影响。即在LSTM进行训练之前,可以通过MLP、softmax函数等进行数据预处理,并加权后的RSS数据作为LSTM训练的训练数据。
在一些实施例中,上述利用通过softmax函数对MLP输出的注意力数值进行转换,得到各RSS数据的权重,并利用RSS数据的权重对对应的RSS数据进行加权,可以通过其他的数据预处理模块实现,而非LSTM层进行数据处理,本申请对此不作限制。
704:获取待定位的RSS数据。
可以理解,待定位的RSS数据为在在线定位阶段,电子设备的PD接收到的接收数据,并基于不同LED灯的标识,对接收数据进行分离处理得到的对应于定位空间内各LED灯的RSS数据。
在一些实施例中,将LED灯的调制频率作为各LED灯的标识,则在获取到接收数据后,可以通过FFT将接收数据进行分离,得到对应各LED灯的RSS数据。
705:将待定位的RSS数据输入定位模型,输出待定位的RSS数据的预测位置。
可以理解,定位模型可以利用注意力机制计算待定位的RSS数据中对应不同LED灯的RSS数据的注意力数值,并将注意力数值通过softmax函数等转换为各RSS数据的权重。定位模型可以将加权后的RSS数据输入训练好的LSTM层,计算加权后的RSS数据的特征数据,并通过FC层将RSS数据映射到定位空间的某一位置,得到待定位的RSS数据的预测位置。
可以理解,上述步骤701至步骤703为本申请实施例提供的定位方法中的离线训练过程,步骤704和步骤705为本申请实施例提供的定位方法中的在线定位过程。在一些实施例中,本申请实施例可以为包括上述步骤701至步骤703的用于定位的模型训练方法,在另一些实施例中,本申请实施例可以为包 括上述步骤704至步骤705的定位方法。在其他实施例中,本申请实施例可以为包括上述步骤701至步骤705的定位方法。本申请对此不作限制。
本申请实施例提供的定位方法,通过采集不同环境光下的RSS数据,对神经网络模型进行训练,得到的定位模型可以应用于多种复杂的环境光干扰下接收设备的定位。并且,定位模型由于采用不同环境光下的RSS数据进行训练,可以抑制环境光影响,定位精度更高。
在一些实施例中,在执行步骤703进行定位模型的训练过程中,可以将训练数据中的部分RSS数据以及对应的真实位置作为优化数据,用于对训练好的定位模型进行优化。具体地,可以将优化数据输入训练好的定位模型,得到的预测位置与对应的真实位置,构建定位模型的损失函数,并基于损失函数进行误差反向传播,对定位模型的参数进行优化。
在一些实施例中,构建的损失函数可以通过下述公式表示:
Figure PCTCN2022124418-appb-000014
其中,p i表示PD的真实位置,
Figure PCTCN2022124418-appb-000015
表示通过定位模型确定的第i个预测位置。
进一步地,可以在传统损失函数中最小化随机误差带来的不稳定性,例如在损失函数中增加与距离误差相关的正则化项。可以理解,传统的损失函数可能会使得定位模型过度拟合,对于定位模型的稳定性会产生影响,基于更新后的损失函数进行反向传播,对定位模型的参数进行优化,可以增强定位模型的抗干扰能力(即鲁棒性)。
在另一些实施例中,构建的增加了正则化项后的轮式函数可以通过下述公式表示:
Figure PCTCN2022124418-appb-000016
其中,β为正则化项的正则化调节系数,N为LED灯的数量,d j表示基于朗伯模型计算出的PD与第j个LED灯之间的距离,RSS j为PD接收到的对应于第j个LED灯的RSS数据,ε表示信道噪声,并且ε~N(μ,δ)为高斯噪声,高斯噪声的均值和方差可以由RSS数据估计得到。
下面结合图9,对上述图7中的离线训练过程以及在线定位过程进行进一步介绍。
如图9所示为本申请实施例提供的一种离线训练过程和在线定位过程的流程示意图。可以理解,其中的虚线箭头表示离线训练过程的数据流转方向,细实线箭头表示在线定位过程的数据流转方向,粗实线箭头表示离线训练过程和在线定位过程共同的数据流转方向。
可以理解,在离线训练过程,权重学习模块930、干扰抑制模块940以及误差计算模块950组成神经网络模型;在在线定位过程,权重学习模块930、干扰抑制模块940(和误差计算模块950)组成定位模型。
如图9所示,离线训练过程包括:
信号接收模块(离线)910通过PD获取PD接收值911(即前文的PD的接收数据)。信号接收模块(离线)910可以通过FFT将PD接收值中对应不同LED灯的接收数据分离,得到各LED灯的RSS数据912。信号接收模块(离线)910还可以通过数据增强的方式,对的单一环境光下的RSS数据进行扩展,得到扩展后的RSS数据913。信号接收模块(离线)910可以将RSS数据912以及扩展后的RSS数据913作为训练数据分别输入权重学习模块930的信噪比(Signal Noise Ratio,SNR)计算单元931以及干扰抑制模块的噪声特性学习单元941。
SNK计算单元931可以计算训练数据的信噪比,并将计算得到的信噪比作为注意力层932的query 与训练数据一起输入注意力层932,学习RSS数据与距离观测量误差之间的映射关系,注意力层932可以输出训练数据中各RSS数据的注意力数值。其中距离观测量误差为利用朗伯模型计算出的LED灯与PD之间的观测量距离和真实距离之间的误差。注意力层932可以将输出的注意力数值输入噪声特性学习单元941中。
噪声特性学习单元941可以将各RSS数据的注意力数值,转换为各RSS数据的权重。例如,通过softmax函数等,将注意力数值转化至(0,1)之间。并且,噪声特性学习单元941可以利用计算出的权重对训练数据中的RSS数据进行加权,并将加权后的RSS数据输入LSTM层942。
LSTM层942可以学习加权后的训练数据中的同一时刻的各RSS数据的之间的关系、多个时刻的RSS数据样本之间的特征关系、不同环境光下的RSS数据之间的关系、同一运动轨迹上不同位置点的RSS数据的变化关系等,对LSTM层942的各参数进行优化。LSTM层942可以输出RSS数据以及对应的位置的特征数据,并将特征数据输入FC层943。
FC层943中可以学习RSS数据的特征数据与对应的位置的特征数据之间的映射关系,对FC层的各参数进行优化。
在一些实施例中,可以基于误差计算模块930计算出的损失误差的反向传播,对干扰抑制模块的噪声特性学习单元941、LSTM层942和FC层943,以及权重学习模块930的注意力层932的各参数进行优化。
具体地,误差计算模块930可以基于FC层输出的定位模型预测的位置951及其对应的真实位置952,构建损失函数953,损失函数可以例如公式(7)或公式(8)对应的损失函数。对于构建出的损失函数953,误差计算模块930可以最小化损失函数,得到损失误差954,并将损失误差进行反向逐层传播,对前述的神经网络模型层进行优化,提高定位精度。
如图9所示,在线定位过程包括:
信号接收模块(在线)920通过PD获取PD接收值921(即前文的PD的接收数据)。信号接收模块(在线)920可以通过FFT将PD接收值中对应不同LED灯的接收数据分离,得到各LED灯的RSS数据922。信号接收模块(在线)920可以将RSS数据922输入权重学习模块930的信噪比(Signal Noise Ratio,SNR)计算单元931以及干扰抑制模块的噪声特性学习单元941。
SNK计算单元931可以计算RSS数据922的信噪比,并将计算得到的信噪比作为注意力层932的query与RSS数据922一起输入注意力层932,输出RSS数据922中各RSS数据的注意力数值。注意力层932可以将输出的注意力数值输入噪声特性学习单元941中。
噪声特性学习单元941可以将RSS数据的注意力数值,转换为RSS数据922的权重。例如,通过softmax函数等,将注意力数值转化至(0,1)之间。并且,噪声特性学习单元941可以利用计算出的权重对RSS数据922进行加权,并将加权后的RSS数据输入LSTM层942。
LSTM层942可以基于输入的加权后的RSS数据进行计算,输出RSS数据的特征数据,并将特征数据输入FC层943。
FC层943中可以将RSS数据的特征数据映射到定位场景中的位置空间,得到RSS数据922对应的预测位置。
在一些实施例中,注意力层可以为MLP,并且PD接收值可以为沿PD运动轨迹采集到的多个位置点的接收数据。则可以按照时间顺序,将PD接收值输入权重学习模块930和干扰抑制模块940的,进行信噪比和权值学习/计算。例如,图10示出了本申请实施例中提供的部分时刻的信噪比和权值学习/计算的过程图。
以离线训练过程为例,对于PD接收值,可以通过FFT变换得到各LED灯对应的RSS数据,并将FFT后的RSS数据分别输入SNK计算单元931以及输入噪声特性学习单元941。SNK计算单元931可以通过FFT后的频谱图,得到RSS数据的信噪比,并将信噪比和RSS数据输入MLP学习信噪比与RSS数据之间的映射关系,以得到RSS数据的注意力数值。
噪声特性学习单元941可以将接收到的RSS数据的注意力数值转换为RSS数据的权重,并对RSS数据进行加权,并将加权后的RSS数据输入LSTM层。
可以理解,通过图9中的离线训练方法训练得到的定位模型通过权重学习模块930和噪声特性学习单元941可以得到更信任距离PD最近的LED灯的RSS数据的定位模型,能够有效抑制噪声干扰,可以降低受干扰的LED灯对应的RSS数据对预测位置的影响。并且,通过LSTM层942学习不同环境光下的RSS数据的特征数据,可以得到可以有效抑制环境光干扰的定位模型,能够实现在复杂的环境光下的高精度定位。此外,通过在误差计算模块950构建的误差函数中增加误差正则化项,可以增强定位模型遇到高斯噪声的鲁棒性,定位模型的稳定性更高。
为了更好的阐述本申请实施例提供的定位模型训练方法的有益效果,下面以图1的定位场景的定位环境为例,结合具体的测试环境以及测试数据进行说明。
可以理解,在一些实施例中,对训练数据的采集环境进行了搭建,得到例如图1中的定位场景中的定位环境。假设图1中的定位空间为空房间,大小为5*5*2.6m 3。将LED灯、(STM32)处理器、脉冲宽度调制(Pulse Width Modulation,PWM)模块组成可见光信号的发射设备安装在图1的定位空间的顶部,发射设备共5个。其中,LED灯作为可见光光源,其功率为10W。发射设备的LED灯发出的可见光信号分别被调制在1756.1kHz、2571kHz、3137.3kHz、4235.3kHz和4864.9kHz,并且发射设备的坐标分别为(0.26,0.66,2.6)、(4.61,0.67,2.6)、(4.57,4.25,2.6)、(0.18,4.25,2.6)、(2.45,2.49,2.6)。
可以理解,测试环境中的各项参数的设置如下表1所示:
表1
Figure PCTCN2022124418-appb-000017
在上述标定的测试环境中分别采集受太阳光干扰、受人工光源干扰以及仅有LED灯的可见光信号的轨迹数据。受太阳光干扰和受人工光源干扰环境光下分别采集两条轨迹的RPD接收值,轨迹如图11a和图11b所示的轨迹,在仅有LED灯的可见光信号的环境中采集3条轨迹的PD接收值,轨迹如图11c 所示。上述采集的数据作为训练数据,采用图7中的步骤701至步骤703的训练方法进行训练,得到定位模型。
为了阐述本申请实施例提供的用于定位的模型训练方法的有益效果,在本申请实施例中还采集了部分真实的轨迹,并利用定位模型进行定位,得到基于真实的轨迹采集的RSS数据输出的预测位置组成的预测轨迹。具体如下:
如图12a人工光源干扰下采集轨迹1的真实轨迹(即图12a中真值对应的轨迹)、本申请实施例提供的定位模型输出的轨迹1的RSS数据对应的定位轨迹(即图12a中定位模型对应的轨迹)以及传统可见光定位方法(例如基于几何的可将光定位方法等)输出的轨迹1的RSS数据对应的预测轨迹(图12a中传统定位对应的轨迹)的轨迹图。
如图12b所示为人工光源干扰下采集轨迹2的真实轨迹(即图12b中真值对应的轨迹)、本申请实施例提供的定位模型输出的轨迹2的RSS数据对应的定位轨迹(即图12b中定位模型对应的轨迹),以及传统定位方法输出的轨迹2的RSS数据对应的预测轨迹(图12b中传统定位对应的轨迹)的轨迹图。
基于本申请实施例中的定位模型输出的定位轨迹与真实轨迹之间的测距误差和累计误差(CDF)的关系,以及传统定位方法输出的预测轨迹与真实轨迹的关系,可以分别绘制出图13a中的轨迹1的关系对比曲线和图13b的关系对比曲线。
结合图12a至图13b的相关数据,可以得到下表2:
表2
Figure PCTCN2022124418-appb-000018
其中,ME为平均误差(Mean Error,ME),RMSE为均方根误差(Root Mean Square Error,RMSE),50%和90%分别表示定位误差为50%和90%。
如图14a太阳光源干扰下采集轨迹1的真实轨迹(即图14a中的真值对应的轨迹)、本申请实施例提供的定位模型输出的轨迹1的RSS数据对应的预测轨迹(即图14a中的定位模型对应的轨迹)以及传统定位方法输出的轨迹1的RSS数据对应的预测轨迹(即图14a中的传统定位对应的轨迹)的轨迹图。
如图14b所示为太阳光源干扰下采集轨迹2的真实轨迹(即图14b中的真值对应的轨迹)、本申请实施例提供的定位模型输出的轨迹2的RSS数据对应的预测轨迹(即图14b中的定位模型对应的轨迹)以及传统定位方法输出的轨迹2的RSS数据对应的轨迹(即图14b中的传统定位对应的轨迹)的轨迹图。
本申请实施例中的定位模型输出的定位轨迹与真实轨迹之间的测距误差和累计误差(CDF)的关系,以及传统定位方法输出的预测轨迹与真实轨迹的关系,可以分别绘制出图15a中的轨迹1的关系对比曲线和图15b的关系对比曲线。
结合图14a至图15b的相关数据,可以得到下表3:
表3
Figure PCTCN2022124418-appb-000019
其中,ME为平均误差(Mean Error,ME),RMSE为均方根误差(Root Mean Square Error,RMSE),50%和90%分别表示定位误差为50%和90%。
以图12a、图13a和表2中的轨迹1对应的数据为例,由上表2可以看出:定位模型50%和90%的定位误差分别为10.9cm和23.55cm,与传统定位方法的50%和90%的定位误差38.8cm和55cm相比,分别减小了71.39%和57.22%。此外定位模型的平均定位误差为12.48cm,比传统定位方法的39.07cm降低了68.60%。其他环境光干扰下的轨迹对应的数据中也得到类似改善。
可以理解,本申请实施例提供的定位模型训练方法训练出的定位模型相比于传统定位方法,可以有效抑制环境光和噪声的干扰,定位精度更高。
为了解决上述可见光定位技术在不同标定环境光下的朗伯模型无法通用的问题,本申请实施例提供了一种用于定位的模型训练装置。如图16所示,用于定位的模型训练装置1600包括:数据获取模块1601和模型训练模块1602。
其中,数据获取模块1601,用于获取在多个位置处采集的各位置处不同环境光下的多个可见光数据,其中每个可见光数据包括来自不同可见光光源的光数据。
其中,模型训练模块1602,用于将各可见光数据、各可见光数据对应的位置信息以及各可见光数据对应的环境光的环境光标识作为训练数据样本,输入第一神经网络模型,以对第一神经网络模型进行训练,得到第二神经网络模型。
可以理解,在一些实施例中,上述数据获取模块1601相当于上述图9中离线训练过程的信号接收模块(离线)910,模型训练模块1602相当于图9中离线训练过程的权重学习模块930、干扰抑制模块940以及误差计算模块950。
为了解决上述可见光定位技术在不同标定环境光下的朗伯模型无法通用的问题,本申请实施例提供了一种定位装置。如图17所示,定位装置1700包括:数据采集模块1701和定位模块1702。
其中,数据采集模块1701,用于获取采集到的实测的可见光数据。
其中,定位模块1702,用于将实测的可见光数据输入上述图16中用于定位的模型训练装置1600训练得到的第二神经网络模型,输出实测的可见光数据对应的预测位置。
下面结合图18,对本申请实施例中的电子设备的硬件结构进行说明。
图18所示为应用本申请实施例提供的方法的电子设备100的硬件结构框图。电子设备100可以用于运行本申请实施例提供的定位方法中相关的指令。在图18中,相似的部件具有同样的附图标记。如图18所示,电子设备100可以包括处理器110、电源模块140、存储器180、摄像头170、移动通信模块130、无线通信模块120、传感器模块190、音频模块150、接口模块160、按键101以及显示屏102 等。在本申请实施例中,存储器180可以用于存储本申请实施例提供的页面显示方法中相关的指令以及处理器执行指令时生成的中间数据文件。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
可以理解,本申请实施例中的电子设备可以为包括PD的手机、平板电脑(portable android device,PAD)、个人数字处理(personal digital assistant,PDA)、具有无线通信功能的手持设备、计算设备、车载设备或可穿戴设备,虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶中的无线终端、远程医疗(remote medical)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等设备,还可以为包括PD和处理器的片上集成芯片。本申请实施例中对电子设备的形态不做具体限定。
处理器110可以包括一个或多个处理单元,例如,可以包括中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、数字信号处理器DSP、微处理器(Micro-programmed Control Unit,MCU)、人工智能(Artificial Intelligence,AI)处理器或可编程逻辑器件(Field Programmable Gate Array,FPGA)等的处理模块或处理电路。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。处理器110中可以设置存储单元,用于存储指令和数据。在一些实施例中,处理器110中的存储单元为高速缓冲存储器180。其中,处理器可以用于执行本申请实施例提供的图7或图9中的相关的方法指令。
电源模块140可以包括电源、电源管理部件等。电源可以为电池。电源管理部件用于管理电源的充电和电源向其他模块的供电。在一些实施例中,电源管理部件包括充电管理模块和电源管理模块。充电管理模块用于从充电器接收充电输入;电源管理模块用于连接电源,充电管理模块与处理器110。电源管理模块接收电源和/或充电管理模块的输入,为处理器110,显示屏102,摄像头170,及无线通信模块120等供电。
移动通信模块130可以包括但不限于天线、功率放大器、滤波器、LNA(Low noise amplify,低噪声放大器)等。移动通信模块130可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块130可以由天线接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块130还可以对经调制解调处理器调制后的信号放大,经天线转为电磁波辐射出去。在一些实施例中,移动通信模块130的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块130至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),无线局域网(wireless local area networks,WLAN),近距离无线通信技术(near field communication,NFC),调频(frequency modulation,FM)和/或field communication,NFC),红外技术(infrared,IR)技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite  system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
无线通信模块120可以包括天线,并经由天线实现对电磁波的收发。无线通信模块120可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。电子设备100可以通过无线通信技术与网络以及其他设备进行通信。
在一些实施例中,电子设备100的移动通信模块130和无线通信模块120也可以位于同一模块中。
显示屏102用于显示人机交互界面、图像、视频等。显示屏102包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。
传感器模块190可以包括接近光传感器、压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。
音频模块150用于将数字音频信息转换成模拟音频信号输出,或者将模拟音频输入转换为数字音频信号。音频模块150还可以用于对音频信号编码和解码。在一些实施例中,音频模块150可以设置于处理器110中,或将音频模块150的部分功能模块设置于处理器110中。在一些实施例中,音频模块150可以包括扬声器、听筒、麦克风以及耳机接口。
摄像头170用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件把光信号转换成电信号,之后将电信号传递给ISP(Image Signal Processing,图像信号处理)转换成数字图像信号。电子设备100可以通过ISP,摄像头170,视频编解码器,GPU(Graphic Processing Unit,图形处理器),显示屏102以及应用处理器等实现拍摄功能。
接口模块160包括外部存储器接口、通用串行总线(universal serial bus,USB)接口及用户标识模块(subscriber identification module,SIM)卡接口等。其中外部存储器接口可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口与处理器110通信,实现数据存储功能。通用串行总线接口用于电子设备100和其他电子设备进行通信。用户标识模块卡接口用于与安装至电子设备10010的SIM卡进行通信,例如读取SIM卡中存储的电话号码,或将电话号码写入SIM卡中。
在一些实施例中,电子设备100还包括按键101、马达以及指示器等。其中,按键101可以包括音量键、开/关机键等。马达用于使电子设备100产生振动效果,例如在用户的电子设备100被呼叫的时候产生振动,以提示用户接听电子设备100来电。指示器可以包括激光指示器、射频指示器、LED指示器等。
在说明书对“一个实施例”或“实施例”的引用意指结合实施例所描述的具体特征、结构或特性被包括在根据本申请公开的至少一个范例实施方案或技术中。说明书中的各个地方的短语“在一个实施例中”的出现不一定全部指代同一个实施例。
本申请公开还涉及用于执行文本中的操作装置。该装置可以专门处于所要求的目的而构造或者其可以包括被存储在计算机中的计算机程序选择性地激活或者重新配置的通用计算机。这样的计算机程序可 以被存储在计算机可读介质中,诸如,但不限于任何类型的盘,包括软盘、光盘、CD-ROM、磁光盘、只读存储器(ROM)、随机存取存储器(RAM)、EPROM、EEPROM、磁或光卡、专用集成电路(ASIC)或者适于存储电子指令的任何类型的介质,并且每个可以被耦合到计算机系统总线。此外,说明书中所提到的计算机可以包括单个处理器或者可以是采用针对增加的计算能力的多个处理器涉及的架构。
另外,在本说明书所使用的语言已经主要被选择用于可读性和指导性的目的并且可能未被选择为描绘或限制所公开的主题。因此,本申请公开旨在说明而非限制本文所讨论的概念的范围。

Claims (16)

  1. 一种用于定位的模型的训练方法,其特征在于,包括:
    获取在多个位置处采集的各位置处不同环境光下的多个可见光数据,其中每个可见光数据包括来自不同可见光光源的光数据;
    将各所述可见光数据、各所述可见光数据对应的位置信息以及各所述可见光数据对应的环境光的环境光标识作为训练数据样本,输入第一神经网络模型,以对所述第一神经网络模型进行训练,得到第二神经网络模型。
  2. 根据权利要求1所述的用于定位的模型的训练方法,其特征在于,所述可见光数据对应的位置信息是以定位场景中预设位置为空间坐标系原点,得到的所述可见光数据的位置的坐标。
  3. 根据权利要求1所述的用于定位的模型的训练方法,其特征在于,所述获取在多个位置处采集的各位置处不同环境光下的多个可见光数据,包括:
    获取预设环境光下在多个位置采集到的各位置处的可见光数据;
    对所述可见光数据进行数据增强,得到各所述位置处不同环境光下的所述多个可见光数据。
  4. 根据权利要求1至3任一项所述的用于定位的模型的训练方法,其特征在于,所述将各所述可见光数据、各所述可见光数据对应的位置信息以及各所述可见光数据对应的环境光的环境光标识作为训练数据样本,包括:
    将所述可见光数据中对应于所述不同可见光光源的光数据进行分离,得到各所述可见光数据对应的第一RSS数据样本,所述第一RSS数据样本中包括对应不同可见光光源的多个第一RSS数据;
    将各所述第一RSS数据样本、各所述第一RSS数据样本对应的位置信息以及各所述第一RSS数据样本对应的环境光标识作为训练数据样本。
  5. 根据权利要求4所述的用于定位的模型的训练方法,其特征在于,所述第一神经网络模型包括第一神经网络子模块和第二神经网络子模块;
    所述将各所述可见光数据、各所述可见光数据对应的位置信息以及各所述可见光数据对应的环境光的环境光标识作为训练数据样本,输入第一神经网络模型,包括:
    将各所述第一RSS数据样本、各所述第一RSS数据样本对应的位置信息以及各所述第一RSS数据样本对应的环境光标识作为训练数据样本,输入所述第一神经网络子模块,其中,所述第一神经网络子模块以任一位置的任一环境光下的来自不同可见光光源的RSS数据为输入,以各RSS数据对应的权重为输出;
    基于所述第一神经网络子模块输出的所述第一RSS数据样本中各所述RSS数据对应的权重,对所述第一RSS数据样本中的RSS数据进行加权,得到第二RSS数据样本;
    将各所述第二RSS数据样本、各所述第二RSS数据样本对应的位置信息以及各所述第二RSS数据样本对应的环境光标识,输入第二神经网络子模块。
  6. 根据权利要求5所述的用于定位的模型的训练方法,其特征在于,所述第一神经网络子模块包括注意力机制。
  7. 根据权利要求5所述的用于定位的模型的训练方法,其特征在于,所述第一神经网络子模块为带注意力机制的多层感知机。
  8. 根据权利要求5所述的用于定位的模型的训练方法,其特征在于,所述第二神经网络子模块包括长短期记忆网络层和全连接层。
  9. 根据权利要求1所述的用于定位的模型的训练方法,其特征在于,还包括:
    基于所述第二神经网络模型输出的预测定位数据以及所述预测定位数据对应的真实位置数据,对所述第二神经网络模型的参数进行优化。
  10. 根据权利要求9所述的用于定位的模型的训练方法,其特征在于,所述对所述第二神经网络模型的参数进行优化包括:
    基于所述预测定位数据以及所述真实位置数据,利用损失函数确定所述预测定位数据与所述真实位置数据之间的误差;
    基于所述误差对所述第二神经网络模型的参数进行优化。
  11. 根据权利要求10所述的用于定位的模型的训练方法,其特征在于,所述损失函数通过如下公式表示:
    Figure PCTCN2022124418-appb-100001
    其中,
    β表征了正则化项的正则化调节系数;
    N表征了可见光光光源的数量;
    d j表征了基于朗伯模型计算出的可见光数据对应的位置与第j个可见光光源之间的距离;
    RSS j表征了第j个可见光光源对应的光数据;
    ε表征了信道噪声,并且所述信道噪声为高斯噪声。
  12. 根据权利要求1至3任一项所示的用于定位的模型的训练方法,其特征在于,所述多个位置中的至少部分位置对应于同一运动轨迹。
  13. 一种定位方法,其特征在于,包括:
    获取采集到的实测的可见光数据;
    将所述实测的可见光数据输入权利要求1至12任一项所述的用于定位的模型的训练方法训练得到的所述第二神经网络模型,输出所述实测的可见光数据对应的预测位置。
  14. 一种电子设备,其特征在于,包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个程序,当所述一个或者多个程序被所述一个或多个处理器执行时,使得所述电子设备执行权利要求1至12中任一项所述的用于定位的模型的训练方法或权利要求13所述的定位方法。
  15. 一种计算机可读存储介质,其特征在于,所述存储介质上存储有指令,所述指令在计算机上执行时使所述计算机执行权利要求1至12中任一项所述的用于定位的模型的训练方法或权利要求13所述的定位方法。
  16. 一种计算机程序产品,其特征在于,所述计算机程序产品包括指令,该指令在执行时使计算机执行权利要求1至12中任一项所述的用于定位的模型的训练方法或权利要求13所述的定位方法。
PCT/CN2022/124418 2022-10-10 2022-10-10 用于定位的模型的训练方法、定位方法、电子设备及介质 WO2024077449A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/124418 WO2024077449A1 (zh) 2022-10-10 2022-10-10 用于定位的模型的训练方法、定位方法、电子设备及介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/124418 WO2024077449A1 (zh) 2022-10-10 2022-10-10 用于定位的模型的训练方法、定位方法、电子设备及介质

Publications (1)

Publication Number Publication Date
WO2024077449A1 true WO2024077449A1 (zh) 2024-04-18

Family

ID=90668504

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/124418 WO2024077449A1 (zh) 2022-10-10 2022-10-10 用于定位的模型的训练方法、定位方法、电子设备及介质

Country Status (1)

Country Link
WO (1) WO2024077449A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190295265A1 (en) * 2018-03-26 2019-09-26 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method, storage medium and electronic device for generating environment model
CN111458681A (zh) * 2020-03-18 2020-07-28 华中科技大学 一种基于双阶段神经网络的可见光定位方法和系统
CN111818449A (zh) * 2020-06-15 2020-10-23 华南师范大学 一种基于改进的人工神经网络的可见光室内定位方法
CN112468954A (zh) * 2020-11-03 2021-03-09 西安工业大学 一种基于神经网络的可见光室内立体定位方法
CN112600618A (zh) * 2020-12-07 2021-04-02 重庆邮电大学 一种基于注意力机制的可见光信号均衡系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190295265A1 (en) * 2018-03-26 2019-09-26 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method, storage medium and electronic device for generating environment model
CN111458681A (zh) * 2020-03-18 2020-07-28 华中科技大学 一种基于双阶段神经网络的可见光定位方法和系统
CN111818449A (zh) * 2020-06-15 2020-10-23 华南师范大学 一种基于改进的人工神经网络的可见光室内定位方法
CN112468954A (zh) * 2020-11-03 2021-03-09 西安工业大学 一种基于神经网络的可见光室内立体定位方法
CN112600618A (zh) * 2020-12-07 2021-04-02 重庆邮电大学 一种基于注意力机制的可见光信号均衡系统及方法

Similar Documents

Publication Publication Date Title
US20230101962A1 (en) Machine learning techniques for precise position determination
CN109327797B (zh) 基于WiFi网络信号的移动机器人室内定位系统
CN113064117B (zh) 一种基于深度学习的辐射源定位方法及装置
KR20230169969A (ko) 라디오 주파수 감지 라벨들에 의한 수동 포지셔닝
CN112365604A (zh) 基于语义分割和slam的ar设备景深信息应用方法
WO2018233692A1 (zh) 一种定位方法、存储介质及定位系统
Chen et al. A wifi indoor localization method based on dilated cnn and support vector regression
Zhu et al. Intelligent fingerprint-based localization scheme using CSI images for internet of things
CN110072192B (zh) 一种智能手机WiFi室内定位方法
Dai et al. Deep-Learning-Based Scenario Recognition With GNSS Measurements on Smartphones
Shen et al. Smart lighting control system based on fusion of monocular depth estimation and multi-object detection
WO2024077449A1 (zh) 用于定位的模型的训练方法、定位方法、电子设备及介质
CN108322889A (zh) 一种多源数据融合室内定位的方法、存储介质及智能终端
Yu et al. Home monitoring system based on indoor service robot and wireless sensor network
Kerdjidj et al. Uncovering the potential of indoor localization: Role of deep and transfer learning
Su et al. Four-dimensional indoor visible light positioning: A deep-learning-based perspective
Tang et al. A sequential-multi-decision scheme for WiFi localization using vision-based refinement
Lu et al. ONavi: Data-driven based multi-sensor fusion positioning system in indoor environments
Strecker et al. MR Object Identification and Interaction: Fusing Object Situation Information from Heterogeneous Sources
Liu et al. Indoor Fingerprinting Positioning System Using Deep Learning with Data Augmentation.
US20230354258A1 (en) Data processing method and apparatus
Junoh et al. Augmentation of Fingerprints for Indoor BLE Localization Using Conditional GANs
Tiku Secure, accurate, real-time, and heterogeneity-resilient indoor localization with smartphones
WO2023005865A1 (zh) 一种室内地图构建方法以及相关装置
CN115236591B (zh) 一种基于机器学习方式的室内可见光定位方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22961644

Country of ref document: EP

Kind code of ref document: A1