A magnetic field mapping method and device based on implicit representation
By converting low-resolution magnetic field images into 2D feature maps and using an MLP network to predict the RGB values of high-resolution magnetic field images, the problem of time-consuming and inefficient construction of dense magnetic field maps is solved, achieving efficient and accurate magnetic field map generation, which is suitable for global localization of mobile robots.
Patent Information
- Application Number
- CN202411037335.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Existing technologies are time-consuming and inefficient in constructing dense magnetic field maps. Traditional methods fail to effectively utilize the inherent properties of magnetic fields, and deep learning methods lack training data, resulting in low efficiency.
A magnetic field mapping method based on implicit representation is adopted to convert low-resolution magnetic field images into 2D feature maps. The decoding function fθ is used to predict the RGB values of high-resolution magnetic field images. The high-resolution magnetic field map is generated through an MLP network. The 2D feature map and the decoding function are used to implicitly represent continuous magnetic field images.
It achieves efficient construction of high-resolution magnetic field maps, improves positioning accuracy and efficiency, solves the time-consuming problem in traditional methods, and exhibits excellent error performance under different grid resolutions.
Smart Images

Figure CN119006290B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of mobile robot perception technology, and more specifically, relates to a magnetic field mapping method and device based on implicit expression. Background Technology
[0002] Accurate and reliable global localization (GNU) is crucial for realizing various mobile robot functions, such as mapping, navigation, and intelligence. Accurate GNU remains a challenging problem for mobile robots operating in GPS-restricted, geometrically repetitive environments (such as service robots in offices and hotel corridors, security robots in parking lots, and industrial robots in warehouses). These geometrically repetitive environments often lack unique geometric features due to their structural similarities. Estimating the robot's initial pose (i.e., initialization) or restoring its state becomes difficult when local localization fails, or when the robot becomes disoriented or abducted. Magnetic fields exhibit distinct characteristics in different indoor locations and are unaffected by the typical repetitive geometry in such environments. Therefore, they can serve as an alternative to GPS signals for localization and navigation in indoor environments. Using magnetic field information for localization is an effective strategy for robots facing the challenges of repetitive indoor environments. Previous research has validated the feasibility of using magnetic fields for indoor localization, demonstrating the stability of magnetic fields over long periods. Typically, the construction of magnetic field-based indoor localization systems requires building grid-based magnetic field maps, the quality of which is critical to the accuracy of localization.
[0003] Due to the limited measurement range of magnetometers and the vast operating environment of robots, it is impossible for robots to collect magnetic field data at every location. Constructing large-scale dense magnetic field maps presents a significant challenge due to the need for intensive data collection and the limitations of current sensor measurement ranges. Each data point in a high-resolution magnetic field map (e.g., a magnetic field map with a resolution of 1 cm) requires individual measurement of magnetic field strength at precise intervals along the x and y axes. This requirement necessitates thousands of measurements over a considerable area, a labor-intensive and time-consuming process. Therefore, modeling the magnetic field and constructing a dense map based on the collected sparse magnetic field data is crucial. Traditionally, methods such as linear interpolation have been used to construct complete magnetic field maps. However, linear interpolation methods do not consider the inherent characteristics of the magnetic field. Gaussian process regression (GPR) methods have also been used, modeling the three axes of the magnetic field using individual Gaussian processes, but this method does not consider the relationship between magnetic field strengths along different axes at the same location.
[0004] In recent years, learning-based methods have become increasingly popular for predicting the surrounding environment. However, collecting comprehensive indoor magnetic field data is both time-consuming and labor-intensive. This complexity makes deep learning methods for magnetic field mapping inefficient, as they require large amounts of training data. Furthermore, the lack of open-source magnetic field datasets with precise measurement locations further complicates training deep learning networks to predict magnetic fields. Summary of the Invention
[0005] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides a magnetic field mapping method and device based on implicit expression, which aims to solve the problem of time-consuming and inefficient construction of existing dense magnetic field maps.
[0006] To achieve the above objectives, according to one aspect of the present invention, a magnetic field mapping method based on implicit expression is provided, the method comprising the following steps:
[0007] S1, convert the low-resolution magnetic field map into a low-resolution magnetic field image;
[0008] S2, encoder The obtained low-resolution magnetic field image is mapped to a 2D feature map;
[0009] S3, input the center coordinates of each pixel in the obtained 2D feature map and high-resolution magnetic field image into the decoding function f. θ Decoding function f θ Predict the RGB value of each pixel location in a high-resolution image; where the decoding function f is used. θ To implicitly represent the continuous magnetic field image;
[0010] S4, a high-resolution magnetic field image is generated based on the RGB values of each pixel position in the high-resolution magnetic field image, and then a high-resolution magnetic field map is obtained based on the high-resolution magnetic field image; wherein, the resolution of the high-resolution magnetic field image is greater than the resolution of the low-resolution magnetic field image, and the resolution of the high-resolution magnetic field map is greater than the resolution of the low-resolution magnetic field map.
[0011] Furthermore, the magnetic field map is represented using a raster graph. The size of each grid cell in the raster graph is defined by the resolution of the magnetic field map, which is represented by the side length r of each grid cell. The overall size of the magnetic field map is: length L x and width L y Each grid cell in the magnetic field map contains specific information: the grid center coordinates (x, y) and the corresponding magnetic field strength component B. x B y B z The magnetic field database is represented in the form of magnetic field images, which are constructed at a resolution of H×W pixels, where H and W are directly derived from the map size L. xL y The formula for calculating the value is derived from the resolution r:
[0012]
[0013] Among the symbols This represents the floor function.
[0014] Furthermore, the pixel coordinates (p) in the magnetic field image x ,p y The coordinates (x, y) are mapped from the grid coordinates (x, y) in the magnetic field map, and the corresponding formula is:
[0015]
[0016] The following normalization formula is used to normalize the magnetic field strength B. x B y B z Standardize to fit the RGB color model range (0-255):
[0017]
[0018] Among them B x,min B x,max B y,min B y,max B z,min and B z,max It is B on the entire magnetic field map. x B y B z The minimum and maximum values; the obtained RGB values are assigned to the corresponding pixel positions in the magnetic field image (p x ,p y ).
[0019] Furthermore, each magnetic field image is represented as B. (i) Pixel data in low-resolution magnetic field images are mapped to two-dimensional feature maps. All magnetic field images share a single decoding function f. θ Decoding function f θ For MLP networks, the formula used in the decoding process is:
[0020] s = f θ (z,x);
[0021] Where z is a vector, x∈X is a two-dimensional coordinate in the continuous magnetic field image domain, and s∈S is the predicted signal, which is the RGB value representing the magnetic field strength.
[0022] Furthermore, the eigenvector z of the two-dimensional feature map M(i) is simply called the hidden code. For the continuous magnetic field image B(i), the coordinate x qThe RGB value is:
[0023] B (i) (x q )=f θ (z * ,x q -v * (1)
[0024] Where z * It is the distance x q The latest hidden code, in M (i) Chinese v * It is the hidden code z * Coordinates in the magnetic field image domain.
[0025] Furthermore, using the decoding function f θ Representing continuous magnetic field images as two-dimensional feature maps Conceptually defined as a hidden code array uniformly distributed over a 2D spatial region, the two-dimensional feature map M (i) Each hidden code z in * They all contain information from a local segment of a continuous magnetic field image.
[0026] Furthermore, formula (1) is optimized as follows:
[0027]
[0028] in These are the nearest hidden codes in the top-left, top-right, bottom-left, and bottom-right subspaces, respectively. yes The coordinates of S t It is x q and The area of the rectangle between, where t′ is the diagonal of t, and the weight is S = ∑ t S t Normalize.
[0029] The present invention also provides a magnetic field mapping system based on implicit expression, the system including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the magnetic field mapping method based on implicit expression as described above.
[0030] The present invention also provides a computer-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the magnetic field mapping method based on implicit expression as described above.
[0031] The present invention also provides an application of the magnetic field mapping method based on implicit expression as described above in the global localization of mobile robots.
[0032] In summary, compared with the prior art, the magnetic field mapping method and device based on implicit expression provided by this invention have the following beneficial effects:
[0033] 1. This invention uses coordinates x. hr Querying on a 2D feature map, x hr It represents the center coordinates of each pixel in a high-resolution magnetic field image; then the function f θ Predict the signal value s for each coordinate based on the 2D feature map. hr (Representing the RGB value of magnetic field strength), a high-resolution magnetic field image is generated by predicting the RGB value of each pixel position in a high-resolution image. The generated high-resolution magnetic field image is then converted into a high-resolution magnetic field map, realizing the mapping of the magnetic field map. It provides a continuous expression and can be effectively extended to unseen locations when in use, while saving time.
[0034] 2. Low-resolution magnetic field images are converted into high-resolution magnetic field maps using two-dimensional feature maps and decoding functions. A method for converting continuous magnetic field images using B is also proposed. (i) coordinates x q The formula for calculating RGB values.
[0035] 3. Equation (1) is optimized into Equation (2), which solves the problem when x q When moving in a two-dimensional domain, the implicit code z * The problem of sudden switching from one hidden code to another (i.e., the recent choice of hidden code changes) is addressed by allowing a local segment represented by a single hidden code (a feature in the feature map) to overlap with its neighboring segments. This overlap ensures that each specific coordinate is associated with four different hidden codes, each of which independently contributes to the signal prediction at that location. At the same time, this approach helps to achieve a smooth and continuous transition at changing coordinates, thereby ensuring continuous prediction output across spatial domains. Attached Figure Description
[0036] Figure 1 This is a schematic diagram illustrating the continuous representation of magnetic field images according to the present invention;
[0037] Figure 2 This is a schematic diagram of the high-resolution magnetic field image generation involved in the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0039] Please see Figure 1 and Figure 2 This invention provides a magnetic field mapping method based on implicit expression, which mainly includes the following steps:
[0040] S1 converts the low-resolution magnetic field map into a low-resolution magnetic field image.
[0041] Typically, a magnetic field map used for robot localization consists of two parts: two-dimensional position coordinates (x, y) and a three-dimensional magnetic field vector B. The magnetic field vector B consists of three components: B0... x B y and B z , representing the intensity in the X, Y, and Z directions, respectively. The magnetic field map is represented using a raster graph. The size of each grid cell in the raster graph is defined by the resolution of the magnetic field map, which is represented by the side length r of each cell; the smaller the r, the higher the quality of the magnetic field map. The overall dimensions of the magnetic field map are: length L x and width L y Each grid cell in the magnetic field map contains specific information: the grid center coordinates (x, y) and the corresponding magnetic field strength component B. x B y B z .
[0042] Generally, magnetic field strength varies continuously in space and has a unique spatial distribution. Color information in images also has spatial distribution characteristics; each pixel has a different RGB value, and together they form a color image that exhibits a certain spatial distribution pattern, which helps in target localization and identification. Furthermore, both magnetic field strength and color information contain three components. Therefore, the magnetic field database is represented in the form of a magnetic field image. The resulting magnetic field image is constructed with a resolution of H×W pixels, where H and W are directly derived from the map size L. x L y The formula for calculating the value is derived from the resolution r:
[0043]
[0044] Among the symbols This represents the floor function, which rounds a real number down to the nearest integer. Each pixel in the magnetic field image corresponds to a cell in the magnetic field map. The pixel coordinates in the magnetic field image (p...)x ,p y The coordinates (x, y) are mapped from the grid coordinates (x, y) in the magnetic field map, and the corresponding formula is:
[0045]
[0046] The following normalization formula is used to normalize the magnetic field strength B. x B y B z Standardize to fit the RGB color model range (0-255):
[0047]
[0048] Among them B x,min B x,max B y,min B y,max B z,min and B z,max It is B on the entire magnetic field map. x B y B z The minimum and maximum values are then determined. The resulting RGB values are then assigned to the corresponding pixel positions (p...) in the magnetic field image. x ,p y This method effectively converts magnetic field data into image format. It can also be used to process magnetic field maps into magnetic field images, establishing a correspondence between magnetic field maps and magnetic field images.
[0049] S2, encoder The obtained low-resolution magnetic field image is mapped to a 2D feature map.
[0050] Using a neural network (decoding function f) θ This is used to predict the RGB values (representing magnetic field strength) of the center coordinates of each pixel in a high-resolution magnetic field image, thus serving as an implicit representation of the continuous magnetic field image. The decoding function f is used... θ To implicitly represent continuous magnetic field images; each magnetic field image is represented as B (i) Pixel data in low-resolution magnetic field images are mapped to two-dimensional feature maps. All magnetic field images share a single decoding function f. θ Decoding function f θ For MLP networks, the formula used in the decoding process is:
[0051] s = f θ (z,x);
[0052] Where z is a vector, x∈X are two-dimensional coordinates in the continuous magnetic field image domain, and s∈S is the predicted signal, i.e., the RGB values representing the magnetic field strength. With the already defined decoding function f...θ Each vector z can be viewed as a function f that maps coordinates to RGB values. θ (z,·):X→S. This implementation assumes that the feature vector z (referred to as the implicit code) of the two-dimensional feature map M(i) is uniformly distributed in the two-dimensional space of the continuous magnetic field image B(i) (e.g., ...). Figure 1 As shown in the diagram, a two-dimensional coordinate is assigned to each hidden code z. For a continuous magnetic field image B(i), the coordinate x... q The RGB value is:
[0053] B (i) (x q )=f θ (z * ,x q -v * (1)
[0054] Where z * It is the distance x q The latest hidden code, in M (i) Chinese v * It is the hidden code z * Coordinates in the magnetic field image domain. Figure 1 For example, It is the current coordinate x q The hidden code, v * It is a hidden code Image domain coordinates.
[0055] Using the decoding function f θ Representing continuous magnetic field images as two-dimensional feature maps Conceptually represented as a hidden code array uniformly distributed over a 2D spatial region. Two-dimensional feature map M (i) Each hidden code z in * Each contains a local segment of information from a continuous magnetic field image; the specific function of this hidden code is to predict the RGB values of a set of defined coordinates that are close to it.
[0056] Because x q The predicted signal value at point M is obtained by querying the two-dimensional feature map M. (i) The latest hidden code z in China * The information is obtained when x q When moving in a two-dimensional domain, the implicit code z * The choice can suddenly switch from one to another (i.e., the most recent choice of implicit code changes). For example, when x q and Figure 1 This situation occurs when the dashed lines intersect. Around those coordinates that intersect the dashed lines, different implicit codes will be used to predict the signal values of two infinitely close coordinates, which is not continuous enough.
[0057] To solve this problem, such as Figure 1 As shown, formula (1) is extended to:
[0058]
[0059] in These are the nearest hidden codes in the top-left, top-right, bottom-left, and bottom-right subspaces, respectively. yes The coordinates of S t It is x q and The area of the rectangle between, where t′ is the diagonal of t (i.e., 00 to 11, 10 to 01), weighted by S = ∑ t S t Normalize.
[0060] This invention allows local segments represented by a single latent code (a feature within a feature map) to overlap with their neighboring segments. This overlap ensures that each specific coordinate is associated with four distinct latent codes, each contributing independently to the signal prediction at that location. These four predictions are then integrated through a consensus mechanism employing a voting system weighted by standardized confidence scores. The confidence score is calculated proportionally to the area of the rectangle formed between the query point and the corresponding point on the diagonal of the nearest latent code; its value increases as the query coordinate gets closer to the latent code. This method helps achieve a smooth and continuous transition at changing coordinates, such as... Figure 1 As shown by the dashed line, this ensures continuous prediction output across spatial domains.
[0061] S3, input the center coordinates of each pixel in the obtained 2D feature map and high-resolution magnetic field image into the decoding function f. θ Decoding function f θ Predict the RGB value of each pixel location in a high-resolution image; where the decoding function f is used. θ To implicitly represent the continuous magnetic field image.
[0062] Based on the proposed decoding function f θ A high-resolution magnetic field image can be rendered from a two-dimensional feature map represented by a low-resolution magnetic field image. For example... Figure 2 As shown, the input low-resolution magnetic field image is generated from a magnetic field map with a sparse grid. This implementation uses ESDR as the encoder. encoder The input low-resolution magnetic field image is mapped to a 2D feature map, which is the same size as the input low-resolution magnetic field image; then the coordinates x... hr Querying on a 2D feature map, x hr It represents the center coordinates of each pixel in a high-resolution magnetic field image; then the function fθ Predict the signal value s for each coordinate based on the 2D feature map. hr (Representing the RGB values of the magnetic field strength). Decoding function f θ It is a 5-layer MLP with ReLU activation layers and 256 hidden dimensions. It generates a high-resolution magnetic field image by predicting the RGB values of each pixel location in a high-resolution image, and then converts the generated high-resolution magnetic field image into a high-resolution magnetic field map to achieve magnetic field mapping.
[0063] S4. A high-resolution magnetic field image is generated based on the RGB values of each pixel position in the high-resolution magnetic field image, and then a high-resolution magnetic field map is obtained based on the high-resolution magnetic field image; wherein, the resolution of the high-resolution magnetic field image is greater than the resolution of the low-resolution magnetic field image, and the two are relative; similarly, the resolution of the high-resolution magnetic field map is greater than the resolution of the low-resolution magnetic field map.
[0064] The performance of three different magnetic field mapping methods (bilinear interpolation (BI), Gaussian process regression (GPR), and the method proposed in this invention) was evaluated on three datasets with different grid resolutions (20 cm, 15 cm, and 5 cm). Evaluation metrics included mean error (Ave), mean squared error (MSE), and error range (maximum and minimum values).
[0065] For 20cm grid mapping, compared with BI (Ave = 0.0324G, RMSE = 0.0477G) and GPR (Ave = 0.1178G, RMSE = 0.1355G), the method proposed in this invention shows significantly lower average error (Ave = 0.031G) and RMSE (0.0443G). Similarly, the maximum error recorded by the method proposed in this invention (maximum value = 0.2136G) is significantly smaller than the error observed using GPR (maximum value = 0.5036G).
[0066] In a 15cm mesh scene, the method proposed in this invention outperforms other methods, exhibiting the lowest RMSE (0.0377G) and a highly competitive average error (Ave = 0.0247G), comparable to BI (Ave = 0.0238G, RMSE = 0.0443G) and significantly superior to GPR (Ave = 0.115G, RMSE = 0.0169G). The maximum error of the proposed method is 0.23G, significantly lower than BI (0.1764G) and GPR (0.48G), demonstrating robust performance even at finer mesh resolutions.
[0067] The most demanding 10cm grid mapping further validated the effectiveness of the proposed method. Compared to BI (mean = 0.0144G, RMSE = 0.0282G) and GPR (mean = 0.1094G, RMSE = 0.1208G), the proposed method achieved the lowest RMSE (0.0264G) and a very competitive mean error (mean = 0.0152G). Notably, the proposed method also recorded the smallest maximum error (maximum = 0.2154G), highlighting its accuracy in processing high-resolution data.
[0068] The present invention also provides a magnetic field mapping system based on implicit expression, the system including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the magnetic field mapping method based on implicit expression as described above.
[0069] The present invention also provides a computer-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the magnetic field mapping method based on implicit expression as described above.
[0070] The present invention also provides an application of the magnetic field mapping method based on implicit expression as described above in the global localization of mobile robots.
[0071] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A magnetic field mapping method based on implicit expression, characterized in that, The method includes the following steps: S1, convert the low-resolution magnetic field map into a low-resolution magnetic field image; S2, encoder The obtained low-resolution magnetic field image is mapped to a 2D feature map; S3. Input the center coordinates of each pixel in the obtained 2D feature map and high-resolution magnetic field image into the decoding function. Decoding function Predict the RGB value of each pixel location in a high-resolution image; where a decoding function is used. To implicitly represent continuous magnetic field images; S4, a high-resolution magnetic field image is generated based on the RGB values of each pixel position in the high-resolution magnetic field image, and then a high-resolution magnetic field map is obtained based on the high-resolution magnetic field image; wherein, the resolution of the high-resolution magnetic field image is greater than the resolution of the low-resolution magnetic field image, and the resolution of the high-resolution magnetic field map is greater than the resolution of the low-resolution magnetic field map.
2. The magnetic field mapping method based on implicit expression as described in claim 1, characterized in that: The magnetic field map is represented using a raster graph. The size of each grid cell in the raster graph is defined by the resolution of the magnetic field map, which is represented by the side length r of each cell. The overall size of the magnetic field map is: length and width Each grid cell in the magnetic field map contains specific information: the grid center coordinates. and the corresponding magnetic field strength components , , The magnetic field database is represented in the form of magnetic field images, and the obtained magnetic field images are... The resolution of pixels is constructed, where and Directly from map size , The formula for calculating the value is derived from the resolution r: Among the symbols This represents the floor function.
3. The magnetic field mapping method based on implicit expression as described in claim 2, characterized in that: Pixel coordinates in a magnetic field image Grid coordinates in the magnetic field map The mapping yields the following formula: ; The magnetic field strength is normalized using the following formula. , , Standardize to fit the RGB color model range (0-255): ; ; ; in , , , , and It is on the entire magnetic field map , , The minimum and maximum values are determined; the resulting RGB values are then assigned to the corresponding pixel positions in the magnetic field image. .
4. The magnetic field mapping method based on implicit expression as described in claim 1, characterized in that: Each magnetic field image is represented as Pixel data in low-resolution magnetic field images are mapped to two-dimensional feature maps. All magnetic field images share a single decoding function. Decoding function For MLP networks, the formula used in the decoding process is: ; in It is a vector. These are two-dimensional coordinates in the continuous magnetic field image domain. It is a predicted signal, which is the RGB value representing the magnetic field strength.
5. The magnetic field mapping method based on implicit expression as described in claim 4, characterized in that: Two-dimensional feature map eigenvectors Simply put, it is a hidden code for continuous magnetic field images. ,coordinate The RGB value is: ;(1) in It is distance Recent cryptanalysis, in middle It is a hidden code Coordinates in the magnetic field image domain.
6. The magnetic field mapping method based on implicit expression as described in claim 5, characterized in that: Using decoding function Representing continuous magnetic field images as two-dimensional feature maps Conceptually defined as a hidden code array uniformly distributed over a 2D spatial region, a two-dimensional feature map. Each hidden code in They all contain information from a local segment of a continuous magnetic field image.
7. The magnetic field mapping method based on implicit expression as described in claim 5, characterized in that: Formula (1) can be optimized as follows: (2) in These are the nearest hidden codes in the top-left, top-right, bottom-left, and bottom-right subspaces, respectively. yes coordinates yes and The area of the rectangle between them, where yes The diagonal, weights through Normalize.
8. A magnetic field mapping system based on implicit expression, characterized in that: The system includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it performs the magnetic field mapping method based on implicit expression as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the magnetic field mapping method based on implicit expression as described in any one of claims 1-7.
10. The application of the magnetic field mapping method based on implicit expression as described in any one of claims 1-7 in the global localization of a mobile robot.