A Spatial Curve Shape Matching Method Based on Deep Learning
Through deep learning technology, the shape information of the streamline data set is encoded into vector descriptors in the latent feature space, which solves the problems of poor streamline pattern description and time-consuming calculation in the prior art, and achieves the speed and accuracy of streamline shape matching.
Patent Information
- Application Number
- CN202210068297.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-01-20
AI Technical Summary
The prior art is difficult to effectively describe the pattern of a single streamline in flow field visualization, and the calculation of paired distances based on similarity measurement is long, and the shape descriptor method is not accurate enough when changing shapes.
The spatial curve shape matching method based on deep learning is adopted to encode the shape information of the streamline data set into vector descriptors in the latent feature space, and the shape matching of the streamline is achieved through visible graph expansion, threshold filtering, sampling, and neural network training steps of time series data.
The speed and accuracy of streamlined shape matching are improved, and the shape changes can be effectively captured and adapted to a certain degree of shape changes, avoiding information loss.
Smart Images

Figure CN114419347B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer prediction models, and specifically relates to a spatial curve shape matching method based on deep learning. Background Art
[0002] Flow visualization is an important topic in scientific visualization. It helps scientists and researchers understand the underlying physical phenomena, which are often associated with specific flow patterns and are visualized through streamline shapes, such as vortices and cerebral aneurysms. This makes it crucial to distinguish different flow patterns and features within streamlines and identify them within the flow field. This topic has been extensively studied in various contexts, including streamline selection, streamline clustering, flow feature detection, shape matching, and shape analysis of curves and ensemble models.
[0003] Existing methods can be roughly divided into two categories: similarity metrics and shape descriptors. Similarity metrics evaluate the similarity of two streamlines, thereby clustering the streamlines based on their similarity and selecting representative streamlines to concisely reveal the flow pattern of the flow field. Shape descriptor methods do not rely on the comparison of streamlines. Instead, this method embeds streamlines as vectors into an abstract space so that pattern features can be extracted in this space. These vectors can be generated in many different ways, and early methods often constructed descriptors based on geometric properties such as curvature and torque.
[0004] Oeltze et al. studied the impact of distance similarity metrics and clustering techniques on blood flow clustering. They categorized streamline similarity metrics into two types: geometry-based and attribute-based. They considered both geometry-based point-pair distances and attribute-based distances when implementing blood flow clustering. Geometry-based streamline similarity is typically represented by a distance metric, generally requiring positivity and symmetry. A common choice is the Hausdorff distance, but this distance is highly sensitive to streamline length because it outputs the maximum distance between all pairs of points. As an alternative to reduce clustering error, Oeltze et al. chose the MCPD distance, which is less sensitive to streamline length because it outputs the average distance between the closest pairs of points. In addition to streamline geometry, they also used streamline attributes for clustering, such as pressure, velocity magnitude, velocity gradient magnitude, angular velocity, and vorticity magnitude. By calculating the distance between streamline attributes and applying them together with the geometry-based MCPD distance to streamline clustering, they achieved more refined clustering results.
[0005] Descriptors are generally used to describe the shape of three-dimensional curves or geometric objects. Early methods, appearing in computer graphics, collected sampled information to form histograms as descriptors. With the continuous development of neural networks and deep learning in recent years, their application in many fields has become increasingly widespread. Given the powerful ability of neural networks to explore the underlying patterns in data, encoding streamlines through deep learning to form potential descriptors for shape matching has become a current research direction to further explore the underlying characteristics of flow fields.
[0006] Methods based on similarity metrics can only describe the relationships between streamlines, not the patterns of individual streamlines. This limits further analysis of distance-based streamlines, such as various clustering methods. Furthermore, such methods typically require computing pairwise distances between a large number of streamlines to fully analyze the structure of the flow field, a costly task. In contrast, shape descriptor methods can describe the shape of streamlines without reference to other streamlines, but they are typically based on aggregated attributes that may not be accurate or robust to varying shapes. Summary of the Invention
[0007] In view of the shortcomings of the existing technology, the present invention provides a spatial curve shape matching method based on deep learning. Through deep learning, the shape information of any streamline data set is separately encoded and embedded into a latent feature space. Under the premise of minimizing information loss as much as possible, accurate shape matching is performed using the latent vector descriptors encoded by the streamlines.
[0008] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0009] A spatial curve shape matching method based on deep learning, the method comprises obtaining a visible graph of the streamline by expanding the visible graph of time series data on the streamline, generating a pairwise distance matrix between all points on the streamline s, and obtaining Then, the required threshold d is selected to filter the matrix to generate a visible graph with a distance d. Sampling is performed in the visible graph to obtain a subgraph. The neural network is trained through deep learning to obtain the latent vector, and finally the shape matching of the streamline is achieved.
[0010] It should be noted that the top of the visible graph is a time series, and the bottom is its corresponding visible graph; the height of each bar in the bar graph represents the size of a value in the time series, and corresponds to a node arranged in the same order in the visible graph; if the bars corresponding to two nodes can observe each other without being blocked by other bars, they are connected by an edge in the visible graph; for a streamline composed of a series of sampling points, if the distance between one point and another is less than the threshold d, then they are visible to each other.
[0011] It should be noted that the visibility graph at infinite distance in the form of an adjacency matrix is the distance matrix of points on the streamline s. The visibility graph with a smaller threshold is a subset of the visibility graph with a larger threshold. That is, if d < d', then
[0012] It should be noted that for a smaller distance d, the visibility graph may only capture the shape structure of a small range of the streamline and is not sufficient to accurately describe the actual shape of the streamline. For an increasingly larger distance d, the visibility graph can capture a structure that is closer and closer to the original streamline layout.
[0013] It should be noted that obtaining a subgraph by sampling in the visibility graph includes identifying a basic shape atlas in the flow field. The visibility graph represented in the form of an adjacency matrix corresponds to a streamline. Each position in each row or column represents a point on the streamline. By extracting the values at the corresponding positions in the matrix, the visible subgraph of the streamline segment is obtained.
[0014] It should be noted that the present invention also includes three sampling strategies:
[0015] Uniform sampling, that is, points are uniformly sampled at a fixed step size. That is, one point is selected as a sampling point between every two points on the streamline; when using a fractional step size, bilinear interpolation is used to sample the visibility graph.
[0016] Equidistant sampling. For a selected sample point, in each iteration, a point with a set distance from the previous sample point is found as the next sample point. That is, a circle is drawn with the previous sample point as the center and the set sampling distance d as the radius, and the point on the streamline closest to the circle boundary is used as the next sampling point, and then this process is repeated continuously.
[0017] Curvature-based sampling. For a point p on the streamline s , its discrete curvature κ i is defined as where p i-1 , p i and p i+1 are three consecutive points on the streamline. That is, the discrete curvature at a certain point can be approximated by the angle between its two adjacent line segments; the curvature-based sampling strategy maintains the required cumulative curvature at consecutive streamline points. That is, sampling is an iterative process. Starting from one end of the streamline as the first sample point, the curvature from the last sample point to the current point is accumulated. Once it is greater than a given threshold α, the current point is saved as a new sampling point, and the accumulated curvature value is reset to zero, and then the sampling process is repeated.
[0018] It should be noted that the present invention also includes the normalization of the visible subgraph. All values in the visibility graph are divided by the length of the corresponding streamline segment to eliminate the influence of scale on the streamline shape matching.
[0019] It should be noted that the deep learning neural network architecture is a standard convolutional autoencoder, consisting of an encoder and a decoder. The encoder encodes the input data into a vector in the latent space, while the decoder reconstructs the original data from the vector. The encoder takes a visual subgraph (equivalent to a two-dimensional image) as input and maps it to a 128-dimensional latent vector through three convolutional layers and two fully connected layers. The decoder uses a similar structure to reconstruct the latent vector into a visual subgraph, compares the reconstructed image with the original input image, and trains the network with the mean square error (MSE) L as the error:
[0020]
[0021] Among them, N is the number of samples (the number of visible subgraphs), n 2 is the size of the square image, x and y are the original image and the reconstructed image, respectively. Through neural network training, we record the shape information of the streamline segment in the 128-dimensional latent vector output by the encoder and use it as the descriptor of the streamline segment for subsequent shape matching.
[0022] It should be noted that the 128-dimensional latent vector corresponding to each streamline segment is obtained through the trained neural network model, that is, each streamline segment has a one-to-one correspondence with a specific latent vector; for two different streamlines s1 and s2, their corresponding latent vectors are v1 and v2 respectively, and the similarity measure of s1 and s2 is defined as the Euclidean distance dis between their corresponding latent vectors, that is:
[0023]
[0024] where v1 and v2 are the latent vectors of streamlines s1 and s2 respectively, and n is the dimension of the latent vector.
[0025] It should be noted that in order to measure the similarity between streamlines, a threshold is set for the similarity of streamlines. If the Euclidean distance between the potential vectors corresponding to the two streamlines is less than the threshold Right now The two streamlines are similar.
[0026] The beneficial effects of the present invention are:
[0027] 1. Compared to existing similarity metrics and shape descriptor methods, the present invention calculates pairwise distances on large amounts of streamline segment data faster than similarity metrics between point pairs, and the training data requires less time to learn a common embedding feature space. Secondly, this method can effectively capture shape changes. The visible graph can well capture the shape of a curve because the position of each point is constrained by its distance to all other points. The present invention can preserve this information by reconstructing the visible graph through a neural network. In contrast, this is impossible with most highly aggregated shape descriptors. Using this technology, it is easy to perform precise shape matching in a dataset and can adapt to a certain degree of shape change.
[0028] 2. Compared to existing technologies, this invention utilizes deep learning to encode streamlines into latent descriptors in a feature space. This differs in that, compared to methods based on similarity metrics, it can describe the flow pattern of a flow field without the need for reference to other streamlines; and compared to descriptor methods, it does not suffer from information loss during the encoding process. Through the technology of this invention, the visible graph of any dataset can be mapped into a universal latent feature space, which supports rapid shape matching and dataset comparison within a single embedding space. Furthermore, this invention employs three different sampling methods to provide users with different types of shape matching results. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is the original visible diagram legend in the present invention;
[0030] Figure 2 This is a schematic diagram of the data form of the streamline in the present invention;
[0031] Figure 3 A subgraph for extracting streamline segments from a visible graph of streamlines in the present invention;
[0032] Figure 4 An example diagram of sampling a streamline for the three strategies in the present invention;
[0033] Figure 5 Schematic diagram of the network structure in the present invention;
[0034] Figure 6 A schematic diagram of the shape matching process for visualizing the results of the present invention; DETAILED DESCRIPTION
[0035] The present invention will be further described below in conjunction with the accompanying drawings. It should be noted that this embodiment is based on the technical solution and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to this embodiment.
[0036] The present invention is a method for matching the shapes of space curves based on deep learning. The method includes obtaining the visibility graph of a streamline by expanding the visibility graph of time series data on the streamline, generating a pairwise distance matrix between all points on the streamline s to obtain Then, a required threshold d is selected to filter the matrix to generate a visibility graph with a distance of d. Subgraphs are obtained by sampling in the visibility graph, and potential vectors are obtained through deep learning training of a neural network. Finally, the shape matching of the streamline is achieved.
[0037] It should be noted that the top of the visibility graph is a time series, and the bottom is its corresponding visibility graph; the height of each bar in the bar graph represents the magnitude of a value in the time series and corresponds to a node arranged in the same order in the visibility graph; if the bars corresponding to two nodes can observe each other without being blocked by other bars, they are connected by an edge in the visibility graph; for a streamline composed of a series of sampling points, if the distance between one point and another point is less than the threshold d, then they are visible to each other.
[0038] It should be noted that the visibility graph at infinite distance in the form of an adjacency matrix is the distance matrix of points on the streamline s. The visibility graph with a smaller threshold is a subset of the visibility graph with a larger threshold, that is, if d < d', then
[0039] It should be noted that for a smaller distance d, the visibility graph may only capture the shape structure of a small range of the streamline and is not sufficient to accurately describe the actual shape of the streamline. For an increasingly larger distance d, the visibility graph can capture a structure closer to the original streamline layout.
[0040] It should be noted that obtaining subgraphs by sampling in the visibility graph includes, in order to identify the basic shape atlas in the flow field, the visibility graph corresponding to a streamline is represented in the form of an adjacency matrix. Each position in each row or column represents a point on the streamline. By extracting the values at the corresponding positions in the matrix, the visible subgraph of the streamline segment is obtained.
[0041] It should be noted that the present invention also includes three sampling strategies:
[0042] Uniform sampling, that is, points are sampled uniformly at a fixed step size, that is, one point is selected as a sampling point between every two points on the streamline; when using a fractional step size, bilinear interpolation is used to sample the visibility graph;
[0043] Equidistant sampling. For a selected sample point, a point with a set distance from the previous sample point is found as the next sample point in each iteration, that is, a circle is drawn with the previous sample point as the center and the set sampling distance d as the radius, and the point on the streamline closest to the circle boundary is used as the next sampling point, and then this process is repeated continuously;
[0044] Based on curvature sampling, for a point p on the streamline s i , its discrete curvature κ i Defined as where p i-1 , p i and p i+1 are three consecutive points on the streamline, that is, the discrete curvature at a certain point can be approximated by the angle between its two adjacent line segments; the curvature-based sampling strategy maintains the required cumulative curvature at continuous streamline points, that is, sampling is an iterative process, starting from one end of the streamline as the first sample point, accumulating the curvature from the last sample point to the current point, and once it is greater than a given threshold α, the current point is saved as a new sampling point, the accumulated curvature value is reset to zero, and then the sampling process is repeated.
[0045] It should be noted that the present invention also includes normalization of the visible subgraph, which divides all values in the visible graph by the length of the corresponding streamline segment to eliminate the influence of scale on streamline shape matching.
[0046] It should be noted that the deep learning neural network architecture is a standard convolutional autoencoder, consisting of an encoder and a decoder. The encoder encodes the input data into a vector in the latent space, while the decoder reconstructs the original data from the vector. The encoder takes a visual subgraph (equivalent to a two-dimensional image) as input and maps it to a 128-dimensional latent vector through three convolutional layers and two fully connected layers. The decoder uses a similar structure to reconstruct the latent vector into a visual subgraph, compares the reconstructed image with the original input image, and trains the network with the mean square error (MSE) L as the error:
[0047]
[0048] Among them, N is the number of samples (the number of visible subgraphs), n 2 is the size of the square image, x and y are the original image and the reconstructed image, respectively. Through neural network training, we record the shape information of the streamline segment in the 128-dimensional latent vector output by the encoder and use it as the descriptor of the streamline segment for subsequent shape matching.
[0049] It should be noted that the 128-dimensional latent vector corresponding to each streamline segment is obtained through the trained neural network model, that is, each streamline segment has a one-to-one correspondence with a specific latent vector; for two different streamlines s1 and s2, their corresponding latent vectors are v1 and v2 respectively, and the similarity measure of s1 and s2 is defined as the Euclidean distance dis between their corresponding latent vectors, that is:
[0050]
[0051] where v1 and v2 are the latent vectors of streamlines s1 and s2 respectively, and n is the dimension of the latent vector.
[0052] It should be noted that in order to measure the similarity between streamlines, a threshold is set for the similarity of streamlines. If the Euclidean distance between the potential vectors corresponding to the two streamlines is less than the threshold Right now The two streamlines are similar.
[0053] Example
[0054] 1. Extension of the visibility graph on streamlines.
[0055] (1) The concept of visible graph is applied to analyze time series data. The original visible graph is as follows: Figure 1 As shown in the figure, a time series is shown at the top and its corresponding visibility graph is shown at the bottom. The height of each bar in the bar graph represents the size of a value in the time series and corresponds to a node arranged in the same order in the visibility graph. If the bars corresponding to two nodes can "see" each other without being blocked by other bars, they are connected by an edge in the visibility graph. For example, two nodes in the visibility graph are connected because the corresponding bars can "see" each other in the time series data, but the nodes are not connected because there is a longer bar in the middle that blocks their visibility to each other, so they are not visible to each other. It is worth noting that the visibility graph is invariant under affine transformations. For example, when the time series data is scaled or translated horizontally or vertically, the visibility between each pair of nodes does not change. According to the above definition, the visibility graph of the time series data is obtained. In the next step, we will extend the visibility graph to the streamlines of the flow field.
[0056] (2) Visibility graph of streamlines: The data form of streamlines is different from that of time series data. Its visibility cannot be defined in the same way as the visibility of time series data. We choose to use a streamline visibility definition that is easier to calculate and more directly related to the streamline pattern: for a streamline composed of a series of sampling points, if the distance between one point and another point is less than the threshold d, then they are visible to each other. Figure 2 As shown, consider the red dot on the streamline shown in the figure. It uses a smaller d, with the red dot as the center and d as the radius to obtain the dotted circle in the figure. The points in the circle are visible to the selected point. Similarly, when a larger radius threshold is selected to obtain the dotted circle, the points enclosed are the points visible to the selected point.
[0057] The visible graph of a streamline is an undirected weighted graph. We represent a streamline s as a structure composed of a series of points, i.e., s = <p1, p2, …, p n >, and its visible graph at a distance d is represented as where each vertex v i ∈V s corresponds to a point p i ∈s, and an edge exists if and only if the distance between the corresponding points on the streamline is less than the threshold d, i.e., |p i - p j | < d.
[0058] 2. Generate a series of visible graphs: The visible graph at infinite distance in the form of an adjacency matrix is the distance matrix of the points on the streamline s. As can be seen from the different virtual circles obtained by using different distance thresholds d for the selected points (red dots), the visible graph with a smaller threshold is a subset of the visible graph with a larger threshold. That is, if d < d', then Figure 2 In this way, we can simply generate a pairwise distance matrix between all points on the streamline s to obtain and then select the required threshold d to filter this matrix to generate a visible graph at a distance of d. For a smaller distance d, the visible graph may only capture the shape structure of a small range of the streamline and is not sufficient to accurately describe the actual shape of the streamline. However, for an increasingly larger distance d, the visible graph can capture a structure that is closer and closer to the original streamline layout, which confirms the ability of the streamline visible graph proposed by us to extract patterns at different scales.
[0059] 3. Sample in the visible graph to obtain a subgraph
[0060] (1) To identify the basic shape atlas in the flow field, we extract the subgraph of the flow segment from the visible graph of the streamline, as shown in Figure 3 (a). The visible graph corresponding to a streamline in the form of an adjacency matrix is shown. Each position in each row or column represents a point on the streamline (arranged in order), forming the sample points of the flow segment. By extracting the values at the corresponding positions in the matrix, we obtain the visible subgraph of the flow segment as shown in Figure 3 (b).
[0061] (2) The selection of sample points is crucial for streamline-based shape analysis. We adopt three strategies to sample a streamline, as follows:
[0062] 2.1 Uniform sampling, that is, points are uniformly sampled at a fixed step size, as shown in Figure 4 (a) shows an example of uniform sampling with a step size of 2, which means that every two points on the streamline are selected as our sampling points. In our experiments, both integer and fractional step sizes are considered. When using fractional step sizes, bilinear interpolation is used to sample the visible graph.
[0063] 2.2 Equidistant sampling, such as Figure 4 As shown in (b), for a selected sample point, the strategy finds a point with a set distance (closest) to the previous sample point as the next sample point in each iteration, that is, a circle is drawn with the previous sample point as the center and the set sampling distance d as the radius, and the point on the streamline closest to the circle boundary is taken as the next sampling point, and then this process is repeated.
[0064] 2.3 Curvature-based sampling, such as Figure 4 (c) As shown in Figure 2. For a point p on the streamline s i , its discrete curvature κ i Defined as where p i-1 , p i and p i+1 are three consecutive points on the streamline, that is, the discrete curvature at a point can be approximated by the angle between its two adjacent line segments. The curvature-based sampling strategy maintains the required cumulative curvature at consecutive streamline points. That is, sampling is an iterative process, starting with one end of the streamline as the first sample point, accumulating the curvature from the last sample point to the current point. Once it is greater than a given threshold α, the current point is saved as a new sampling point, the accumulated curvature value is reset to zero, and the sampling process is repeated.
[0065] 4. Normalization of the visible subgraph: The visible subgraph corresponds to streamline segments of different lengths, which greatly affects the distance between sample points and causes streamline patterns of different scales to be unable to be matched. Therefore, to normalize the visible subgraph, we divide all values in the visible graph by the length of the corresponding streamline segment to eliminate the impact of scale on streamline shape matching.
[0066] 5. Deep learning training of neural network to obtain latent vector: Our deep learning neural network architecture is a standard convolutional autoencoder, which consists of an encoder and a decoder. The encoder encodes the input data into a vector in the latent space, and the decoder reconstructs the original data from the vector. Our network structure is as follows Figure 5As shown in the figure, the encoder takes a visual subgraph (equivalent to a two-dimensional image) as input and maps it to a 128-dimensional latent vector through three convolutional layers and two fully connected layers. The decoder uses a similar structure to reconstruct the latent vector into a visual subgraph, compares the reconstructed image with the original input image, and trains the network with the mean square error (MSE) L as the error:
[0067]
[0068] Among them, N is the number of samples (the number of visible subgraphs), n 2 is the size of the square image, x and y are the original image and the reconstructed image, respectively. Through neural network training, we record the shape information of the streamline segment in the 128-dimensional latent vector output by the encoder and use it as the descriptor of the streamline segment for subsequent shape matching.
[0069] 6. Streamline shape matching: Using the trained neural network model, we can obtain the 128-dimensional latent vector corresponding to each streamline segment. That is, each streamline segment has a one-to-one correspondence with a specific latent vector. Therefore, we can use this 128-dimensional latent vector as a descriptor of the streamline for our shape matching. First, we need to define the similarity measure of the streamlines described by the latent vector. For two different streamlines s1 and s2, their corresponding latent vectors are v1 and v2 respectively. We define the similarity measure of s1 and s2 as the Euclidean distance dis between their corresponding latent vectors, that is:
[0070]
[0071] Where v1 and v2 are the latent vectors of streamlines s1 and s2 respectively, and n is the dimension of the latent vector. In our experiment, n = 128. To measure the similarity between streamlines, we set a threshold for the similarity of streamlines If the Euclidean distance between the potential vectors corresponding to the two streamlines is less than the threshold Right now Then we say that these two streamlines are similar.
[0072] Establish a one-to-one mapping between the original streamline and the potential vector, and visualize the shape matching process of the result as follows Figure 6 As shown in the figure, after selecting the dark target streamline, since each streamline corresponds to a specific potential vector, the Euclidean distance between other streamlines and the target streamline is calculated based on the potential vector of the streamline, and the calculated results that are less than the threshold value are All streamlines are visualized as light-colored streamlines as a result of matching the shape of the target streamlines we selected. Figure 6From the shape matching results, we can see that the matching results (light streamlines) and the target streamlines (dark streamlines) have a high degree of similarity in shape, which proves the effectiveness of our shape matching method based on deep learning.
[0073] Those skilled in the art can make various corresponding changes based on the above technical solutions and concepts, and all of these changes should be included in the protection scope of the claims of the present invention.
Claims
1. A method for spatial curve shape matching based on deep learning, characterized in that, The method includes obtaining the visible graph of the streamline by extending the visible graph of time series data on the streamline, and generating a pairwise distance matrix between all points on the streamline s to obtain Then, a required threshold d is selected to filter the matrix to generate a visible graph with a distance of d. Subgraphs are obtained by sampling in the visible graph, and a neural network is used for deep learning training to obtain latent vectors. Finally, the shape matching of the streamline is achieved; as can be seen, the top of the figure is a time series, and the bottom is its corresponding visible figure; the height of each bar in the bar chart represents the magnitude of a value in the time series and corresponds to a node arranged in the same order in the visible figure; if two bars corresponding to nodes can observe each other without being blocked by other bars, they are connected by an edge in the visible figure; for a streamline composed of a series of sampling points, if the distance between one point and another point is less than the threshold d, then they are visible to each other; the sampling in the visible figure to obtain a subfigure includes, in order to identify the basic shape atlas in the flow field, the visible figure corresponding to a streamline is represented in the form of an adjacency matrix, and each position in each row or each column represents a point on the streamline. By extracting the values at the corresponding positions in the matrix, the visible subfigure of the streamline segment is obtained; the deep learning neural network architecture is a standard convolutional autoencoder, consisting of an encoder and a decoder. The encoder encodes the input data into a vector in the latent space, and the decoder reconstructs the original data from this vector. The encoder takes a visible subfigure as input and maps it to a 128-dimensional latent vector through three convolutional layers and two fully connected layers, while the decoder uses a similar structure to reconstruct the latent vector into a visible subfigure. The reconstructed image is compared with the original input image, and the mean squared error (MSE) L is used as the error of the network for training: where N is the number of samples, n 2 is the size of the square image, and x and y are the original image and the reconstructed image, respectively; through the training of the neural network, the shape information of the streamline segment is recorded on the 128-dimensional latent vector output by the encoder, and this is used as the descriptor of the streamline segment for subsequent shape matching; Through the trained neural network model, a 128-dimensional latent vector corresponding to each streamline segment is obtained, that is, each streamline segment corresponds one-to-one with a specific latent vector; for two different streamlines s 1 and s 2 , their corresponding latent vectors are v 1 and v 2 , and the similarity measure between s 1 and s 2 is defined as the magnitude dis of the Euclidean distance between their corresponding latent vectors, that is: where, v 1 and v 2 are the latent vectors of streamline s 1 and s 2 respectively, and n is the dimension of the latent vector; To measure the similarity between streamlines, a threshold is set for the similarity of streamlines If the Euclidean distance between the potential vectors corresponding to two streamlines is less than the threshold That is These two streamlines are similar.
2. The method for spatial curve shape matching based on deep learning according to claim 1, characterized in that, Visible graph at infinite distance in the form of an adjacency matrix is the distance matrix of points on streamline s, and the visible graph with a smaller threshold is a subset of the visible graph with a larger threshold, that is, if d < d', then 3. The method for spatial curve shape matching based on deep learning according to claim 2, characterized in that, for a relatively small distance d, the visible figure may only capture the shape structure of a small range of the streamline, which is not sufficient to accurately describe the actual shape of the streamline. For a gradually increasing distance d, the visible figure can capture a structure that is closer and closer to the original streamline layout.
4. The method for spatial curve shape matching based on deep learning according to claim 1, characterized in that, it further includes three sampling strategies: uniform sampling, that is, points are uniformly sampled at a fixed step size, that is, one point is selected as a sampling point for every two points on the streamline; when using a fractional step size, bilinear interpolation is used to sample the visible figure; equidistant sampling, for a selected sample point, each iteration finds a point with a set distance from the previous sample point as the next sample point, that is, a circle is drawn with the previous sample point as the center and the set sampling distance d as the radius, and the point on the streamline closest to the circle boundary is used as the next sample point, and then this process is repeated continuously; Curvature-based sampling, for a point p on a streamline s i , its discrete curvature κ i is defined as where p i-1 , p i , p i+1 are three consecutive points on the streamline, that is, the discrete curvature at a certain point can be approximated by the angle between its two adjacent line segments; the curvature-based sampling strategy maintains the required cumulative curvature at consecutive streamline points, that is, the sampling is an iterative process that starts from one end of the streamline as the first sample point, accumulates the curvature from the last sample point to the current point, and once it is greater than the given threshold α, the current point is saved as a new sample point, the accumulated curvature value is reset to zero, and then the sampling process is repeated.
5. The method for spatial curve shape matching based on deep learning according to claim 1, characterized in that, It also includes the normalization of the visible sub-graph, where all values in the visible graph are divided by the length of the corresponding streamline segment to eliminate the influence of scale on streamline shape matching.
Citation Information
Patent Citations
Unsupervised graph representation learning method and device on large-scale attribute graph based on sub-graph sampling
CN111950594A
Fluid rapid synthesis method, device and system based on machine learning and medium
CN112017267A