{ "url": "http://arxiv.org/abs/2404.16423v1", "title": "Neural Assembler: Learning to Generate Fine-Grained Robotic Assembly Instructions from Multi-View Images", "abstract": "Image-guided object assembly represents a burgeoning research topic in\ncomputer vision. This paper introduces a novel task: translating multi-view\nimages of a structural 3D model (for example, one constructed with building\nblocks drawn from a 3D-object library) into a detailed sequence of assembly\ninstructions executable by a robotic arm. Fed with multi-view images of the\ntarget 3D model for replication, the model designed for this task must address\nseveral sub-tasks, including recognizing individual components used in\nconstructing the 3D model, estimating the geometric pose of each component, and\ndeducing a feasible assembly order adhering to physical rules. Establishing\naccurate 2D-3D correspondence between multi-view images and 3D objects is\ntechnically challenging. To tackle this, we propose an end-to-end model known\nas the Neural Assembler. This model learns an object graph where each vertex\nrepresents recognized components from the images, and the edges specify the\ntopology of the 3D model, enabling the derivation of an assembly plan. We\nestablish benchmarks for this task and conduct comprehensive empirical\nevaluations of Neural Assembler and alternative solutions. Our experiments\nclearly demonstrate the superiority of Neural Assembler.", "authors": "Hongyu Yan, Yadong Mu", "published": "2024-04-25", "updated": "2024-04-25", "primary_cat": "cs.CV", "cats": [ "cs.CV", "cs.RO" ], "label": "Original Paper", "paper_cat": "Graph AND Structure AND Learning", "gt": "The assembly task necessitates predicting a sequence of operations for the placement of various components. Accurate and efficient assembly algorithms play a pivotal role in robotics. These assembly challenges are pervasive in daily life, as in scenarios like constructing LEGO models Chung et al. (2021), assembling furniture Su\u00e1rez-Ruiz et al. (2018), and Minecraft Chen et al. (2019). In previous research, Chen et al. Chen et al. (2019) suggested replicating human building order with spatial awareness to construct Minecraft houses without target information. Wang et al. Wang et al. (2022a) introduced a step-by-step approach for assembling LEGO models based on the assembly manual, while the work in Zhan et al. (2020) focused on predicting the 6-DoF pose of each component based on the object\u2019s class for assembly. Li et al. Li et al. (2020) predicted the poses of parts using a single image. In this study, we define a new task of image-guided assembly. We are provided with a set of multi-view images captured from a 3-D model, assuming it is built with components from a pre-specified library. The goal of the task is to generate a sequence of fine-grained assembly instructions, encompassing all parameters\u2014such as component types, geometric poses of each component, and assembly order\u2014in accordance with physical rules and suitable for execution by a robotic arm. The task serves as a valuable testbed for advancing vision-guided autonomous systems, presenting a range of technical challenges. Firstly, understanding the correspondence between 2D images and 3D objects is crucial. Given that certain components in the 3D model might be entirely obscured from specific viewpoints, we employ multi-view images (e.g., typically 4 in this study) as input. The algorithm must effectively arXiv:2404.16423v1 [cs.CV] 25 Apr 2024 Neural Assembler Object library with Shape / Texture Object Relation Graph 0 1 6 8 7 2 9 3 4 5 0 1 4 2 6 7 3 5 8 9 \u2026 Assembly Instructions Multi-view Images Object Detection and Pose Estimation Camera 1 Camera 2 Camera 3 Camera 4 Figure 1: Schematic illustration of the proposed Neural Assembler. See Section 3 for more details. integrate information from images captured from multiple perspectives. Secondly, estimating critical information for each component is non-trivial. With a 3D library in place, the algorithm needs to segment components across all images and categorize each based on predefined object types in the library, mainly using shape and texture cues. In addition, one also needs estimate the 3-D spatial position and rotation matrix of each component. Thirdly, obtaining typological information for all components is necessary to formulate a physically feasible assembly plan. Importantly, observations of a component in images are often incomplete, primarily due to frequent occlusions. This poses a substantial challenge in fully understanding and interpreting the scene. Such occlusions are particularly challenging when assembling complex, multi-layerd models. For this novel task, we propose an end-to-end neural network, dubbed as Neural Assembler. The computational pipeline of Neural Assembler is illustrated in Figure 1. Taking multi-view images and a 3-D component library as input, Neural Assembler not only identifies each component from images but also determines its 3D pose at each step of assembly. Leveraging images from multiple viewpoints, our method aims to enhance the overall scene understanding and accurately predict the order for placing parts in assembly tasks. We present two datasets for the proposed image-guided assembly task, namely the CLEVR-Assembly dataset and LEGO-Assembly dataset. Each sample in these datasets comprises images of the object captured from various perspectives, along with the pose of each part (2D keypoints, mask, 3D position, and rotation), and the relationship graph of all components. Comprehensive experiments are conducted on both datasets. Due to the absence of prior work addressing this novel setting like Neural Assembler, we establish two robust baselines for comparison. The evaluations unequivocally demonstrate that Neural Assembler outperforms the baselines across all performance metrics.", "main_content": "Assembly algorithms Assembly tasks have utilized computational strategies for part selection and placement, including action scoring Yuille and Kersten (2006); Bever and Poeppel (2010), genetic algorithms Lee et al. (2015), and voxel-based optimization Kim et al. (2020); van den Hengel et al. (2015). Manual-driven approaches have been investigated Shao et al. (2016); Wang et al. (2022a); Chen et al. (2019); Walsman et al. (2022); Chung et al. (2021), with LSTM showing limitations in long sequence predictions Walsman et al. (2022), and the reinforcement learning methodChung et al. (2021) struggling with block complexity. Existing research into part-based 3D modeling Zhan et al. (2020); Mo et al. (2019); Li et al. (2020); Niu et al. (2018) and parts retrieval from 3D meshes Chaudhuri and Koltun (2010); Shen et al. (2012); Sung et al. (2017) assumes prior part knowledge. Our novel task of reconstructing 3D models from multi-view images without prior information presents a unique challenge not yet addressed by none of above works. Multi-view scene understanding Many scene understanding tasks are intractable in single-view and can only be solved given multi-view inputs. For example, The SLAM (simultaneous localization and mapping) task requires reconstructing the 3D geometric scene and estimating camera poses given a sequence of video frames. 3D-SIS Hou et al. (2019) performed instance segmentation by reading a set of RGB-D images. MVPointNet Jaritz et al. (2019) was based on a set of RGB-D images and point clouds for instance segmentation. Murez et al. (2020) performed 3D semantic segmentation 2 and reconstruction based on multiple RGB images. Similarly in our work, the algorithm understands the structure of 3D brick models and predicts the poses of parts based on multi-view images. Structural modeling for scenes or 3-D models Recent studies have focused on inferring structural representations like graphs Johnson et al. (2015); Cong et al. (2023); Li et al. (2022) and programmatic descriptions Ellis et al. (2018); Liu and Wu (2019); Wu et al. (2017) from images. Techniques range from encoder-decoder architectures for triplet generation Cong et al. (2023) to efficient graph-based methods Li et al. (2022), CNNs for primitive shape programs Ellis et al. (2018). An encoder-decoder approach for scene re-rendering Wu et al. (2017) and transformers for structural change detection Qiu et al. (2023) have also been proposed. Our work differs by using structural representations to predict assembly sequences of object parts. 3 Neural Assembler 3.1 Task Specification Given several multi-perspective images of a 3-D brick model {Ik}K k=1, the corresponding camera parameters with respect to some reference coordinate system, and a predefined 3-D brick (or termed as component, as used exchangeably in this paper) library Lib = {b1, b2, . . . , bM}, our algorithm identifies the bricks present in the scene, predicts each brick\u2019s pose and constructs a relational graph G = {V, E}. The vertex set V correspond to the bricks and the directed edge set E represent spatial configuration that can further be used to derive the assembly instructions. In particular, each brick bi in the library is denoted as (Si, Ti) where Si is assumed to be point clouds and Ti is represented as texture images. In the relationship graph, each node vi \u2208V describes the i-th brick information vi = (Si, Ti, Kpsi, Roti, Mi) where Kpsi \u2208([0, 1] \u00d7 [0, 1])K\u00d72 encodes the 2D keypoints (we use this notation to refer to the planar projection of the brick center) in K views, Roti \u2208[0, 2\u03c0]K are the rotation angles in K views and Mi \u2208{0, 1}K\u00d7H\u00d7W are the binary masks of the brick in K views. The edge ei,j \u2208E explicitly describes the assembly order, where ei,j = 1 only when a brick vj is placed into the 3-D model after brick vi. Here we develop a baseline for the proposed task, namely Neural Assembler, whose computational pipeline is shown in Figure 2, Our model leverages a graph convolutional network (GCN) to delineate the assembly sequence effectively. The 3-D poses of objects are inferred from 2D image data across multiple views, exploiting the geometric constraints provided by the camera parameters to ensure spatial consistency in the 3D domain. This framework showcases the capability of capturing complex relational patterns and translating them into a structured assembly protocol. 3.2 Multi-View Feature Fusion We adopt the pretrained CLIP image encoder to get the feature maps F k and CLIP feature vectors vk CLIP , k \u2208{1, 2, ...K}. Then the features of all views are fused with others, using an adapted implementation of group-based semantic agreement Transformer Xu and Mu (2023). The scene consensus (denoted as a vector g) of the images from different perspectives are extracted according to the rule: g = 1 K PK k=1 Norm(vk CLIP ), where Norm(\u00b7) is the L2 normalization. Afterwards, the scene consensus g is dispersed to multi-view image features through channel-wise multiplication: \u02c6 F k = F k \u00b7 g, k = 1, 2, . . . , K. Template as visual prompts. Let the texture image Ti \u2208RHTi\u00d7WTi\u00d73, where (HTi, WTi) is the texture image size, represent the texture template and point clouds Si \u2208RNP \u00d73 represent the shape template. In all experiments of this work, we fix the parameter NP to be all 1024, striking a balance between compute expense and capability of representing the bricks. For the texture image, we set both HTi and WTi to 224. A CNN backbone (e.g., ResNet-18 He et al. (2016)) generates template features Ti \u2190CNN(Ti), and a pointnet backbone (e.g., PointNet Qi et al. (2017)) generates shape features Si \u2190PointNet(Si). Transformer decoder. The decoder accepts as input the shape feature library S = {Si}, the texture feature library T = {Ti} and the fused image features \u02c6 F k. As shown in Fig. 2, the transformer decoder is designed to obtain the image conditioned object query. 3 Multi-view Images Image Encoder Texture Library ... Shape Library ... Point Cloud Encoder Texture Encoder Shape Features Texture Features + Object Queries Visual Prompts Consensus Dispersion Fused Image Features Linear Interpolation Object-conditioned Image Feature + Transformer Decoder Global Object Features Scene Consensus Materials Keypoints Rotations Masks ... ... Per-view Object Features Assembly Graph Number of Bricks Shapes Image Features Figure 2: The proposed Neural Assembler architecture. An image encoder outputs the visual embeddings of multi-view images. The shape and texture library are provided as visual prompts for object detection. Then the transformer decoder module is applied to get the library-based object features. Finally, the object-conditioned image features are decoded to the bricks\u2019 masks, keypoints, and rotation angles, while the global object features are decoded to the bricks\u2019 textures, shapes, the number of blocks, and the assembly graph. The elements from the shape feature library S or the texture feature library T and the N learned object queries O are concatenated to define a query O\u2032 = [S, T, O]. Given the fused image features \u02c6 F k and the query O\u2032, the library-based object queries f k i (i = 1, 2, . . . , N, k = 1, 2, . . . , K) are obtained through a couple of decoding layers that employ the structure of FS-DETR Bulat et al. (2023). Then we use an averaging operation to obtain a unified, multi-view feature representation for each object: f global i = PK k=1 f k i , i = 1, 2, . . . , N. This approach effectively integrates diverse perspectives to enhance the overall understanding for the object\u2019s attribute. As shown in Fig. 2, for the Consensus Dispersion module and Linear Interpolation module, to obtain the object-conditioned image features, we adapt the combination of CLIPSeg L\u00fcddecke and Ecker (2022) and group-based semantic agreement Transformer Xu and Mu (2023). The node features f k i serve as conditional prompts. Feature fusion between node features and image features is achieved through linear interpolation. Formally, in each perspective, the object-conditioned image features F k i = LI( \u02c6 F k, f k i ) where i = 1...N, k = 1, 2, ...K, LI is linear interpolation. Next, the scene consensus g is dispersed to multi-view object-conditioned image features through channel-wise multiplication \u02c6 F k i = F k i \u00b7 g. 3.3 Brick Number Prediction For each view k = 1, 2, . . . , K, we average the N object-conditioned image features \u02c6 F k avg = 1 N PN i=1 \u02c6 F k i . Then the scene feature can be obtained by \u02c6 Fscene = 1 K PK k=1 \u02c6 F k avg. Finally a couple of convolution layers are used to predict the number of bricks in the scene. 3.4 Relation Graph Generation Predicting the assembly sequence is equivalent to predicting the connections of bricks which can be described using the relationship graph. If brick A is placed on the top of B, then there is a directed edge from B to A. A graph convolutional network Kipf and Welling (2016) is adopted to predict the existence of each edge in the graph. Given the complete graph G = (V, E) with initial node features p0 i = f global i . Similar to Johnson et al. (2018); Wald et al. (2020), we implemented the GCN using the MLP (multi-layer perception) structure. Each iteration of message passing starts from computing edge features: et+1 i,j \u2190MLP([pt i, pt j]). An average-pooling is performed over all edge 4 features connected to a node, obtaining an updated node feature pt+1 i = 1 |{u|(u, i) \u2208E}| X (u,i)\u2208E et+1 u,i . (1) After gathering the edge features via graph convolutions as {et i,j}T t=1, we use another MLP to predict the probability of the existence of each edge, P(i,j) = MLP(eT i,j) Finally, to determine the assembly sequence during inference, the directed edges are sorted in descending order according to the predicted probability and subsequently incorporated into the directed graph. If a loop is formed after adding an edge, this edge will not be added. The process continues until it reach a state where there exists a vertex that can reach all other vertices in the graph. 3.5 Pose Estimation The N object query features {f global i }N i=1 are used for shape and texture classification. The shape prediction head predicts the shape label and the texture prediction head predicts the texture label. Mask and heatmap prediction. We employ a simple deconvolution layer on the object-conditioned image feature \u02c6 F k i to obtain the heatmap of keypoint and mask of the object i in each perspective k. Rotation prediction The rotation angle is represented as a 2D vector representing the sine and cosine values of it. The rotation predictor accepts conditional image features \u02c6 F k i as input and outputs the sine and cosine value. Confidence score prediction Since bricks may not be visible at all perspectives, here we predict the the confidence score ck i of each brick at each perspective. Specifically, ck i represents the Iou(Intersection Over Union) between the predicted mask and ground truth mask. Figure 3: Illustration of 3D position prediction module. During inference, the pose of each object in 3D space is obtained by merging the poses from each perspective (see Figure 3). In more details, for 3D position prediction, our method involves detecting keypoints of the object parts from the view whose confidence score ci is higher than a threshold \u03b8. Then, utilizing the camera parameters, the rays in 3D space generated by keypoints are used to infer the object\u2019s position in 3D space. Each ray Ri is represented as ri(t) = Oi + t \u00b7 Di where Oi is the origin and Di is the direction. Our objective is to find a point P that minimizes the function: h(Z) = L X i d(Z, Ri), (2) where L is the number of rays and d(Z, Ri) represents the shortest distance from the point P to the ray Ri. Here, the minimization of the objective function h(Z) is approached through the gradient descent method. 3.6 Training and Loss functions We train Neural Assembler with full supervision on the generated dataset where each sample we have the groundtruth shape, texture, keypoint, mask, rotation information of each brick, the number of bricks and the relationship graph of bricks. The entire neural network is trained end-to-end with gradient descent. Our objective function is computed by L = \u03b1 \u00b7 Lcount + \u03b2 \u00b7 Lgraph + Lpose, where Lcount is the L1 Loss between the predicted number of bricks and ground truth countgt. Following Carion et al. (2020), bipartite matching is used to find an optimal permutation {\u03c3i}N i=1 to match the N object queries and ground truth bricks in the scene. The pose loss of bricks includes the loss of shape, texture, keypoint, mask and rotation. Lpose = Lkeypoint + Lmask + \u03b31Lrotation (3) + \u03b32Lshape + \u03b33Ltexture + \u03b34Lconfidence, (4) 5 where Lkeypoint is the focal loss Lin et al. (2017) computed based on the predicted heatmap and ground truth heatmap generated by Kps\u03c3i, Lmask is the focal and dice loss between the predicted mask and ground truth mask M\u03c3i, Lrotation is the L1 Loss between the prediced sine and cosine and the ground truth sine and cosine of Rot\u03c3i, Lshape and Ltexture are the cross entropy loss for shape and texture classification and Lconfidence is L1 Loss between the predicted confidence score and Iou of the predicted mask and ground truth mask. Our model strategically prioritizes the hyperparameters Lkeypoint and Lmask due to their critical impact on object detection, essential for accurate object interaction and identification in complex scenes. In contrast, Lrotation, Lshape, Ltexture and Lconfidence are assigned a reduced weight of 0.1 each, a decision grounded in empirical findings that highlight their relatively minor incremental benefits to overall model efficacy. Lgraph is the loss for relationship graph prediction. Firstly, we define the loss for any subset of the entire edge set. For a subset \u02c6 E of the edge set E of the complete graph, the edge loss of \u02c6 E is defined as L \u02c6 E = P (x,y)\u2208\u02c6 E LCE(P(x,y), \u02c6 E(x,y)). Then the Lgraph is defined as Lgraph = LE + LtopKE LtopKE = 1 KE KE X k=1 LEtopk , (5) where Etopk is the set of the edges with the top k highest predicted probability. Since the entire relationship graph is a directed graph with sparse edges, the hyperparameter KE is defined as countgt + 1. 4 Experiments Dataset preparation. Experiments are conducted on two self-constructed datasets. The CLEVRAssembly Dataset, created via the CLEVR-EngineJohnson et al. (2017), comprises a shape library with 6 brick shapes and 16 textures, a 76.5% visibility probability of each brick per perspective, 7.51 bricks per sample, and an average assembly graph depth of 4.01, with approximately 10K training, 500 validation, and 2000 test samples. The LEGO dataset, synthesized using Pytorch3d, features 12 LEGO brick shapes and 8 textures, an 82.6% visibility probability of each brick per perspective, 7.39 bricks per sample, and an average graph depth of 4.49, also with approximately 10K training, 500 validation, and 2000 test samples. The two datasets, characterized by brick number, occlusion from variable visibility, and complex assembly graph, reflect the complexity of assembly tasks. Baseline models. In addressing this novel task, for which no direct baseline exists, we have established a comparative framework against three distinct baseline methods to demonstrate the efficacy of our approach. First, to assess the validity of our assembly order prediction methodology, we introduce a Long Short-Term Memory (LSTM) Graves and Graves (2012) module as a surrogate baseline to contrast with our Graph Convolutional Network (GCN) based module. This comparison aims to highlight the enhanced predictive capabilities our GCN model brings to complex assembly sequences. Furthermore, for the object pose estimation component, our methodology is rigorously benchmarked against DETR3D Wang et al. (2022b), a prominent baseline in the realm of object detection within autonomous driving scenarios. This comparison is pivotal in underscoring the adaptability and accuracy of our model in 3D pose estimation, a crucial aspect in varied application domains. Lastly, in evaluating our multi-view image feature fusion process, we contrast our approach with a method that does not leverage scene consensus. This comparison is instrumental in showcasing the enhanced scene understanding and feature integration our method offers, thus demonstrating its superiority in synthesizing and utilizing multi-view image data. Implementation details. Our approach is implemented in single-scale version for fair comparison with other works. It incorporates a CLIPRadford et al. (2021) pre-trained ViT-B/16 image encoder, a PointNet-based Qi et al. (2017) point cloud encoder, and a ResNet-18He et al. (2016) for texture encoding. We employ a two-layer residual network for brick number prediction. The shape, material, iou prediction heads are implemented using 3-layer MLP and ReLU activations. Rotation prediction also uses a two-layer residual network, and our GCN architecture employs two message-passing layers. Training is conducted on an RTX 3090 GPU using AdamW, with an initial rate of 5e-4, decaying by 0.8 per epoch, a weight decay of 1e-3, and batch size 8 over 10 epochs for both datasets. 6 Evaluation metrics. In this assembly task, we introduce several metrics to evaluate the performance of our algorithm both at a per-scene and per-step level, providing a holistic measure of our method\u2019s efficacy. Specifically, for the per-scene metrics, our approach necessitates the prediction of the entire assembly sequence based on multi-view images, emphasizing the ability to comprehend and reconstruct the complete scene from various perspectives. In contrast, the per-step metrics operate under the assumption that the assembly order is known a priority. Here, we focus on calculating the error between the predicted information for each individual brick and the corresponding ground truth, independent of the assembly order. This allows for a comprehensive evaluation of the method\u2019s ability in both holistic scene understanding and step-wise brick analysis. Table 1: Comparison of per-scene metrics. Method Complete Rate Per-scene Acc Count Acc Order CR LEGO-Assembly LSTM Graves and Graves (2012) 27.5 5.3 60.3 35.1 DETR3D Wang et al. (2022b) 25.8 2.5 61.5 63.5 Ours (w/o consensus) 43.7 18.4 69.0 64.5 Ours 43.9 22.9 76.3 69.4 CLEVR-Assembly LSTM Graves and Graves (2012) 19.7 8.0 91.5 22.6 DETR3D Wang et al. (2022b) 16.8 4.5 89.5 35.3 Ours (w/o consensus) 28.6 6.6 92.1 45.5 Ours (2 views) 22.0 4.6 88.7 38.6 Ours (3 views) 25.7 9.3 94.0 44.5 Ours 41.5 22.5 95.5 62.1 For per-scene metrics, we evaluate the Complete Rate (completion percentage of the brick model), Order CR (completion rate of the sequence of brick types), Per-scene Acc (accuracy of completely assembling an entire brick model), Count Acc(precision of predicting the number of bricks). For per-step metrics, we evaluate the Pos Acc and Rot Acc (3D position accuracy and rotation accuracy), Shape Acc and Texture Acc (shape accuracy and texture accuracy), Kps Mse (error of the predicted 2D keypoints of the object), mIou (mean Intersection over Union between the predicted mask and the ground truth), the F1-score between predicted relation graph and ground truth relation graph and Per-step Acc(accuracy of correct predictions for each brick\u2019s information). Results on CLEVR-Assembly. Per-scene quantitative results on the CLEVR-Assembly Dataset are summarized in Table 1. Neural Assembler outperforms baseline models in all metrics considered. From Table 2, we can see Neural Assembler locates objects more accurately than DETR3D. 1 2 3 4 5 6 7 8 9 Number of Steps 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Probability (a) CLEVR-Assembly LSTM GCN 1 2 3 4 5 6 7 8 9 Number of Steps 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Probability (b) LEGO-Assembly LSTM GCN Figure 4: The probability distribution of CCA. The metric CCA proposed by Chen et al. (2019) is adopted here for the brick order evaluation. It denotes the probability distribution of the number of brick that a model can consecutively place from scratch. As shown in Fig.4, LSTM perform worse than GCN. This is because time dependence is not crucial for the assembly order prediction. Instead, the assembly problem requires prediction from complex spatial relationships. The adeptness of GCN in capturing spatial relation plays a critical role in understanding the assembly order. Consensus Module As shown in Table 2, extracting the consensus can better align the information of the images from various perspectives. Without scene consensus, it is difficult for the model to integrate information from multi-view images to obtain the overall information of each brick. Number of views Furthermore, we compared the results obtained by accepting different numbers of images as input. As shown in Tables 1 and 2, the result shows that more perspectives as input can improve the performance. This is because each brick may not be seen from some perspectives due to the existence of occlusion. More views mean more information for prediction. Fig. 5 further shows the generated assembly instructions for a brick model in the CLEVR-Assembly Dataset. Perspectives with confidence score greater than 0.66 are selected to infer the brick\u2019s 7 Multi-view Images Brick Type 3D Pos Rotation (-0.72, -0.76, 0.49) 70.37 Last Step This Step Object Detection Figure 5: Result from CLEVR-Assembly Dataset. Multi-view Images Brick Type 3D Pos Rotation (0, 0, 4) 0 Last Step This Step Object Detection Figure 6: Result from LEGO-Assembly Dataset. Table 2: Comparison of baselines on per-step metrics. Method Per-Step Acc Pos Acc Rot Acc Shape Acc Texture Acc mIoU Kps Mse F1 LEGO-Assembly DETR3D Wang et al. (2022b) 41.7 47.2 78.2 87.8 98.3 0.797 Ours (w/o consensus) 71.7 79.0 87.2 89.9 98.3 76.3 1.12 0.829 Ours 73.5 80.4 88.0 91.5 98.3 78.5 0.88 0.820 CLEVR-Assembly DETR3D Wang et al. (2022b) 29.2 32.4 75.6 72.4 67.0 0.734 Ours (w/o consensus) 57.2 67.9 78.9 87.1 88.5 61.2 1.2 0.781 Ours (2 views) 56.1 71.7 73.0 80.0 86.4 65.4 2.5 0.721 Ours (3 views) 61.1 74.6 77.9 85.7 90.7 67.1 1.5 0.772 Ours 69.2 79.1 84.1 91.5 93.8 71.1 0.78 0.840 information. It is evident that Neural Assembler is adept at excluding perspectives where bricks are obscured by predicting confidence scores, thereby identifying optimal perspectives for predicting positional information. Concurrently, it is capable of predicting the structure between bricks to determine the appropriate assembly sequence. Results on LEGO-Assembly. Different from CLEVR-Dataset, LEGO bricks are connected through slots. It is easier to infer the position of the bricks based on the connection constraints between the LEGO bricks, as long as the rough position of the LEGO bricks is predicted. However, there are many challenges in predicting the assembly sequence of LEGO brick models. For instance, the more compact assembly of LEGO bricks results in increased occlusion. The LEGO brick will only have rotations chosen from (0\u25e6, 90\u25e6, 180\u25e6, 270\u25e6). Meanwhile, the position of LEGO bricks is discretized. We adopt the connection-constrained inference subroutine and an inference-by-synthesis subroutine used in Wang et al. (2022a) to predict the position and rotation angle for each view, and then integrated them through voting. The results in Table 1 and Table 2 shows that Neural Assembler can yield more accurate results than other baselines. Fig.6 further shows the generated assembly instructions for a LEGO model. Method Per-scene Acc Complete Rate Novel-Dataset LSTM Graves and Graves (2012) 16.0 27.3 DETR3D Wang et al. (2022b) 7.3 21.8 Ours 34.2 58.5 Real-World Dataset LSTM Graves and Graves (2012) 7.3 21.8 DETR3D Wang et al. (2022b) 2.4 12.8 Ours 22.0 50.5 Table 3: The performance of the fine-tuned model on the novel simulated dataset and real-world dataset. Real-world experiments. To confirm the model\u2019s generalizability, a comprehensive test dataset is constructed, complete with annotations for each brick\u2019s shape, position, and rotation. For each sample, we acquired real brick images using a Realsense camera in the real world and generated corresponding simulated images 8 (1.31, 0.04, 1) -4.95 3D Pos Rotation (-0.28, -1.68, 1) 7.13 (1.42, 1.56, 0.5) 2.51 (-0.34, -0.06, 0.5) -0.11 (1.22, -1.66, 1) 1.42 (-1.66, -1.30, 0.5) -5.43 (0.95, -1.53, 2.5) 66.73 Simulated Assembly Brick Type Real-world Images Figure 7: The result from the real-world brick model. The left box displays 4 images captured using a Realsense camera, while the right delineates the detected type, position, rotation angle of each brick, and the sequential assembly order of the brick model. in the simulation environment employing real-world camera parameters to ensure the consistent coordinate between the simulated and real environments. The dataset encompasses 5 brick types and 7 textures, averaging 6.1 bricks per brick model. To evaluate the Neural Assembler, we collected point clouds and textures from real bricks. This data facilitated the creation of a synthetic dataset, used for fine-tuning the model initially trained on the CLEVR-Assembly dataset. As indicated in Table 3, the Neural Assembler achieves performance in real-world experiments close to the results obtained in simulated environments, demonstrating its robust applicability. Fig. 7 presents the result on the real world dataset. Discussion. As shown in Fig. 8, the occlusion still greatly affects the performance of the model, especially the objects under the brick model will be greatly blocked by the bricks pressing on it. To alleviate this problem, in future work, we plan to enhance model performance with a deeper integration of physical scene understanding. The model is expected to not only interpret the visual aspects but also the underlying physical principles governing the scene. Prediction Ground Truth View 1 View 2 View 3 View 4 Figure 8: Failure case. The model confidently but incorrectly predicts the highlighted block in View 1, while in View 3, despite correct keypoint identification, occlusion results in a less confident. This causes erroneous overall prediction. 5 Conclusion We study the problem of generating robotic assembly instructions from multi-view images and propose Neural Assembler, a model that predicts the assembly instructions of the brick model. The key idea behind our model is to learn the graph structure to predict the relationships among bricks and infer the 3D pose according to multi-view images. Results show that our model outperforms existing methods on the newly collected CLEVR-Assembly and LEGO-Assembly Dataset. 9", "additional_graph_info": { "graph": [ [ "Hongyu Yan", "Yadong Mu" ] ], "node_feat": { "Hongyu Yan": [ { "url": "http://arxiv.org/abs/2404.16423v1", "title": "Neural Assembler: Learning to Generate Fine-Grained Robotic Assembly Instructions from Multi-View Images", "abstract": "Image-guided object assembly represents a burgeoning research topic in\ncomputer vision. This paper introduces a novel task: translating multi-view\nimages of a structural 3D model (for example, one constructed with building\nblocks drawn from a 3D-object library) into a detailed sequence of assembly\ninstructions executable by a robotic arm. Fed with multi-view images of the\ntarget 3D model for replication, the model designed for this task must address\nseveral sub-tasks, including recognizing individual components used in\nconstructing the 3D model, estimating the geometric pose of each component, and\ndeducing a feasible assembly order adhering to physical rules. Establishing\naccurate 2D-3D correspondence between multi-view images and 3D objects is\ntechnically challenging. To tackle this, we propose an end-to-end model known\nas the Neural Assembler. This model learns an object graph where each vertex\nrepresents recognized components from the images, and the edges specify the\ntopology of the 3D model, enabling the derivation of an assembly plan. We\nestablish benchmarks for this task and conduct comprehensive empirical\nevaluations of Neural Assembler and alternative solutions. Our experiments\nclearly demonstrate the superiority of Neural Assembler.", "authors": "Hongyu Yan, Yadong Mu", "published": "2024-04-25", "updated": "2024-04-25", "primary_cat": "cs.CV", "cats": [ "cs.CV", "cs.RO" ], "main_content": "Assembly algorithms Assembly tasks have utilized computational strategies for part selection and placement, including action scoring Yuille and Kersten (2006); Bever and Poeppel (2010), genetic algorithms Lee et al. (2015), and voxel-based optimization Kim et al. (2020); van den Hengel et al. (2015). Manual-driven approaches have been investigated Shao et al. (2016); Wang et al. (2022a); Chen et al. (2019); Walsman et al. (2022); Chung et al. (2021), with LSTM showing limitations in long sequence predictions Walsman et al. (2022), and the reinforcement learning methodChung et al. (2021) struggling with block complexity. Existing research into part-based 3D modeling Zhan et al. (2020); Mo et al. (2019); Li et al. (2020); Niu et al. (2018) and parts retrieval from 3D meshes Chaudhuri and Koltun (2010); Shen et al. (2012); Sung et al. (2017) assumes prior part knowledge. Our novel task of reconstructing 3D models from multi-view images without prior information presents a unique challenge not yet addressed by none of above works. Multi-view scene understanding Many scene understanding tasks are intractable in single-view and can only be solved given multi-view inputs. For example, The SLAM (simultaneous localization and mapping) task requires reconstructing the 3D geometric scene and estimating camera poses given a sequence of video frames. 3D-SIS Hou et al. (2019) performed instance segmentation by reading a set of RGB-D images. MVPointNet Jaritz et al. (2019) was based on a set of RGB-D images and point clouds for instance segmentation. Murez et al. (2020) performed 3D semantic segmentation 2 and reconstruction based on multiple RGB images. Similarly in our work, the algorithm understands the structure of 3D brick models and predicts the poses of parts based on multi-view images. Structural modeling for scenes or 3-D models Recent studies have focused on inferring structural representations like graphs Johnson et al. (2015); Cong et al. (2023); Li et al. (2022) and programmatic descriptions Ellis et al. (2018); Liu and Wu (2019); Wu et al. (2017) from images. Techniques range from encoder-decoder architectures for triplet generation Cong et al. (2023) to efficient graph-based methods Li et al. (2022), CNNs for primitive shape programs Ellis et al. (2018). An encoder-decoder approach for scene re-rendering Wu et al. (2017) and transformers for structural change detection Qiu et al. (2023) have also been proposed. Our work differs by using structural representations to predict assembly sequences of object parts. 3 Neural Assembler 3.1 Task Specification Given several multi-perspective images of a 3-D brick model {Ik}K k=1, the corresponding camera parameters with respect to some reference coordinate system, and a predefined 3-D brick (or termed as component, as used exchangeably in this paper) library Lib = {b1, b2, . . . , bM}, our algorithm identifies the bricks present in the scene, predicts each brick\u2019s pose and constructs a relational graph G = {V, E}. The vertex set V correspond to the bricks and the directed edge set E represent spatial configuration that can further be used to derive the assembly instructions. In particular, each brick bi in the library is denoted as (Si, Ti) where Si is assumed to be point clouds and Ti is represented as texture images. In the relationship graph, each node vi \u2208V describes the i-th brick information vi = (Si, Ti, Kpsi, Roti, Mi) where Kpsi \u2208([0, 1] \u00d7 [0, 1])K\u00d72 encodes the 2D keypoints (we use this notation to refer to the planar projection of the brick center) in K views, Roti \u2208[0, 2\u03c0]K are the rotation angles in K views and Mi \u2208{0, 1}K\u00d7H\u00d7W are the binary masks of the brick in K views. The edge ei,j \u2208E explicitly describes the assembly order, where ei,j = 1 only when a brick vj is placed into the 3-D model after brick vi. Here we develop a baseline for the proposed task, namely Neural Assembler, whose computational pipeline is shown in Figure 2, Our model leverages a graph convolutional network (GCN) to delineate the assembly sequence effectively. The 3-D poses of objects are inferred from 2D image data across multiple views, exploiting the geometric constraints provided by the camera parameters to ensure spatial consistency in the 3D domain. This framework showcases the capability of capturing complex relational patterns and translating them into a structured assembly protocol. 3.2 Multi-View Feature Fusion We adopt the pretrained CLIP image encoder to get the feature maps F k and CLIP feature vectors vk CLIP , k \u2208{1, 2, ...K}. Then the features of all views are fused with others, using an adapted implementation of group-based semantic agreement Transformer Xu and Mu (2023). The scene consensus (denoted as a vector g) of the images from different perspectives are extracted according to the rule: g = 1 K PK k=1 Norm(vk CLIP ), where Norm(\u00b7) is the L2 normalization. Afterwards, the scene consensus g is dispersed to multi-view image features through channel-wise multiplication: \u02c6 F k = F k \u00b7 g, k = 1, 2, . . . , K. Template as visual prompts. Let the texture image Ti \u2208RHTi\u00d7WTi\u00d73, where (HTi, WTi) is the texture image size, represent the texture template and point clouds Si \u2208RNP \u00d73 represent the shape template. In all experiments of this work, we fix the parameter NP to be all 1024, striking a balance between compute expense and capability of representing the bricks. For the texture image, we set both HTi and WTi to 224. A CNN backbone (e.g., ResNet-18 He et al. (2016)) generates template features Ti \u2190CNN(Ti), and a pointnet backbone (e.g., PointNet Qi et al. (2017)) generates shape features Si \u2190PointNet(Si). Transformer decoder. The decoder accepts as input the shape feature library S = {Si}, the texture feature library T = {Ti} and the fused image features \u02c6 F k. As shown in Fig. 2, the transformer decoder is designed to obtain the image conditioned object query. 3 Multi-view Images Image Encoder Texture Library ... Shape Library ... Point Cloud Encoder Texture Encoder Shape Features Texture Features + Object Queries Visual Prompts Consensus Dispersion Fused Image Features Linear Interpolation Object-conditioned Image Feature + Transformer Decoder Global Object Features Scene Consensus Materials Keypoints Rotations Masks ... ... Per-view Object Features Assembly Graph Number of Bricks Shapes Image Features Figure 2: The proposed Neural Assembler architecture. An image encoder outputs the visual embeddings of multi-view images. The shape and texture library are provided as visual prompts for object detection. Then the transformer decoder module is applied to get the library-based object features. Finally, the object-conditioned image features are decoded to the bricks\u2019 masks, keypoints, and rotation angles, while the global object features are decoded to the bricks\u2019 textures, shapes, the number of blocks, and the assembly graph. The elements from the shape feature library S or the texture feature library T and the N learned object queries O are concatenated to define a query O\u2032 = [S, T, O]. Given the fused image features \u02c6 F k and the query O\u2032, the library-based object queries f k i (i = 1, 2, . . . , N, k = 1, 2, . . . , K) are obtained through a couple of decoding layers that employ the structure of FS-DETR Bulat et al. (2023). Then we use an averaging operation to obtain a unified, multi-view feature representation for each object: f global i = PK k=1 f k i , i = 1, 2, . . . , N. This approach effectively integrates diverse perspectives to enhance the overall understanding for the object\u2019s attribute. As shown in Fig. 2, for the Consensus Dispersion module and Linear Interpolation module, to obtain the object-conditioned image features, we adapt the combination of CLIPSeg L\u00fcddecke and Ecker (2022) and group-based semantic agreement Transformer Xu and Mu (2023). The node features f k i serve as conditional prompts. Feature fusion between node features and image features is achieved through linear interpolation. Formally, in each perspective, the object-conditioned image features F k i = LI( \u02c6 F k, f k i ) where i = 1...N, k = 1, 2, ...K, LI is linear interpolation. Next, the scene consensus g is dispersed to multi-view object-conditioned image features through channel-wise multiplication \u02c6 F k i = F k i \u00b7 g. 3.3 Brick Number Prediction For each view k = 1, 2, . . . , K, we average the N object-conditioned image features \u02c6 F k avg = 1 N PN i=1 \u02c6 F k i . Then the scene feature can be obtained by \u02c6 Fscene = 1 K PK k=1 \u02c6 F k avg. Finally a couple of convolution layers are used to predict the number of bricks in the scene. 3.4 Relation Graph Generation Predicting the assembly sequence is equivalent to predicting the connections of bricks which can be described using the relationship graph. If brick A is placed on the top of B, then there is a directed edge from B to A. A graph convolutional network Kipf and Welling (2016) is adopted to predict the existence of each edge in the graph. Given the complete graph G = (V, E) with initial node features p0 i = f global i . Similar to Johnson et al. (2018); Wald et al. (2020), we implemented the GCN using the MLP (multi-layer perception) structure. Each iteration of message passing starts from computing edge features: et+1 i,j \u2190MLP([pt i, pt j]). An average-pooling is performed over all edge 4 features connected to a node, obtaining an updated node feature pt+1 i = 1 |{u|(u, i) \u2208E}| X (u,i)\u2208E et+1 u,i . (1) After gathering the edge features via graph convolutions as {et i,j}T t=1, we use another MLP to predict the probability of the existence of each edge, P(i,j) = MLP(eT i,j) Finally, to determine the assembly sequence during inference, the directed edges are sorted in descending order according to the predicted probability and subsequently incorporated into the directed graph. If a loop is formed after adding an edge, this edge will not be added. The process continues until it reach a state where there exists a vertex that can reach all other vertices in the graph. 3.5 Pose Estimation The N object query features {f global i }N i=1 are used for shape and texture classification. The shape prediction head predicts the shape label and the texture prediction head predicts the texture label. Mask and heatmap prediction. We employ a simple deconvolution layer on the object-conditioned image feature \u02c6 F k i to obtain the heatmap of keypoint and mask of the object i in each perspective k. Rotation prediction The rotation angle is represented as a 2D vector representing the sine and cosine values of it. The rotation predictor accepts conditional image features \u02c6 F k i as input and outputs the sine and cosine value. Confidence score prediction Since bricks may not be visible at all perspectives, here we predict the the confidence score ck i of each brick at each perspective. Specifically, ck i represents the Iou(Intersection Over Union) between the predicted mask and ground truth mask. Figure 3: Illustration of 3D position prediction module. During inference, the pose of each object in 3D space is obtained by merging the poses from each perspective (see Figure 3). In more details, for 3D position prediction, our method involves detecting keypoints of the object parts from the view whose confidence score ci is higher than a threshold \u03b8. Then, utilizing the camera parameters, the rays in 3D space generated by keypoints are used to infer the object\u2019s position in 3D space. Each ray Ri is represented as ri(t) = Oi + t \u00b7 Di where Oi is the origin and Di is the direction. Our objective is to find a point P that minimizes the function: h(Z) = L X i d(Z, Ri), (2) where L is the number of rays and d(Z, Ri) represents the shortest distance from the point P to the ray Ri. Here, the minimization of the objective function h(Z) is approached through the gradient descent method. 3.6 Training and Loss functions We train Neural Assembler with full supervision on the generated dataset where each sample we have the groundtruth shape, texture, keypoint, mask, rotation information of each brick, the number of bricks and the relationship graph of bricks. The entire neural network is trained end-to-end with gradient descent. Our objective function is computed by L = \u03b1 \u00b7 Lcount + \u03b2 \u00b7 Lgraph + Lpose, where Lcount is the L1 Loss between the predicted number of bricks and ground truth countgt. Following Carion et al. (2020), bipartite matching is used to find an optimal permutation {\u03c3i}N i=1 to match the N object queries and ground truth bricks in the scene. The pose loss of bricks includes the loss of shape, texture, keypoint, mask and rotation. Lpose = Lkeypoint + Lmask + \u03b31Lrotation (3) + \u03b32Lshape + \u03b33Ltexture + \u03b34Lconfidence, (4) 5 where Lkeypoint is the focal loss Lin et al. (2017) computed based on the predicted heatmap and ground truth heatmap generated by Kps\u03c3i, Lmask is the focal and dice loss between the predicted mask and ground truth mask M\u03c3i, Lrotation is the L1 Loss between the prediced sine and cosine and the ground truth sine and cosine of Rot\u03c3i, Lshape and Ltexture are the cross entropy loss for shape and texture classification and Lconfidence is L1 Loss between the predicted confidence score and Iou of the predicted mask and ground truth mask. Our model strategically prioritizes the hyperparameters Lkeypoint and Lmask due to their critical impact on object detection, essential for accurate object interaction and identification in complex scenes. In contrast, Lrotation, Lshape, Ltexture and Lconfidence are assigned a reduced weight of 0.1 each, a decision grounded in empirical findings that highlight their relatively minor incremental benefits to overall model efficacy. Lgraph is the loss for relationship graph prediction. Firstly, we define the loss for any subset of the entire edge set. For a subset \u02c6 E of the edge set E of the complete graph, the edge loss of \u02c6 E is defined as L \u02c6 E = P (x,y)\u2208\u02c6 E LCE(P(x,y), \u02c6 E(x,y)). Then the Lgraph is defined as Lgraph = LE + LtopKE LtopKE = 1 KE KE X k=1 LEtopk , (5) where Etopk is the set of the edges with the top k highest predicted probability. Since the entire relationship graph is a directed graph with sparse edges, the hyperparameter KE is defined as countgt + 1. 4 Experiments Dataset preparation. Experiments are conducted on two self-constructed datasets. The CLEVRAssembly Dataset, created via the CLEVR-EngineJohnson et al. (2017), comprises a shape library with 6 brick shapes and 16 textures, a 76.5% visibility probability of each brick per perspective, 7.51 bricks per sample, and an average assembly graph depth of 4.01, with approximately 10K training, 500 validation, and 2000 test samples. The LEGO dataset, synthesized using Pytorch3d, features 12 LEGO brick shapes and 8 textures, an 82.6% visibility probability of each brick per perspective, 7.39 bricks per sample, and an average graph depth of 4.49, also with approximately 10K training, 500 validation, and 2000 test samples. The two datasets, characterized by brick number, occlusion from variable visibility, and complex assembly graph, reflect the complexity of assembly tasks. Baseline models. In addressing this novel task, for which no direct baseline exists, we have established a comparative framework against three distinct baseline methods to demonstrate the efficacy of our approach. First, to assess the validity of our assembly order prediction methodology, we introduce a Long Short-Term Memory (LSTM) Graves and Graves (2012) module as a surrogate baseline to contrast with our Graph Convolutional Network (GCN) based module. This comparison aims to highlight the enhanced predictive capabilities our GCN model brings to complex assembly sequences. Furthermore, for the object pose estimation component, our methodology is rigorously benchmarked against DETR3D Wang et al. (2022b), a prominent baseline in the realm of object detection within autonomous driving scenarios. This comparison is pivotal in underscoring the adaptability and accuracy of our model in 3D pose estimation, a crucial aspect in varied application domains. Lastly, in evaluating our multi-view image feature fusion process, we contrast our approach with a method that does not leverage scene consensus. This comparison is instrumental in showcasing the enhanced scene understanding and feature integration our method offers, thus demonstrating its superiority in synthesizing and utilizing multi-view image data. Implementation details. Our approach is implemented in single-scale version for fair comparison with other works. It incorporates a CLIPRadford et al. (2021) pre-trained ViT-B/16 image encoder, a PointNet-based Qi et al. (2017) point cloud encoder, and a ResNet-18He et al. (2016) for texture encoding. We employ a two-layer residual network for brick number prediction. The shape, material, iou prediction heads are implemented using 3-layer MLP and ReLU activations. Rotation prediction also uses a two-layer residual network, and our GCN architecture employs two message-passing layers. Training is conducted on an RTX 3090 GPU using AdamW, with an initial rate of 5e-4, decaying by 0.8 per epoch, a weight decay of 1e-3, and batch size 8 over 10 epochs for both datasets. 6 Evaluation metrics. In this assembly task, we introduce several metrics to evaluate the performance of our algorithm both at a per-scene and per-step level, providing a holistic measure of our method\u2019s efficacy. Specifically, for the per-scene metrics, our approach necessitates the prediction of the entire assembly sequence based on multi-view images, emphasizing the ability to comprehend and reconstruct the complete scene from various perspectives. In contrast, the per-step metrics operate under the assumption that the assembly order is known a priority. Here, we focus on calculating the error between the predicted information for each individual brick and the corresponding ground truth, independent of the assembly order. This allows for a comprehensive evaluation of the method\u2019s ability in both holistic scene understanding and step-wise brick analysis. Table 1: Comparison of per-scene metrics. Method Complete Rate Per-scene Acc Count Acc Order CR LEGO-Assembly LSTM Graves and Graves (2012) 27.5 5.3 60.3 35.1 DETR3D Wang et al. (2022b) 25.8 2.5 61.5 63.5 Ours (w/o consensus) 43.7 18.4 69.0 64.5 Ours 43.9 22.9 76.3 69.4 CLEVR-Assembly LSTM Graves and Graves (2012) 19.7 8.0 91.5 22.6 DETR3D Wang et al. (2022b) 16.8 4.5 89.5 35.3 Ours (w/o consensus) 28.6 6.6 92.1 45.5 Ours (2 views) 22.0 4.6 88.7 38.6 Ours (3 views) 25.7 9.3 94.0 44.5 Ours 41.5 22.5 95.5 62.1 For per-scene metrics, we evaluate the Complete Rate (completion percentage of the brick model), Order CR (completion rate of the sequence of brick types), Per-scene Acc (accuracy of completely assembling an entire brick model), Count Acc(precision of predicting the number of bricks). For per-step metrics, we evaluate the Pos Acc and Rot Acc (3D position accuracy and rotation accuracy), Shape Acc and Texture Acc (shape accuracy and texture accuracy), Kps Mse (error of the predicted 2D keypoints of the object), mIou (mean Intersection over Union between the predicted mask and the ground truth), the F1-score between predicted relation graph and ground truth relation graph and Per-step Acc(accuracy of correct predictions for each brick\u2019s information). Results on CLEVR-Assembly. Per-scene quantitative results on the CLEVR-Assembly Dataset are summarized in Table 1. Neural Assembler outperforms baseline models in all metrics considered. From Table 2, we can see Neural Assembler locates objects more accurately than DETR3D. 1 2 3 4 5 6 7 8 9 Number of Steps 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Probability (a) CLEVR-Assembly LSTM GCN 1 2 3 4 5 6 7 8 9 Number of Steps 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Probability (b) LEGO-Assembly LSTM GCN Figure 4: The probability distribution of CCA. The metric CCA proposed by Chen et al. (2019) is adopted here for the brick order evaluation. It denotes the probability distribution of the number of brick that a model can consecutively place from scratch. As shown in Fig.4, LSTM perform worse than GCN. This is because time dependence is not crucial for the assembly order prediction. Instead, the assembly problem requires prediction from complex spatial relationships. The adeptness of GCN in capturing spatial relation plays a critical role in understanding the assembly order. Consensus Module As shown in Table 2, extracting the consensus can better align the information of the images from various perspectives. Without scene consensus, it is difficult for the model to integrate information from multi-view images to obtain the overall information of each brick. Number of views Furthermore, we compared the results obtained by accepting different numbers of images as input. As shown in Tables 1 and 2, the result shows that more perspectives as input can improve the performance. This is because each brick may not be seen from some perspectives due to the existence of occlusion. More views mean more information for prediction. Fig. 5 further shows the generated assembly instructions for a brick model in the CLEVR-Assembly Dataset. Perspectives with confidence score greater than 0.66 are selected to infer the brick\u2019s 7 Multi-view Images Brick Type 3D Pos Rotation (-0.72, -0.76, 0.49) 70.37 Last Step This Step Object Detection Figure 5: Result from CLEVR-Assembly Dataset. Multi-view Images Brick Type 3D Pos Rotation (0, 0, 4) 0 Last Step This Step Object Detection Figure 6: Result from LEGO-Assembly Dataset. Table 2: Comparison of baselines on per-step metrics. Method Per-Step Acc Pos Acc Rot Acc Shape Acc Texture Acc mIoU Kps Mse F1 LEGO-Assembly DETR3D Wang et al. (2022b) 41.7 47.2 78.2 87.8 98.3 0.797 Ours (w/o consensus) 71.7 79.0 87.2 89.9 98.3 76.3 1.12 0.829 Ours 73.5 80.4 88.0 91.5 98.3 78.5 0.88 0.820 CLEVR-Assembly DETR3D Wang et al. (2022b) 29.2 32.4 75.6 72.4 67.0 0.734 Ours (w/o consensus) 57.2 67.9 78.9 87.1 88.5 61.2 1.2 0.781 Ours (2 views) 56.1 71.7 73.0 80.0 86.4 65.4 2.5 0.721 Ours (3 views) 61.1 74.6 77.9 85.7 90.7 67.1 1.5 0.772 Ours 69.2 79.1 84.1 91.5 93.8 71.1 0.78 0.840 information. It is evident that Neural Assembler is adept at excluding perspectives where bricks are obscured by predicting confidence scores, thereby identifying optimal perspectives for predicting positional information. Concurrently, it is capable of predicting the structure between bricks to determine the appropriate assembly sequence. Results on LEGO-Assembly. Different from CLEVR-Dataset, LEGO bricks are connected through slots. It is easier to infer the position of the bricks based on the connection constraints between the LEGO bricks, as long as the rough position of the LEGO bricks is predicted. However, there are many challenges in predicting the assembly sequence of LEGO brick models. For instance, the more compact assembly of LEGO bricks results in increased occlusion. The LEGO brick will only have rotations chosen from (0\u25e6, 90\u25e6, 180\u25e6, 270\u25e6). Meanwhile, the position of LEGO bricks is discretized. We adopt the connection-constrained inference subroutine and an inference-by-synthesis subroutine used in Wang et al. (2022a) to predict the position and rotation angle for each view, and then integrated them through voting. The results in Table 1 and Table 2 shows that Neural Assembler can yield more accurate results than other baselines. Fig.6 further shows the generated assembly instructions for a LEGO model. Method Per-scene Acc Complete Rate Novel-Dataset LSTM Graves and Graves (2012) 16.0 27.3 DETR3D Wang et al. (2022b) 7.3 21.8 Ours 34.2 58.5 Real-World Dataset LSTM Graves and Graves (2012) 7.3 21.8 DETR3D Wang et al. (2022b) 2.4 12.8 Ours 22.0 50.5 Table 3: The performance of the fine-tuned model on the novel simulated dataset and real-world dataset. Real-world experiments. To confirm the model\u2019s generalizability, a comprehensive test dataset is constructed, complete with annotations for each brick\u2019s shape, position, and rotation. For each sample, we acquired real brick images using a Realsense camera in the real world and generated corresponding simulated images 8 (1.31, 0.04, 1) -4.95 3D Pos Rotation (-0.28, -1.68, 1) 7.13 (1.42, 1.56, 0.5) 2.51 (-0.34, -0.06, 0.5) -0.11 (1.22, -1.66, 1) 1.42 (-1.66, -1.30, 0.5) -5.43 (0.95, -1.53, 2.5) 66.73 Simulated Assembly Brick Type Real-world Images Figure 7: The result from the real-world brick model. The left box displays 4 images captured using a Realsense camera, while the right delineates the detected type, position, rotation angle of each brick, and the sequential assembly order of the brick model. in the simulation environment employing real-world camera parameters to ensure the consistent coordinate between the simulated and real environments. The dataset encompasses 5 brick types and 7 textures, averaging 6.1 bricks per brick model. To evaluate the Neural Assembler, we collected point clouds and textures from real bricks. This data facilitated the creation of a synthetic dataset, used for fine-tuning the model initially trained on the CLEVR-Assembly dataset. As indicated in Table 3, the Neural Assembler achieves performance in real-world experiments close to the results obtained in simulated environments, demonstrating its robust applicability. Fig. 7 presents the result on the real world dataset. Discussion. As shown in Fig. 8, the occlusion still greatly affects the performance of the model, especially the objects under the brick model will be greatly blocked by the bricks pressing on it. To alleviate this problem, in future work, we plan to enhance model performance with a deeper integration of physical scene understanding. The model is expected to not only interpret the visual aspects but also the underlying physical principles governing the scene. Prediction Ground Truth View 1 View 2 View 3 View 4 Figure 8: Failure case. The model confidently but incorrectly predicts the highlighted block in View 1, while in View 3, despite correct keypoint identification, occlusion results in a less confident. This causes erroneous overall prediction. 5 Conclusion We study the problem of generating robotic assembly instructions from multi-view images and propose Neural Assembler, a model that predicts the assembly instructions of the brick model. The key idea behind our model is to learn the graph structure to predict the relationships among bricks and infer the 3D pose according to multi-view images. Results show that our model outperforms existing methods on the newly collected CLEVR-Assembly and LEGO-Assembly Dataset. 9", "introduction": "The assembly task necessitates predicting a sequence of operations for the placement of various components. Accurate and efficient assembly algorithms play a pivotal role in robotics. These assembly challenges are pervasive in daily life, as in scenarios like constructing LEGO models Chung et al. (2021), assembling furniture Su\u00e1rez-Ruiz et al. (2018), and Minecraft Chen et al. (2019). In previous research, Chen et al. Chen et al. (2019) suggested replicating human building order with spatial awareness to construct Minecraft houses without target information. Wang et al. Wang et al. (2022a) introduced a step-by-step approach for assembling LEGO models based on the assembly manual, while the work in Zhan et al. (2020) focused on predicting the 6-DoF pose of each component based on the object\u2019s class for assembly. Li et al. Li et al. (2020) predicted the poses of parts using a single image. In this study, we define a new task of image-guided assembly. We are provided with a set of multi-view images captured from a 3-D model, assuming it is built with components from a pre-specified library. The goal of the task is to generate a sequence of fine-grained assembly instructions, encompassing all parameters\u2014such as component types, geometric poses of each component, and assembly order\u2014in accordance with physical rules and suitable for execution by a robotic arm. The task serves as a valuable testbed for advancing vision-guided autonomous systems, presenting a range of technical challenges. Firstly, understanding the correspondence between 2D images and 3D objects is crucial. Given that certain components in the 3D model might be entirely obscured from specific viewpoints, we employ multi-view images (e.g., typically 4 in this study) as input. The algorithm must effectively arXiv:2404.16423v1 [cs.CV] 25 Apr 2024 Neural Assembler Object library with Shape / Texture Object Relation Graph 0 1 6 8 7 2 9 3 4 5 0 1 4 2 6 7 3 5 8 9 \u2026 Assembly Instructions Multi-view Images Object Detection and Pose Estimation Camera 1 Camera 2 Camera 3 Camera 4 Figure 1: Schematic illustration of the proposed Neural Assembler. See Section 3 for more details. integrate information from images captured from multiple perspectives. Secondly, estimating critical information for each component is non-trivial. With a 3D library in place, the algorithm needs to segment components across all images and categorize each based on predefined object types in the library, mainly using shape and texture cues. In addition, one also needs estimate the 3-D spatial position and rotation matrix of each component. Thirdly, obtaining typological information for all components is necessary to formulate a physically feasible assembly plan. Importantly, observations of a component in images are often incomplete, primarily due to frequent occlusions. This poses a substantial challenge in fully understanding and interpreting the scene. Such occlusions are particularly challenging when assembling complex, multi-layerd models. For this novel task, we propose an end-to-end neural network, dubbed as Neural Assembler. The computational pipeline of Neural Assembler is illustrated in Figure 1. Taking multi-view images and a 3-D component library as input, Neural Assembler not only identifies each component from images but also determines its 3D pose at each step of assembly. Leveraging images from multiple viewpoints, our method aims to enhance the overall scene understanding and accurately predict the order for placing parts in assembly tasks. We present two datasets for the proposed image-guided assembly task, namely the CLEVR-Assembly dataset and LEGO-Assembly dataset. Each sample in these datasets comprises images of the object captured from various perspectives, along with the pose of each part (2D keypoints, mask, 3D position, and rotation), and the relationship graph of all components. Comprehensive experiments are conducted on both datasets. Due to the absence of prior work addressing this novel setting like Neural Assembler, we establish two robust baselines for comparison. The evaluations unequivocally demonstrate that Neural Assembler outperforms the baselines across all performance metrics." } ], "Yadong Mu": [ { "url": "http://arxiv.org/abs/1608.03658v1", "title": "Deep Hashing: A Joint Approach for Image Signature Learning", "abstract": "Similarity-based image hashing represents crucial technique for visual data\nstorage reduction and expedited image search. Conventional hashing schemes\ntypically feed hand-crafted features into hash functions, which separates the\nprocedures of feature extraction and hash function learning. In this paper, we\npropose a novel algorithm that concurrently performs feature engineering and\nnon-linear supervised hashing function learning. Our technical contributions in\nthis paper are two-folds: 1) deep network optimization is often achieved by\ngradient propagation, which critically requires a smooth objective function.\nThe discrete nature of hash codes makes them not amenable for gradient-based\noptimization. To address this issue, we propose an exponentiated hashing loss\nfunction and its bilinear smooth approximation. Effective gradient calculation\nand propagation are thereby enabled; 2) pre-training is an important trick in\nsupervised deep learning. The impact of pre-training on the hash code quality\nhas never been discussed in current deep hashing literature. We propose a\npre-training scheme inspired by recent advance in deep network based image\nclassification, and experimentally demonstrate its effectiveness. Comprehensive\nquantitative evaluations are conducted on several widely-used image benchmarks.\nOn all benchmarks, our proposed deep hashing algorithm outperforms all\nstate-of-the-art competitors by significant margins. In particular, our\nalgorithm achieves a near-perfect 0.99 in terms of Hamming ranking accuracy\nwith only 12 bits on MNIST, and a new record of 0.74 on the CIFAR10 dataset. In\ncomparison, the best accuracies obtained on CIFAR10 by existing hashing\nalgorithms without or with deep networks are known to be 0.36 and 0.58\nrespectively.", "authors": "Yadong Mu, Zhu Liu", "published": "2016-08-12", "updated": "2016-08-12", "primary_cat": "cs.CV", "cats": [ "cs.CV" ], "main_content": "Throughout this paper we will use bold symbols to denote vectors or matrices, and italic ones for scalars unless otherwise instructed. Suppose a data set X = {x1, . . . , xn} with supervision information is provided as the input. Prior works on supervised hashing have considered various forms of supervision, including triplet of items \u27e8x, x+, x\u2212\u27e9where the pair \u27e8x, x+\u27e9is more alike than the pair \u27e8x, x\u2212\u27e9[21, 23, 16], pairwise similar/dissimilar relations [20] or specifying the label of each sample. Observing that triplet-type supervision incurs tremendous complexity during hashing function learning and semantic-level sample labels can be effortlessly converted into pairwise relations, hereafter the discussion focuses on supervision in pairwise fashion. Let S, D collect all similar / dissimilar pairs respectively. For notational convenience, we further introduce a supervision matrix Y \u2208{\u22121, 0, 1}n\u00d7n as \uf8f1 Yi,j = \uf8f1 \uf8f2 \uf8f3 \uf8f1 \uf8f2 \uf8f3 ate l n 1, (xi, xj) \u2208S \u22121, (xi, xj) \u2208D 0, otherwise. (1) \uf8f3 Figure 1 illustrates our proposed pipeline of learning a deep convolutional network for supervised hashing. The network is comprised of two components: a topmost layer meticulously-customized for the hashing task and other conventional layers. The network takes a p \u00d7 q-sized images with c channels as the inputs. The K neurons on the top layer output either -1 or 1 as the hash code. Formally, each top neuron represents a hashing function hk(x) : Rp\u00d7q\u00d7c \ufffd\u2192{\u22121, 1}, k = 1 . . . K, where x denotes the 3-D raw image. For notational clarity, let us denote the response vector on the second topmost layer as z = \u03c6(x), where \u03c6(\u00b7) implicitly defines the highly non-linear mapping from the raw data to a specified intermediate layer. For the topmost layer, we adopt a simple linear transformation, followed by a signum operation, which is formally presented as hk(x) = sign \ufffd w\u22a4 k z \ufffd = sign \ufffd w\u22a4 k \u03c6(x) \ufffd . (2) Convolution Pooling Similar Pair Dissimilar Pair ... .. . Pre-Training Stage #1 .. . Image Classification .. . .. . ... Parameter Transfer Pre-Training Stage #2 .. . .. . Parameter Transfer Joint Fine-Tuning Stage Hash Loss Image Figure 1. Illustration of our proposed deep network and the pre-training / \ufb01ne-tuning process. Due to space limit, non-linear activation layers are not plotted in the diagram. See text for more explanations. The reminder of this section \ufb01rstly introduces the hashing loss function and the calculation of its smoothed surrogate in Section 2.1. More algorithmic details of our proposed pretraining-\ufb01netuning procedure are delivered in Section 2.2. 2.1. Exponentiated Code Product Optimization The key purpose of supervised hashing is to elevate the image search accuracy. The goal can be intuitively achieved by generating discriminative hash codes, such that similar data pairs can be perfectly distinguished from dissimilar pairs according to the Hamming distances calculated over the hash codes. A number of hashing loss functions have been devised by using above design principal. In particular, Norouzi et al. [22] propose a hinge-like loss function. Critically, hinge loss is known to be non-smooth and thus complicates gradient-based optimization. Two other works [20, 18] adopt smooth L2 loss de\ufb01ned on the inner product between hash codes. It largely remains unclear for designing optimal hashing loss functions in perceptron-like learning. The major complication stems from the discrete nature of hash codes, which prohibits direct gradient computation and propagation as in typical deep networks. As such, prior works have investigated several tricks to mitigate this issue. Examples include optimizing a variational upper bound of the original non-smooth loss [22], or simply computing some heuristicoriented sub-gradients [16]. In this work we advocate an exponential discrete loss function which directly optimizes the hash code product and enjoys a bilinear smoothed approximation. Compared with other alternative hashing losses, here we \ufb01rst show the proposed exponential loss arguably more amenable for mini-batch based iterative update and later exhibit its empirical superiority in the experiments. Let bi = \u27e8h1(xi), . . . , hK(xi)\u27e9\u22a4\u2208{\u22121, 1}K denote K hash bits in vector format for data object xi. We also use the notations bi(k), bi(\\k) to stand for bit k of bi and the hash code with bit k absent respectively. As a widely-known fact in the hashing literature [20], code product admits a one-toone correspondence to Hamming distance and comparably easier to manipulate. A normalized version of code product ranging over [\u22121, 1] is described as bi \u25e6bj = 1 K PK k=1 bi(k)bj(k), (3) and when bit k is absent, the code product using partial hash codes is bi(\\k) \u25e6bj(\\k) = bi \u25e6bj \u22121 K bi(k)bj(k). (4) Exponential Loss: Given the observation that bi \u25e6bj faithfully indicates the pairwise similarity, we propose to minimize an exponentiated objective function Q de\ufb01ned as the accumulation over all data pairs: (\u03b8\u2217, w\u2217 k) = arg min\u03b8,wk Q \u225cP i,j \u2113(xi, xj), (5) where \u03b8 represents the collection of parameters in the deep networks excluding the hashing loss layer. The atomic loss term is \u2113(xi, xj) = e\u2212Yi,j(bi\u25e6bj). (6) This novel loss function enjoys some elegant traits desired by deep hashing compared with those in BRE [14], MLH [22] and KSH [20]. It establishes more direct connection to the hashing function parameters by maximizing the correlation of code product and pairwise labeling. In comparison, BRE and MLH optimize the parameters by aligning Hamming distance with original metric distances or enforcing the Hamming distance larger/smaller than prespeci\ufb01ed thresholds. Both formulations incur complicated optimization procedures, and their optimality conditions are unclear. KSH adopts a least-squares formulation for regressing code product onto the target labels, where a smooth surrogate for gradient computation is proposed. However, the surrogate heavily deviates from the original loss function due to its high non-linearity. Gradient Computation: A prominent advantage of exponential loss is its easy conversion into multiplicative form, which elegantly simpli\ufb01es the derivation of its gradient. For presentation clarity, we hereafter only focus on the calculation conducted over the topmost hashing loss layer. Namely, hk(x) = sign \u0002 w\u22a4 k z \u0003 for bit k, where z = \u03c6(x) are the response values at the second top layer and wk are parameters to be learned for bit k (k = 1, . . . , K). Following the common practice in deep learning, two groups of quantities \u2202Q/\u2202wk, k = 1 \u00b7 \u00b7 \u00b7 K and \u2202Q/\u2202zi (i ranges over the index set of current mini-batch) need to be estimated on the hashing loss layer at each iteration. The former group of quantities are used for updating wk, k = 1 \u00b7 \u00b7 \u00b7 K, and the latter are propagated backwards to the bottom layers. The additive algebra of hash code product in Eqn. (3) inspires us to estimate the gradients in a leave-oneout mode. For atomic loss in Eqn. (6), it is easily veri\ufb01ed \u2113(xi, xj) = e\u2212Yi,j(bi\u25e6bj) = e\u2212Yi,j(bi(\\k)\u25e6bj(\\k)) \u00b7 e\u22121 K Yi,j(bi(k)bj(k)), where only the latter factor is related to wk. Since the product bi(k)bj(k) can only be -1 or 1, we can linearize the latter factor through exhaustively enumerating all possible values, namely e\u22121 K Yi,j(bi(k)bj(k)) = ci,j + c\u2032 i,j \u00b7 \u0010 bi(k)bj(k) \u0011 , (7) where ci,j, c\u2032 i,j are two sample-speci\ufb01c constants, calculated by ci,j = 1 2(e\u22121 K Yi,j + e 1 K Yi,j) and c\u2032 i,j = 1 2(e\u22121 K Yi,j \u2212e 1 K Yi,j). Since the hardness of calculating the gradient of Eqn. (7) lies in the bit product bi(k)bj(k), we replace the signum function using the sigmoid-shaped function \u03c3(x) = 1/(1 + exp(\u2212x)), obtaining bi(k)bj(k) = sign(w\u22a4 k zi) \u00b7 sign(w\u22a4 k zj) = sign(w\u22a4 k ziz\u22a4 j wk) \u2248 2 \u00b7 \u03c3(w\u22a4 k ziz\u22a4 j wk) \u22121. (8) Freezing the partial code product bi(\\k) \u25e6bj(\\k), we de\ufb01ne an approximate atomic loss with only bits k active: \u2113(k)(xi, xj) \u225c e\u2212Yi,j(bi(\\k)\u25e6bj(\\k)) \u00b7 \u0010 ci,j + c\u2032 i,j \u00b7 (2 \u00b7 \u03c3(w\u22a4 k ziz\u22a4 j wk) \u22121) \u0011 , (9) where the \ufb01rst factor e\u2212Yi,j(bi(\\k)\u25e6bj(\\k)) plays a role of reweighting speci\ufb01c data pair, conditioned on the rest K\u22121 Algorithm 1 DeepHash Algorithm 1: Input: Training set X, data labels, and step size \u03b7 > 0; 2: Output: network parameters wk, k = 1 \u00b7 \u00b7 \u00b7 K for the hashing-loss layer, and \u03b8 for other layers; pre-training stage #1: initialize \u03b8 3: Concatenate all layers (excluding top hashing-loss layer) with a softmax layer that de\ufb01nes an image classi\ufb01cation task; 4: Apply AlexNet [13]) style supervised parameter learning algorithm, obtaining \u03b8. 5: Calculate neuron responses on second topmost layer through z = \u03c6(x; \u03b8); pre-training stage #2: initialize wk 6: Replicate all z\u2019s from previous stage; 7: while not converged do 8: Forward computation starting from z; 9: for k = 1 to K do 10: Update wk by minimizing the image classi\ufb01cation error; 11: end for 12: end while simultaneous supervised \ufb01ne-tuning 13: while not converged do 14: Forward computation starting from the raw images; 15: for k = 1 to K do 16: Estimate \u2202Q/\u2202wk \u221dP i,j,k \u2202\u2113(k)(zi, zj)/\u2202wk; 17: Update wk \u2190wk \u2212\u03b7 \u00b7 \u2202Q/\u2202wk; 18: end for 19: Estimate \u2202Q/\u2202zi \u221dP j,k \u2202\u2113(k)(zi, zj)/\u2202zi, \u2200i; 20: Propagate \u2202Q/\u2202zi to bottom layers, updating \u03b8; 21: end while bits. Iterating over all k\u2019s, the original loss function can now be approximated by \u2113(xi, xj) \u22481 K PK k=1 \u2113(k)(xi, xj). (10) Compared with other sigmoid-based approximations in previous hashing algorithms (e.g., KSH [20]), ours only requires |w\u22a4 k ziz\u22a4 j wk| (rather than both |w\u22a4 k zi| and |w\u22a4 k zj|) is suf\ufb01ciently large. This bilinearity-oriented relaxation is more favorable for reducing approximation error, which will be corroborated by the subsequent experiments. Since the objective Q in Eqn. (5) is a composition of atomic losses on data pairs, we only need to instantiate the gradient computation on speci\ufb01c data pair (xi, xj). Applying basic calculus rules and discarding some scaling factors, we \ufb01rst obtain \u2202\u2113(k)(xi, xj) \u2202w\u22a4 k ziz\u22a4 j wk \u221d e\u2212Yi,j(bi(\\k)\u25e6bj(\\k)) \u00b7 c\u2032 i,j \u00b7 \u00001 \u2212\u03c3(w\u22a4 k ziz\u22a4 j wk) \u0001 \u00b7 \u03c3(w\u22a4 k ziz\u22a4 j wk), and further using calculus chain rule brings \u2202\u2113(k)(xi, xj) \u2202wk = \u2202\u2113(k)(xi, xj) \u2202w\u22a4 k ziz\u22a4 j wk \u00b7 \u0000ziz\u22a4 j + zjz\u22a4 i \u0001 wk, \u2202\u2113(k)(xi, xj) \u2202zi = \u2202\u2113(k)(xi, xj) \u2202w\u22a4 k ziz\u22a4 j wk \u00b7 \u0000wkw\u22a4 k zj \u0001 . Importantly, the formulas below obviously hold by the construction of \u2113(k)(xi, xj): \u2202\u2113(k)(xi, xj) \u2202wk\u2032 = \u2202\u2113(k)(xi, xj) \u2202zq = 0, k\u2032 \u0338= k, q \u0338= i, j. (11) The gradient computations on other deep network layers simply follow the regular calculus rules. We thus omit the introduction. 2.2. Two-Stage Supervised Pre-Training Deep hashing algorithms (including ours) mostly strive to optimize pairwise (or even triplet as in [16]) similarity in Hamming space. This raises an intrinsic distinction compared with conventional applications of deep networks (such as image classi\ufb01cation via AlexNet [13]). The total count of data pairs quadratically increases with regard to the training sample number, and in conventional applications the number of atomic losses in the objective only linearly grows. This entails a much larger mini-batch size in order to combat numerical instability caused by undersampling1, which unfortunately often exceeds the maximal memory space on modern CPU/GPUs. We adopt a simple two-stage supervised pre-training approach as an effective network pre-conditioner, initializing the parameter values in the appropriate range for further supervised \ufb01ne-tuning. In the \ufb01rst stage, the network (excluding the hashing loss layer) is concatenated to a regular softmax layer. The network parameters are learned through optimizing the objective of a relevant semantics learning task (e.g., image classi\ufb01cation). After stage one is complete, we extract the neuron outputs of all training samples from the second topmost layer (i.e., the variable z\u2019s in Section 2.1), feed them into another two-layer shallow network as shown in Figure 1 and initialize the hashing parameters wk, k = 1 \u00b7 \u00b7 \u00b7 K. Finally, all layers are jointly optimized in a \ufb01ne-tuning process, minimizing the hashing loss objective Q. The entire procedure is illustrated in Figure 1 and detailed in Algorithm 1. 3. Experiments This section reports the quantitative evaluations between our proposed deep hashing algorithm and other competitors. 1For instance, a training set with 100,000 samples demands a minibatch of 1,000 data for 1% sampling rate in image classi\ufb01cation. In contrast, in deep hashing, capturing 1% pairwise similarity requires a tremendous mini-batch of 10,000 data. Dataset Train/Query Set #Class #Dim Feature MNIST 50,000 / 10,000 10 500 CNN CIFAR10 50,000 / 10,000 10 1,024 CNN Kaggle-Face 315,799 / 7,178 7 2,304 CNN SUN397 87,003 / 21,751 397 9,216 CNN Table 1. Summary of the experimental benchmarks. Feature dimensions correspond to the neuron counts on the second topmost layer. Kaggle Face SUN397 CIFAR10 MNIST Figure 2. Exemplar images from MNIST, CIFAR10, Kaggle-Face and SUN397 datasets. Description of Datasets: We conduct quantitative comparisons over four image benchmarks which represent different visual classi\ufb01cation tasks. They include MNIST2 for handwritten digits recognition, CIFAR103 which is a subset of 80 million Tiny Images dataset4 and consists of images from ten animal or object categories, Kaggle-Face5, which is a Kaggle-hosted facial expression classi\ufb01cation dataset to stimulate the research on facial feature representation learning, and SUN397 [30] which is a large scale scene image dataset of 397 categories. Figure 2 shows exemplar images. For all selected datasets, different classes are completely mutually exclusive such that the similarity/dissimilarity sets as in Eqn (1) can be calculated purely based on label consensus. Table 1 summarizes the critical information of these experimental data, wherein the column of feature dimension refers to the neuron numbers on the second topmost layers (i.e., dimensions of feature vector z). Implementation and Model Speci\ufb01cation: We have implemented a substantially-customized version of the opensource Caffe [12]. The proposed hashing loss layer is patched to the original package and we also largely enrich Caffe\u2019s model speci\ufb01cation grammar. Moreover, To ensure that mini-batches more faithfully represent the real distribution of pairwise af\ufb01nities, we re-shuf\ufb02e the training set at each iteration. This is approximately accomplished by using the trick of random skipping, namely skipping the next 2http://yann.lecun.com/exdb/mnist/ 3http://www.cs.toronto.edu/\u02dckriz/cifar.html 4http://groups.csail.mit.edu/vision/TinyImages/ 5https://www.kaggle.com/c/challenges-in-representation-learningfacial-expression-recognition-challenge few samples6 in the image database after adding one into the mini-batch. We designate the network layers for each dataset by referring to Caffe\u2019s model zoo [12]. Table 5 presents the deep network structure used for Kaggle-Face. The non-linear transform layers (e.g., RELU and local normalization layers) are ignored due to space limit. Speci\ufb01cally, the softmax layer is used only for pre-training the \ufb01rst 7 layers and not included during \ufb01ne-tuning. We provide the network con\ufb01guration information in the format of Caffe\u2019s grammar in the supplemental material. Baselines and Evaluation Protocol: All the evaluations are conducted on a large-scale private cluster, equipped with 12 NVIDIA Tesla K20 GPUs and 8 K40 GPUs. We denote the proposed algorithm as DeepHash. On the chosen benchmarks, DeepHash is compared against classic or stateof-the-art competing hashing schemes, including unsupervised methods such as random projection-based LSH [6], PCAH, SH [28], ITQ [10], and supervised methods like LDAH [5], MLH [22], BRE [14], and KSH [20]. LSH and PCAH are evaluated using our own implementations. For the rest aforementioned baselines, we thank the authors for publicly sharing their code and adopt the parameters as suggested in the original software packages. Moreover, to make the comparisons comprehensive, four previous deep hashing algorithms are also contrasted, denoted as DH-1 and DH\u2217-1 from [29], DH-2 [19], and DH-3 [16]. Since the authors do not share the source code or model speci\ufb01cations, we instead cite their reported accuracies under identical (or similar) experimental settings. Importantly, the performance of a hashing algorithm critically hinges on the semantic discriminatory power of its input features. Previous deep hashing works [29, 16] use traditional hand-crafted features (e.g., GIST and SIFT bagof-words) for all baselines, which is not an optimal setting for fair comparison with deep hashing. To rule out the effect of less discriminative features, we strictly feed all baselines (except for four deep hashing algorithms from [29, 19, 16]) with features extracted from some intermediate layer of the corresponding networks used in deep hashing. Speci\ufb01cally, after the \ufb01rst supervised pre-training stage in Algorithm 1 is completed, we re-arrange the neuron responses on the layer right below the hashing loss layer (e.g., layer #7 in Table 5) into vector formats (namely the variable z\u2019s) and feed them into baselines. All methods share identical training and query sets. After the hashing functions are learned on the training set, all methods produce binary hash codes for the querying data respectively. There exist multiple search strategies using hash codes for image search, such as hash table lookup [1] and sparse coding style criterion [18]. Following recent hash6The skipped samples vary at each operation, parameterized by a random integer uniformly drawn from [0, 200] in our experiments. ing works, we only carry out Hamming ranking once the hashing functions are learned, which refers to the process of ranking the retrieved samples based on their Hamming distances to the query. Under Hamming ranking protocol, we measure each algorithm using both mean-average-precision (mAP) scores and precision-recall curves. Investigation of Hamming Ranking Results: Table 3 and Figure 3 show the mAP scores for our proposed DeepHash algorithms (with supervised pre-training and \ufb01ne-tuning) and all baselines. To clearly depict the evolving accuracies with respect to the search radius, Figure 4 displays the precision-recall curves for all algorithms with 32 hash bits. There are three key observations from these experimental results that we would highlight: 1) On all four datasets, our proposed DeepHash algorithm signi\ufb01cantly perform better than all baselines in terms of mAP. For all non-deep-network based algorithm, KSH achieves the best accuracies on MNIST, CIFAR10 and Kaggle-Face, and ITQ shows top performances on SUN397. Using 48 hash bits, the best mAP scores obtained by KSH or ITQ are 0.9817, 0.5482, 0.4132, and 0.0471 on MNIST / CIFAR10 / Kaggle-Face / SUN397 respectively. In comparison, our proposed DeepHash performs nearly perfect on MNIST (0.9938), and defeat KSH and ITQ by very large margins, scoring 0.7410, 0.5615, and 0.1293 on other three datasets respectively. 2) We also include four deep hashing algorithms by referring to the accuracies reported in the original publications. Recall that the evaluations in [29, 16] feed baseline algorithms with non-CNN features (e.g., GIST). Interestingly, our experiments reveal that, when conventional hashing algorithms take CNN features as the input, the relative performance gain of prior deep hashing algorithms becomes marginal. For example, under 48 hash bits, KSH\u2019s mAP score 0.5482 is comparable with regard to DH-3\u2019s 0.581. We attribute the striking superiority of our proposed deep hashing algorithm to the importance of jointly conducting feature engineering and hash function learning (i.e., the \ufb01ne-tuning process in Algorithm 1). 3) Elevating inter-bit mutual complementarity is overly crucial for the \ufb01nal performance. For those methods that generate hash bits independently (such as LSH) or by enforcing performance-irrelevant inter-bit constraints (such as LDAH), the mAP scores only show slight gains or even drop when increasing hash code length. Among all algorithms, two code-product oriented algorithm, KSH and our proposed DeepHash, show steady improvement by using more hash bits. Moreover, our results also validate some known insights exposed by previous works, such as the advantage of supervised hashing methods over the unsupervised alternatives. Effect of Supervised Pre-Training: We now further highMNIST CIFAR10 Kaggle-Face SUN397 12 bits 24 bits 48 bits 12 bits 24 bits 48 bits 12 bits 24 bits 48 bits 12 bits 24 bits 48 bits LSH [6] 0.3717 0.4933 0.5725 0.1311 0.1619 0.2034 0.1911 0.2011 0.1976 0.0057 0.0060 0.0071 ITQ [10] 0.7578 0.8132 0.8293 0.2711 0.2825 0.2909 0.2435 0.2513 0.2514 0.0268 0.0361 0.0471 PCAH [15] 0.4997 0.4607 0.3641 0.2056 0.1867 0.1695 0.2169 0.2058 0.1991 0.0218 0.0261 0.0315 SH [28] 0.5175 0.5330 0.4898 0.1935 0.1921 0.1750 0.2117 0.2054 0.2015 0.0210 0.0236 0.0273 LDAH [5] 0.5052 0.3685 0.3093 0.2187 0.1794 0.1587 0.2154 0.2032 0.1961 0.0224 0.0262 0.0306 BRE [14] 0.6950 0.7498 0.7785 0.2552 0.2668 0.2864 0.2414 0.2522 0.2587 0.0226 0.0293 0.0372 MLH [22] 0.6731 0.4404 0.4258 0.1737 0.1675 0.1737 0.2000 0.2115 0.2162 0.0070 0.0100 0.0210 KSH [20] 0.9537 0.9713 0.9817 0.3441 0.4617 0.5482 0.2862 0.3668 0.4132 0.0194 0.0261 0.0325 DH-1 [29] 0.957 0.963 0.960 0.439 0.511 0.522 \u2013 \u2013 \u2013 \u2013 \u2013 \u2013 DH\u2217-1 [29] 0.969 0.975 0.975 0.465 0.521 0.532 \u2013 \u2013 \u2013 \u2013 \u2013 \u2013 DH-2 [19] 0.4675 0.5101 0.5250 0.1880 0.2083 0.2251 \u2013 \u2013 \u2013 \u2013 \u2013 \u2013 DH-3 [16] \u2013 \u2013 \u2013 0.552 0.566 0.581 \u2013 \u2013 \u2013 \u2013 \u2013 \u2013 DeepHash 0.9918 0.9931 0.9938 0.6874 0.7289 0.7410 0.5487 0.5552 0.5615 0.0748 0.1054 0.1293 Table 2. Experimental results in terms of mean-average-precision (mAP) under various hash bits. The mAP scores are calculated based on Hamming ranking. Best scores are highlighted in bold. Note that the mAP scores are in the numerical range of [0, 1]. We directly cite the performance reported in [29, 19, 16] since the source codes are not publicly shared. In the table, \u201c\u2013\u201d indicates the corresponding scores are not available. Refer to text for more details. 10 20 30 40 50 60 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Hash Bit Number Mean Average Precision (0\u22121) MNIST 10 20 30 40 50 60 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Hash Bit Number Mean Average Precision (0\u22121) CIFAR10 10 20 30 40 50 60 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 Hash Bit Number Mean Average Precision (0\u22121) Kaggle\u2212Face 10 20 30 40 50 60 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 Hash Bit Number Mean Average Precision (0\u22121) SUN397 LSH ITQ PCAH SH LDAH BRE MLH KSH DeepHash Figure 3. Experimental results in terms of mean-average-precision (mAP) under varying hash code lengths for all algorithms. Best viewing in color mode. light the effectiveness of the two-stage supervised pretraining process. To this end, in Table 3 we show the mAP scores achieved by three different strategies of learning the network parameters. The scheme \u201cDeepHash (random init.)\u201d refers to initializing all parameters with random numbers without any pre-training. A typical supervised gradient back-propagation procedure as in AlexNet [13] is then used. The second scheme \u201cDeepHash (pre-training)\u201d refers to initializing the network using two-stage pre-training in Algorithm 1, without any subsequent \ufb01ne-tuning. It serves as an appropriate baseline for assessing the bene\ufb01t of the \ufb01ne-tuning process as in the third scheme \u201cDeepHash (\ufb01netuning)\u201d. In all cases, the learning rate in gradient descent drops at a constant factor (0.1 in all of our experiments) until the training converges. There are two major observations from the results in Table 3. First, simultaneous tuning all the layers (including the hashing loss layer) often signi\ufb01cantly boosts the performance. As a key evidence, \u201cDeepHash (random init.)\u201d demonstrates prominent superiority on MNIST and CIFAR10 compared with \u201cDeepHash (pre-training)\u201d. The joint parameter tuning of \u201cDeepHash (random init.)\u201d is supposed to compensate the low-quality random parameter initialization. Secondly, positioning the initial solution near a \u201cgood\u201d local optimum is crucial for learning on challenging data. For example, the dataset of SUN397 has as many as 397 unique scene categories. However, due to the limitation of GPU memory, even a K40 GPU with 12GB memory only support a mini-batch of 600 samples at maximum. State differently, each mini-batch only comprises 1.5 samples per category on average, which results in a heavily biased sampling towards the pairwise af\ufb01nities. We attribute the relatively low accuracies of \u201cDeepHash (random init.)\u201d to this issue. In contrast, training deep networks with both superMNIST CIFAR10 Kaggle-Face SUN397 12 bits 24 bits 48 bits 12 bits 24 bits 48 bits 12 bits 24 bits 48 bits 12 bits 24 bits 48 bits DeepHash (random init.) 0.9806 0.9862 0.9873 0.5728 0.6503 0.6585 0.4125 0.4473 0.4620 0.0211 0.0384 0.0360 DeepHash (pre-training) 0.9673 0.9753 0.9796 0.4986 0.5588 0.5966 0.4282 0.4484 0.4589 0.0335 0.0430 0.0592 DeepHash (\ufb01ne-tuning) 0.9918 0.9931 0.9938 0.6874 0.7289 0.7410 0.5487 0.5552 0.5615 0.0748 0.1054 0.1293 Table 3. Comparisons of three strategies of parameter initialization and learning for the proposed DeepHash. See text for more details. 0.2 0.4 0.6 0.8 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Recall Rate Precision MNIST 0.2 0.4 0.6 0.8 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Recall Rate Precision CIFAR10 0.2 0.4 0.6 0.8 1 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 Recall Rate Precision Kaggle\u2212Face 0.2 0.4 0.6 0.8 1 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 Recall Rate Precision SUN397 LSH ITQ PCAH SH LDAH BRE MLH KSH DeepHash Figure 4. Precision-recall curves under 32 hash bits on all image benchmarks. Hand-Crafted Feature CNN Feature 16 bits 32 bits 16 bits 32 bits LSH 0.1215 0.1385 0.1354 0.1752 ITQ 0.1528 0.1604 0.2757 0.2862 BRE 0.1308 0.1362 0.2634 0.2803 MLH 0.1373 0.1334 0.1810 0.1800 KSH 0.2191 0.2081 0.3958 0.5039 DeepHash 0.2166 0.2304 0.5472 0.5674 Hand-Crafted Feature CNN Feature 16 bits 32 bits 16 bits 32 bits LSH 0.0067 0.0072 0.0059 0.0063 ITQ 0.0159 0.0157 0.0309 0.0410 BRE 0.0070 0.0075 0.0252 0.0319 MLH 0.0148 0.0147 0.0083 0.0144 KSH 0.0105 0.0095 0.0216 0.0300 DeepHash 0.0166 0.0189 0.0387 0.0525 Table 4. mAP scores using hand-crafted features and CNN features in hashing-based image search. The method \u201cDeepHash\u201d refers to the variant without \ufb01ne-tuning. The top and bottom tables correspond to the results on CIFAR10 and SUN397 respectively. vised pre-training and \ufb01ne-tuning (i.e., the third scheme in Table 3) exhibit robust performances over all datasets. Comparison with Hand-Crafted Features: To complement a missing comparison in other deep hashing works [29, 19, 16]), we also compare the hashing performance with conventional hand-crafted features and CNN features extracted from our second topmost layers. Following the choices in relevant literature, we extract 800D GIST feature from CIFAR10 images, and 5000-D DenseSIFT Bag-of-Words feature from SUN397 images. The comparisons under 16 and 32 hash bits are found in Table 4, exhibiting huge performance gaps between these two kinds of features. It clearly reveals how the feature quality impacts the \ufb01nal performance of a hashing algorithm, and a fair setting shall be established when comparing conventional and deep hashing algorithms. 4. Concluding Remarks In this paper a novel image hashing technique is presented. We accredit the success of the proposed deep hashing to the following aspects: 1) it jointly does the feature engineering and hash function learning, rather than feeding hand-crafted visual features to hashing algorithms, 2) the proposed exponential loss function excellently \ufb01ts the paradigm of mini-batch based training and the treatment in Eqn. (10) naturally encourages inter-bit complementarity, and 3) to combat the under-sampling issue in the training phase, we introduce the idea of two-stage supervised pretraining and validate its effectiveness by comparisons. Our comprehensive quantitative evaluations consistently demonstrate the power of deep hashing for the data hashing task. The proposed algorithm enjoys both scalability to large training data and millisecond-level testing time for processing a new image. We thus believe that deep hashing is promising for ef\ufb01ciently analyzing visual big data.", "introduction": "Recent years have witnessed spectacular progress on similarity-based hash code learning in a variety of com- puter vision tasks, such as image search [7], object recog- nition [26] and local descriptor compression [5] etc. The hash codes are highly compact (e.g., several bytes for each image) in most cases, which signi\ufb01cantly reduces the over- head of storing visual big data and also expedites similarity- based image search. The theoretic ground of similarity- oriented hashing is rooted from Johnson-Lindenstrause the- orem [8], which elucidates that for arbitrary n samples, some O(log(n))-dimensional subspace exists and can be found in polynomial time complexity. When embedded into this subspace, pairwise af\ufb01nities among these n sam- ples are preserved with tight approximation error bounds. This seminal theoretic discovery sheds light on trading sim- ilarity preservation for high compression of large data set. The classic locality-sensitive hashing (LSH) [11] is a good demonstration for above tradeoff, instantiated in various similarity metrics such as Hamming distance [11], cosine similarity [6], \u2113p distance with p \u2208(0, 2] [9], Jaccard in- dex [4] and Euclidean distance [2]. Images are often accompanied with supervised informa- tion in various forms, such as semantically similar / dissim- ilar data pairs. Supervised hash code learning [21, 27] har- nesses such supervisory information during parameter op- timization and has demonstrated superior image search ac- curacy compared with unsupervised hashing algorithms [1, 28, 10]. Exemplar supervised hashing schemes include LDAHash [5], two-step hashing [18], and kernel-based su- pervised hashing [20] etc. Importantly, two factors are known to be crucial for hashing-based image search accuracy: the discriminative power of the features and the choice of hashing functions. In a typical pipeline of existing hashing methods, these two factors are separately treated. Each image is often repre- sented by a vector of hand-crafted visual features (such as SIFT-based bag-of-words feature or sparse codes). Regard- ing hash functions, a large body of existing works have adopted linear functions owing to the simplicity. More re- cently, researchers have also explored a number of non- linear hashing functions, such as anchor-based kernalized hashing function [20] and decision tree based function [18]. This paper attacks the problem of supervised hashing 1 arXiv:1608.03658v1 [cs.CV] 12 Aug 2016 by concurrently conducting visual feature engineering and hash function learning. Most of existing image features are designated for general computer vision tasks. Intu- itively, by unifying these two sub-tasks in the same formu- lation, one can expect the extracted image features to be more amenable for the hashing purpose. Our work is in- spired by recent prevalence and success of deep learning techniques [17, 3, 13]. Though the unreasonable effective- ness of deep learning has been successfully demonstrated in tasks like image classi\ufb01cation [13] and face analysis [25], deep learning for supervised hashing still remains inade- quately explored in the literature. Salakhutdinov et al. proposed semantic hashing in [24], where stacked Restricted Boltzmann Machines (RBMs) are employed for hash code generation. Nonetheless, the algo- rithm is primarily devised for indexing textual data and its extension to visual data is unclear. Xia et al. [29] adopted a two-step hashing strategy similar to [18]. It \ufb01rstly factorizes the data similarity matrix to obtain the target binary code for each image. In the next stage, the target codes and the image labels are jointly utilized to guide the network parameter op- timization. Since the target codes are not updated once ap- proximately learned in the \ufb01rst stage, the \ufb01nal model is only sub-optimal. Lai et al. [16] developed a convolutional deep network for hashing, comprised of shared sub-networks and a divide-and-encode module. However, the parameters of these two components are still separately learned. After the shared sub-networks are initialized, their parameters (in- cluding all convolutional/pooling layers) are frozen during optimizing the divide-and-encode module. Intrinsically, the method in [16] shall be categorized to two-step hashing, rather than simultaneous feature / hashing learning. Liong et al. [19] presented a binary encoding network built with purely fully-connected layers. The method essentially as- sumes that the visual features (e.g., GIST as used in the experiments therein) have been learned elsewhere and fed into its \ufb01rst layer as the input. As revealed by above literature overview, a deep hashing method which simultaneously learns the features and hash codes remains missing in this research \ufb01eld, which inspires our work. The key contributions of this work include: \u2022 We propose the \ufb01rst deep hashing algorithm of its kind, which performs concurrent feature and hash function learning over a uni\ufb01ed network. \u2022 We investigate the key pitfalls in designing such deep networks. Particularly, there are two major obstacles: the gradient calculation from non-differentiable binary hash codes, and network pre-training in order to even- tually stay at a \u201cgood\u201d local optimum. To address the \ufb01rst issue, we propose an exponentiated hashing loss function and devise its bilinear smooth approx- imation. Effective gradient calculation and propaga- tion are thereby enabled. Moreover, an ef\ufb01cient pre- training scheme is also proposed. We verify its effec- tiveness through comprehensive evaluations on real- world visual data. \u2022 The proposed deep hashing method establishes new performance records on four image benchmarks which are widely used in this research area. For instance, on the CIFAR10 dataset, our method achieves a mean average precision of 0.73 for Hamming ranking based image search, which represents some drastic improve- ment compared with the state-of-the-art methods (0.58 for [16] and 0.36 for [20])." } ] }, "edge_feat": {} } }