A rock block section three-dimensional modeling method and system based on a twin neural network
By improving the loss function and feature normalization method of the Siamese neural network, the problems of low accuracy and efficiency in traditional 3D modeling of rock block cross sections are solved, and high-precision digital 3D model construction and intelligent reconstruction of rock block cross sections are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHWEST ENGINEERING CORPORATION LIMITED
- Filing Date
- 2026-03-17
- Publication Date
- 2026-06-23
AI Technical Summary
Traditional methods for identifying rock block cross sections and constructing digital 3D models rely on human experience, resulting in low modeling accuracy and efficiency, high data acquisition costs, and difficulty in applying them to complex cross sections.
A three-dimensional modeling method for rock block cross sections based on Siamese neural networks is adopted. By improving the loss function and feature normalization method of Siamese neural networks, a feature matching cost function is constructed to determine disparity information and build a digital three-dimensional model.
It improved the accuracy of rock block cross-section matching, reduced manual intervention in the modeling process, realized intelligent 3D reconstruction of rock blocks, and improved modeling accuracy and efficiency.
Smart Images

Figure CN121904304B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for three-dimensional modeling of rock block cross sections based on twin neural networks, belonging to the field of geological modeling technology. Background Technology
[0002] In geological exploration and mining, the fracture and segmentation morphology of rock blocks are important criteria for evaluating the stability of rock mass structures.
[0003] Traditional rock block cross section identification and digital 3D model construction mainly rely on manual measurement or structured light scanning methods. These methods have the following shortcomings: (1) The cross section registration and splicing process is highly dependent on human experience and subjectivity, resulting in low modeling accuracy and efficiency, and is not suitable for complex cross sections; (2) Rock block cross sections have high noise, irregular curved surfaces and broken boundaries, and traditional feature point-based matching algorithms are prone to failure; (3) Data acquisition costs are high, 3D scanners and structured light systems are expensive, and on-site deployment is complex. Summary of the Invention
[0004] This invention provides a method and system for three-dimensional modeling of rock block cross sections based on twin neural networks, which can solve the problems of low modeling accuracy and efficiency of existing methods.
[0005] On one hand, the present invention provides a method for three-dimensional modeling of rock block cross-sections based on twin neural networks, the method comprising:
[0006] S1. Obtain the first and second images of the rock block cross-section from different perspectives;
[0007] S2. Improve the loss function of the Siamese neural network based on the feature normalization method, and use the improved Siamese neural network to determine the first feature representation of the first image and the second feature representation of the second image; D1 < D2, where D1 represents the distance between the first feature representation and the second feature representation of the same spatial point on the rock block cross-section, and D2 represents the distance between the first feature representation and the second feature representation of different spatial points;
[0008] S3. Construct a feature matching cost function based on the first feature representation and the second feature representation, and determine the disparity information of the first image and the second image based on the feature matching cost function;
[0009] S4. Determine the depth information of the first image and the second image based on the parallax information, and construct a digital three-dimensional model of the rock block cross-section based on the depth information.
[0010] Optionally, in S2, the loss function of the Siamese neural network is improved based on the feature normalization method, specifically including:
[0011] The output features of the Siamese neural network are normalized based on the feature normalization method, and a regularization term is constructed based on the normalized output features.
[0012] The loss function of the Siamese neural network is improved based on the regularization term.
[0013] Optionally, in S3, a feature matching cost function is constructed based on the first feature representation and the second feature representation, specifically including:
[0014] The feature matching cost function is constructed based on the norm of the difference between the first and second feature representations of the same spatial point.
[0015] Optionally, in S3, determining the disparity information of the first image and the second image based on the feature matching cost function specifically includes:
[0016] Based on the feature matching cost function, the matching cost is minimized and optimized, and the disparity value corresponding to the minimized matching cost is determined as the optimal disparity value.
[0017] The disparity information of the first image and the second image is determined based on the optimal disparity value.
[0018] Optionally, determining the disparity information of the first image and the second image based on the optimal disparity value specifically includes:
[0019] Based on the optimal disparity value, the disparity information of the first image and the second image is determined using a smoothing constraint method.
[0020] Optionally, in step S4, the depth information of the first image and the second image is determined based on the disparity information, specifically including:
[0021] The depth value of each pixel in the first image and the second image is determined based on the parallax information, and the confidence level of each depth value is determined.
[0022] Depth values with confidence levels below a preset threshold are corrected to obtain depth information for the first and second images.
[0023] Optionally, the confidence level for each depth value is determined, specifically including:
[0024] The confidence level of each depth value is determined based on the optimal disparity value.
[0025] Optionally, depth values with confidence levels below a preset threshold are corrected, specifically including:
[0026] For depth values with confidence levels below a preset threshold, perform smoothing correction and / or normal correction.
[0027] Optionally, in S4, a digital three-dimensional model of the rock block cross-section is constructed based on the depth information, specifically including:
[0028] The point cloud data of the rock block cross section is determined based on the depth information;
[0029] Based on the point cloud data, a digital three-dimensional model of the rock block cross-section is constructed using a surface reconstruction algorithm.
[0030] On the other hand, the present invention provides a three-dimensional modeling system for rock block cross-sections based on a twin neural network, the system comprising:
[0031] The image acquisition module is used to acquire first and second images of the rock block cross-section from different perspectives.
[0032] The feature extraction module is used to improve the loss function of the Siamese neural network based on the feature normalization method, and to use the improved Siamese neural network to determine the first feature representation of the first image and the second feature representation of the second image; D1 < D2, where D1 represents the distance between the first feature representation and the second feature representation of the same spatial point on the rock block cross-section, and D2 represents the distance between the first feature representation and the second feature representation of different spatial points.
[0033] The disparity determination module is used to construct a feature matching cost function based on the first feature representation and the second feature representation, and to determine the disparity information of the first image and the second image based on the feature matching cost function;
[0034] The model building module is used to determine the depth information of the first and second images based on the parallax information, and to build a digital three-dimensional model of the rock block cross-section based on the depth information.
[0035] The beneficial effects that this invention can produce include:
[0036] This invention introduces a Siamese neural network to achieve a deep representation of rock block cross-sectional features, significantly improving cross-section matching accuracy and solving the problem of traditional modeling methods being susceptible to noise interference. Based on this, by improving the loss function of the Siamese neural network, the feature recognition and matching accuracy of the Siamese neural network for irregular, textured, and weakly characterized objects like rocks is enhanced. This allows the Siamese neural network to be applied to feature extraction of complex cross-sections such as fractured sections and mud-covered sections, and to perform feature measurement learning on corresponding regions of images from different perspectives, thereby establishing a highly robust embedded feature space across perspectives and forming a highly discriminative feature representation. Based on this highly discriminative feature representation, the disparity and depth information of images from different perspectives can be accurately determined, thus improving the construction accuracy of digital 3D models of rock block cross-sections and providing accurate modeling data for fields such as volume calculation, structural analysis, and geological simulation. Simultaneously, this invention utilizes automated feature matching and spatial stitching mechanisms to significantly reduce the degree of manual intervention in the modeling process, realizing intelligent 3D reconstruction of rock blocks and effectively improving modeling accuracy. Attached Figure Description
[0037] Figure 1 A flowchart illustrating a method for three-dimensional modeling of rock block cross-sections based on a twin neural network, provided in an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a rock block cross-section provided in an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of a digital three-dimensional model of a rock block cross-section provided in an embodiment of the present invention;
[0040] Figure 4 A comparison chart of the prediction accuracy of different modeling methods provided in the embodiments of the present invention. Detailed Implementation
[0041] The present invention will now be described in detail with reference to the embodiments, but the present invention is not limited to these embodiments.
[0042] This invention provides a method for three-dimensional modeling of rock block cross-sections based on twin neural networks, such as... Figure 1 As shown, the method includes:
[0043] S1. Obtain the first and second images of the rock block cross-section from different perspectives.
[0044] This embodiment utilizes two fixed-base imaging devices to capture first and second images of the rock cross-section from different perspectives. Then, three-dimensional spatial coordinate reference systems are established in both the first and second images, and each image is discretized into multiple image units, giving each image unit corresponding three-dimensional coordinates. Specifically, the image unit can be a pixel or a voxel; this embodiment uses pixels as an example.
[0045] In practice, rock sample specimens typically have multiple different rock block cross sections, such as... Figure 2 As shown, by placing the rock sample on a rotating device such as a turntable and rotating the rock sample one revolution at preset angular intervals (for example, rotating the turntable 36 times at 10° intervals), first and second images of different rock cross sections can be captured, which is convenient for subsequent construction of digital three-dimensional models of different rock cross sections.
[0046] The shooting device in this embodiment has a calibration device, which is used to correct the baseline of the two shooting devices.
[0047] Furthermore, to improve the data consistency and feature distinguishability of the first and second images, this embodiment performs image preprocessing on the first and second images. The image preprocessing includes:
[0048] 1. Image brightness correction.
[0049] The brightness distribution of the first and second images may be affected by factors such as changes in ambient light intensity and differences in exposure of the shooting devices. To mitigate these effects, this embodiment uses a global brightness normalization model to normalize the image brightness, making the brightness distribution of the images from different viewpoints more consistent, thereby reducing the impact of changes in light intensity and differences in device exposure on subsequent feature extraction.
[0050] Specifically, the global brightness normalization model can be expressed as:
[0051] (1)
[0052] In formula (1), Indicates either the first image or the second image. Representing an image The median coordinate is The brightness of the pixels, This represents the image after brightness normalization. Representing an image The median coordinate is The brightness of the pixels, Representing an image The average brightness of all pixels in the image. Representing an image The standard deviation of pixel brightness.
[0053] Furthermore, this embodiment can also utilize an adaptive histogram equalization method to correct local illumination unevenness. The local mapping function of the adaptive histogram equalization method can be expressed as:
[0054] (2)
[0055] In formula (2), The coordinates in the locally corrected image are... The brightness of the pixels, Representing an image The median coordinate is The brightness of the pixels, Indicated by local window centered The brightness probability distribution function within.
[0056] After the above corrections, the brightness and contrast of local areas of the image are improved, and the details at the image edges are more obvious.
[0057] 2. Image distortion correction.
[0058] Let the ideal imaging coordinates of the imaging device be... The pixel coordinates of the distorted image are Then the model formula for image distortion can be expressed as:
[0059] (3)
[0060] In formula (3), Indicates the radial distortion coefficient; Indicates the tangential distortion coefficient; Represents the ideal imaging coordinates of the shooting equipment; Represents the pixel coordinates of the distorted image.
[0061] Based on formula (3), using calibration parameters Ideal imaging coordinates can be recovered through reverse mapping calculation. Thus, the image after distortion correction is obtained. :
[0062] (4)
[0063] In formula (4), This represents the image after distortion correction. Indicates either the first image or the second image. Represents the ideal imaging coordinates of the shooting equipment. Represents the pixel coordinates of the distorted image.
[0064] After correction, the geometric consistency of the images from each viewpoint is guaranteed, providing accurate spatial correspondence for subsequent view matching.
[0065] 3. Edge and texture enhancement.
[0066] To highlight the texture of the rock block cross section and the characteristics of the fracture boundary, this embodiment uses a combination of high-pass filtering and gradient enhancement to enhance the edges and textures of the image.
[0067] Specifically, let the image convolution kernel be... and with As a high-pass operator, the edge enhancement process can be represented as:
[0068] (5)
[0069] In formula (5), This represents the image after edge enhancement processing. This represents the image after distortion correction. represents the high-pass operator, This indicates a convolution operation.
[0070] Among them, Qualcomm operators The typical form is as follows:
[0071] (6)
[0072] Then, in this embodiment, the image after edge enhancement processing and the image after brightness normalization processing are weighted and fused:
[0073] (7)
[0074] In formula (7), This represents the image after fusion. This represents the image after edge enhancement processing. This represents the image after brightness normalization. and To integrate the weighting coefficients, and .
[0075] After weighted fusion, the edge details, rock crack outlines and surface textures of the image are enhanced, which helps to capture the structural features of the rock cross section in subsequent steps.
[0076] 4. Normalized output.
[0077] This embodiment performs normalization processing on the image after the above processing. The normalization process can be represented as follows:
[0078] (8)
[0079] In formula (8), This represents the output image after normalization. This represents the image after fusion.
[0080] The above image preprocessing process can significantly improve the data consistency and feature distinguishability of images from different perspectives, thereby providing high-quality input data for subsequent feature extraction and modeling.
[0081] S2. Determine the first feature representation of the first image and the second feature representation of the second image based on the twin neural network; D1 < D2, where D1 represents the distance between the first feature representation and the second feature representation of the same spatial point on the rock block cross-section, and D2 represents the distance between the first feature representation and the second feature representation of different spatial points.
[0082] Both the first image and the second image are images that have undergone image preprocessing. The first feature representation includes the feature representation of each pixel in the first image, and the second feature representation includes the feature representation of each pixel in the second image. The feature representation can be in the form of vectors, matrices, etc.
[0083] Specifically, the Siamese neural network used in this embodiment includes two convolutional subnetworks that share weight parameters. and Two convolutional subnetworks are used to process the first image and the second image, respectively, and output the first feature representation of the first image and the second feature representation of the second image.
[0084] Let the first image and the second image be respectively and Then the two convolutional subnetworks and The first and second feature representations are output as follows:
[0085] (9)
[0086] In formula (9), and These are the first feature representation and the second feature representation, respectively. and These are the first image and the second image, respectively. and These are two convolutional subnetworks of a twin neural network.
[0087] because and Because the weight parameters are shared, it is possible to guarantee equivalent mapping of features from different perspectives under the same structural conditions.
[0088] In this embodiment, each convolutional subnetwork comprises three convolutional layers, one self-attention module, and one fully connected embedding layer. The kernel sizes of the three convolutional layers are 3×3, 5×5, and 3×3, corresponding to 64, 128, and 256 channels, respectively. The structure of the convolutional subnetwork can be represented as follows:
[0089] (10)
[0090] In formula (10), It is a convolutional subnetwork; , and It consists of three convolutional layers; It is a self-attention module used to enhance the sensitivity to local spatial relationships; This is a fully connected embedding layer used to map the features output by the convolutional layers to the embedding feature space, thus outputting the corresponding feature representation. The embedding feature space can have dimensions such as 128 or 256, and the two convolutional sub-networks each map their corresponding feature representations to the same embedding feature space.
[0091] When outputting the first feature representation and the second feature representation, the Siamese neural network also measures the similarity between the first feature representation and the second feature representation in the embedded feature space by measuring the distance between them, so as to ensure that the distance between the first feature representation and the second feature representation at the same spatial point on the rock block cross-section is much smaller than the distance between the first feature representation and the second feature representation at different spatial points.
[0092] Specifically, this embodiment uses the Euclidean distance metric function to measure the similarity between the first feature representation and the second feature representation in the embedding space.
[0093] The Euclidean distance metric function can be expressed as:
[0094] (11)
[0095] In formula (11), and These are the first feature representation and the second feature representation, respectively; The first feature representation Second feature representation The Euclidean distance between them; Represents the L2 norm;
[0096] When the first feature representation and the second feature representation match (i.e., the first feature representation and the second feature representation correspond to the same spatial point), Approaching 0; when the first feature representation and the second feature representation do not match (i.e., the first feature representation and the second feature representation correspond to different spatial points), It approaches a larger constant.
[0097] To enhance the robustness of the metric, this embodiment also defines a supplementary metric based on cosine similarity:
[0098] (12)
[0099] In formula (12), and These are the first feature representation and the second feature representation, respectively; The first feature representation Second feature representation The cosine of the angle between the vectors, .
[0100] The cosine value is 1 when the vector directions of the first and second feature representations are exactly the same; the cosine value is -1 when their vector directions are completely opposite. Based on the cosine value, the accuracy of similarity measurement can be further improved, thereby improving the feature recognition and matching accuracy of Siamese neural networks.
[0101] The loss function of the Siamese neural network in this embodiment is the contrastive loss function. During the training process of the Siamese neural network, the contrastive loss function can enable the Siamese neural network to maximize the distance between the first feature representation and the second feature representation corresponding to different spatial points, and minimize the distance between the first feature representation and the second feature representation corresponding to the same spatial point, so as to minimize the classification loss.
[0102] Specifically, let the first feature represent Second feature representation The matching labels of the formed sample pairs are . =0 indicates the first feature representation Second feature representation The resulting sample pairs are matched sample pairs; =1 indicates the first feature representation. Second feature representation The resulting sample pairs are non-matching sample pairs.
[0103] Therefore, the contrastive loss function can be expressed as:
[0104] (13)
[0105] In formula (13), To compare loss functions; The first feature representation Second feature representation The matching labels of the formed sample pairs; The total number of sample pairs; The first feature representation Second feature representation The Euclidean distance between them; It is a positive interval constant used to define the minimum distance between unmatched sample pairs.
[0106] During the training phase, by minimizing the expected value of the contrastive loss function, the Siamese neural network can learn that the embedding features between matched sample pairs are similar, while the embedding features between unmatched samples are far apart.
[0107] The process of minimizing the expected value of the contrastive loss function can be expressed as:
[0108] (14)
[0109] In formula (14), To compare loss functions; To compare the expected value of the loss function; Given the parameter set of the Siamese neural network, the parameters of the Siamese neural network are updated through backpropagation and gradient descent, iterating until the loss function converges.
[0110] To further improve the feature extraction stability and cross-perspective consistency of Siamese neural networks, this embodiment also improves the loss function of Siamese neural networks based on feature normalization methods, specifically including:
[0111] 1. Based on the feature normalization method, the output features of the fully connected embedding layer in the Siamese neural network are normalized to obtain the normalized output features:
[0112] (15)
[0113] In formula (15), The output features are those after normalization. This represents the output features of the fully connected embedding layer in a Siamese neural network.
[0114] 2. Construct an L2 regularization term based on all output features after normalization:
[0115] (16)
[0116] In formula (16), For L2 regularization terms, The normalized version Each output feature; This is the regularization coefficient.
[0117] 3. Improve the contrastive loss function of the Siamese neural network by applying the L2 regularization term to obtain the improved joint loss function:
[0118] (17)
[0119] In formula (17), For the improved joint loss function, The original contrastive loss function; This is an L2 regularization term.
[0120] This embodiment improves the loss function of the Siamese neural network, enhancing its feature recognition and matching accuracy for irregular, textured, and weakly cross-sectional objects like rocks. This enables the Siamese neural network to be applied to feature extraction of complex rock cross-sections and to perform feature measurement learning on corresponding regions of images from different perspectives. This establishes a highly robust cross-view embedding feature space, providing highly discriminative feature representations for subsequent modeling.
[0121] After training, the improved Siamese neural network exhibits good clustering properties in its mapped embedding feature space for any pixel in an image. Its characteristic representation It can be mapped to a high-dimensional feature manifold. Dimensionality reduction methods such as principal component analysis can be used to visualize the feature distribution embedded in the feature space to evaluate feature separability. Specifically, this embodiment defines a feature clustering metric to evaluate feature separability:
[0122] (18)
[0123] In formula (18), and These are the inter-class scatter matrix and the intra-class scatter matrix, respectively. Represents the matrix trace operation; For feature clustering metric, The larger the value, the higher the discriminability of the feature representation learned by the Siamese neural network.
[0124] S3. Construct a feature matching cost function based on the first feature representation and the second feature representation, and determine the disparity information of the first image and the second image based on the feature matching cost function. Specifically, this includes:
[0125] 1. Construct a feature matching cost function based on the norm of the difference between the first and second feature representations of the same spatial point. The feature matching cost function can be expressed as:
[0126] (19)
[0127] In formula (19), For matching costs; For pixels in the first image The first feature representation; For pixels in the second image The second feature representation; pixel and pixels Corresponding to the same spatial point on the cross-section of the rock block; For pixels and pixels The disparity value is the pixel offset within the disparity search range.
[0128] Matching cost Reflects the first feature representation Second feature representation In offset Similarity.
[0129] 2. Based on the feature matching cost function, the matching cost is minimized and optimized. The disparity value corresponding to the minimized matching cost is determined as the optimal disparity value, which can be expressed as:
[0130] (20)
[0131] In formula (20), To achieve the optimal disparity value, For matching costs; This represents the disparity value. This represents the maximum parallax range.
[0132] 3. Determine the disparity information of the first and second images based on the optimal disparity value.
[0133] This embodiment is based on the optimal disparity value. The disparity information of corresponding pixels in the first and second images can be determined, and the disparity information can be converted into a disparity map. Presented in the form of a disparity map The grayscale value is inversely proportional to the pixel depth.
[0134] Furthermore, to improve the parallax map To ensure smoothness and consistency, this embodiment also utilizes a smoothing constraint method to determine the disparity information of the first and second images, specifically including:
[0135] 1) Define smoothing constraint terms using the smoothing constraint method:
[0136] (twenty one)
[0137] In formula (21), For smoothing constraint terms; It is a set of pixel neighborhoods; Weighting factors are based on grayscale differences; and They represent the sets of pixels in the neighborhood. The positions of two adjacent pixels within; for The disparity value of the pixel at that location; for The disparity value of the pixel.
[0138] Among them, the weighting factor based on grayscale difference The calculation formula is:
[0139] (twenty two)
[0140] In formula (22), Weighting factors are based on grayscale differences; For the intensity difference scale parameter; and They represent the sets of pixels in the neighborhood. The positions of two adjacent pixels within; for The grayscale value of the pixel at that location; for The grayscale value of the pixel.
[0141] 2) Construct the total cost function based on the smoothing constraint term and the matching cost corresponding to the optimal disparity value:
[0142] (twenty three)
[0143] In formula (23), For the total cost; This is the optimal disparity value; This represents the matching cost corresponding to the optimal disparity value. For smoothing constraint terms; The weights of the smoothing constraint terms.
[0144] By minimizing the total cost function This allows us to obtain globally optimal disparity information.
[0145] S4. Determine the depth information of the first and second images based on the parallax information, and construct a digital 3D model of the rock block cross-section based on the depth information. Specifically, this includes:
[0146] 1. Determine the depth value of each pixel in the first and second images based on the parallax information.
[0147] Based on the known parameters of the shooting device (such as a stereo camera), the parallax information of each pixel can be converted into depth information through geometric relationships.
[0148] Specifically, assuming the optical centers of the two imaging devices are respectively and The baseline length of the two shooting devices is focal length is Then the projections of the same spatial point on the cross-section of the rock block onto the first and second images satisfy:
[0149] (twenty four)
[0150] In formula (24), and These are the projections of the same spatial point onto the first and second images, respectively. Baseline length; Focal length; , , ) represents the three-dimensional spatial coordinates of this point.
[0151] The definition of disparity is:
[0152] (25)
[0153] In formula (25), This represents the disparity value. and These are the projections of the same spatial point onto the first and second images, respectively. Baseline length; Focal length; These are the coordinates of the point in space along the depth direction.
[0154] This gives us the inverse formula for depth:
[0155] (26)
[0156] In formula (26), For pixels The depth value; Baseline length; Focal length; This is the optimal disparity value.
[0157] According to formula (26), the depth value is inversely proportional to the disparity value; the larger the focal length and baseline length, the higher the depth resolution. For each pixel... Based on the intrinsic parameter matrix, its image coordinates can be restored to three-dimensional spatial coordinates:
[0158] (27)
[0159] In formula (27), ( , , () represents the three-dimensional spatial coordinates of this point; Baseline length; Focal length; To achieve the optimal disparity value, For pixels The depth value; and pixels exist and Focal length in direction; The coordinates of the main point.
[0160] The above transformation process achieves the projection inversion from two-dimensional pixel coordinates to three-dimensional spatial coordinates.
[0161] 2. Determine the confidence level of each depth value based on the optimal disparity value.
[0162] In practice, the calculated depth values may contain errors due to factors such as feature matching. To assess the reliability of the depth values, this embodiment introduces a confidence estimation model based on feature similarity distribution, which can be expressed as:
[0163] (28)
[0164] In formula (28), This is a confidence estimation model based on feature similarity distribution; The disparity value for the current candidate; For pixels In disparity value Matching cost at that time; This is an index for all candidate disparity values, used to normalize the matching cost within the disparity space.
[0165] Pixels The confidence level of the depth value can be expressed as:
[0166] (29)
[0167] In formula (29), For pixels The confidence level of the depth value; The value is the result of substituting the optimal disparity value into the confidence estimation model based on feature similarity distribution.
[0168] Furthermore, to reduce parallax holes caused by occlusion and reflection areas, this embodiment also utilizes guided filtering to smooth the parallax map. The guided filtering model can be expressed as:
[0169] (30)
[0170] In formula (30), Disparity map after smoothing compensation; It can be either the first image or the second image; and The parameters are obtained by minimizing the local linear fitting error.
[0171] After guided filtering, the parallax in the edge areas of the image remains clear, while the flat areas are smoothed, which can effectively improve the integrity of subsequent 3D modeling.
[0172] Through the above steps, this embodiment can stably obtain high-precision parallax and depth information on rock surfaces with complex lighting and sparse textures, providing a precise data foundation for digital 3D modeling of rock cross-sections.
[0173] 3. Correct depth values with confidence levels below a preset threshold to obtain depth information for the first and second images.
[0174] Specifically, this embodiment optimizes the confidence level by constructing a multi-scale confidence fusion model to correct depth values with confidence levels below a preset threshold. The multi-scale confidence fusion model includes a data fidelity term, a depth smoothing term, and a normal consistency term.
[0175] The data fidelity term aims to maintain the depth values in high-confidence regions as consistent as possible before and after optimization, with high-confidence pixels having a greater impact on the optimization results. Low-confidence regions are smoothed and / or normalized by depth smoothing and normalization terms. The depth smoothing term suppresses depth noise and maintains surface continuity, allowing geometric discontinuities to be preserved at rock fractures while smoothing noise fluctuations within the same region. The normalization term is a regularization term based on local normal consistency. Since the surface of a real rock cross-section has certain planar or curved continuous features, this embodiment improves the geometric consistency of the depth field through the normalization term.
[0176] Specifically, assuming the initial depth map is a multi-scale confidence fusion model, it can be expressed as:
[0177] (31)
[0178] In formula (31), This indicates the resolution levels from coarse to fine. Represents resolution levels The corresponding depth value; Represents resolution levels The corresponding depth value; This indicates the optimization operation at the current scale; Indicates upsampling interpolation; Represents resolution levels The confidence level of the corresponding depth value.
[0179] The multi-scale confidence fusion model downsamples the input depth value and confidence level into depth values and confidence levels corresponding to different scales through top-down confidence propagation, and optimizes them layer by layer. At the same time, iterative optimization algorithms are used to optimize and iteratively solve the multi-scale confidence fusion model until the energy converges or the change is lower than the convergence threshold. This can improve the accuracy of local details while ensuring computational efficiency, and obtain optimized global depth information.
[0180] 4. Construct a digital three-dimensional model of the rock block cross-section based on depth information.
[0181] Point cloud data of the rock block cross-section is determined based on depth information. Then, a digital 3D model of the rock block cross-section is constructed using a surface reconstruction algorithm based on the point cloud data. The surface reconstruction algorithm can be Poisson surface reconstruction algorithm, moving least squares method, etc. This embodiment uses Poisson surface reconstruction algorithm as an example for explanation.
[0182] Specifically, this embodiment obtains the following by unifying and fusing the point cloud data of the rock block cross-section to the world coordinate system: Figure 3 The dense point cloud data shown is then transformed into a continuous, smooth surface model with high detail fidelity using the Poisson surface reconstruction algorithm, thus obtaining a digital 3D model of the rock block cross-section.
[0183] To verify the modeling accuracy of the method described in this embodiment, the same rock block cross section was modeled using both the method described in this embodiment and the traditional multi-view reconstruction method. A total of four rock block cross sections were selected for modeling. The comparison and verification results of the two methods in the four modeling attempts are shown in Table 1.
[0184] Table 1. Validation comparison results of this method and traditional multi-view reconstruction methods
[0185]
[0186] The results in Table 1 show that the depth error and reconstruction accuracy of the proposed method are significantly better than those of the traditional multi-view reconstruction method, indicating that the improved Siamese neural network can effectively enhance the consistency of rock block cross-section feature extraction, thereby improving the accuracy and stability of the three-dimensional model of the rock block cross-section.
[0187] To further verify the accuracy of this method in predicting spatial point locations, this embodiment also verifies the model reconstruction effect of this method based on actual rock mass profile data.
[0188] Specifically, a cross-section of a tunnel wall in an underground mining area was selected as the modeling object. A baseline of 0.8m was set up on-site, and two industrial cameras were used to simultaneously acquire cross-sectional images from different perspectives. Twenty-five sets of image data were collected from 25 different locations on the rock wall cross-section, with an image resolution of 1029×1080 and a sampling interval of 10 mm. For each location's image data, a corresponding digital 3D model of the cross-section was established using this method. Each modeling operation corresponded to one experiment, for a total of 25 experiments.
[0189] Meanwhile, a laser scanner-based modeling method was used as a comparison method. The corresponding cross sections at the above 25 different locations were modeled using the comparison method. Each modeling corresponds to one experiment, and a total of 25 experiments were conducted.
[0190] Then, the prediction accuracy of the proposed method and the comparison method for the spatial point location in each experiment were compared. The comparison results are as follows: Figure 4 As shown.
[0191] from Figure 4 As can be seen, the prediction accuracy of the method described in this embodiment is better than that of the comparative method in each experiment, indicating that the modeling accuracy of this method is significantly better than that of the comparative method.
[0192] Another embodiment of the present invention provides a three-dimensional modeling system for rock block cross-sections based on a twin neural network, the system comprising:
[0193] The image acquisition module is used to acquire first and second images of the rock block cross-section from different perspectives.
[0194] The feature extraction module is used to improve the loss function of the Siamese neural network based on the feature normalization method, and to use the improved Siamese neural network to determine the first feature representation of the first image and the second feature representation of the second image; D1 < D2, where D1 represents the distance between the first feature representation and the second feature representation of the same spatial point on the rock block cross-section, and D2 represents the distance between the first feature representation and the second feature representation of different spatial points.
[0195] The disparity determination module is used to construct a feature matching cost function based on the first feature representation and the second feature representation, and to determine the disparity information of the first image and the second image based on the feature matching cost function;
[0196] The model building module is used to determine the depth information of the first and second images based on the parallax information, and to build a digital three-dimensional model of the rock block cross-section based on the depth information.
[0197] This invention introduces a Siamese neural network to achieve a deep representation of rock block cross-sectional features, significantly improving cross-section matching accuracy and solving the problem of traditional modeling methods being susceptible to noise interference. Based on this, by improving the loss function of the Siamese neural network, the feature recognition and matching accuracy of the Siamese neural network for irregular, textured, and weakly characterized objects like rocks is enhanced. This allows the Siamese neural network to be applied to feature extraction of complex cross-sections such as fractured sections and mud-covered sections, and to perform feature measurement learning on corresponding regions of images from different perspectives, thereby establishing a highly robust embedded feature space across perspectives and forming a highly discriminative feature representation. Based on this highly discriminative feature representation, the disparity and depth information of images from different perspectives can be accurately determined, thus improving the construction accuracy of digital 3D models of rock block cross-sections and providing accurate modeling data for fields such as volume calculation, structural analysis, and geological simulation. Simultaneously, this invention utilizes automated feature matching and spatial stitching mechanisms to significantly reduce the degree of manual intervention in the modeling process, realizing intelligent 3D reconstruction of rock blocks and effectively improving modeling accuracy.
[0198] The above description is merely a few embodiments of this application and is not intended to limit this application in any way. Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any changes or modifications made by those skilled in the art without departing from the scope of the technical solution of this application using the disclosed technical content are equivalent to equivalent implementation cases and all fall within the scope of the technical solution.
Claims
1. A method for three-dimensional modeling of rock mass discontinuities based on twin neural networks, characterized by, The method comprises: S1, acquiring a first image and a second image of a rock mass section under different viewing angles; S2, improving a loss function of a twin neural network based on a feature normalization method, and determining a first feature representation of the first image and a second feature representation of the second image by using the improved twin neural network; D1<D2, wherein D1 represents a distance between the first feature representation and the second feature representation of a same spatial point on the rock mass section, and D2 represents a distance between the first feature representation and the second feature representation of different spatial points; S3, constructing a feature matching cost function according to the first feature representation and the second feature representation, and determining disparity information of the first image and the second image based on the feature matching cost function; S4, determining depth information of the first image and the second image according to the disparity information, and constructing a digital three-dimensional model of the rock mass section based on the depth information; In S2, the loss function of the twin neural network is improved based on the feature normalization method, specifically comprising: The output features of the twin neural network are normalized based on the feature normalization method, and a regularization term is constructed according to the normalized output features; The loss function of the twin neural network is improved according to the regularization term.
2. The method of claim 1, wherein, In S3, the feature matching cost function is constructed according to the first feature representation and the second feature representation, specifically comprising: The feature matching cost function is constructed according to the norm of the difference between the first feature representation and the second feature representation of the same spatial point.
3. The method of claim 1, wherein, In S3, the disparity information of the first image and the second image is determined based on the feature matching cost function, specifically comprising: The matching cost is minimized by optimization based on the feature matching cost function, and the optimal disparity value corresponding to the minimized matching cost is determined as the optimal disparity value; The disparity information of the first image and the second image is determined according to the optimal disparity value.
4. The method of claim 3, wherein, In S3, the disparity information of the first image and the second image is determined according to the optimal disparity value, specifically comprising: According to the optimal disparity value, the disparity information of the first image and the second image is determined by using a smoothing constraint method.
5. The method of claim 3, wherein, In S4, the depth information of the first image and the second image is determined according to the disparity information, specifically comprising: The depth value of each pixel in the first image and the second image is determined according to the disparity information, and the confidence of each depth value is determined; The depth value with a confidence lower than a preset threshold is corrected to obtain the depth information of the first image and the second image.
6. The method of claim 5, wherein, The confidence of each depth value is determined, specifically comprising: The confidence of each depth value is determined according to the optimal disparity value.
7. The method of claim 5, wherein, The depth value with a confidence lower than a preset threshold is corrected, specifically comprising: The depth value with a confidence lower than a preset threshold is smoothed and / or normally corrected.
8. The method of claim 5, wherein, In S4, the digital three-dimensional model of the rock mass section is constructed based on the depth information, specifically comprising: Point cloud data of the rock mass section is determined based on the depth information; The digital three-dimensional model of the rock mass section is constructed by using a surface reconstruction algorithm according to the point cloud data.
9. A twin neural network based 3D modeling system for rock face, characterized in that, The system comprises: The image acquisition module is used to acquire first and second images of the rock block cross-section from different perspectives. The feature extraction module is used to improve the loss function of the Siamese neural network based on the feature normalization method, and to use the improved Siamese neural network to determine the first feature representation of the first image and the second feature representation of the second image; D1 < D2, where D1 represents the distance between the first feature representation and the second feature representation of the same spatial point on the rock block cross-section, and D2 represents the distance between the first feature representation and the second feature representation of different spatial points. The disparity determination module is used to construct a feature matching cost function based on the first feature representation and the second feature representation, and to determine the disparity information of the first image and the second image based on the feature matching cost function; The model building module is used to determine the depth information of the first and second images based on the parallax information, and to build a digital three-dimensional model of the rock block cross-section based on the depth information.
Citation Information
Patent Citations
Rapid construction method and system of three-dimensional model for building
CN117372647A