A point cloud encoding method based on multi-level ball octree and graph-driven attention entropy model
By using a multi-level spherical octree and a graph-driven attention entropy model, combined with a graph convolutional network and attention module, the computational complexity and robustness issues in point cloud data compression are solved, achieving efficient and accurate point cloud data processing.
Patent Information
- Application Number
- CN202411151533.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Existing technologies suffer from high computational complexity and poor robustness in point cloud data compression, making it difficult to fully utilize redundant information and local features of point clouds, resulting in low compression efficiency and information loss.
We employ a multi-level spherical octree and a graph-driven attention entropy model. The octree is constructed using spherical coordinates and combined with a graph convolutional network, a grouped graph attention module, and a cross attention module to learn the local and global features of point clouds for efficient encoding.
It improves the encoding efficiency and feature extraction accuracy of point cloud data, reduces computational complexity, enhances adaptability to high-resolution point clouds, and ensures higher quality compression results.
Smart Images

Figure CN119006620B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of point cloud data coding, and particularly to a point cloud coding method based on a multi-level spherical octree and a graph-driven attention entropy model. BACKGROUND
[0002] Point cloud data has been rapidly developed and widely applied in the fields of autonomous driving, robotics and 3D mapping due to its high precision and high resolution. However, such high-precision point cloud data is huge in volume, bringing great challenges to storage and transmission. In the face of such a huge data processing task, how to reduce the computational complexity and improve the compression rate has become a key technical problem. Moreover, due to the unordered and sparse characteristics of point cloud data, traditional image and video compression methods are difficult to be directly applied to point cloud data compression.
[0003] The prior art mainly compresses point cloud data through voxel, image and tree-based algorithms. Among them, the voxel-based method grids the point cloud data and then compresses the grid data; by organizing point cloud data into voxels, a 3D convolution is used to predict the occupancy of each voxel. However, these methods have poor robustness to point cloud resolution, and can only obtain limited neighborhood information receptive fields in fixed-size voxels. In addition, the introduction of voxel coding brings a lot of computation, especially for higher resolution point clouds.
[0004] Secondly, the image-based method compresses point cloud data by projecting it onto a depth map and then compressing the depth map. Although this method has fast compression speed, it may cause information loss when processing non-planar point cloud data.
[0005] Furthermore, the tree structure-based method includes KD tree, prediction tree, quad tree and octree, etc. Among them, the octree-based method stands out due to its high compression efficiency, fast compression speed, adaptability to point cloud sparsity and other advantages, and is widely used in point cloud data compression. However, it is mainly based on Cartesian coordinates to construct an octree structure, which ignores the azimuth invariance brought by LiDAR rotation scanning and the multi-circular characteristics in point cloud, resulting in that the model fails to fully utilize the redundant information of point cloud, while increasing the additional computational overhead and reducing the learning ability of local features.
[0006] Therefore, there is an urgent need to provide a point cloud compression method that can save computing resources while fully exploiting geometric features and finding fine-grained prediction differences between nodes to obtain more compact and higher quality point cloud compression. SUMMARY
[0007] In view of the deficiencies of the prior art, the present application provides a point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model, which can improve the encoding efficiency and feature extraction accuracy of point cloud data, thereby realizing efficient and accurate point cloud data processing.
[0008] The technical scheme of the present application is a point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model, comprising:
[0009] S1), encoding the point cloud data using an octree entropy model based on multi-level spherical coordinates;
[0010] S2), constructing an adjacency matrix of a parent graph and a distance graph using an octree structure and a spherical coordinate representation of the point cloud;
[0011] S3), constructing an entropy encoding model based on graph-driven attention;
[0012] S4), using a graph convolution network module to embed the adjacency matrix with auxiliary context information;
[0013] S5), using a grouping graph attention module and a cross-attention module to learn the relevance of parent node context and sibling node context;
[0014] S6), predicting the probability of the placeholder symbol of each octree node based on the entropy encoding model;
[0015] S7), using arithmetic encoding to compress the placeholder symbol sequence of the octree node into a binary floating-point number sequence;
[0016] S8), converting the binary floating-point number sequence into a bit stream;
[0017] S9), using arithmetic decoding to convert the bit stream into the placeholder symbol sequence of the octree, reconstructing the octree and restoring the point cloud data.
[0018] As a preferred, in step S1), the multi-level spherical coordinate octree is constructed, which specifically includes the following steps:
[0019] S11), introducing a quantization step of the spherical coordinate octree; the quantization step q ρ of the spherical coordinate (ρ, θ, φ) is θ , respectively expressed as:
[0020] q ρ = q;
[0021]
[0022] wherein b represents the quantization step q ρ , and ρ is the total number of bins, specifically represented as p is the radial distance of the spherical coordinates through the origin to the point; q is the octree quantization step size based on the Cartesian coordinate system; p max is the maximum value of the radial distance;
[0023] S12), introducing the reconstruction error e of the spherical coordinate octree s ; that is:
[0024]
[0025] In the formula, p i is the original point cloud coordinate; is the center coordinate of the voxel;
[0026] S13), obtaining the original point cloud data, converting the Cartesian coordinate system (x, y, z) in the data into the spherical coordinate system calculating the maximum radial distance p max after coordinate conversion;
[0027] According to the formula of step S11), the quantization step size is calculated, and the converted point cloud data is normalized; the maximum radial distance r max is calculated again, and the maximum radial distance r max and the processed point cloud are used to construct an octree;
[0028] S14), calculating the boundary range of the point cloud according to r max , and then calculating the center and maximum range of the bounding box enclosing the entire point cloud; starting from the root node of the octree, it is determined whether to continue to divide the current octant node into child nodes or to keep it as a leaf node according to the preset maximum depth of the tree; if the current octant node does not reach the maximum depth, it is recursively divided into eight child nodes, and the division is based on the center point of the node; each child node covers a specific sub-region of the parent node space;
[0029] For each octree node, add node features including center spherical coordinate octant, tree depth, occupancy; recursively build until the maximum depth is reached to obtain an octree containing node features.
[0030] As a preferred, in step S11), the point cloud is divided into N levels, and different numbers of additional quantization levels are allocated to each level; the number of additional quantization levels of each level is n, and the value range is {0, 1,..., N-1}, and p n In the interval [t n p maxt n+1 ρ max ) where t n is the critical value of the partition, satisfying 0≤t n <t n+1 <1, t0=0, t N =1; the additional quantization level is represented as the reduction of quantization step, specifically q n =q / 2 n .
[0031] As preferred, in step S12), the upper limit of the reconstruction error ε s is controlled to be less than or equal to the upper limit of the octree reconstruction error ε c under the Cartesian coordinate system, a spherical coordinate octree with a multi-level concept is introduced, and the reconstruction error ε n is represented as:
[0032]
[0033] As preferred, in step S2), the adjacency matrix of the parent graph and the distance graph is constructed, specifically including the following steps:
[0034] S21), obtaining the adjacency matrix of the parent graph according to the hierarchical relationship of the multi-level spherical coordinate octree constructed in step S1);
[0035] S22), constructing the adjacency matrix of the distance graph based on the geometric distance relationship of the point cloud.
[0036] As preferred, in step S21), the parent graph is constructed by traversing the ancestor nodes of multiple levels of the multi-level spherical coordinate octree; and for context nodes sharing the same ancestor, a unit edge weight is given.
[0037] As preferred, in step S21), for nodes o i and o j in the same context, the calculation formula of the edge weight Edge p (o i ,o j ) of the nodes in the parent graph is:
[0038]
[0039]
[0040] In the formula, m represents the depth of the current octree when searching the ancestor nodes of the nodes o i and o j ; respectively represent the ancestor nodes of the nodes o i and o j under the current octree depth m.
[0041] Preferably, in step S22), for node o of the spherical coordinate octree... i and o j The distance between the two is D(o) i ,o j ) is represented as:
[0042]
[0043] In the formula, Representing node o i and o j The radial length ρ in spherical coordinates; Representing node o i and o j The polar angle θ in spherical coordinates; Representing node o i and o j The azimuth angle φ in spherical coordinates.
[0044] Preferably, in step S22), for node o of the spherical coordinate octree... i and o j The unit edge weight between them is expressed as:
[0045]
[0046] In the formula, D max D min Representing node o i and o j The maximum and minimum distances between them; the above regularization operation can restrict the final unit edge weight to the range [0,1].
[0047] The graph-driven attention-based entropy coding model includes a graph convolutional network module, a grouped graph attention module, and a cross attention module;
[0048] Preferably, in step S3), the group graph attention module is used to learn the context information of the parent node, which reduces computational complexity by reducing the calculation of distant points, enhances the local context learning ability, and shares information between groups to capture global features.
[0049] The cross-attention module enhances feature extraction by learning between the encoded neighbor node context and the parent node context.
[0050] Preferably, in step S4), the graph convolutional network module includes multiple linear layers (Linear) and multilayer perceptrons (MLP).
[0051] As preferred, in step S4), a graph convolution network module is used to embed context information for the adjacency matrix, specifically comprising: the graph convolution network module maps the context information to be embedded to a target dimension through a linear layer Linear, and then multiplies it with the adjacency matrix; the obtained feature is multiplied with the adjacency matrix again after passing through another linear layer Linear; the obtained feature is subjected to a normalization operation LayerNorm; finally, a multi-layer perceptron MLP and a residual connection are used to map the convolution output to a target output dimension, so as to obtain the adjacency matrix embedded with context information.
[0052] As preferred, in step S5), the grouping graph attention module is used to learn the context information of the parent node, reduce the calculation complexity by reducing the calculation of the long-distance points, enhance the local context learning ability, and share the information between groups to capture the global features.
[0053] The grouping graph attention module splits the long sequence context into groups according to the edge weight of the adjacency matrix embedded with context information, specifically comprising the following steps:
[0054] S511), the adjacency matrices of the parent graph / distance graph are input alternately, and the tensor with a size of (batch_size, N, in_feature) is transformed into (batch_size*n, N / n, in_feature) according to the input; wherein n is the number of groups, and in_feature is the feature dimension of the input tensor;
[0055] S512), the feature of the context information is mapped to a target dimension out_feature through a linear layer;
[0056] S513), then the data dimension is expanded from (batch_size*n, N / n, out_feature) to (batch_size*n, N / n, N / n, out_feature) through one-time horizontal replication and splicing;
[0057] S514), then the data dimension is expanded from (batch_size*n, N / n, N / n, out_feature) to (batch_size*n, N / n, N / n, 2*out_feature) through one-time vertical replication and splicing; wherein N represents the length of the input sequence;
[0058] S515), then the corresponding part of the adjacency matrix is used for mask processing; the attention weight between nodes is extracted;
[0059] S516), the attention weight is multiplied by the value vector previously mapped to the target dimension through linear transformation to obtain the attention output, finally the inter-group information is captured through the multi-layer perception (MLP) to achieve more detailed feature learning, and the data dimension is reshaped to restore the grouping and obtain the final output result of the grouping graph attention module.
[0060] As preferred, in step S5), the cross-attention module enhances feature extraction by learning between the encoded neighbor node context and the parent node context, specifically as follows:
[0061] First, the parent node context is projected to the same feature dimension through two linear layers to generate key K and value V vectors;
[0062] Then, the neighbor node context is compressed through a linear layer to generate a query Q vector;
[0063] Next, the neighbor node context queries the parent node context, i.e., the query Q vector of the neighbor node context is multiplied by the key K vector of the parent node context; and normalized through a softmax activation function to obtain the attention weight;
[0064] Finally, the attention weight is multiplied by the value V vector of the parent node context to obtain the final result.
[0065] As preferred, in step S6), the entropy encoding model is used to predict the probability distribution of the placeholder symbol of each octree node , i.e.:
[0066]
[0067] In the formula, represents the probability value of the entropy encoding model at a given point a; n a represents the occupancy of the encoding node; f a , f a represent the embedding of the current feature and the reference feature, respectively; ω is the context window length, and w is the weight of the entropy model.
[0068] As preferred, in step S6), the target of the entropy encoding model is to improve the accuracy by minimizing the cross-entropy between the estimated distribution and the real distribution Q(n); therefore, the objective function of the entropy encoding model is:
[0069] E n~Q [-log n Q(n)];
[0070] In the formula, E represents the expected log loss of the predicted value of node symbol n by the entropy coding model prediction distribution Q, given that node symbol n follows distribution Q; Q(n) represents the true probability distribution of node placeholder symbol n generated from actual data; and n represents the node placeholder symbol of the octree.
[0071] Preferably, in step S7), arithmetic coding is used to compress the placeholder sign sequence of the octree node into a binary floating-point number sequence, specifically including the following steps:
[0072] S71) Establish a frequency table;
[0073] S72), with Φ k (x i A series of nested intervals are created in the form ) = (b,v), where Φ k (x i ) represents the number line mapping interval; b represents the starting point of the nested interval, v represents the length of the nested interval, and x represents the number line mapping interval. i The placeholder symbol for node i; the initial interval Φ0(x i The interval is [0,1), and in each step, the interval is further divided; as shown in the following formula:
[0074] Φ0(x i )=(b0,v0)=(0,1);
[0075] Φ k (x i )=(b k ,v k )=(b k-1 +c(s k )l k-1 ,p(s k )l k-1 k = 1, 2, ..., 256;
[0076] In the formula, s k The placeholder symbol x for node i i The kth format, p(s) k ) indicates format s k The probability of c(s); k ) represents the cumulative probability; l k-1 b is the length of the previous interval; k-1 It is the starting point of the previous interval;
[0077] S73), place the placeholder symbol x of node i. i Map a value Y to the real number interval [0,1), and use the binary expansion of Y as the result of compression encoding; place the placeholder symbol x in the node to be encoded. i The corresponding number line mapping interval Φ k (xi ) In the floating point number selection step S8), a floating point number is selected to represent the placeholder of node i i .
[0078] As preferred, in the floating point number sequence to bit stream conversion step S8), specifically includes:
[0079] S81), selecting a floating point number within a specified range to represent the placeholder of a node, and converting each floating point number to binary form and then to byte stream;
[0080] S82), according to the interval length v k , dynamically selecting a floating point number with the least number of binary bits to represent each node;
[0081] S83), storing the dynamic floating point number binary bits of each node and converting them to bit stream;
[0082] S84), using breadth-first search to concatenate the bit streams of all the nodes in the octree into a bit stream with a certain length;
[0083] S85), establishing a prediction probability frequency table of the node placeholder symbols through arithmetic decoding, and mapping it to the real number interval [0, 1), and the sequence number for the interval is converted to binary form, thereby obtaining the decoded node placeholder symbols.
[0084] As preferred, in the bit stream to placeholder sequence conversion step S9), the bit stream is converted to the placeholder sequence of the octree using arithmetic decoding, and the point cloud data is reconstructed, specifically including:
[0085] S91), obtaining the information required for decoding, including the bit stream data, the coordinates of the root node, and the edge length;
[0086] S92), constructing the root node of the octree, and inputting the root node features into the entropy coding model to obtain the probability distribution of the placeholder symbols of the root node as the frequency table for arithmetic decoding;
[0087] S93), extracting the part of the root node layer from the bit stream and using the frequency table to parse it to a floating point number,
[0088] obtaining an 8-bit placeholder symbol representing the distribution of the child nodes of the root node;
[0089] S94), reconstructing the next layer of nodes according to the distribution of the child nodes of the root node obtained in step S93), specifically including creating an octree node for each child node with a placeholder symbol of 1 for the current root node, generating node features; and inputting them into the entropy coding model to obtain the probability distribution of the placeholder symbols of the new layer generating a plurality of frequency tables of arithmetic decoding;
[0090] S95), intercepting the part of the new layer from the bit stream, and parsing the symbol sequence of the new layer by using the new decoded frequency table, then continuing to reconstruct the next layer of the octree, repeating the above process until the reconstruction of the octree is completed;
[0091] S96), by traversing the reconstructed octree structure, extracting the center points of all child leaf nodes, completing the restoration of the point cloud data of the octree encoding.
[0092] The beneficial effects of the present application are:
[0093] 1. The present application reduces the quantization error, improves the compression efficiency, balances the calculation complexity and the compression effect, and significantly enhances the adaptability to high-resolution point cloud data by combining the multi-level spherical coordinate octree structure, graph convolution, grouping graph attention module and cross attention module.
[0094] 2. The present application adopts the octree structure based on multi-level spherical coordinates, solves the problem that the redundant information of point cloud in the Cartesian coordinate system cannot be fully utilized; by constructing the octree in the spherical coordinate system and classifying the point cloud data according to the distance, the points obtained by the same laser beam are more easily allocated to the same voxel, so that the local features are more easily learned, the redundant information processing is reduced, and higher quality and efficient coding is realized.
[0095] 3. The present application solves the problem that the existing method cannot effectively utilize the inherent correlation of nodes in the octree structure by embedding context information through graph convolution; by constructing the adjacency matrix of the parent graph and the distance graph, the context information is embedded by using graph convolution, so that the attention mechanism can introduce more semantic details, enhance the context understanding and prediction accuracy.
[0096] 4. The grouping graph attention module is used to solve the problem that the attention mechanism has high computational complexity and cannot fully capture local features; the grouping graph attention module reduces the calculation of distant points, reduces the computational complexity, enhances the local context learning ability, and shares information between groups to capture global features, thereby improving the efficiency and feature extraction ability.
[0097] 5. The cross attention module is used to solve the problem that the existing method cannot effectively utilize the high-resolution information expression of the octree; by using the cross attention module, the correlation between the parent node and the neighbor node context is learned, the receptive field of the model is expanded, the information expression is enriched, and the feature representation ability is improved. BRIEF DESCRIPTION OF DRAWINGS
[0098] Figure 1 The framework diagram of the point cloud encoding method of the present application;
[0099] Figure 2 A framework diagram of the graph convolution network module of the present application;
[0100] Figure 3 A framework diagram of the group graph attention and cross attention of the present application;
[0101] Figure 4 An error gamut diagram for the experiment of the embodiment of the present application. DETAILED DESCRIPTION
[0102] The specific embodiments of the present application will be further described below in conjunction with the accompanying drawings:
[0103] As shown in the figure, the embodiment provides a point cloud encoding method based on multi-level spherical octree and graph-driven attention entropy model, which comprises: Figure 1
[0104] S1), using an octree entropy model based on multi-level spherical coordinates to encode point cloud data; specifically comprising the following steps:
[0105] S11), introducing the quantization step of the spherical coordinate octree; the quantization step q ρ , θ , is respectively expressed as:
[0106] q ρ =q
[0107]
[0108] Where b represents the quantization step q ρ , the total number of bins of the coordinate, which is specifically represented as is the radial distance of the spherical coordinate through the origin to the point; is the polar angle measured downward from the positive z-axis; is the azimuth angle measured from the positive x-axis along the projection in the xy plane; q is the octree quantization step based on the Cartesian coordinate system; is the maximum value of the radial distance; max
[0109] S12), introducing the reconstruction error of the spherical coordinate octree s ; that is:
[0110]
[0111] In the formula, p i is the original point cloud coordinate; is the center coordinate of the voxel;
[0112] It can be found through observation that the error upper limit of the octree under the spherical coordinate is linearly related to p; therefore, for the divided voxel, the farther the distance from the center point, the larger the volume, and the greater the error upper limit caused;
[0113] S13), obtaining the original point cloud data, converting the Cartesian coordinate system (x, y, z) in the data into a spherical coordinate system Calculate the maximum radial distance p of the converted data max , calculate the quantization step according to the formula of step S11), and normalize the converted point cloud data; calculate the maximum radial distance r of the normalized point cloud again max , use r max and the processed point cloud to build an octree;
[0114] S14), first calculate the boundary range of the point cloud according to r max , then calculate the center and maximum range of the bounding box enclosing the entire point cloud; these values are used to determine the properties of the root node of the octree; starting from the root node of the octree, according to the maximum depth of the tree specified by humans, it is determined whether to continue to divide the current octant node into child nodes or to keep it as a leaf node; if the current octant node has not reached the maximum depth, it is recursively divided into eight child nodes, and the division is based on the center point of the node; each child node covers a specific sub-region of the parent node space;
[0115] For each octree node, add node features, including center spherical coordinates octant, tree depth, occupancy; recursively build until the maximum depth is reached to obtain an octree containing node features.
[0116] As preferred in this embodiment, in step S11), the point cloud is divided into N levels, and different numbers of additional quantization levels are assigned to each level; the number of additional quantization levels for each level is n, which takes a value in the range {0, 1,..., N-1}, and on this basis, the p n in the interval [t n p max , t n+1 p max ), where t n is the critical value of the partition, satisfying 0≤t n < t n+1 <1, t0=0, t N =1; the additional quantization level is represented as a reduction in the quantization step, which is specifically q n = q / 2 n ; in actual operation, the number of levels N is set to 3; the corresponding
[0117] Therefore, the upper limit of the reconstruction error e s is controlled to be less than or equal to the octree reconstruction error e cupper limit, a multi-level concept of spherical coordinate octree is introduced, whose reconstruction error ε n is expressed as:
[0118]
[0119] S2), constructing the adjacency matrix of the parent graph and the distance graph by using the octree structure and the spherical coordinate representation of the point cloud; specifically including the following steps:
[0120] S21), obtaining the adjacency matrix of the parent graph according to the hierarchical relationship of the multi-level spherical coordinate octree constructed in step S1). In this embodiment, the parent graph is constructed by traversing the ancestor nodes of multiple levels of the multi-level spherical coordinate octree; and for context nodes sharing the same ancestor, a unit edge weight is given. For nodes o i and o j in the same context, the calculation formula of the edge weight Edge p (o i ,o j ) of the nodes in the parent graph is:
[0121] Edge p (o i ,o j ) = ∑1 m U m ;
[0122]
[0123] In the formula, m represents the depth of the current octree when searching for the ancestor nodes of the nodes o i and o j ; respectively represent the ancestor nodes of the nodes o i and o j under the current octree depth m.
[0124] S22), constructing the adjacency matrix of the distance graph based on the geometric distance relationship of the point cloud; in this embodiment, for the nodes o i and o j of the spherical coordinate octree, the distance D(o i ,o j ) between them is expressed as:
[0125]
[0126] In the formula, respectively represent the spherical coordinate radial lengths of the nodes o i and o j ; respectively represent the polar angles of the spherical coordinates of the nodes o i and o j ; Representing node o i and o j The azimuth angle φ in spherical coordinates.
[0127] In this embodiment, for node o of the spherical coordinate octree i and o j The unit edge weight between them is expressed as:
[0128]
[0129] In the formula, D max D min Representing node o i and o j The maximum and minimum distances between them; the above regularization operation can restrict the final unit edge weight to the range [0,1].
[0130] S3) Construct an entropy coding model based on graph-driven attention; wherein, the grouped graph attention module is used to learn the context information of the parent node, reduce computational complexity by reducing the calculation of distant points, enhance the local context learning ability, and share information between groups to capture global features;
[0131] The cross-attention module enhances feature extraction by learning between the encoded neighbor node context and the parent node context.
[0132] S4) Use graph convolutional network modules to embed contextual information using adjacency matrices; such as Figure 2 As shown, the graph convolutional network module described in this embodiment includes multiple linear layers (Linear) and a multilayer perceptron (MLP). The graph convolutional network module embeds contextual information into the adjacency matrix, specifically including: the graph convolutional network module maps the contextual information to be embedded onto the target dimension through linear layers (Linear), and then multiplies it with the adjacency matrix; the resulting features are then passed through another linear layer (Linear) and multiplied with the adjacency matrix again; the resulting features are then normalized using a LayerNorm operation; finally, the convolutional output is mapped to the target output dimension through a multilayer perceptron (MLP) and residual connections, thereby obtaining the embedded contextual information.
[0133] S5) Construct grouped graph attention modules and cross-attention modules to learn the relevance between parent node context and sibling node context; such as Figure 3 As shown in this embodiment, the grouped graph attention module is used to learn the context information of the parent node. By reducing the calculation of distant points, the computational complexity is reduced, the local context learning ability is enhanced, and information is shared between groups to capture global features; thereby simplifying the calculation while enhancing the feature representation.
[0134] The grouping graph attention module splits the long sequence context according to the edge weight of the adjacency matrix embedded with the context information, and specifically includes the following steps:
[0135] S511), the adjacency matrix of the parent graph / distance graph is alternately input, and the tensor with a size of (batch_size, N, in_feature) is transformed into (batch_size*n, N / n, in_feature) according to the input; wherein n is the number of groups, and in_feature is the feature dimension of the input tensor;
[0136] S512), the features of the context information are mapped to the target dimension out_feature through a linear layer;
[0137] S513), then through one-time horizontal replication and splicing, the data dimension is expanded from (batch_size*n, N / n, out_feature) to (batch_size*n, N / n, N / n, out_feature);
[0138] S514), then go through one-time vertical replication and splicing, and expand the data dimension from (batch_size*n, N / n, N / n, out_feature) to (batch_size*n, N / n, N / n, 2*out_feature); wherein N represents the length of the input sequence;
[0139] S515), then use the corresponding part of the adjacency matrix for mask processing; extract the attention weight between nodes;
[0140] S516), multiply the attention weight with the value vector mapped to the target dimension through linear transformation to obtain the attention output, finally capture the group information through the multi-layer perception MLP, realize more detailed feature learning, reshape the data dimension, restore the grouping, and obtain the final output result of the grouping graph attention module.
[0141] The grouping graph attention module of the application reduces the calculation of long-distance nodes, mainly concentrates in the local window, and the calculation complexity is Compared with the traditional attention mechanism, the calculation amount is reduced , wherein k is the size of the sub-window. Since the distribution of node dependency relationship in the octree context is more concentrated, even if a smaller k is used, a better prediction effect can be achieved.
[0142] In the embodiment, the cross attention module enhances feature extraction by learning between the encoded neighbor node context and the parent node context, specifically as follows:
[0143] First, the parent node context is projected to the same feature dimension through two linear layers to generate key K and value V vectors;
[0144] Then, the neighbor node context is compressed through a linear layer to generate a query Q vector;
[0145] Next, the neighbor node context queries the parent node context, i.e., the query Q vector of the neighbor node context is multiplied by the key K vector of the parent node context; and normalized through a softmax activation function to obtain an attention weight;
[0146] Finally, the attention weight is multiplied by the value V vector of the parent node context to obtain the final result.
[0147] S6), predict the probability of the placeholder symbol of each octree node based on the entropy coding model; specifically:
[0148] The probability distribution of the placeholder symbol of each octree node is predicted by the entropy coding model , that is:
[0149]
[0150] In the formula, represents the probability value of the entropy coding model at a given point a; n a represents the occupancy of the coding node; f a , f a and f represent the embedding of the current feature and the reference feature respectively; ω is the context window length, and w is the weight of the entropy model;
[0151] Since the distribution of a only depends on the local context window of the octree node n , the distribution is predicted using all the features of the current sequence and the selected reference sequence
[0152] In this embodiment, the goal of the entropy coding model is to improve the accuracy by minimizing the cross entropy between the estimated distribution and the real distribution Q(n); therefore, the objective function of the entropy coding model is:
[0153] E n~Q [-log n Q(n)];
[0154] In the formula, E represents the expectation of the logarithmic loss of the prediction value of the entropy coding model for the node symbol n under the condition that the node symbol n is subject to the distribution Q; Q(n) represents the real probability distribution of the node placeholder symbol n generated by the actual data; and n represents the node placeholder symbol of the octree.
[0155] S7), compressing the placeholder symbol sequence of the octree node into a binary floating-point number sequence using arithmetic coding; specifically comprising the following steps:
[0156] S71), establishing a frequency table; specifically comprising the following steps:
[0157] S711), collecting and counting the frequency of occurrence of each node placeholder symbol x i Since there can be 256 kinds of symbols in the node of the octree, the number of occurrences of each kind of symbol is counted;
[0158] S712), dividing the number of occurrences of each kind of symbol by the total number of symbols to obtain the probability p(s k ) of each symbol, which represents the relative frequency of the symbol s k in the node symbol set;
[0159] S713), according to the order of occurrence of the symbols, from the lowest to the highest probability, the cumulative probability c(s k ) of each symbol is calculated one by one; the cumulative probability represents the position of the symbol s k in the frequency table, forming an interval from 0 to 1, and the calculation formula is:
[0160]
[0161] S714), based on the frequency table, associating the interval size with the symbol occurrence probability.
[0162] S72), creating a series of nested intervals in the form of Φ k (x i )=(b,v), wherein Φ k (x i ) represents the number axis mapping interval; b represents the starting point of the nested interval, v represents the length of the nested interval, and x i represents the placeholder symbol of node i; the initial interval Φ0(x i ) is [0,1), and in each step, the interval is further divided; specifically as follows:
[0163] Φ0(x i )=(b0,v0)=(0,1);
[0164] Φ k (x i )=(b k ,vk ) = (b k-1 +c(s k )l k-1 ,p(s k )l k-1 );k=1,2,…,256;
[0165] where s k denotes the k-th format of the placeholder x i of node i, p(s k ) denotes the probability of format s k ; c(s k ) denotes the cumulative probability; l k-1 is the length of the previous interval; b k-1 is the start point of the previous interval.
[0166] S73), mapping the placeholder x i of node i to a value Y on the real interval [0, 1), and taking the binary expansion of Y as the compression encoding result; in the corresponding number line mapping interval Φ i (x k ) of the node placeholder x i to be encoded, a floating-point number is selected to represent the placeholder x i of node i.
[0167] S8), converting the binary floating-point number sequence into a bit stream; specifically including the following steps:
[0168] S81), selecting a limited floating-point number within a specified range to represent the placeholder of the node, and converting each floating-point number into binary form and then into a byte stream;
[0169] S82), dynamically selecting a floating-point number with the least number of binary bits to represent each node according to the interval length v k ; for example, for interval length v k ∈ [0.25, 0.5), the potential selection set is {0, 0.25, 0.5, 0.75}, which corresponds to the binary form {0.002, 0.012, 0.102, 0.112}, and the minimum number of bits used is
[0170] S83), storing the dynamic floating-point binary bits of each node and converting them into a bit stream;
[0171] S74), using breadth-first search to concatenate the bit streams of all the nodes in the octree into a bit stream with a certain length;
[0172] S85), the prediction probability frequency table of the node placeholder symbol is established by arithmetic decoding and is mapped to the real number interval [0, 1), and the serial number of the interval is converted into binary form, so that the decoded node placeholder symbol is obtained.
[0173] S9), the bit stream is converted into the placeholder symbol sequence of the octree by using arithmetic decoding, and the octree is reconstructed and the point cloud data is restored, specifically including the following steps:
[0174] S91), information required for decoding is obtained, including bit stream data, coordinates and edge length of the root node;
[0175] S92), the root node of the octree is constructed, and the root node features are input into the entropy coding model to obtain the probability distribution of the placeholder symbol of the root node as the frequency table of arithmetic decoding;
[0176] S93), the part of the root node layer in the bit stream is intercepted and parsed into a floating point number by using the frequency table, and an 8-bit placeholder symbol representing the distribution of the child nodes of the root node is obtained;
[0177] S94), the next layer node is reconstructed according to the child node distribution of the root node obtained in step S93), specifically, for the current root node, an octree node is created for each child node with a placeholder symbol of 1, and node features are generated; and the node features are input into the entropy coding model to obtain the probability distribution of the placeholder symbol of the new layer a plurality of frequency tables of arithmetic decoding are generated;
[0178] S95), the part of the new layer in the bit stream is intercepted, and the new decoded frequency table is used to parse the symbol sequence of the new layer, and then the next layer of the octree is reconstructed, and the above process is repeated until the reconstruction of the octree is completed;
[0179] S96), by traversing the reconstructed octree structure, the center points of all child leaf nodes are extracted, and the point cloud data restoration of the octree coding is completed.
[0180] In addition, the 3D point cloud data sets used in the embodiment, the SemanticKITTI data set and the Ford data set, are used to verify the method of the embodiment.
[0181] wherein the SemanticKITTI dataset contains 22 sequences, totaling 43,504 scans, each containing over 120,000 individual points. Sequences 00 to 10 are used for training, and sequences 11 to 21 are used for testing. The Ford dataset contains scans of over 1,500 static point cloud scenes, using the same training / test split as the Ford benchmark task, including 1,045 for training, 156 for validation, and 312 for testing. For the SemanticKITTI dataset, the quantization step is set to D is the octree depth, which is maximally 14 in training and 9 to 14 in testing, and the sequence length is 32 to 1024. For the Ford dataset, the quantization step is set to The octree depth is maximally 16 in training and 11 to 16 in testing. Point-to-point peak signal-to-noise ratio (D1 PSNR), point-to-plane peak signal-to-noise ratio (D2 PSNR), and Chamfer distance (CD) are used to evaluate the point cloud reconstruction quality. As shown in Figure 4 the color error is closer to blue, indicating that the reconstructed three-dimensional points are closer to the original points. The GPCC and EHEM are used as a comparison in the present embodiment; wherein the GPCC is a point cloud compression method proposed by the International Dynamic Image Expert Group MPEG; and the EHEM (Efficient Hierarchical Entropy Model) is an existing point cloud compression method. The results prove that the data volume after compression by the method of the present embodiment is significantly reduced, and since the entropy coding model based on the multi-level spherical coordinate octree and the graph-driven attention more efficiently encodes the three-dimensional point cloud data, the reconstructed point cloud data can still maintain high accuracy. By reducing the storage and transmission overhead, while ensuring the reconstruction quality.
[0182] The above embodiments and descriptions described only illustrate the principles and the best mode of the present application, and the present application can have various changes and improvements without departing from the spirit and scope of the present application, and these changes and improvements all fall within the scope of the claimed present application.
Claims
1. A point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model, characterized in that, Includes the following steps: S1) Encode the point cloud data using an octree entropy model based on multi-level spherical coordinates; S2) Construct the adjacency matrix of the parent graph and the distance graph using the octree structure and the spherical coordinate representation of the point cloud; S3) Construct an entropy coding model based on graph-driven attention; S4) Use graph convolutional network modules to embed contextual information using adjacency matrices; S4) Use the grouped graph attention module and the cross attention module to learn the relevance between the parent node context and the sibling node context; S5) Predict the probability of placeholder symbols for each octree node based on an entropy coding model; S6) Arithmetic coding is used to compress the placeholder sign sequence of the octree node into a binary floating-point sequence; S7) Convert the binary floating-point sequence into a bit stream; S8) Use arithmetic decoding to convert the bit stream into a placeholder sequence of octrees, reconstruct it into an octree, and restore the point cloud data.
2. The point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 1, characterized in that: In step S1), the reconstruction error of the multi-level spherical coordinate octree entropy model Represented as: In the formula, ; Quantize the step size of the octree based on the Cartesian coordinate system; The number of additional quantization levels for each interval; This represents the maximum radial distance. It is the first The critical value of each partition.
3. The point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 1, characterized in that: In step S2), the adjacency matrix of the parent graph and the distance graph is constructed, which specifically includes the following steps: S21) Obtain the adjacency matrix of the parent graph based on the hierarchical relationship of the multi-level spherical coordinate octree entropy model constructed in step S1). S22) Construct the adjacency matrix of the distance graph based on the geometric distance relationship of the point cloud.
4. The point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 3, characterized in that: In step S21), a parent graph is constructed by traversing the ancestor nodes of multiple levels of the octree entropy model in multi-level spherical coordinates; and for context nodes sharing the same ancestor, a unit edge weight is assigned; for nodes in the same context... and Edge weights of nodes in the parent graph The calculation formula is: ; ; In the formula, m represents the search node. and The ancestor node is the depth of the current octree; , These represent the nodes at the current octree depth m. and Ancestor node.
5. The point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 4, characterized in that: In step S22), for the nodes of the spherical coordinate octree and The distance between the two Represented as: ; In the formula, , Representing nodes respectively and spherical coordinate radial length ; , Representing nodes respectively and polar angle of spherical coordinates ; , Representing nodes respectively and azimuth of spherical coordinates .
6. The point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 5, characterized in that: In step S22), for the nodes of the spherical coordinate octree and The unit edge weight between them is expressed as: ; In the formula, , Representing nodes respectively and The maximum and minimum distances between them; the above regularization operation can restrict the final unit edge weight to the range [0,1].
7. The point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 1, characterized in that: The graph-driven attention-based entropy coding model includes a graph convolutional network module, a grouped graph attention module, and a cross attention module; The grouped graph attention module is used to learn the context information of the parent node, which reduces computational complexity by reducing the calculation of distant points, enhances the local context learning ability, and shares information between groups to capture global features; The cross-attention module enhances feature extraction by learning between the encoded neighbor node context and the parent node context.
8. A point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 7, characterized in that: In step S4), the graph convolutional network module includes multiple linear layers (Linear) and a multilayer perceptron (MLP). The graph convolutional network module maps the context information to be embedded onto the target dimension through the linear layers (Linear), and then multiplies it with the adjacency matrix. The resulting features are then passed through another linear layer (Linear) and multiplied with the adjacency matrix again. The resulting features are then normalized using the LayerNorm operation. Finally, the convolutional output is mapped to the target output dimension through a multilayer perceptron (MLP) and residual connections, thereby obtaining the embedded context information.
9. A point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 7, characterized in that: In step S5), the grouped graph attention module splits the long sequence context into groups based on the edge weights of the adjacency matrix containing embedded context information, specifically including the following steps: S511) Alternately input the adjacency matrices of the parent graph and the distance graph, and transform the tensor with input (batch_size, N, in_feature) into (batch_size*n, N / n, in_feature) accordingly; where The number of groups is given, and in_feature is the feature dimension of the input tensor; S512) Maps the features of the contextual information to the target dimension out_feature through a linear layer; S513), and then after a horizontal copy and splicing, the data dimension is expanded from (batch_size*n, N / n, out_feature) to (batch_size*n, N / n, N / n, out_feature). S514) After another vertical copying and splicing, the data dimension is expanded from (batch_size*n, N / n, N / n, out_feature) to (batch_size*n, N / n, N / n, 2*out_feature); where N represents the length of the input sequence; (S515) Then, the adjacency matrix of the corresponding part is used for masking; the attention weights between nodes are extracted. (S516) The attention weights are multiplied by the value vector that has been linearly transformed and mapped to the target dimension to obtain the attention output. Finally, the inter-group information is captured by the multilayer perceptron (MLP) to achieve more refined feature learning. The data dimensions are reshaped and the groups are merged and restored to obtain the final output of the group graph attention module.
10. A point cloud encoding method based on a multi-level spherical octree and a graph-driven attention entropy model according to claim 7, characterized in that: In step S5), the cross-attention module enhances feature extraction by learning between the encoded neighbor node context and the parent node context, as follows: First, the parent node context is projected onto the same feature dimension through two linear layers to generate key K and value V vectors; Then, the neighbor node context is compressed in terms of feature dimension through a linear layer to generate the query Q vector; Next, the query is performed from the neighbor node context to the parent node context, that is, the query Q vector of the neighbor node context is multiplied by the key K vector of the parent node context; and then normalized by the softmax activation function to obtain the attention weights. Finally, the attention weights are multiplied by the value vector V of the parent node's context to obtain the final result.
Citation Information
Patent Citations
Multi-view fusion space-time dynamic graph convolutional network urban traffic flow prediction method
CN116935649A
Traffic accident prediction systems and methods
US20230140289A1