A curve data compression method and system based on autoencoder neural network
Through the curve data compression method based on the autoencoder neural network, the problem of low curve data compression efficiency in the prior art is solved, and high-precision curve data compression and decompression are realized, which is suitable for the transmission and storage of geospatial big data.
Patent Information
- Application Number
- CN202410562022.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-05-08
AI Technical Summary
The prior art is difficult to effectively compress curve data in geospatial big data, especially in network transmission and storage, and traditional compression algorithms cannot approximate the original curve at the allowed threshold.
The curve data compression method based on the autoencoder neural network is adopted to preprocess the vector space data, build the autoencoder compression model, and use closed difference correction to obtain coordinate increments to achieve efficient compression and restoration of the curve data.
It realizes high-precision compression and decompression of curved data, and can maintain data stability and accuracy in curved data of different sizes and complexities, which is suitable for shape reconstruction and data transmission requirements in map space.
Smart Images

Figure CN118428421B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of curve data compression, and in particular to a curve data compression method and system based on an autoencoder neural network. Background Art
[0002] In recent years, the sharing mode of vector spatial data has gradually changed from offline sharing to online publishing on the Internet. The existing Internet bandwidth level is difficult to support the transmission and storage of large-scale and frequently updated geospatial big data in network transmission channels. Effective compression of spatial data is one of the effective ways to reduce network transmission pressure. Conventional file compression is divided into lossless compression and lossy compression. Lossless compression ensures complete recovery of data. RAR is a common file lossless compression format. It uses the RLE (Run-Length Encoding) compression algorithm and the LZSS (Lempel-Ziv-Storer-Szymanski) algorithm. The RLE algorithm achieves compression by replacing consecutive identical data fragments with a single data value and a count indicating the number of repetitions, while LZSS achieves compression by establishing a dictionary and searching for matching strings in the data. Lossy compression cannot completely restore the file, but it can approach the original file within the allowed threshold. The spatial vector data in the field of geographic information is a collection of a series of coordinates, and the compression of this data is generally lossy compression.
[0003] Scale-driven curve simplification aims at map expression and deletes graphic details that cannot be expressed at the current scale. Its classic models include the Douglas-Peucker algorithm, the Li-Openshaw algorithm based on the "minimum visible distance", the VW algorithm based on the triangle area, and the compression algorithm based on bending. In addition, some scholars have combined the DP algorithm with the Li-Openshaw algorithm and improved it. These algorithms actually play a role in data compression, but they generally cannot restore the original curve. Curve fitting based on mathematical functions also has a compression effect on data, such as Bezier curve fitting, Fourier series fitting, wavelet fitting, etc. This method is a continuous approximation of the curve, and a higher order fitting is required to approach the original arc segment.
[0004] In recent years, data-driven deep learning methods have been widely used in shape similarity discrimination, group pattern recognition, and feature selection, merging, and simplification in map space. Such methods can also be divided into classification and reconstruction. Classification is to divide arcs and arc units such as curve nodes and bends into two categories: retention and deletion. For example, Zhou et al. constructed a three-layer BP neural network with six attributes of feature geometry, topology, and theme as input features, and trained the neural network to determine whether the road is retained at a specific scale; Du et al. abstracted 18 features based on adjacent vertices, bends, and global polylines, and used ANN and three designed controllers to determine the selection of points on the curve. Jiang et al. used a deep separable convolutional residual neural network to determine whether a specific bend is retained. Reconstruction is to extract curve features through deep learning and generate new curves at a specific scale. For example, Courtial et al. used a U-Net network to synthesize rasterized mountain roads to generate simplified curves. Du et al. converted vector roads and their synthesis results into multiple raster tiles, learned the cartographic synthesis process of roads through the pix2pix model, and finally generated the synthesized vector roads. Yu et al. constructed a stacked autoencoder, completed multi-level simplification of curves by increasing the number of hidden layers, and used a decoder to reconstruct the curve to achieve multi-scale expression of the curve. Yan et al. simplified curves and buildings through a graph convolutional neural network. These deep learning methods are all shape reconstruction of geographic elements under scale transformation requirements. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a curve data compression method based on an autoencoder neural network, the method comprising:
[0006] Performing normalization operation on the vector space data after preprocessing to obtain preprocessed data, wherein the vector space data is curve data on the map;
[0007] Constructing a compression model of the autoencoder based on the preprocessed data;
[0008] The output of the compression model is corrected using closure error to obtain a coordinate increment, and the arc segment curve in the curve on the map is restored according to the coordinate increment.
[0009] Optionally, the preprocessing of the vector space data specifically includes:
[0010] Performing curve segmentation on the vector space data;
[0011] The segmented arc segments are resampled using equidistant linear interpolation to resample the arc segment coordinate points;
[0012] Calculate the coordinate increments of the resampled coordinate points and normalize the data based on the coordinate increments.
[0013] Optionally, the content of curve segmentation of the vector space data specifically includes:
[0014] Assume the length of the vector curve is L, the length of the segment is l, and the number of whole cycles that can be divided is k; k = [L / l];
[0015] The remaining arc length r is: r=Lk*l; the remaining arc length is divided into three types:
[0016] when When no extension processing is performed, l k+1 = r;
[0017] when When , the remaining arc length is merged with the kth sub-arc, l k =L-(k-1)*l;
[0018] when When the arc segment is extended, an arc segment with a length of l is intercepted in the opposite direction at the end point of the remaining arc segment. k+1 =l.
[0019] Optionally, the content of resampling the arc coordinate points by using equidistant linear interpolation on the segmented arcs specifically includes:
[0020] The segmented arcs are resampled using the equidistant linear interpolation method, with the number of sampling points set to N+1 and the sampling interval of each arc being l. m / N, where l m is the length of the arc segment with sequence number m.
[0021] Optionally, the coordinate increment of the resampled coordinate point is calculated, and the content of data normalization based on the coordinate increment specifically includes:
[0022] For the N+1 pairs of coordinates (X j ,Y j ), where j = 0, 1, ..., N; calculate the coordinate difference between two consecutive points and obtain the coordinate increment (Δx i ,Δy i ), where i = 0, 1, ..., N-1;
[0023] The coordinate increment is divided by the length of the arc segment to normalize to the (-1,1) interval:
[0024]
[0025] Optionally, the content of the compression model of the autoencoder specifically includes:
[0026] Encoding layer: The normalized coordinates are input into the encoder to encode the high-dimensional data into a low-dimensional latent variable z;
[0027] Hidden layer: After receiving the hidden variable z, the hidden layer extracts the arc segment feature vector;
[0028] Decoding layer: input the arc segment feature vector into the decoder for decoding, and output the decoded coordinate increment.
[0029] Optionally, in the compression model, the encoding layer, the hidden layer and the decoding layer all use the hyperbolic tangent function as the activation function, so that the output data are all in the range of [-1,1].
[0030] Optionally, using closure error correction to obtain a coordinate increment from the output of the compression model, and calculating the restoration of the arc segment curve according to the coordinate increment specifically includes:
[0031] Perform closure correction on the output coordinate increments:
[0032] Let f x ,f y Represent the accumulated errors in the x and y directions respectively, Add a correction to the coordinate increment of each segment: The output vector is corrected to
[0033] Calculate the actual coordinates of the arc curve based on the corrected coordinate increments:
[0034] Will Multiply by the arc length and perform inverse normalization to obtain the actual coordinate increment: The actual coordinates of each point are calculated based on the starting point coordinates to restore the arc curve of vector space data.
[0035] A curve data compression based on an autoencoder neural network system, the system comprising:
[0036] A vector space data preprocessing module, which performs normalization operation on the vector space data after preprocessing to obtain preprocessed data, wherein the vector space data is curve data on the map;
[0037] A compression model building module, which builds a compression model of the autoencoder according to the preprocessed data;
[0038] The arc segment curve restoration module is used to obtain coordinate increments from the output of the compression model using closure error correction, and restore the arc segment curve in the curve on the map according to the coordinate increments.
[0039] Optionally, the arc segment curve restoration module further includes:
[0040] The output correction submodule is used to correct the closure error of the output coordinate increments:
[0041] Let f x ,f y Represent the accumulated errors in the x and y directions respectively, Add a correction to the coordinate increment of each segment: The output vector is corrected to
[0042] The actual coordinate calculation submodule is used to calculate the actual coordinates of the arc curve based on the corrected coordinate increments:
[0043] Will Multiply by the arc length and perform inverse normalization to obtain the actual coordinate increment: The actual coordinates of each point are calculated based on the starting point coordinates to restore the arc curve of vector space data.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] The present invention uses an autoencoder neural network to construct a compression and decompression model for vector curve data. When faced with curve data of different scales and complexities, the model first performs segmentation and resampling processing to normalize the input vector, and realizes a high-precision compression and decoding module by optimizing the autoencoder structure and adjusting the loss function. Finally, the stability of the data is ensured by allocating the coordinate closure difference of the arc segment data. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0047] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0048] Figure 2 A flow chart of the curve segmentation and resampling process according to an embodiment of the present invention;
[0049] Figure 3 Schematic diagram of an autoencoder according to an embodiment of the present invention;
[0050] Figure 4 Schematic diagram of an arc segment data compression model based on an autoencoder according to an embodiment of the present invention;
[0051] Figure 5 This is a graph showing changes in the average value of coordinate offsets under different compression rates in an embodiment of the present invention;
[0052] Figure 6The following are comparison diagrams of position offsets of arc segments of three county-level administrative regions at different compression rates according to an embodiment of the present invention; Figure (a) is a position offset diagram when the compression rate is 15%; Figure (b) is a position offset diagram when the compression rate is 25%; Figure (c) is a position offset diagram when the compression rate is 35%;
[0053] Figure 7 This is a comparison diagram of the fitting effects of the present model, Fourier and Bessel under different compression rates in an embodiment of the present invention; Figure 7 (a) is the compression result of this model, Bessel model and Fourier model when the compression rate is 15%; Figure 7 (b) is the compression result of this model, Bessel model and Fourier model when the compression rate is 25%; Figure 7 (c) shows the compression results of this model, Bessel model and Fourier model when the compression rate is 35%. Specific implementation methods
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] Embodiment 1
[0057] A curve data compression method based on autoencoder neural network, such as Figure 1 As shown, specifically including:
[0058] Even different curves of the same type in the same map often have very different lengths. In order to improve the convergence and fitting accuracy of the model, it is necessary to ensure that the scale (length) of the input arc elements is consistent. Therefore, the compressed arc segments need to be preprocessed, which specifically includes two parts: curve segmentation and coordinate point resampling.
[0059] The preprocessing content specifically includes:
[0060] (I) Curve segmentation:
[0061] The vector space data is segmented into curves; the segmented arc segments are resampled by using equidistant linear interpolation to coordinate points of the arc segments; the coordinate increments of the resampled coordinate points are calculated, and data normalization is performed based on the coordinate increments.
[0062] like Figure 2As shown, the content of curve segmentation of vector space data specifically includes: assuming that the length of the vector curve is L, the segment length is l, and the number of whole cycles that can be segmented is k; k = [L / l]; the remaining arc segment length r is: r = Lk*l; the remaining arc segment length is divided into three types: when When no extension processing is performed, l k+1 = r; when When , the remaining arc length is merged with the kth sub-arc, l k =L-(k-1))*l; when When the arc segment is extended, an arc segment with a length of l is intercepted in the opposite direction at the end point of the remaining arc segment. k+1 =l.
[0063] (II) Resampling The arc segments after segmentation are resampled by using equidistant linear interpolation. The contents of resampling the arc segment coordinate points specifically include: resampling the arc segments after segmentation by using equidistant linear interpolation, setting the number of sampling points to: N+1, and the sampling interval of each arc segment to l m / N, where l m is the length of the arc segment with sequence number m.
[0064] Calculate the coordinate increment of the resampled coordinate point, and the content of data normalization based on the coordinate increment specifically includes: j ,Y j ), where j = 0, 1, ..., N; calculate the coordinate difference between two consecutive points and obtain the coordinate increment (Δx i ,Δy i ), where i = 0, 1, ..., N-1; the coordinate increment is divided by the length of the arc segment to normalize to the interval (-1, 1):
[0065]
[0066] A compression model of the autoencoder is constructed based on the preprocessed data.
[0067] The compression model is built based on the autoencoder, such as Figure 3 As shown in the figure, the autoencoder uses the data itself as a supervisory signal to complete the training of the network, including:
[0068] Encoding layer: The normalized coordinates are input into the encoder to encode the high-dimensional data into a low-dimensional latent variable z.
[0069] Hidden layer: After receiving the hidden variable z, the hidden layer extracts the arc segment feature vector.
[0070] Decoding layer: The arc feature vector is input into the decoder for decoding, and the decoded coordinate increment is output. The mapping is completed through the neural network θ:v→v.
[0071] Network θ Divided into two parts, the previous sub-network realizes the mapping v→z, the following sub-network is completed z→v mapping, such as Figure 2 As shown, It is the process of data encoding, which encodes the high-dimensional input v into a low-dimensional latent variable z, called the Encoder network; It is the process of data decoding, which decodes the encoded input z into a high-dimensional v, called a Decoder network. The encoder and decoder jointly complete the encoding and decoding process of the input data v. The entire network model f θ It is called Auto-Encoder.
[0072] If you use a deep neural network or a convolutional neural network to parameterize and function, it is called a deep or convolutional autoencoder.
[0073] like Figure 4 As shown in the figure, in the compression model, the encoding layer, hidden layer and decoding layer all use the hyperbolic tangent function as the activation function, so that the output data are all in the range of [-1,1]. In the deep convolutional autoencoder model for arc segment data compression, the input vector (Input Layer) is the processed coordinate increment, the target value of the output vector (Output Layer) is the same as the input vector, and the middle hidden layer (Code Layer) is the arc segment feature vector extracted by the model, which is also the compressed vector of the arc segment. The preprocessed data is input into the compression model to train the entire model. After the model training is completed, it is divided into two parts: coordinate data compression and coordinate data decompression, and compression and decompression operations are performed respectively.
[0074] The number of neurons in the hidden layer is smaller than that in the input layer, thereby achieving arc segment compression, and the compression ratio is the ratio of the number of input nodes (2N) to the number of hidden layer nodes (M).
[0075] Taking into account the existence of positive and negative numbers in the parameters (coordinate increments) in the network, the hyperbolic tangent function (tanh) is used as the activation function for each layer in the model to ensure that the output is in the range of [-1,1].
[0076] The goal of the autoencoder loss function is to judge the similarity between the input and output. Let s o =[dx 0 ,dy 0 ,dx 1 ,dy 1 ,…,dxN-1 ,dy N-1 ] (N is the number of sampling segments of the sub-arc segment) is the input vector, is the output vector. The input and output vectors form two arc segments on the plane. The loss function can be constructed from the geometric properties of the differences in their positions, lengths, and directions, corresponding to equations (2), (3), and (4) respectively.
[0077]
[0078]
[0079]
[0080] In formula (2), LOC(s o ,s T ) corresponds to the average value of the offset distance of each node of the input and output, which has more geometric significance than the mean squared error. In formula (3), LEN(s o ,s T ) is the length difference between the two arc segments, LDM(s o ,s T ) corresponds to the average direction difference between the input and output arc segments, and its unit is seconds, θ, is a vector (dx i ,dy i ), The weighted sum of the three spatial errors represented by equations (2)-(4) is used to obtain the final loss function Loss as shown in equation (5):
[0081] Loss = λ 1 *LOC+λ 2 *LEN+λ 3 *LDM (5)
[0082] where λ 1 ,λ 2 ,λ 3 ∈[0,1], the units and dimensions of the three constraints are inconsistent. In practical applications, 1 ,λ 2 ,λ 3 To make dimensional adjustment.
[0083] The output of the compression model is corrected using the closure error to obtain the coordinate increment, and the arc curve restoration is calculated based on the coordinate increment. Specifically, it includes:
[0084] After the model is trained, the output of the autoencoder is a coordinate increment that is similar to the input. The input and output will inevitably produce a shift in the previous and next data. In order to eliminate the problem that the end point calculated by the coordinate increment after decompression does not coincide with the actual end point position, a closure error correction must be performed. This method is the same as the closure error processing of the wire data in the control measurement: Let f x ,f y Represent the accumulated errors in the x and y directions respectively, Add correction value to each segment coordinate increment The output vector is corrected to Will Multiply by the arc length to perform inverse normalization to obtain the actual coordinate increment Then calculate the actual coordinates of each point based on the starting point coordinates.
[0085] For the third case of non-integer periodic arc segments of curve segmentation, only the points within the sub-segment are selected, and the points outside the sub-segment are deleted. Finally, the sub-segments are spliced together to realize the decompression of the arc segment and obtain the actual coordinates of different curves in the map.
[0086] Curve segmentation, node resampling, autoencoder, data restoration module and trained parameters constitute a complete spatial data compression system, in which the encoder is a compression module, compressing the longer coordinate string data into a shorter feature code, which can be organized into independent files in practical applications; the decoder restoration module constitutes a decompression module. The two parts are trained as a whole during training, and the two parts can be used independently in practical applications. The compression module generates arc segment compressed files, and the decompression module restores them to curves.
[0087] Embodiment 2
[0088] A curve data compression based on an autoencoder neural network system, the system comprising:
[0089] The vector space data preprocessing module is used to perform normalization operations on the vector space data after preprocessing to obtain preprocessed data; curve segmentation is performed on the vector space data; arc segment coordinate points are resampled by using equidistant linear interpolation for the segmented arc segments; the coordinate increments of the resampled coordinate points are calculated, and data normalization is performed based on the coordinate increments.
[0090] like Figure 2 As shown, the content of curve segmentation of vector space data specifically includes: assuming that the length of the vector curve is L, the segment length is l, and the number of whole cycles that can be segmented is k; k = [L / l]; the remaining arc segment length r is: r = Lk*l; the remaining arc segment length is divided into three types: when When no extension processing is performed, l k+1= r; when When , the remaining arc length is merged with the kth sub-arc, l k =L-(k-1)*l; when When the arc segment is extended, an arc segment with a length of l is intercepted in the opposite direction at the end point of the remaining arc segment. k+1 =l.
[0091] The resampling process uses equidistant linear interpolation to resample the arc coordinate points after segmentation. The resampling process includes: using equidistant linear interpolation to resample the arc after segmentation, setting the number of sampling points to N+1, and the sampling interval of each arc segment to l m / N, where l m is the length of the arc segment with sequence number m.
[0092] Calculate the coordinate increment of the resampled coordinate point, and the content of data normalization based on the coordinate increment specifically includes: j ,Y j ), where j = 0, 1, ..., N; calculate the coordinate difference between two consecutive points and obtain the coordinate increment (Δx i ,Δy i ), where i = 0, 1, ..., N-1; the coordinate increment is divided by the length of the arc segment to normalize to the interval (-1, 1):
[0093]
[0094] A compression model building module, used to build a compression model of the autoencoder according to the preprocessed data;
[0095] The autoencoder completes the mapping through a neural network. The network is divided into two parts, the front sub-network realizes the mapping, and the back sub-network completes the mapping, such as Figure 2 As shown, It is the process of data encoding, which encodes high-dimensional input into low-dimensional latent variables z, called Encoder network; It is the process of data decoding, which decodes the encoded input into a high-dimensional network, called a Decoder network.
[0096] The encoder and decoder together complete the encoding and decoding process of the input data, and the entire network model is called an auto-encoder. If a deep neural network or convolutional neural network is used to parameterize the sum function, it is called a deep or convolutional autoencoder.
[0097] The compression model is built based on the autoencoder. In the compression model, the encoding layer, hidden layer and decoding layer all use the hyperbolic tangent function as the activation function, so that the output data is in the range of [-1,1].
[0098] The deep convolutional autoencoder model for arc segment data compression has an input vector (Input Layer) that is the processed coordinate increment, an output vector (Output Layer) with the same target value as the input vector, and an intermediate hidden layer (CodeLayer) that is the arc segment feature vector extracted by the model, which is also the compression vector of the arc segment. The number of neurons in the hidden layer is smaller than the number of neurons in the input layer, thereby achieving arc segment compression. The compression ratio is the ratio of the number of input nodes (2N) to the number of hidden layer nodes (M).
[0099] Considering that the parameters (coordinate increments) in the network have positive and negative values, the hyperbolic tangent function (tanh) is used as the activation function for each layer in the model to ensure that the output is in the range of [-1,1]. The goal of the autoencoder loss function is to judge the similarity between the input and output. Let s o =[dx 0 ,dy 0 ,dx 1 ,dy 1 ,…,dx N-1 ,dy N-1 ] (N is the number of sampling segments of the sub-arc segment) is the input vector, is the output vector. The input and output vectors form two arc segments on the plane. The loss function can be constructed from the geometric properties of the differences in their positions, lengths, and directions, corresponding to equations (7), (8), and (9) respectively.
[0100]
[0101]
[0102]
[0103] In formula (7), LOC(s o ,s T ) corresponds to the average value of the offset distance of each node of the input and output, which has more geometric significance than the mean squared error. In formula (8), LEN(s o ,s T ) is the length difference between the two arc segments, and LDM(s o ,s T ) corresponds to the average direction difference between the input and output arc segments, in seconds, θ i , is a vector (dxi ,dy i ), The corresponding azimuth.
[0104] The weighted sum of the three spatial errors represented by equations (7)-(9) is used to obtain the final loss function Loss as shown in equation (10):
[0105] Loss = λ 1 *LOC+λ 2 *LEN+λ 3 *LDM (10)
[0106] where λ 1 ,λ 2 ,λ 3 ∈[0,1], the units and dimensions of the three constraints are inconsistent. In practical applications, 1 ,λ 2 ,λ 3 To make dimensional adjustment.
[0107] The arc segment curve restoration module is used to obtain coordinate increments from the output of the compression model using closure error correction, and calculate the restoration of the arc segment curve based on the coordinate increments.
[0108] The arc curve restoration module also includes: an output correction submodule, which is used to correct the closure error of the output coordinate increment: let f x ,f y Represent the accumulated errors in the x and y directions respectively, Add a correction to the coordinate increment of each segment: The output vector is corrected to
[0109] The actual coordinate calculation submodule is used to calculate the actual coordinates of the arc curve based on the corrected coordinate increments: Multiply by the arc length and perform inverse normalization to obtain the actual coordinate increment: The actual coordinates of each point are calculated based on the starting point coordinates to restore the arc curve of vector space data.
[0110] Embodiment 3
[0111] The accuracy and suitability of the model were analyzed at different scales.
[0112] Evaluate the accuracy of the model:
[0113] (1) Coordinate offset:
[0114] The coordinate offset reflects the position difference of the characteristic points of the curve before and after compression and decompression, and is used to evaluate the accuracy of the compression model. The larger the node position offset, the lower the compression accuracy; the smaller the offset, the higher the compression accuracy. The coordinate offset is expressed as the average value of the displacement of all points.
[0115] (2) Number of topological errors:
[0116] The topological error of the model refers to the error of arc segment self-intersection and hanging points between different arc segments in the decompressed file. The amount of topological error is an important factor in measuring the accuracy of the model. If topological errors occur, further processing is required.
[0117] (3) Area change ratio:
[0118] For the surface elements enclosed by arc segments, the model compresses the arc segments as units and reconstructs the surface elements with the decompressed arc segments. The areas of the front and back elements are inconsistent, and the relative value of their area change is another parameter for evaluating the model, as shown in formula (11).
[0119]
[0120] Where S is the area after encoding and decoding, S 0 is the area of the original feature.
[0121] The compression ratio is calculated to obtain the suitability: The compression ratio refers to the ratio of the amount of data after data compression to the amount of data before compression. The specific calculation formula for the compression ratio of each compressed arc segment is shown in (12).
[0122]
[0123] Where R is the compression ratio, B 1 , B 2 Respectively represent the data size before and after compression. 1 is twice the number of points after sampling (because each point has a two-dimensional coordinate), B 2 Indicates the amount of data after compression, calculated by the number of neurons in the middle code layer. The smaller the compression ratio R value, the greater the degree of compression.
[0124] If the data volume of neural network parameters is considered, the data volume before compression is the sum of the total number of points of all curves and the number of network parameters.
[0125] Assuming that the number of arcs in the file is K, the average number of points in each arc is P, the length of the code layer in the autoencoder is M, and the total number of network parameters is W, the compression rate is expressed in the first half of equation (13). When the number of arcs K is large enough, the influence of the weight parameter and the bias parameter can be ignored, and the compression rate is simplified to the expression in the second half of equation (13).
[0126]
[0127] Taking into account the human visual resolution limit, map scale accuracy, and the distance that the map is suitable for expressing, for the compressed and decompressed curves, if the point offset distance is within the allowed threshold range, the compression is considered to be effective compression at this scale. The offset distance threshold of the paper map is set to 0.2mm, and the actual offset is related to the scale, and its value is (0.2mm*S / 1000)m (where S is the scale denominator). The distance is 20m (=0.2mm*100000 / 1000) at a scale of 1:100,000, and 200m at a scale of 1:1,000,000.
[0128] Embodiment 4
[0129] The 2021 1:1 million public version of basic geographic information data was obtained from the website of the National Basic Geographic Information Center, and 824 county-level administrative boundary lines in Hunan, Shanxi and Jiangxi provinces were extracted. Table 1 is the length distribution of the sample data.
[0130] The above method is used for segmentation and sampling. The segment length is 25m. Each sub-arc segment is resampled at equal intervals of 100 segments. The sample data contains 2099 sub-curves. The point-by-point coordinate increment of each sub-arc segment is calculated and normalized to obtain an input tensor with a dimension of 2099*200. Table 1 is a summary of the length distribution of administrative boundary lines in the experimental data.
[0131] Table 1
[0132]
[0133] A 9-layer autoencoder neural network was constructed based on the TensorFlow framework. The number of neurons is 200, 512, 256, 128, X, 128, 256, 512, and 200 respectively. The 5th layer (middle layer) is the feature vector of curve compression. The number of nodes is dynamically adjusted according to the compression rate. The hyperbolic tangent function (tanh) is used as the activation function for each layer. The number of neurons in each layer is symmetrical about the middle layer. The loss function adopts the model of formula (5). After multiple adjustments, when λ 1 =0.8,λ 2 =0.1,λ 2 When =0.1, the model accuracy is the highest.
[0134] For the experimental data and network structure, the number of nodes in the middle layer of the autoencoder neural network is 10, 20, 30, 40, 50, 60, 80, and 100, respectively, and the corresponding compression rates are 5%, 10%, 15%, 20%, 25%, 30%, 40%, and 50%, respectively. Figure 4 This is the model accuracy convergence diagram under compression rates of 15%, 25%, and 35%. Figure 5 It is obvious that the autoencoders of the three types of compression rates converge very quickly, and the models are stable after 100 epochs.
[0135] Figure 6 The following are the comparison diagrams of the arc segments before and after compression rates of 15%, 25%, and 35% for three county-level administrative regions in Shanxi Province. The three sub-graphs at the bottom are enlarged diagrams of the corresponding areas. The black curve is the original arc segment, and the red curve is the arc segment after compression and decompression. It is not difficult to see that at a scale of 1:750,000, the human eye can hardly distinguish between the original arc segment and the arc segment after compression and decompression. Figure 6 The lower part is a 1:200,000 magnified image of the upper dotted line range. It is not difficult to see that as the compression rate increases (the degree of compression decreases), the decompressed arc segment gets closer and closer to the original arc segment. Figure 6 (a), (b), and (c) are comparison diagrams of the position offset of arc segments of three county-level administrative regions with compression rates of 15%, 25%, and 35% at different compression rates.
[0136] Table 2 shows the number of point errors, area errors and topological errors under different compression rates of the boundary line. It is not difficult to see that when the compression rate is in a low range, the coordinate offset and area change rate (boundary line) decrease significantly with the increase of the compression rate, that is, the model accuracy increases with the increase of the compression rate. When the compression rate is in a high range, the coordinate offset hardly changes with the change of the compression rate, but there is a certain fluctuation. For example, the error with a compression rate of 50% is greater than the error of 40%. For the boundary line data with a scale of 1:1 million, when the compression rate is 25%, the amount of compressed data is only 1 / 4 of the original data, and the average values of the coordinate offset and area change rate are 0.112mm and 0.1575% respectively, and the errors are less than the actual allowed threshold. At this time, the number of topological errors is 5, which needs to be edited and resolved.
[0137] Table 2
[0138]
[0139] Based on the ability of the autoencoder neural network to effectively extract feature features, a compression and decompression model for map space vector curve elements is constructed. The model includes arc segmentation, resampling and normalization, autoencoder module, coordinate closure error processing, coordinate data restoration and other modules. Through experiments on 1:1 million county-level arc segments in Shanxi, Hunan and Jiangxi provinces, it is found that the compression method of the model can meet the application needs at this scale. The greater the compression rate (the smaller the compression degree), the higher the accuracy of data restoration. The model in this paper does not need to label the samples, so all the obtained curves can be included in the samples. All subsequent compressed curve data is also a fine-tuning of the model parameters, so the accuracy will also be improved. The time complexity of the model is not high, and the training can be completed on a daily PC. There is also a potential advantage that its compressed file has a confidentiality function. The parameters of its neural network and the network model are the secret key for data interpretation, which can better ensure the security of geographic information data in network transmission. Compared with the Fourier model and the Bessel model, this method is more suitable for situations with a smaller compression rate (25%).
[0140] Since the autoencoder has a certain degree of oscillation, its accuracy fluctuates during the convergence process of training. The more times of training, the higher the accuracy. Therefore, it is necessary to capture effective parameters during the training process and deal with a small amount of topological errors in data restoration. In future work, we will further explore the impact of factors such as the number of arc segments, the number of sub-arc sampling, the amount of sample data, and the network structure on the accuracy of the model, explore the fine-tuning of existing models in the face of new data, and try to use graph convolution and adversarial generative neural networks to build models.
[0141] Embodiment 5
[0142] Comparison of the present invention with other methods.
[0143] Fourier fitting method:
[0144] The model of formula (14-15) is used to perform Fourier fitting on the curve, so that the coordinate data of the original curve is replaced by the Fourier series.
[0145]
[0146]
[0147] in is a parameter, L is the arc period, s is the function independent variable, N is the number of expansion terms, when N→+∞, the Fourier series can completely restore the original curve. The smaller the N value, the greater the compression degree and the smaller the compression rate R. Assuming the number of points in the arc is M, the calculation formula of the compression rate R is as shown in formula (16).
[0148]
[0149] Bessel fitting method:
[0150] The principle of fitting a curve with multiple Bezier curves is to make each Bezier curve fit a sufficiently long arc segment under the set offset threshold. When the average error of the point position is greater than the set threshold, the current Bezier curve is terminated, and then the next Bezier curve is enabled to continue fitting the subsequent arc segment until the curve ends. Each Bezier curve is determined by 4 control points, and its model is shown in formula (17).
[0151] B(t)=P 0 (1-t) 3 +P 1 (1-t) 2 t+P 2 (1-t)t 2 +P 3 t 3 (17)
[0152] Where t is a parameter, 0≤t≤1,P 0 , P 1 , P 2 , P 3 As four control points, the original curve coordinates are replaced by the control points of all Bezier curves. Different offset thresholds will result in different numbers of Bezier curves. As the threshold is larger, the number of Bezier curves T is smaller, the compression rate R is smaller, and the compression degree is greater. Assuming the number of points of the curve is M, the calculation formula of the compression rate R is formula (18).
[0153]
[0154] Comparative analysis:
[0155] Using the same experimental data, the results of Fourier series and Bezier curve fitting are compared with the results of this model. In the experiment, the segment length is 25,000m and the number of interpolated segments is 100, with 2099 boundary lines. Table 3 compares the three models in terms of point offset error, running time and topological error at different compression rates. Figure 7 (a), (b), and (c) are comparison diagrams of three models of the boundary line of Ziyang District, Yiyang City, Hunan Province with compression rates of 15%, 25%, and 35%. Figure 7 The lower part is an enlarged view of the arc segment marked by the boundary line. The black line is the original curve, and the red, green and blue lines are the arc segments of this model, Fourier model and Bessel restoration respectively. Figure 7It can be seen that the fitting curves of the three models gradually approach the original curves as the compression rate increases. Under low compression rates, compared with the Fourier model and the Bessel model, the arc segments after decompression of this model are more similar to the original arc segments. It can also be seen from Table 3 that the deviation of the corresponding feature points of this model is smaller and the topological errors are less. The running time of this model is mainly concentrated in the initial training of the model. The curve compression time based on the trained model is much lower than that of the Fourier model and the Bessel model. The Fourier model uses smooth sine and cosine functions to fit the curve. When the compression rate is low, there are more topological errors of self-intersection and mutual intersection of arc segments, but when the compression rate is large, the accuracy of the Fourier model is getting higher and higher. The error of the Bessel model is greater than that of the other two types at all compression rates, but the topological error is lower, indicating that the Bessel model is not suitable for curve compression. From a mathematical principle, it is more suitable for smoothing the curve. As the compression rate increases, the error of this model is relatively stable, and the accuracy of the model will not continue to improve as the compression rate increases. Compared with the three, this model is more suitable for the case of small compression rate (such as 25%), the Fourier model is more suitable for the case of large compression rate, and the Bessel model is suitable for smooth processing of curves. There are certain topological errors in the three, and all need topological correction.
[0156] Table 3
[0157]
[0158] The above shows and describes the main features and advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present invention.
Claims
1. A curve data compression method based on an autoencoder neural network, characterized in that: The method comprises: Performing normalization operation on the vector space data after preprocessing to obtain preprocessed data, wherein the vector space data is curve data on the map; The vector space data is segmented into curves, and the segmented arcs are resampled using an equidistant linear interpolation method. The number of sampling points is set to N+1, and the sampling interval of each arc is ,in, Indicates the serial number is The length of the arc segment; Constructing a compression model of the autoencoder based on the preprocessed data; The method uses the closure error correction to obtain a coordinate increment for the output of the compression model, and restores the arc segment curve in the curve on the map according to the coordinate increment, specifically including: Perform closure correction on the output coordinate increments: set up Respectively The cumulative error in direction, , , Where N represents the number of sampling segments of the sub-arc segment. , represents the input vector, , represents the output vector, ; Add a correction to the coordinate increment of each segment: , , the output vector is corrected to , ; Calculate the actual coordinates of the arc curve based on the corrected coordinate increments: Will , Multiply by the arc length and perform inverse normalization to obtain the actual coordinate increment: , , the actual coordinates of each point are calculated according to the starting point coordinates to realize the arc curve restoration of vector space data.
2. The curve data compression method based on the autoencoder neural network according to claim 1 is characterized in that: The content of preprocessing vector space data specifically includes: Performing curve segmentation on the vector space data; The segmented arc segments are resampled using equidistant linear interpolation to resample the arc segment coordinate points; Calculate the coordinate increments of the resampled coordinate points and normalize the data based on the coordinate increments.
3. The curve data compression method based on the autoencoder neural network according to claim 2 is characterized in that: The content of curve segmentation of the vector space data specifically includes: Assume the length of the vector curve is L, the length of the segment is l, and the number of whole cycles that can be divided is k; ; The remaining arc length r is: ; Divide the remaining arc length into three types: when When , no extension processing is performed. ; when When , the remaining arc length is merged with the kth sub-arc. ; when When , the arc segment is extended, and an arc segment with a length of l is intercepted in the opposite direction at the end point of the remaining arc segment. .
4. The curve data compression method based on the autoencoder neural network according to claim 3 is characterized in that: Calculate the coordinate increment of the resampled coordinate point, and normalize the data based on the coordinate increment, including: The resampled +1 pair of coordinates ,in, ; Calculate the coordinate difference between two consecutive points and get the coordinate increment ,in ; The coordinate increment is divided by the length of the arc segment to normalize to the (-1,1) interval: 。 5. The curve data compression method based on the autoencoder neural network according to claim 1 is characterized in that: The content of the compression model of the autoencoder specifically includes: Encoding layer: The normalized coordinates are input into the encoder to encode the high-dimensional data into a low-dimensional latent variable z; Hidden layer: After receiving the hidden variable z, the hidden layer extracts the arc segment feature vector; Decoding layer: input the arc segment feature vector into the decoder for decoding, and output the decoded coordinate increment.
6. The curve data compression method based on the autoencoder neural network according to claim 5 is characterized in that: In the compression model, the encoding layer, hidden layer and decoding layer all use the hyperbolic tangent function as the activation function, so that the output data are all in the range of [-1,1].
7. A curve data compression system based on an autoencoder neural network, the system being used to implement the curve data compression method according to any one of claims 1 to 6, characterized in that: The system comprises: The vector space data preprocessing module performs normalization operation on the vector space data after preprocessing to obtain preprocessed data. The vector space data is curve data on the map; the vector space data is segmented into curves, and the segmented arcs are resampled by equidistant linear interpolation method. The number of sampling points is set to N+1, and the sampling interval of each arc is ,in, Indicates the serial number is The length of the arc segment; A compression model building module, which builds a compression model of the autoencoder according to the preprocessed data; The arc segment curve restoration module is used to obtain a coordinate increment from the output of the compression model using the closure error correction, and restore the arc segment curve in the curve on the map according to the coordinate increment; the arc segment curve restoration module also includes: The output correction submodule is used to correct the closure error of the output coordinate increments: set up Respectively The cumulative error in direction, , , where N represents the number of sampling segments of the sub-arc segment, , represents the input vector, , represents the output vector, ; Add a correction to the coordinate increment of each segment: , , the output vector is corrected to , ; The actual coordinate calculation submodule is used to calculate the actual coordinates of the arc curve based on the corrected coordinate increments: Will , Multiply by the arc length and perform inverse normalization to obtain the actual coordinate increment: , , the actual coordinates of each point are calculated according to the starting point coordinates to realize the arc curve restoration of vector space data.
Citation Information
Patent Citations
Side channel curve processing method and device and electronic equipment
CN111680787A