Single-view blade 3D reconstruction method based on deep learning
Through a single-view blade three-dimensional reconstruction method based on deep learning, using the improved ResNet18 network and various loss functions, combined with a differentiable renderer, the problem of low accuracy and complexity of blade three-dimensional reconstruction in the existing technology is solved, and a more efficient The three-dimensional shape of the blade is restored.
Patent Information
- Application Number
- CN202111582989.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-22
AI Technical Summary
The existing single-view blade 3D reconstruction technology has the problems of low accuracy, complex implementation, and slow speed, making it difficult to accurately restore the 3D information of the blade.
A single-view blade 3D reconstruction method based on deep learning is used to integrate the 3D and 2D images from multiple views by creating a leaf data set, training a neural network model, optimizing the parameters of the reconstruction network model, and combining the improved ResNet18 network and a variety of loss functions. Data information, use a differentiable renderer to optimize and reconstruct the network model.
It improves the accuracy and speed of single-view blade 3D reconstruction, reduces manual modeling time, reduces reconstruction difficulty, and achieves more accurate and faster 3D shape recovery of blades.
Smart Images

Figure CN114241160B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of crop leaf three-dimensional reconstruction, and in particular to a single-view leaf three-dimensional reconstruction method based on deep learning. Background Art
[0002] In the current field of smart agriculture, leaf phenotype is one of the criteria for measuring plant growth. The 3D reconstruction of leaves from a single perspective is a task for analyzing plant growth traits and can describe plant growth in a digital twin system. In addition, breeders can use the 3D geometry of crop leaves to make corresponding decisions. Such decisions include selecting the best cultivar to continue the breeding process and selecting the best cultivar for the next season. Therefore, fast and accurate 3D reconstruction of leaves is essential for leaf phenotyping, parameter measurement, and virtual visualization.
[0003] At present, the single-view reconstruction technology has developed rapidly, which has greatly improved the accuracy and real-time performance of reconstruction. With the rapid development of deep learning in the three-dimensional field, the ShapeNet dataset has also been widely used in three-dimensional reconstruction methods based on deep learning. At present, a large number of network models have been developed using different three-dimensional model representation methods (such as voxels, point clouds, grids, etc.). Based on the grid representation method, Wang et al. extracted image feature results through a network similar to VGG-16. The three-dimensional grid reconstruction method based on cascade deformation uses a GCN (full convolutional network) convolutional network to store three-dimensional spatial information, solving the problem of three-dimensional grid anti-pooling.
[0004] Although the above methods have made some progress in the research of blade 3D reconstruction, there is little work on using deep learning to complete the 3D plane blade geometry. At the same time, in the above-mentioned single-view reconstruction algorithm, blade 3D reconstruction often has problems such as low accuracy, complex implementation, and slow speed, making it difficult to restore the 3D information of the blade. Summary of the invention
[0005] In view of this, the purpose of the present invention is to overcome the defects in the prior art and provide a single-perspective blade 3D reconstruction method based on deep learning, which can improve the accuracy and speed of single-perspective blade 3D reconstruction, reduce the time of manual modeling and reduce the difficulty of single-perspective reconstruction.
[0006] The single-view blade 3D reconstruction method based on deep learning of the present invention comprises the following steps:
[0007] S1. Produce a blade dataset; the blade dataset includes rendered views of the blade at different viewing angles and point clouds corresponding to the viewing angles;
[0008] S2. Input the leaf data set into the neural network model for network training to obtain a trained reconstruction network model;
[0009] S3. Input the target blade image into the reconstruction network model, output the mesh rendering contour information of the target blade, adjust the parameter values in the reconstruction network model so that the difference between the output mesh rendering contour information and the contour information of the target blade image is minimized, and the reconstruction network model set when the difference is minimized is used as the optimal reconstruction network model;
[0010] S4. Input the image of the blade to be measured into the optimal reconstruction network model, and output the three-dimensional shape of the blade to be measured.
[0011] Further, the making of the leaf data set specifically includes:
[0012] Collect several blades with different leaf shapes, obtain several blade models with different contours, and obtain three-dimensional data information of the blade models;
[0013] Normalize the blade models so that several blade models are of the same scale;
[0014] Uniformly sample the grid of the blade model to obtain a number of sample point cloud data;
[0015] Determine the rendering position, angle and field of view of the scene camera, and then render the leaf model in the scene in combination with different camera viewing angles and light intensities to obtain rendering views from different viewing angles;
[0016] The coordinate information corresponding to the three-dimensional points of the blade model is mapped back to the rendered view for matching, so that the formed point cloud data can be matched with the two-dimensional feature points in the rendered view.
[0017] Furthermore, before matching, the leaf model is rotated and translated while ensuring that the three-dimensional shape of the existing leaf model remains unchanged, so as to increase the diversity of the leaf model samples.
[0018] Furthermore, the neural network model uses an improved ResNet18 network as a feature extraction network;
[0019] The improved ResNet18 network initially uses two layers of 3×3 16-dimensional convolution kernels and 32-dimensional convolution kernels to extract two-dimensional shallow image feature information; the improved ResNet18 network selects 3×3 small convolution kernels to replace the 64-dimensional 7×7 convolution kernels in the original ResNet18, and stacks the 3×3 small convolution kernels to improve the feature extraction capability of the network model.
[0020] Furthermore, the loss functions used in the neural network model include Chamfer loss function, Normal loss function, Laplacian regularization and Edge length regularization;
[0021] The Chamfer loss function is used to limit the specific positions of the blade mesh vertices;
[0022] The Normal loss function is used to enhance the consistency of the mesh surface normals;
[0023] The Laplacian regularization is used to maintain the relative position relationship between adjacent vertices during deformation;
[0024] The edge length regularization is used to prevent local optimization of individual abnormal points, which causes the mesh surface to be uneven.
[0025] Furthermore, the difference between the output mesh rendering contour information and the contour information of the target leaf image is marked as L s ;
[0026] Said
[0027] in, The mesh rendering contour image of the target blade output by the reconstruction network model; s is the contour image of the target leaf; is the product of the elements.
[0028] Furthermore, the leaf image to be measured is an RGBA image.
[0029] Furthermore, the step S2 also includes testing and evaluating the trained reconstruction network model using evaluation indicators to determine the degree of similarity between the result output by the reconstruction network model and the actual result.
[0030] Furthermore, the evaluation indicators include 3D IOU, F-score, CD and EMD; wherein, the larger the 3D IOU and F-score, the higher the similarity; and the smaller the CD and EMD, the higher the similarity.
[0031] The beneficial effects of the present invention are as follows: a single-perspective blade 3D reconstruction method based on deep learning disclosed in the present invention is trained by information fusion of 3D data and 2D data of blades from multiple perspectives, and corresponding parameters are optimized, while the reconstruction network model is optimized in combination with a differentiable renderer, so that the reconstructed single-perspective blade mesh model is close to the target image in shape, thereby improving the accuracy and speed of single-perspective blade 3D reconstruction, reducing the time for manual modeling and reducing the difficulty of single-perspective reconstruction. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0033] Figure 1It is a schematic diagram of the framework of the blade 3D reconstruction method of the present invention;
[0034] Figure 2 It is a schematic diagram of the structure of the reconstruction network model of the present invention;
[0035] Figure 3 This is a schematic diagram of the loss comparison of residual networks with different numbers of layers of the present invention. DETAILED DESCRIPTION
[0036] The present invention is further described below in conjunction with the accompanying drawings, as shown in the drawings:
[0037] The single-view blade 3D reconstruction method based on deep learning of the present invention comprises the following steps:
[0038] S1. Produce a blade dataset; the blade dataset includes rendered views of the blade at different viewing angles and point clouds corresponding to the viewing angles;
[0039] S2. Inputting the blade data set into the neural network model for network training to obtain a trained reconstruction network model; wherein the trained reconstruction network model is a coarse grid model;
[0040] S3. Input the target blade image into the reconstruction network model, output the mesh rendering contour information of the target blade, adjust the parameter values in the reconstruction network model so that the difference between the output mesh rendering contour information and the contour information of the target blade image is minimized, and the reconstruction network model set when the difference is minimized is used as the optimal reconstruction network model; through the above steps, the adjustment and optimization of the coarse mesh model is achieved, and then the optimal reconstruction network model is obtained;
[0041] S4. Input the image of the blade to be measured into the optimal reconstruction network model, and output the three-dimensional shape of the blade to be measured.
[0042] The present invention uses an improved residual network to enhance feature extraction, and then uses Pixl2Mesh to combine the features of the image with the three-dimensional position. Finally, the model is deformed and optimized through differentiable rendering technology, which improves the authenticity and accuracy of the reconstructed network model and reduces the impact of the surrounding complex environment on the three-dimensional reconstruction, thereby providing a reasonable method for the three-dimensional reconstruction of plant leaves. The present invention can be used for the reconstruction model of the agricultural digital twin system, reconstructing the three-dimensional shape of the leaf from the leaf image of a single perspective, enhancing the accuracy of reconstruction, reducing redundant extraction, simplifying the reconstruction process, and improving the reconstruction speed. The leaves in the image can be accurately reconstructed, and can be widely used in agricultural digital twins for crop leaf growth monitoring, non-destructive measurement, phenotypic analysis and other scenarios.
[0043] In this embodiment, the step of preparing the leaf data set specifically includes:
[0044] Several blades with different leaf shapes are collected to obtain several blade models with different contours, and the three-dimensional data information of the blade models is acquired; among them, 9 blade models with different leaf shapes are collected, and the three-dimensional data information of the blades is mainly divided into three parts: scene camera perspective, blade model rendering view, and point cloud of the blade corresponding to the perspective.
[0045] In order to scale the blade model size within a cubic bounding box of a specified size, the origin of the coordinates is set to the center of the blade model, and the blade model is normalized by the mean so that several blade models are of the same scale. The blade model coordinates are controlled between -1 and 1.
[0046] The mesh of the blade model is uniformly sampled to obtain a number of sample point cloud data; among them, the vertices of the original blade model are downsampled, and the point cloud of the normalized mesh model is downsampled using Meshlab software, and 1000 vertices are uniformly sampled for each group of models.
[0047] Determine the rendering position, angle and field of view of the scene camera, and then render the blade model in the scene in combination with different camera viewing angles and light intensities to obtain rendering views from different viewing angles; 24 different camera viewing angles can be set;
[0048] The coordinate information corresponding to the three-dimensional points of the blade model is mapped back to the rendered view for matching, so that the formed point cloud data can be matched with the two-dimensional feature points in the rendered view.
[0049] In this embodiment, before matching, in order to avoid the deviation between the two-dimensional image information and the three-dimensional coordinate information, which may lead to the mismatch between the reconstructed model and the input image, position shift, etc., the existing three-dimensional model data is augmented, specifically, the leaf model is subjected to random transformations such as rotation (0-180°) and translation at a certain angle while keeping the three-dimensional shape of the existing leaf model unchanged, so as to increase the diversity of the leaf model samples.
[0050] In this embodiment, a neural network training platform with TensorFlow as the underlying layer is built by configuring the environment; on the basis of Pixel2mesh, the original feature extraction network is modified, and the original vgg-16 network is modified into an improved ResNet18 network; the neural network model adopts the improved ResNet18 network as the feature extraction network; wherein, the ResNet18 means that ResNet adopts an 18-layer residual network.
[0051] In deep learning, the number of layers in the network is an important consideration as it directly affects the prediction performance. The performance of the commonly used 18-, 34-, and 50-layer residual networks as feature extraction networks is compared. After scanning all the test data, the impact of the number of layers in the proposed model on the loss and reconstruction performance is evaluated. Figure 3 The loss trend of different layers from 18 to 50 on the test set is shown. The experimental results show that as the number of layers decreases, the loss value on the test set decreases rapidly. When the number of layers is 18, the network reconstruction result is the best.
[0052] The original ResNet18 extracts image features from 64 dimensions, using a large 7×7 convolution kernel. Although the large convolution kernel has a large receptive field, it is not as good as the small-scale convolution kernel in extracting the fine contour features of the leaves in a single view. Based on the Pixel2Mesh feature extraction network, the feature extraction network is improved by combining the advantages of ResNet18. Two layers of 3×3 16-dimensional convolution kernels and 32-dimensional convolution kernels are added to the beginning of the original ResNet18 to extract the two-dimensional shallow image feature information; secondly, a 3×3 small convolution kernel is selected to replace the 64-dimensional 7×7 convolution kernel in the original ResNet18, and the 3×3 small convolution kernels are stacked to improve the model's ability to extract features, thereby obtaining more detailed feature information, making the predicted 3D position features more accurate.
[0053] In this embodiment, the loss functions used by the neural network model include Chamfer loss function, Normal loss function, Laplacian regularization and Edge length regularization;
[0054] The Chamfer loss function, also known as the chamfer distance, is a function that targets each vertex in a set and finds the nearest point in another set, adds their square distances, and vertex vertexes to verify whether the 3D mesh vertex is similar to the actual 3D mesh vertex. Its function is to limit the specific position of the mesh vertex. The calculation formula of the Chamfer loss function is shown in formula (2):
[0055]
[0056] In the reconstruction network, not only the vertex position of the three-dimensional mesh is considered, but also the feature loss of the mesh surface. By using the Normal loss function, the consistency of the normal vector of the mesh surface is guaranteed to increase the surface smoothness. The calculation formula of the Normal loss function is shown in formula (3):
[0057]
[0058] Laplacian regularization, the function of this function is to maintain the relative position relationship between adjacent vertices during deformation. The calculation formula of the Laplacian regularization is shown in (4):
[0059]
[0060] Edge length regularization, the purpose of this function is to prevent local optimization of individual abnormal points, resulting in uneven mesh surface. The calculation formula of the Edge length regularization is shown in (5):
[0061]
[0062] In this embodiment, the neural network model constructed above is used for network training, and the self-made three-dimensional data set in step S1 is used as training data, which contains 9 types of blade three-dimensional grid models of different shape categories. The ratio of training set to validation set is 4:1, that is, 20736 groups are used as training data sets, and the rest are used as test data sets. The input image size is 224×224, the initial learning rate is set to 3e-5, the optimizer is Adam, the Epoch is 50, and all categories of objects in the training set are trained uniformly. To prevent overfitting of the data, different types of data are randomly arranged, and the Batch Size is set to 1. The training time is about 3 days.
[0063] In this embodiment, since the trained reconstruction network model may have a mesh shape that is different from the contour shape of the input image, it is necessary to compare the contour information of the input image with the mesh rendering contour information at this stage, and then deform the mesh model to achieve the purpose of making the single-view mesh shape similar to the input image; the single view can be understood as a single view.
[0064] Based on the trained reconstruction network model, the initial rough model is reconstructed, and a differentiable rendering operator is defined to compare the contour of the current mesh with the contour of the input image. Using the differentiable renderer, a loss function and gradient descent can be defined to minimize the loss value, and machine learning methods can be used to accelerate optimization and update the loss function.
[0065] The difference between the output mesh rendering contour information and the contour information of the target leaf image is marked as L s ;
[0066] Said
[0067] in, The mesh rendering contour image of the target blade output by the reconstruction network model; s is the contour image of the target leaf; It is the product of the elements. By comparing the difference between the rendered contour image and the target contour image, the mesh model is deformed to achieve the purpose of shape optimization.
[0068] The differentiable renderer defined in the present invention can be used to perform back propagation on the source mesh to deform the mesh model shape so as to minimize the difference between the rendered view and the target image, thereby making the rendered image as similar as possible to the target image. Figure 2 As shown in the figure, the optimized reconstruction network model consists of two parts: the upper part is the feature extraction module, which extracts the leaf image features at different levels layer by layer, and the lower part is designed with three cascade deformation modules, which are composed of GCN and are used to store the mesh information after each deformation. The initial mesh (ellipsoid) is continuously deformed by perceiving the two-dimensional feature information of the feature pooling layer to approximate the real three-dimensional shape of the leaf. Each deformation process fuses the leaf image feature points with the vertex features in the GCN as a new round of input to the GCN, thereby updating its three-dimensional vertices and features. At the same time, the number of nodes and edges is increased through the pooling layer on the graph to improve the level of detail of the model. Finally, the initial model is continuously transformed into the target model through iterative updates.
[0069] In this embodiment, in step S4, a specific crop leaf image is taken in an actual scene, and the crop leaf is used as the leaf to be tested. Based on the traditional image processing method, a specific leaf is selected by manual interaction, and then segmented to obtain an RGBA leaf image, which is then input into the optimal reconstruction network model and reconstructed to obtain the three-dimensional shape of the leaf to be tested. The matching degree between the leaf mesh model and the input image at the visual level can be verified. Compared with ordinary RGB images, the RGBA leaf image has a richer color space, which enhances the compatibility of the input leaf image.
[0070] In this embodiment, the step S2 also includes testing and evaluating the trained reconstruction network model using evaluation indicators to determine the similarity between the output result of the reconstruction network model and the real result. This process is mainly based on the trained reconstruction network model to evaluate the reconstruction network model on the test sets of different leaf categories, detect the similarity between the results predicted by the reconstruction network model in the test set and the Ground truth, so as to determine the similarity between the output of the reconstruction network model and the real model. The evaluation indicators include 3D IOU, F-score, CD and EMD; wherein, the larger the 3D IOU and F-score, the higher the similarity; the smaller the CD and EMD, the higher the similarity. Through the above-mentioned test and evaluation of the reconstruction network model, the output accuracy and reliability of the reconstruction network model can be evaluated, which provides a reference for optimizing the reconstruction network model, and is beneficial to further clarify the purpose and direction of optimizing the reconstruction network model.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A single-view blade 3D reconstruction method based on deep learning, characterized by: The steps include: S1. Create leaf dataset; The blade data set includes rendering views of the blade at different viewing angles and point clouds of corresponding viewing angles; The step of preparing the leaf data set specifically includes: Collect several blades with different leaf shapes, obtain several blade models with different contours, and obtain three-dimensional data information of the blade models; Normalize the blade models so that several blade models are of the same scale; Uniformly sample the grid of the blade model to obtain a number of sample point cloud data; Determine the rendering position, angle and field of view of the scene camera, and then render the leaf model in the scene in combination with different camera viewing angles and light intensities to obtain rendering views from different viewing angles; Mapping the coordinate information corresponding to the three-dimensional points of the blade model back to the rendered view for matching, so that the formed point cloud data can correspond to the two-dimensional feature points in the rendered view; S2. Inputting the leaf data set into the neural network model for network training to obtain a trained reconstruction network model; the neural network model uses an improved ResNet18 network as a feature extraction network; The improved ResNet18 network initially uses two layers of 3×3 16-dimensional convolution kernels and 32-dimensional convolution kernels to extract two-dimensional shallow image feature information; the improved ResNet18 network selects 3×3 small convolution kernels to replace the 64-dimensional 7×7 convolution kernels in the original ResNet18, and stacks the 3×3 small convolution kernels to improve the feature extraction capability of the network model; The loss functions used in the neural network model include Chamfer loss function, Normal loss function, Laplacian regularization and Edge length regularization; The Chamfer loss function is used to limit the specific positions of the blade mesh vertices; The Normal loss function is used to enhance the consistency of the mesh surface normals; The Laplacian regularization is used to maintain the relative position relationship between adjacent vertices during deformation; The Edge length regularization is used to prevent local optimization of individual abnormal points, which causes the mesh surface to be uneven. S3. Input the target blade image into the reconstruction network model, output the mesh rendering contour information of the target blade, adjust the parameter values in the reconstruction network model so that the difference between the output mesh rendering contour information and the contour information of the target blade image is minimized, and the reconstruction network model set when the difference is minimized is used as the optimal reconstruction network model; S4. Input the image of the blade to be measured into the optimal reconstruction network model, and output the three-dimensional shape of the blade to be measured.
2. The single-view blade 3D reconstruction method based on deep learning according to claim 1, characterized in that: Before matching, the leaf model is rotated and translated while ensuring that the three-dimensional shape of the existing leaf model remains unchanged to increase the diversity of the leaf model samples.
3. The single-view blade 3D reconstruction method based on deep learning according to claim 1, characterized in that: The difference between the output mesh rendering contour information and the contour information of the target leaf image is marked as Ls; Said in, The mesh rendering contour image of the target blade output by the reconstruction network model; s is the contour image of the target leaf; is the product of the elements.
4. The single-view blade 3D reconstruction method based on deep learning according to claim 1, characterized in that: The leaf image to be measured is an RGBA image.
5. The single-view blade 3D reconstruction method based on deep learning according to claim 1, characterized in that: The step S2 also includes testing and evaluating the trained reconstruction network model using evaluation indicators to determine the degree of similarity between the results output by the reconstruction network model and the actual results.
6. The single-view blade 3D reconstruction method based on deep learning according to claim 5, characterized in that: The evaluation indicators include 3D IOU, F-score, CD and EMD; wherein, the larger the 3D IOU and F-score, the higher the similarity; and the smaller the CD and EMD, the higher the similarity.
Citation Information
Patent Citations
Three-dimensional model reconstruction method based on grid deformation
CN110021069A
Single-frame image free viewpoint three-dimensional model reconstruction method based on deep learning
CN110223382A
Single-frame image three-dimensional model surface reconstruction method based on deep learning
CN110288695A
Human body three-dimensional reconstruction method and device based on RGBD single-view images
CN110335343A
Three-dimensional point cloud data classification method based on multi-view convolution pooling
CN111695494A
