{'fraction_non_alphanumeric': 0.030274228183194283, 'fraction_numerical': 0.008096595909458937, 'mean_word_length': 4.92080033347228, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Emergent Hand Morphology and Control from Optimizing Robust Grasps of Diverse Objects

Evolution in nature illustrates that the creatures' biological structure and their sensorimotor skills adapt to the environmental changes for survival. Likewise, the ability to morph and acquire new skills can facilitate an embodied agent to solve tasks of varying complexities. In this work, we introduce a data-driven approach where effective hand designs naturally emerge for the purpose of grasping diverse objects. Jointly optimizing morphology and control imposes computational challenges since it requires constant evaluation of a black-box function that measures the performance of a combination of embodiment and behavior. We develop a novel Bayesian Optimization algorithm that efficiently co-designs the morphology and grasping skills jointly through learned latent-space representations. We design the grasping tasks based on a taxonomy of three human grasp types: power grasp, pinch grasp, and lateral grasp. Through experimentation and comparative study, we demonstrate the effectiveness of our approach in discovering robust and cost-efficient hand morphologies for grasping novel objects.


I. INTRODUCTION
Natural life provides ample evidence of a history of the body, the mind, and the environment all evolving together in cooperation with, and in response to each other [1]. An agent not only learns a policy with immutable morphology, but the morphology itself adapts (slowly) to the distribution of tasks it is exposed to. This shows up in many instances such the co-emergence of adducted thumb along with larger cognitive processing ability in humans. As humans developed rare abilities, such as tool use, throwing, and clubbing [2], both the hand and the ability to use it emerged. Likewise, for a robot to solve a task, say manipulating objects, the interplay between the robot embodiment (hardware) and its control algorithm (software) has an integral role in task success.
Meanwhile, recent advances in learning for robotics have yielded studies on data-driven techniques for robot grasping [3], [4]. Most of them have focused on grasp planning and selection [5], i.e., the control algorithm of grasping, with fixed and often simple parallel-jaw grippers. In contrast, customizing the robot embodiment to a particular task simplifies the computational burden of decision making, a phenomenon referred to as morphological computation in robot control [6]. For the task of grasping with different modes, robot hands with sophisticated mechanical mechanisms, such as passive compliance [7], [8], suction end-effectors [3], [9], and actuated rolling fingertips [10] have been carefully engineered to simplify grasp planning problems and improve performance. Though the data-driven approaches have given rise to more robust grasps on various objects from raw sensory data, their effectiveness has been fundamentally handicapped due to the neglect of the impact of the robot embodiment, where failure modes are often attributed to the limitation of the gripper designs.
In this work, we introduce a data-driven approach to jointly optimizing robot embodiment and behavior for object grasping, with the aim of maximizing grasp performance. While optimizing for a specific task may lead to ill-formed hand designs that specialize at the task but fails on others, we demonstrate that robust and cost-efficient hand designs emerge from grasp optimization on a diverse of objects in three distinct grasp types (power, precision, and lateral), as classified under the taxonomy of human grasps [11]. In Figure 1 we show example hands optimized considering the performance and cost all together by optimizing the design on a diverse set of objects.
The key challenge of this problem resides in the high dimensionality of the optimization problem, involving a coadaptation of the morphology and control parameters. The quality of the parameters can only be faithfully assessed through empirical grasping trials. However, the high costs incurred for conducting grasping trials, even in physics-based simulation, make it prohibitive for conventional black-box optimization techniques [12], [13]. Our intuition is that only a subset of design parameters have a strong impact on the grasping performance. Therefore, we can reduce the problem size by extracting these important factors through learning.  Fig. 2: High-level overview of our optimization framework. We jointly optimize the hand design and the control policy to solve diverse object grasping tasks. With representation learning of the design parameters in a latent space, our Bayesian optimizer (LABO) finds a robust and cost-efficient hand design for various grasp types.
To this end, our method learns latent representations of morphology and control parameters that capture the importance and redundancy of design parameters and thereby facilitate knowledge transfer across similar morphologies. Figure 2 shows a high-level overview of our latent-space optimization framework for hand design.
Summary of Contributions. (1) We develop a novel Bayesian Optimization (BO) method that harnesses a learned latent space of morphology and control parameters for efficient co-adaptation of both. (2) We design an auxiliary loss function which predicts the performance of the morphology and control design along with variational auto-encoder (VAE) to train an encoder that cast raw parameters into a latent feature space where important factors are magnified, which accelerates the optimization process by around 100 iterations.
(3) Extensive experiments show that our approach outperforms standard black-box optimization baselines by around 20% of success rate. We also demonstrate that the emergent design with simple but effective three-fingers hand, trained on a diverse set of 3D shapes, generalizes well to novel objects unseen during training.

II. RELATED WORK
Optimization-Based Morphological Design. The physical embodiment impacts a robot's potentials and limitations of dexterous behaviors. Carefully engineered robot designs have been shown to simplify the downstream computational problems of grasping and manipulation [6]- [10]. While robot designs have drawn direct inspirations from reallife organisms [14]- [16], it remains an immense challenge in dealing with numerous design parameters and practical constraints. Optimization-based methods have been used for automating the co-design of morphology and control. These include gradient-free methods, such as evolutionary algorithms [17]- [19], and gradient-based methods, such as constrained optimization [20], [21], differentiable simulation [22], [23], and policy optimization [24]. However, these methods require either great amount of samples to search in the high-dimensional design space or manual specification of constraints. Our method efficiently co-optimizes the robot morphology and the control policy for grasping.
Knowledge Sharing Across Embodiments. Most of the existing studies for embodied agents focus on generalizing towards environmental variations for a specific agent. Sharing knowledge across agents of different embodiments has gained an increased attention [22], [25]- [28]. Knowledge transfer is typically achieved by either exploiting the compositional structures of embodiment [25], [26], [28] or by learning shared representations of the embodiment [22], [28]. This has enabled effective transfer of robot skills [25], fast adaptation to test-time changes [26], and efficient policy training with new morphologies [27]. Most relevant to ours is learning-in-the-loop optimization [22], which learns a latent space for designing soft robots. However, they have to rely on a fully-differentiable physical simulation for evaluating and updating the embodiment.
Data-Driven Grasping Methods. Recent advances in data-driven grasping methods [3], [4], [29]- [32] have substantially improved the performance of robotic grasping in unstructured environments from raw sensory input. To cope with the data-hungry nature of learning grasping models, especially with deep networks, simulated data has been extensively used as the training sources [33]- [35]. While some works have recently explored grasping and manipulation of dexterous or soft hands [36], [37], the main body of the data-driven grasping literature has centered on simple and fixed end-effectors, often the parallel-jaw grippers, where the grasp prediction problem can be reduced to computing the gripper pose. Closest to our work is UniGrasp [5], which learned a gripper representation in order to transfer grasps across a set of N -fingered robotic hands. However, it only considers a fixed set of grippers rather than optimizing the hand morphologies.
Latent Space Bayesian Optimization. Latent space BO has been explored in chemistry and medical domains, where prior approaches have explored unsupervised learning methods, such as variational auto-encoder (VAE) [38], [39], to perform dimension reduction of the search space for BO. In contrast, we introduce auxiliary supervision of grasping success labels to expedite task-oriented representation learning, and use empirical simulated grasping trials with the latentspace Bayesian optimizer for data-driven hand design.

III. MORPHOLOGY DESIGN WITH LATENT SPACE BAYESIAN OPTIMIZATION
We introduce a data-driven approach to emergent morphological and policy design. Inspired by the morphological evolution of human hands [40] and the task-oriented optimization of robot design [41], we study the problem of jointly optimizing the morphology and control through grasp trials on a diverse set of objects. We examine how joint optimization on these diverse tasks could generate a robust hand morphology and control design that generalizes to unseen scenarios.
The co-optimization of morphology and control imposes significant challenges due to the high-dimensional parameter space, where naïve sampling methods fail to discover effective designs. Our intuition is to exploit the correlation and redundancy in the design parameters -some parameters have a stronger influence in task performance than others, and very often several of them work in synergy to shape the robot behaviors. For this reason, learning latent representations of the design parameters could capture such relationships among the parameters, leading to efficient search in the design space. Therefore, we use a representation learning module that transforms the raw parameter space into a reduced latent space. The learned latent space can be seamlessly integrated with distributed Bayesian optimization algorithms for black-box optimization of grasp quality metrics. We name our proposed approach LAtent-space Bayesian Optimization (LABO), as shown in Figure 3. Next, we first give a formal problem formulation and then introduce our LABO model.

A. Problem Formulation
We define the morphology and control parameters as θ, where θ ∈ R d ≥0 and d is the total dimension of the parameter space. A parameter θ can be further partitioned into two components (θ m , θ a ), where θ m specifies the robot hand model, such as the number of fingers and their lengths, and θ a defines the action command that actuates the hand for grasping, and we use torque control for each joint in the robot. Our goal is to maximize a black-box objective function F by searching for a specific combination of morphology and control parameter θ * such that where F is a score function that evaluates the quality of individual morphology and control designs. In practice, F can be a simulator that instantiates the hand model and performs grasp trials to evaluate empirical performances of the design. Unlike prior work that used differentiable simulation [22], [23], we only assume black-box access to this function, and each call of the function incurs non-trivial computational cost, for instance, running physical simulation of grasping diverse objects. We define the grasping task space as T . Each unique task t ∈ T corresponds to a specific grasp type (power, pinch, or lateral) and a specific object instance. The task t will take in the morphology and policy parameter θ and return the episodic reward obtained: R(θ). The reward function is related with the quality and success rate of the grasping, also related with how robust it is against perturbations. In addition, we want to encourage a cost-effective design of the hand, such that non-functioning hand parts will be suppressed. The cost is task independent, and each hand design corresponds to a cost value C(θ), which corresponds to the morphology complexity. The score function is thus a weighted combination of the rewards and the cost: where w 1 is the weight for the cost, and w 2 is the weight for the episodic rewards on all tasks, and |T | is the number of all tasks.
Reward and Cost Functions. The reward per step is defined per grasping task. Denote finger self-collision as c s  Fig. 3: Schematic diagram of our LABO model. We learn a representation learning module, consisting of the encoder, decoder, and predictor to cast raw morphology and control parameters θ into a latent representation z. Then we perform Bayesian optimization in the latent space. We rely on simulated grasp trials to evaluate the generated hand morphology and control on success metrics p.
(the value is 0 or 1), and the proportion of finger tips that are in contact with the object as r o , the difference between the initial object position and orientation and the current object position and orientation as d pos , d orn , we have the following rewards definition: Define the number of fingers as n f and the number of finger segments as n s,i , for i ∈ {1, 2, · · · , n f }, the cost function is The grasp success is checked by applying external adversarial perturbation forces from random directions at the center of mass of the object. If the object is held tightly in hand without dropping, the grasp is deemed a success; otherwise, a failure. The action space is consisted of the joint torques applied on all finger joints.

B. Representation Learning of Design Parameters
Directly optimizing in the raw parameter space suffers from the curse of dimensionality. To reduce the problem complexity and encourage knowledge transfer among different hand designs, we develop an encoder-decoder architecture to learn a latent space of design parameters, and use auxiliary losses to facilitate the representations to capture task-oriented information.
Denote the encoder network as φ E and decoder network as φ D . The encoder network casts raw parameters θ into a probabilistic lower-dimensional latent space characterized by the mean µ and the standard deviation σ, where we use the reparameterization trick [42] to draw a sample in the latent space z = µ + σ , where ∼ N (0, I). To ensure that the latent space representation is constricted within a bounded region for the ease of the subsequent optimization, we further take a sigmoid function on z: where d d and f ∞ = 1. The decoder reconstructs the original input from the latent representation. This can be written as We further regularize the latent space by restricting the KL divergence between N (µ, σ) and N (0, I). However, the simple auto-encoding objectives are insufficient to inform the representations about the quality of the parameters in terms of task performance. We thus propose to use the grasp success metrics p as an additional supervision for learning the latent representation f , where p is a binary vector of which each dimension corresponds to the grasp success label on each training object. We train another prediction network φ P that predicts the values of p from the representation f with binary cross-entropy losses. The information flow of the auxiliary task can be expressed as To sum up, the overall loss function for training the representation module is, whereθ = φ D (f ),p = φ P (f ), CELoss denotes the binary cross entropy loss, and D KL denotes the KL-divergence of two distributions. Note that, in our optimization, the reward function R(θ) in Equation (2) is a dense reward function more informative than the binary grasp labels p.

C. Latent Space Bayesian Optimization
Bayesian Optimization (BO) [13] is a classical family of methods to solve black-box optimization problems. Here we assume the function to be optimized is an unknown (and often costly) function with only inquiry access. Thus, solving the optimization problem with as few samples as possible is vital. This is particularly important for us, as evaluating a hand on a set of hundreds of tasks takes millions of simulation steps, and fabricating a new hand design in the real world can be even more costly. Therefore, LABO harnesses the learned latent representations to accelerate the Bayesian optimization process.
Pretrain the Representation Learning Module. Before the optimization process starts, we pretrain the latent space by drawing random design parameters and train the encoder and decoder with the VAE objective [42]. The pretraining loss function can be expressed as (N (0, I)||N (µ, σ)).
(10) As we have not tested these designs in simulated trials, we do not have the grasp labels p for supervising the auxiliary losses as in Equation (9). Nonetheless, this procedure yields a good initialization of the latent representations to be further fine-tuned over the course of optimization.

18:
For i = 1 to NBO: 19: f ∼ A(ξ, β) andθ = φD(f ) sample new data point 20: q = (f, F (θ)) evaluate the new data in simulation 21: Fit G(ξ) with Q once every N3 steps Equation (11) 23: For j = 1 to N2: 24: +∇ φ E Lpre(D, φE, φD) 26: update φE with ∇ φ E 27: +∇ φ D Lpre(D, φE, φD) 29: update φD with ∇ φ D 30: update φP with ∇ φ P perform optimization in the latent space. As more effective hand designs are expected to be gradually discovered, we can in turn use these new samples to update the representation module for subsequent optimization steps. For each BO iteration, we perform multiple iterations of representation learning. To speed up the process, rather than using a sequential sampler, we employ the parallelized Bayesian Optimization framework BoTorch [43] for distributed sampling in the latent space. We use a Gaussian Process to model the data distribution, consisting of the morphology and control parameters in the latent space and their corresponding score value F (θ): where N is the number of data points the algorithm has seen so far. Given this dataset, we fit a surrogate distribution model of the data, with parameters ξ: G(q 1:k ; ξ) ∼ Normal(µ(q 1:k ), Σ(q 1:k , q 1:k ); ξ), where Σ(q 1:k , q 1:k ) is the kernel function and we use the Matern kernel where K v is a modified Bessel function with parameter v, and α is another hyperparameter. We use Upper Confidence Bound (UCB) as our acquisition function: where β is a parameter that can be tuned to trade off exploitation and exploration. The UCB algorithm is chosen since it has an additional parameter to tune how much exploration is done, which is important given the dimension of this optimization. We choose the Matern kernel since the changes in the morphology space is non-smooth (changes of numbers of fingers and finger segments), and a traditional Gaussian kernel might fail to model that well. Each time multiple data points are sampled to fit the surrogate model, and new samples are generated by maximizing the acquisition function. We include a complete pseudocode in Algorithm 1.

IV. EXPERIMENTS
To operationalize our idea, we develop a new simulated platform in BulletPhysics [44] that supports procedural generation of parameterized robot hand morphologies and actuating the hand with joint-space controllers. We design our experiments to investigate the following questions: 1) Can the proposed model discover robust hand designs of high success rate and low cost, in comparison to baseline methods? 2) How well does the final hand design generalize to unseen objects in different grasp types? 3) How does the performance change with respect to objects of varying complexity? 4) How is the performance of simpler hand with fewer fingers compared to complex hand with more fingers. To answer these questions, we compare with several baselines and present both quantitative and qualitative results in this section.

A. Experiment Setup
Grasp Types. To facilitate robust morphologies to emerge, we select three types of grasps from the human grasp taxonomy [11], including power, pinch, and lateral grasp. We give definitions of these types of grasping tasks and provide a visualization of these types of grasps in Figure 4a: 1) Power Grasp: The hand exerts forces to wrap the objects, with the surface of these fingers in a close contact with the object and the palm supporting the object. In this task, the palm faces upward and the object starts within the hand and we let the hand close to perform the grasp. 2) Pinch Grasp: The fingers mainly rely on the fingertips to pick up the object, and the palm region will not support the object as well. In this task, we keep the palm facing downward and the hand will pick up an object below it and raise the object to a certain height. 3) Lateral Grasp: The hand uses finger inner surface and tips to support the object. Two set of fingers support opposite sides of an object. In this task, the target objects are mainly shaped like a thin plane. The hands will have the palm facing horizontally and try to grasp a plane object from the side of the object.
Object Datasets. To get a diverse set of objects that demand different grasp strategies, we use the objects from the recently introduced EGAD dataset [45] and select 48 objects of varying grasp difficulties to assist evaluating the performance of the optimized hand on power and pinch  Fig. 4: (a) Three main grasp types of the human grasp taxonomy: power grasp, lateral grasp, and pinch grasp (images are taken from Feix et al. [11]); (b) Example objects we used for evaluating grasps. These objects are either selected from the EGAD dataset [45] or procedurally generated.
grasps. For lateral grasps, we generate thin boxes with different sizes and shapes. Example objects are shown in Figure 4b. The objects range from regular polygons, such as spheres and boxes, to irregular shapes, such as mugs.
Parameterized Design Space. Our original parameter space consists of 185 dimensions, with each dimension ranging between 0 and 1, denoted as θ ∈ R 185 ≥0 , where θ ∞ = 1. The first 122 dimensions correspond to the parameters θ m that determine a specific hand design and the rest 63 dimensions determine the control θ a for the three types of grasping tasks. For simplicity, we use open-loop control and share the same action command for objects in each grasp type. The 122 dimensions include parameters for number of fingers, mass, surface friction, finger shape parameters. The additional dimensions that determines the policy of the robot are related with the torque applied on each of the joints. These parameters are chosen since they affect the structure and the physical characteristics of the hand. The control policy parameters have 63 dimensions, where each grasping task (power, pinch, lateral) get 21 dimensions. These 21 dimensions specified the torque applied on the palm-finger joints, finger-self joints and finger-tip joints for a maximum of 6 fingers and 6 finger segments.
Comparative Study of Hand Complexity. To analyze how grasping performance varies with respect to the hand complexity, we compare the performance of hands with different numbers of fingers. We fix the number of fingers of the hand to be 2 to 6, and perform optimization with LABO.

B. Experiment Results
Baseline Comparisons. We compare LABO with three baselines for black-box optimization: 1) Uniform Sampling (Uniform): we randomly sample morphology and control parameters uniformly from [0,1] in the original raw parameter space and run the experiments for multiple trials and select the best design with the highest overall success rate as the final design. 2) CMA-ES: We use the covariance matrix adaptation evolutionary strategy (CMA-ES) [12] approach and select the design of the highest overall success rate.  the Uniform Sampling and CMA-ES baselines fail to produce robust hand designs, resulting in more than 20% lower success rate than ours and increased costs. Qualitatively speaking, the hand with a higher cost usually have redundant finger segments that are not functioning. The baselines can still find some successful hand designs but fail to remove these non-functioning fingers or segments due to the high dimensionality of the optimization problem. Optimizing in the latent space using LABO effectively find the important factors for design and can find more cost-effective hands. Figure 5a shows the success rate curves of the all methods over the course of optimization. We found that the our model not only achieved the highest final performance, but also outperformed all baselines with less number of evaluations, and to achieve a success rate of 40%, it is around 100 iterations faster than BO with raw parameters. It implies that the learned latent representations facilitate efficient search of promising samples and knowledge sharing across different design parameters, reducing the sample complexity of the Bayesian Optimization process. We further analyze the impact of object geometry on the grasp performance, and show an ablation study of the success rates of our optimal hand on these tasks with respect to the object geometric complexity in Figure 5b. The geometric complexity is measured by the number of vertices in the 3D mesh models of the objects, where object models of less than 5k vertices are classified as low and object models of greater than 7k vertices high, and medium otherwise. The results show that objects of medium complexity are easiest to grasp. We hypothesize that objects of low complexity, such as spheres, might lack flat surface for stable grasps, and those of high complexity, such as flower shapes, might be difficult to reach contact points. Figure 1 shows the qualitative examples of the optimized hands from our model and the grasping behaviors on objects of the   Table II, we show the result of the per-task grasping success rate, overall success rate for the optimized hand by fixing the number of fingers. It shows that simple hand with only 2 fingers can hardly succeed at the grasping tasks. We hypothesize that two-fingers hand is hard to form a tight force-closure and these hands are vulnerable to adversarial perturbations. With three or four fingers, the hand are becoming more robust to external perturbations while still keep the morphology costeffective. Increased number of fingers cause a significantly increased overall success rate variance. This might be that with more fingers to design, there are more choices to make and less easy to make consistent designs.

V. CONCLUSION
In this work, we explore the emergence of embodiment and behavior of a robot hand to fulfill grasping tasks. Our goal is to discover robust and cost-efficient hand morphologies capable of grasping a diverse set of objects. To combat the challenge of searching in the high-dimensional design space, we integrate the learning of latent representations with scalable Bayesian optimization algorithms. It validates our hypothesis that morphology and control can arise as emergent phenomena for the purpose of performing tasks. While our optimization method is general, two notable limitations could hinder its real-world use for designing robot hands. First, the optimization objective does not consider all practical constraints and costs of mechanical design. Our model simplified important factors, such as actuation limits, fabrication costs, and energy efficiency, when evaluating the design samples. Second, using a physical simulator for grasp trials might result in vastly different outcomes than realworld experiments. A careful quantification of the simulation quality is necessary to ensure sim-to-real transfer of the grasp behaviors. For future work, we would like to explore the learning of vision-based closed-loop grasp policies in replacement of the open-loop controller. We also hope to take into account hardware constraints and the reality gap in order to extend our method to real-world robot designs.