Im2Struct: Recovering 3D Shape Structure from a Single RGB Image

04/16/2018 ∙ by Chengjie Niu, et al. ∙ 0

We propose to recover 3D shape structures from single RGB images, where structure refers to shape parts represented by cuboids and part relations encompassing connectivity and symmetry. Given a single 2D image with an object depicted, our goal is automatically recover a cuboid structure of the object parts as well as their mutual relations. We develop a convolutional-recursive auto-encoder comprised of structure parsing of a 2D image followed by structure recovering of a cuboid hierarchy. The encoder is achieved by a multi-scale convolutional network trained with the task of shape contour estimation, thereby learning to discern object structures in various forms and scales. The decoder fuses the features of the structure parsing network and the original image, and recursively decodes a hierarchy of cuboids. Since the decoder network is learned to recover part relations including connectivity and symmetry explicitly, the plausibility and generality of part structure recovery can be ensured. The two networks are jointly trained using the training data of contour-mask and cuboid structure pairs. Such pairs are generated by rendering stock 3D CAD models coming with part segmentation. Our method achieves unprecedentedly faithful and detailed recovery of diverse 3D part structures from single-view 2D images. We demonstrate two applications of our method including structure-guided completion of 3D volumes reconstructed from single-view images and structure-aware interactive editing of 2D images.



There are no comments yet.


page 1

page 6

page 7

page 8

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

The last few years have witnessed a continued interest in single-view image-based 3D modeling [2, 4, 5]

. The performance of this task has been dramatically boosted, due to the tremendous success of deep convolutional neural networks (CNN) on image-based learning tasks 

[10]. The existing deep models, however, have so far been mainly targeting the output of volumetric representation of 3D shapes [2]. Such models are essentially learned to map an input 2D image to a 3D image (voxel occupancy of a 3D shape in a 3D volume). Some compelling results have been demonstrated.

Figure 1: 3D shape structures (2nd column) recovered from photos of household objects (1st column). Top row: The inferred 3D shape structure can be used to complete and refine the volumetric shape estimated from the image using existing methods [22]. Bottom row: The structure is used to assist structure-aware image editing, where our cuboid structure is used as an editing proxy  [25].
Figure 2: An overview of our network architecture. The structure masking network is a two-scale CNN which is trained to produce a contour mask for the object of interest. The structure recovery network first fuses the feature map of the masking network and the CNN feature of the original image, and decode the fused feature recursively into a box structure. The red arrows in the resultant chair structure (right most) indicate recovered reflectional symmetries between chair legs.

While enjoying the high capacity of deep models in learning the image-to-image mapping, the 3D volumes reconstructed by these methods lose an important information of 3D shapes – shape topology or part structure. Once a 3D shape is converted into a volumetric representation, it would be hard to recover its topology and structure, especially when there exist topological defects in the reconstructed volume. Shape structure, encompassing part composition and part relations, has been found highly important to semantic 3D shape understanding and editing [15]. Inferring a part segmentation for a 3D shape (surface or volumetric model) is known to be difficult [8]. Even if a segmentation is given, it is still challenging to reason about part relations such as connection, symmetry, parallelism, etc.

We advocate learning a deep neural network that directly recovers 3D shape structure of an object, from a single RGB image. The extracted structure can be used for enhancing the volumetric reconstruction obtained by existing methods, facilitating structure-aware editing of the reconstructed 3D shapes, and even enabling high-level editing of the input images (see Fig. 1). However, directly mapping an image to a part structure seems a dunting task. Tulsiani et al. [19] proposed a deep architecture to map a 3D volume to a set of cuboid primitives. Their method, however, cannot be adapted to our problem setting since the output primitive set does not possess any structural information (mutual relations between primitives are not recovered).

Our problem involves the reasoning not only about shape geometry, but also for higher level information of part composition and relations. It poses several special challenges. 1) Different from shape geometry, part decomposition and relations do not manifest explicitly in 2D images. Mapping from pixels to part structure is highly ill-posed, as compared to pixel-to-voxel mapping studied in many existing 2D-to-3D reconstruction works. 2) Many 3D CAD models of man-made objects contain diverse, fine-grained substructures. A faithful recovery of those complicated 3D structures goes far beyond shape synthesis modulated by a shape classification. 3) Natural images always contain cluttered background and the imaged objects have large variations of appearance due to different textures and lighting conditions.

Human brains do well both in shape inference based on low-level visual stimulus and structural reasoning with the help of prior knowledge about 3D shape compositions. The strength of human perception is to integrate the two ends of processing and reasoning to form a capable vision system for high-level 3D shape understanding. Motivated by this, we propose to learn and integrate two networks, a structure masking network for accentuating multi-scale object structures in an input 2D image, followed by a structure recovery network to recursively recover a hierarchy of object parts abstracted by cuboids (see Figure 2).

The structure masking network produces a multi-scale attentional mask for the object of interest, thereby decerning its shape structures in various forms and scales. It designed as a multi-scale convolutional neural networks (CNN) augmented with jump connections to retain shape details while screening out the structure-irrelevant information such as background and textures in the output mask image. The structure recovery network fuses the features extracted in the structure masking network and the CNN features of the original input image and feed them into a recursive neural network (RvNN) for 3D structure decoding 

[13]. The RvNN decoder, which is trained to explicitly model part relations, expands the fused image features recursively into a tree organization of 3D cuboids with plausible spatial configuration and reasonable mutual relations.

The two networks are jointly trained, with the training data of image-mask and cuboid-structure pairs. Such pairs can be generated by rendering 3D CAD models and extracting the box structure based on the given parts of the shape. Several mechanisms are devised to avoid overfitting in training this model. Experiments show that our method is able to faithfully recover diverse and detailed part structures of 3D objects from single 2D natural images. Our paper makes the following contributions:

  • We propose to directly recover 3D shape structures from single RGB images. The faithful and detailed recovery of 3D structural information of an object, such as part connectivity and symmetries, from 2D images has never been seen before, to our knowledge.

  • We present an architecture to tackle the hard learning task, via integrating a convolutional structure masking network and a recursive structure recovery network.

  • We develop two prototype applications where we use the recovered box structures 1) to refine the 3D shapes reconstructed from single images by existing methods and 2) to assist structure-aware editing of 2D images.

2 Related work

Reconstructing 3D shapes from a single image has been a long-standing pursue in both vision and graphics fields. Due to its ill-posedness, many priors and assumptions have been attempted, until the proliferation of high-capacity deep neural networks. We will focus only on those deep learning based models and categorize the fast-growing literature in three different dimensions.

Depth estimation vs. 3D reconstruction.

Depth estimation is perhaps the most straightforward solution for recovering 3D information from single images. Deep learning has been shown to be highly effective for depth estimation [3, 11]. Compared to depth estimation, reconstructing a full 3D model is much more challenging due to the requirement of reasoning about the unseen parts. The latter has to resort to shape or structure priors. Using deep neural networks to encode shape priors of a specific category has received much attention lately, under the background of fast growing large 3D shape repositories [1]. Choy et al. [2] develop a 3D Recurrent Reconstruction Neural Network to generate 3D shapes in volumetric representation, given a single image as input. A point set generation network is proposed for generating from a 2D image a 3D shape in point cloud [4]. We are not aware of any previous works that can generate part-based structures directly from a single image.

Discriminative vs. Generative.

For the task of 3D modeling from 2D images, discriminative models are learned to map an input image directly to the output 3D representation, either by a deep CNN for one-shot generation or a recurrent model for progressive generation [2]. The advantages of such approach include ease of training and high-quality results. With the recent development of deep generative models such as variational auto-encoder (VAE) [9], generative adversarial nets (GAN) [6] and their variants. Learning a generative model for 3D shape generation has gained extensive research [22, 5, 13]. For generative models, the input image can be used to condition the sampling from the predefined parameter space or learned latent space [22, 5]. Generative models are known hard to train. For the task of cross-modality mapping, we opt to train a discriminative model with a moderate size of training data.

Geometry reconstruction vs. Structure recovery.

The existing works based on deep learning models mostly utilize volumetric 3D shape representation [22, 5]. Some notable exceptions include generating shapes in point clouds [4], cuboid primitives [19] and manifold surfaces [14]. However, none of these representations contains structural information of parts and part relations. Interestingly, structure recovery is only studied with non-deep-learning approaches [24, 17, 7]. This is largely because of the lack of a structural 3D shape representation suitable for deep neural networks. Recently, Li et al. [13] propose to use recursive neural networks for structural representation learning, nicely addressing the encoding/decoding of arbitrary number of shape parts and various types of part relations. Our method takes the advantage of this and integrate it into a cross-modality mapping architecture for structure recovery from an RGB image.

3 Method

We introduce our architecture for learning 3D shape structures from single images. It is an auto-encoder composed of two sub-networks: a structure masking network for decerning the object structures from the input 2D image and a structure recovery network for recursive inference of a hierarchy of 3D boxes along with their mutual relations.

3.1 Network architecture

Our network is shown in Fig. 2, which is composed of two modules: a two-scale convolutional structure masking network and a recursive structure recovery network. The structure masking network is trained to estimate the contour of the object of interest. This is motivated by the observation that object contours provides strong cues for understanding shape structures in 2D images [16, 18]. Instead of utilizing the extracted contour mask, we feed the feature map of the last layer of the structure masking network into the structure recovery network. To retain more information in the original image, this feature is fused with the CNN feature of the input image via concatenation and fully connected layers, resulting in a D feature code. An RvNN decoder then recursively unfolds the feature code into a hierarchical organization of boxes, with plausible spatial configuration and mutual relations, as the recovered structure.

3.2 Structure Masking Network.

Our structure masking network is inspired by the recently proposed multi-scale network for detailed depth estimation [12]. Given an input RGB image rescaled to , we design a two-scale structure masking network to output a binary contour mask with a quarter of the input resolution (). The first scale captures the information of the whole image while the second produces a detailed mask map at a quarter of the input resolution. As our prediction target is a binary mask, we use the SoftMax Loss as our training loss.

We employ VGG-16 to initialize the convolutional layers (up to pool5) of the first scale network, followed by two fully connected layers. The feature maps and outputs of the first scale network are fed into various layers of the second scale one for refined structure decerning. The second scale network, as a refinement block, starts from one convolution and one pooling over the original input image, followed by nine successive convolutions without pooling. The feature maps from the pool3, pool4 and the output of last fully connected layer of first scale network are fused into the second, the fourth and the sixth convolutional layer of the second scale network, respectively. All the feature fusions get through a jump connections layer, which has a convolutional layer and a 2x or 4x up-sampling to match the feature map size in the second scale; the jump connection from the fully connected layer is a simple concatenation. It is shown that jump connections help extracting detailed structures from images effectively [12].

3.3 Structure Recovery Network

The structure recovery network integrates the features extracted from the structure masking network and for the input image into a bottleneck feature and recursively decodes it into a hierarchy of part boxes.

Feature fusion.

We fuse features from two convolutional channels. One channel takes as input the feature map of the structure masking network (the last feature map before the mask prediction layer), followed by two convolutions and poolings. Another channel is the CNN feature of the original image extracted by a VGG-16. The output feature maps from the two channels are then concatenated with size , and further encoded into a D code after two fully connected layers, capturing the object structure information from the input image. We found through experiments such fused features not only improve the accuracy of structure recovery, but also attain good domain-adaption from rendered images to real ones. We believe the reason is that the extracted features for mask prediction task retain shape details through factoring them out of background clutters, texture variations and lighting conditions. Since it is hard for the masking network to produce perfect mask prediction, the CNN feature of the original image provides complimentary information via retaining more object information.

Structure decoding.

We adopt a recursive neural network (RvNN) as box structure decoder like in [13]

. Starting from a root feature code, RvNN recursively decodes its into a hierarchy of features until reaching the leaf nodes which each can be further decoded into a vector of box parameters. There are three types of nodes in our hierarchy: leaf node, adjacency node and symmetry node. During the decoding, two types of part relations are recovered as the class of internal nodes:

adjacency and symmetry. Thus, each node can be decoded by one of the three decoders below, based on its type (adjacency node, symmetry node or box node):

Adjacency decoder.

Decoder AdjDec splits a parent code into two child codes and , using the mapping function:

where and . is the dimension of a non-leaf node.

Symmetry decoder.

Decoder SymDec recovers a symmetry group in the form of a symmetry generator (a node code ) and a vector of symmetry parameters :

where , and . We use for symmetry parameters consisting of: symmetry type (D); number of repetitions for rotational and translational symmetries (D); and the reflectional plane for reflective symmetry, rotation axis for rotational symmetry, or position and displacement for translational symmetry (D).

Box decoder.

Decoder BoxDec converts the code of a leaf node to a D box parameters defining the center, axes and dimensions of a 3D oriented box, similar to [13].

where , and .

Figure 3: Recursive decoding of a 3D box structure from a 2D image feature (top) and an illustration of decoder network at a given node (bottom).

The decoders are recursively applied during decoding. The key is how to determine the type of a node so that the corresponding decoder can be used at the node. This is achieved by learning a node classifier based on the training task of structure recovery where the ground-truth box structure is known for a given training pair of image and shape structure. The node classifier is jointly trained with the three decoders. The process of structure decoding is illustrated in Fig. 

3. In our implementation, the node classifier and the decoders for both adjacency and symmetry are two-layer networks, with the hidden layer and output layer being D and D vectors, respectively.

3.4 Training details

There are two stages in the training. First, we train the structure masking network to estimate a binary object mask for the input image. The first and the second scale of the structure masking network are trained jointly. In the next, we jointly refine the structure masking network and train the structure recovery network, during which a low learning rate for structure masking network is used. The structure recovery loss is computed as the sum of the box reconstruction error and the cross entropy loss for node classification. The reconstruction error is calculated as the sum of squared differences between the input and output parameters for each box and symmetry node. Prior to training, all 3D shapes are resized into a unit bounding box to make the reconstruction error comparable across different shapes. In Fig. 4 (top), we plot the training and testing losses for box reconstruction, symmetry recovery and node classification, respectively, demonstrating the convergence of our structure recovery network.

Figure 4: The convergence of the structure recovery network. We show in the top plot the training and testing losses for cuboid reconstruction, symmetry parameter recovery and node classification, respectively. The bottom plot shows that our method with structure masking network yields lower reconstruction loss than without it.

We use the Stochastic Gradient Descent (SGD) to optimize our structure recovery network with back-propagation through structure (BPTT) for the RvNN decoder training. The convolutional layers of VGG-16 are initialized with the parameters pre-trained over ImageNet; all the other convolutional layers, the fully connected layers and the structure recovery network are randomly initialized. The learning rate of the structure masking network is

for pre-training and for fine-tuning. During joint training, the learning rate is for structure masking network, for RvNN decoder and for RvNN node classifier. These learning rates are decreased by a factor of for every epoches. Our network is implemented with Matlab based on the MatConvNet toolbox [20]. The details on generating training data is provided in Section 4.1.

4 Experiments

We collected a dataset containing 3D shapes from three categories in ShapeNet: chairs (), tables (), aeroplanes (). The dataset is split into two subsets for training() and testing (), respectively. With these 3D shapes, we generate training and testing pairs of image mask and shape structure to train the network and evaluate our method quantitatively. We also evaluate our methods qualitatively with a Google image search challenge. Both quantitative and qualitative evaluations demonstrate the capability of our method in recovering 3D shape structures from single RGB images faithfully and accurately.

4.1 Training data generation

Image-structure pair generation.

For each 3D shape, we create rendered views around the shape for every rotation and with elevations. Plus another randomly generated views, we create rendered RGB images in total for each shape. The 3D shapes are rendered with randomly selected backgrounds from NYU v2 dataset. For each RGB image, the ground-truth object mask can be easily extracted using the depth buffer for rendering.

All 3D shapes in our dataset are pre-segmented based on their original mesh components or using the symmetry-aware segmentation proposed in [21]. We utilize symmetry hierarchy [21] to represent the shape structure, which defines how parts in a shape are recursively assembled by connectivity or grouped by symmetry. We adopt the method in [13] to infer consistent hierarchy trees for the shapes of each category. Specifically, we train a unsupervised auto-encoder with the task of self-reconstruction for all shapes. During testing, we use this auto-encoder to perform a greedy search of grouping hierarchy for each shape. For more details on this process, please refer to the original work. Consequently, we generate image-structure pairs for each 3D shape.

Data processing and augmentation.

To further enhance our dataset and alleviate overfitting, we conduct on each training 3D shape structure-aware deformation [23] based on component-wise controllers [26] to generate a set of structurally plausible variations for the training shape. Such structure-aware deformation preserves the connection and symmetry relations between shape parts, while maintaining the shape texture for each part. This step is fully automatic and the parameters for each variation generation is randomly set within a given range. In our implementation, we randomly generate new variations for each 3D shape, thus enlarging our database to K 3D shapes. For the input images (and the corresponding object masks), we employ the common operations for image data augmentation [12] such as color perturbation, contrast adjustment, image flip and transformation, etc.

4.2 Results and evaluation

Figure 5:

Object mask predictions for six sample images from the Internet. The probability of object mask is indicated by the brightness in the grey-scale output.

We first show in Fig. 5 some results of object mask prediction by our structure masking network. As can be seen in the output, the background clutters are successfully filtered out and some detailed structures of the objects are captured.

Google image challenge for structure recovery.

We first perform a qualitative evaluation on the capability and versatility of our structure recovery. In order for a more objective study, instead of cherry-picking a few test images, we opt to conduct a small-scale stress test with a Google image challenge [24]. During the test, we perform text-based image search on Google using the keywords of “chair”, “table” and “airplane”, respectively. For each search, we try to recover a 3D cuboid structure for each of the top 8 returned images using our method.

The results are shown in Fig. 6. From the results, we can see that our method is able to recover 3D shape structures from real images in a detailed and accurate way. More importantly, our method can recover the connection and symmetry relations of the shape parts from single view inputs, leading to high quality results with coherent and plausible structure. Examples of symmetry recovery include the reflectional symmetry of chair legs or airplane wings, the rotational symmetry of legs in a swivel chair or a table.

There are some failure cases (marked with red boxes in Fig. 6). The marked chair example is not even composed of multiple parts and hence may not admit a part structure. When the structure of the object of interest is unseen from our training dataset of 3D shapes, such as the marked table example, our method fails to recover a reasonable structure.

Figure 6: Google image search challenge for 3D shape structure recovery. We perform text-based image search on Google with keywords “chair”, “table” and “airplane”, respectively. For each search, we run our method on the top 8 returned images (duplicate or very similar images are removed). Failure cases are marked with red boxes.

Quantitative evaluation.

We quantitatively evaluate our algorithm with our test dataset. For the structure masking network, we evaluate the mask accuracy by the overall pixel accuracy and per-class accuracy against the ground-truth mask (see table 1). We provide a simple ablation study by comparing our method with two baselines: single-scale (without refinement network) and two-scale (without jump connection). The results demonstrate the effectiveness of our multi-scale masking network.

Method Overall Pixel Per-Class
single-scale 0.953 0.917
two-scale (w/o jump) 0.982 0.964
two-scale (with jump) 0.988 0.983
Table 1: An ablation study of structure masking network.

For 3D shape structure recovery, we develop two measures to evaluate the accuracy:

  • Hausdorff Error: , where is a recovered shape structure (represented by a set of boxes) and its corresponding ground-truth. is the number of models in the test dataset. measures the averaged minimum Hausdorff distance from the boxes in structure to those in , where and represent the boxes in and , respectively. is the Hausdorff distance between two boxes, with and being the corner points of box. Since Hausdorff is asymmetric, the distance is computed for both directions and averaged.

  • Thresholded Accuracy: The percentage of boxes such that , where is the -th box in recovered shape structure and its nearest box in the ground-truth . is the Hausdorff distance between two boxes as defined above. is the diagonal length of a box.

We consider as our baseline where the structure masking network is simply a vanilla VGG-16 network. In table 2, we compare the accuracy of structure recovery, based on the above two measures, for our method and the baseline. We also compare the two methods where VGG-16 is replaced with VGG-19. The results demonstrate the significant effect of our structure masking network in helping the structure decoding. This can also be observed from the reconstruction error plotted in Figure 4 (bottom). A deeper structure masking network (with VGG-19) also boosts the performance to a certain degree.

Method Hausdorff Thresholded Acc.
Vanilla VGG-16 0.0980
Structure masking (VGG-16) 0.0894
Vanilla VGG-19 0.0922
Structure masking (VGG-19) 0.0846
Table 2: Comparison of structure recovery accuracy over different methods.


In Fig. 7, we give a visual comparison of 3D shape reconstruction from single-view images between our method and two state-of-the-art methods, [7] and [19]. Both the two alternatives produce part-based representation of 3D shapes, making them comparable to our method. The method by Huang et al. [7] recovers 3D shapes through assembling parts from database shapes while preserving their symmetry relations. The method of Tulsiani et al. [19] generates cuboid representation similar to ours, but does not produce symmetry relations. As can be seen, our method produces part structures which are more faithful to the input, due to the integration of the structure masking network, and meanwhile structurally more plausible, benefiting from our part relation recovery.

Figure 7: Comparing single-view, part-based 3D shape reconstruction between our Im2Struct and two alternatives.

5 Applications

We develop two prototype applications to demonstrate the utility of the recovered shape structure in structure-aware shape editing and processing.

Structure-aware image editing.

In [25], a structure-aware image editing is proposed, where a cuboid structure is manually created for the object in the image to assist a plausible shape deformation. With our method, this cuboid structure can be automatically constructed. Moreover, the part relations are also recovered which can be used to achieve structure-aware editing. Given an RGB image, we first recover the 3D shape structure of the object of interest using our method. To align the inferred cuboid structure with the input image, we train another network to estimate the camera view. The 3D cuboids are then projected to the image space according to the estimated view. The object in the image is segmented with a CRF-based method constrained with the cuboid projections [24]. Each segment is assigned to a 3D cuboid based their image-space overlapping. At this point, the image editing method in [25] can be employed to deform the object of interest. Fig. 1 and 8 show a few examples of structure-aware image editing based on our 3D shape structure recovery.

Figure 8: Examples of structure-aware image editing. Given an input image (the left column), we show the edited structures of 3D cuboids along with the edited images.

Structure-assisted 3D volume refinement.

A common issue with 3D reconstruction with volumetric shape representation is that the resolution of volume is greatly limited due to the high computational cost. This usually results in missing parts and hence broken structure in the reconstructed volume. Our recovered 3D structures can be used to refine the 3D volumes estimated by existing approaches such as 3D-GAN [22]. Given a 2D image, a 3D volume is estimated with 3D-GAN and a cuboid structure recovered by our method. They can be easily aligned with the help of camera view estimation (as have been done above). Each voxel is assigned to the closest cuboid, leading to a part-based segmentation of the volume. We then utilize the part symmetry relation in our recovered structure to complete the missing voxels; see results in Fig. 9.

Figure 9: Part symmetry induced volume refinement. Given a 2D image, a volumetric shape is recovered using 3D-GAN [22] where the missing voxels break the symmetry of the object. Our recovered 3D structure helps complete the volume based on part symmetry relation.

6 Conclusion

We have proposed a deep learning framework that directly recovers 3D shape structures from single 2D images. Our network joins a structure masking network for decerning the object structure and a structure recovery network for inferring 3D cuboid structure. The recovered 3D structures achieve both fidelity with respect to the input image and plausibility as a 3D shape structure. To the best of our knowledge, our work is the first that recovers detailed 3D shape structures from single 2D images.

Our method fails to recover structures for object categories unseen from the training set. For such cases, it would be interesting to learn an incremental part assembler. Our method currently recovers 3D cuboids only but not the underlying part geometry. A worthy direction is to synthesize detailed part geometry matching the visual appearance of the input image. Another interesting topic is to study the profound correlation between 2D features and 3D structure, so as to achieve a more explainable 3D structure decoding.