Automatic Detection of Repetitive Components in 3D Mechanical Engineering Models

We present an intelligent method to automatically detect repetitive components in 3D mechanical engineering models. In our work, a new Voxel-based Shape Descriptor (VSD) is proposed for effective matching, based on which a similarity function is defined. It uses the voxels intersecting with 3D outline of mechanical components as the feature descriptor. Because each mechanical component may have different poses, the alignment before the matching is needed. For the alignment, we adopt the genetic algorithm to search for optimal solution where the maximum global similarity is the objective. Two components are the same if the maximum global similarity is over a certain threshold. Note that the voxelization of component during feature extraction and the genetic algorithm for searching maximum global similarity are entirely implemented on GPU; the efficiency is improved significantly than with CPU. Experimental results show that our method is more effective and efficient than that existing methods for repetitive components detection.


Introduction
Pattern recognition plays an important role in artificial intelligence. In mechanical engineering, there are always repetitive patterns (components) in designs. The ability to detect such repetitive components automatically from the general input of 3D mechanical models is important for many applications in mechanical engineering. For example, finding out such repetitive components provides a natural way of model reduction [1,2], and it facilitates intelligent editing of mechanical models, such as propagating edits to multiple instances of one mechanical component.
Our paper addresses the problem of detect repetitive components in 3D mechanical models, such as the wheel rims and the tires of a car, shown in Figure 1. This means we are looking for components in the model that can be reused under orthogonal mappings (rotation and mirroring) and translations to assemble the original model more compactly. Detecting such repetitive components in 3D models is a challenging work, since we typically have no prior knowledge of the size, shape, location, or orientation of the individual components. It is essential to normalize the pose of each component into a canonical coordinate system before the similarity measuring between each other. The pose alignment [3][4][5] is a series of geometry-invariant transformations, including translation, rotation, and scaling. After the pose alignment, the feature descriptors [5][6][7][8][9][10][11] are extracted to represent each component. The distance between the feature descriptors indicates the similarity between the two components.
Content-based 3D model retrieval [8,[12][13][14][15] also faces the same problem of pose alignment and similarity measuring. The most well-known approach to compute the pose alignment in 3D model retrieval is the Principal Component Analysis (PCA) method [9,16], which is based on the computation of moments of the components. In most cases, 3D models are represented by geometric meshes and corresponding attributes which are used as input of PCA, such as vertices (CPCA) [1,5], normals (NPCA) [5], and voxels (VPCA) [11]. However, PCA often faces severe inaccuracies regarding the alignment of similar models [10,14]. Similarity measuring can be separated from pose alignment if it is based on PCA method. Feature descriptor used for similarity measuring differs from one method to another. Chen et al. [17] proposed the light field descriptor with good discriminative power but it has long extraction and matching time as a disadvantage, generated by 2D images-projections of the 3D model. Zhang et al. [11] use hybrid descriptors being extracted from these depth images to represent the 3D model. These feature descriptors usually are based on pose alignment which could be separated from similarity measuring. There are also some optimization methods [18,19] which mix the pose alignment and the similarity measuring. They are dedicated to finding an optimal solution of the pose alignment under which the maximum similarity can be achieved. The pose is adjusted through the resulting similarity. These optimization methods outputs better results than PCA-based methods, but have higher time cost. To minimize the time cost, Martinek and Grosso [20] propose a GPU-based similarity measuring function using improved depth images to accelerate optimal pose searching.
The inaccuracy of PCA-based pose alignment affects severely the similarity measuring, while the time efficiency is the problem for optimization methods but it has better accuracy. Our aim is to detecting repetitive components in 3D mechanical engineering models, so that the accuracy is the highest priority with the consideration of time efficiency. In our work, a new Voxel-based Shape Descriptor (VSD) is proposed for the effective matching, based on which a similarity function is defined. It uses the voxels intersecting with 3D outline of mechanical components as the feature descriptor. Because each mechanical component may have different pose, the alignment before the matching is needed. For the alignment, we adopt the Genetic Algorithm (GA) to search the optimal solution where the maximum global similarity is the objective. If the maximum global similarity is over 0.99 allowing the error 0.01, we tell that the two components are same. Note that the voxelization of component during feature extraction and the GA for searching maximum global similarity are entirely implemented on GPU; the efficiency is improved significantly than on CPU. With GPU, the time efficiency of our method is very close to that of nonoptimization methods.

Pose Alignment.
Pose alignment of 3D models is used for preprocessing models before 3D shape matching and is commonly used in 3D model retrieval [8,13,21]. To conduct such alignment, a concatenation of isometrics in 3D space must be selected to determine the canonical coordinate system, and then the related model is aligned under it. The most wellknown approach used to compute the canonical coordinate system of 3D models is the Principal Component Analysis method (PCA) [9], which is based on the computation of moments of 3D models.
After translating the 3D model according to its center of mass to the origin of the world coordinate system, three principal axes computed with PCA are used to determine the orientation. Some PCA-based methods, such as CPCA [9,12] and NPCA [5], mainly focus on the different selection Repetitive components Figure 1: The aim of our work to finding out repetitive mechanical components, for example, tires and wheel rims. of samples; the samples of CPCA are the weighted vertices, whose precision is affected by the distribution of the vertex on the surface. While NPCA uses the area-weighted normal of each triangle as the sample, its precision depends on the distribution of the normal. Since PCA is a statistic method, its precision, regarding to the alignment of similar models with small difference [10,14], is affected by the quality of the samples.
There are also other different solutions. First, symmetrybased approach, Chaouch and Verroust-Blondet [4], is based on two types of symmetries of the models: the reflective symmetry [22] and the local translational symmetry along a direction. Second, optimization-based approach, Kazhdan [18] decomposes the 3D optimization alignment problem into two subproblems of 2D and 1D optimization aligning respectively. Martinek and Grosso [20] introduced a GPUbased optimal 3D model alignment approach. It is similar to Kzahdan's method, but a GPU-based similarity function using improved depth images to accelerate approximately optimal pose alignment searching and high efficiency is obtained. Third, projection area-based approach, Johan et al. [3] proposed an algorithm to find the alignment axes based on minimum projection area by noting that many objects have a minimum projection area when we orthogonally project them in the direction parallel to one of the axes of the ideal canonical coordinate frame.

Feature
Descriptor. Feature descriptor is extremely important for model matching, model classification, model indexing, or model recognition. Because 3D space can be parameterized using spherical functions, Vranic and Saupe [12] proposed the ray-based descriptor which characterizes a 3D model by a spherical extent function capturing the furthest intersection points of the model's surface with rays emanating from the origin. Spherical harmonics and moments representation of the spherical extent function were tested in [6], showing better performance than the former. Chen et al. [17] proposed the light field descriptor with good discriminative power but it has long extraction and matching time as a disadvantage, generated by 2D images-projections of the 3D model. In [23], the generalized radon transform is introduced, where the descriptor is extracted by combining the radial integration transform which captures the radial information of a 3D model and the spherical integration transform which captures its spherical information. Cornea et al. [7] proposes the use of curve skeletons produced by application of the generalized distance field to the volumetric representation of a 3D model. The hybrid descriptor proposed by [5] is a combination of many different methods in order to achieve better performance. Zhang et al. [11] use hybrid descriptors being extracted from these depth images to represent the origin 3D model shape. More other methods were surveyed in [13].

Overview of the Proposed Approach
We proposed a high-efficient and accurate approach to detect the repetitive components. Matching method for 3D geometries is our main problem to be solved. Voxel-based Shape Descriptor (VSD) which represented each component is used for our similarity measuring. Pose alignment is the preprocessing for the similarity measuring. Our approach uses Genetic Algorithm (GA) to achieve the maximum similarity by searching optimal pose of two components. But the time cost is the fatal weakness of using genetic algorithms directly on CPU. GPU has the highly parallel architecture which can process a large amount of data in the same time cycle of CPU, so we transplant our GA from CPU to GPU to reduce the runtime. The projected depth images are usually used as the feature descriptor, and it is also used in Martinek's method [20]. But projecting these depth images must use the GPU rendering pipeline, so it will affect the whole algorithms if it was run in GPU as general purpose. The VSD we proposed could apply the spatial transformation quickly and easily running on GPU.
Our matching method is transformed into the problem of using GA to search optimal pose alignment of two components to achieve maximum similarity, shown in Figure 2. For two components and , do the following.
(1) Simply normalize the and to their norm-size by their Axis Aligned Bounding Box (AABB), so the domain of the translation and scale are limited into a subdomain of 3D space. It minimizes the domain of GA searching, shown in Figure 2(a).
(2) Do the voxelization of and according to their own AABB, so that the voxels intersecting the 3D outline of and can be used for our proposed VSD, shown in Figure 2(b). It stands for the physic shape of component, so it works when detecting rigid repetitive components. And the significant feature is that it can be paralleled on GPU. Since the resolution of voxelization affects the accuracy of similarity measuring, the discussion of it is detailed in Section 6.1.
(3) Initialize the population of poses of for GA method running on GPU, since we align to , shown in Figure 2(c). Better initial population for GA method can reduce the iteration of generation to find the optimal solution. So the PCA computed poses such as CPCA and NPCA, special rotation angles such as 0.5 , , and 2 around axes , , and , and the original pose of are used as initial population, more details in Section 5.2. (4) Search the optimal pose alignment of and to achieve the maximum similarity using GPU-based GA method, and update the evolution poses, shown in Figure 2

Pose Definition.
In order to find the best pose alignment between and , we let reside in its original pose and assign a pose only to . First of all, both of the two components are normalized by their AABB bounding box. The quality of the pose alignment can be measured by means of the similarity function using VSD defined in the next section which we will also be refered to as objective function.
The pose in 3D space can be composed of three parts: rotation, translation, and scale. Translation uses the center position of the 3D component as the reference point, t = { , , }. Scale affects the size of , and it can be represented by a scalar to complete the scaling, s = { }. Notice that both of the two components are normalized, so the searching domain of the translation and scale, respectively, are confined into a subdomain of the 3D space. For the translation, if is moved out of the range of the AABB of , the two components will never overlap. So we can limit the translation vector t by the domain , , ∈ [−1.0, 1.0]. The same to the scale, if is too small or too large, the alignment result will obviously be the solution, so the domain of the scale can be confined to ∈ [0.5, 2.0]. For the rotation, it can be represented by an orthogonal 3 × 3 matrix which is not suitable for carrying out numerical optimization procedure. We parameterize the space of rotations according to Euler angles ∈ [−0.5 , 0.5 ] and , ∈ [− , ], which are similar to the ways used in [18]. It expresses every rotation around the -axis, multiplied on the left and right by rotation about the -axis, r( , , ). 4

Advances in Mechanical Engineering
The goal of our approach is to find the pose alignment which applied to could get the maximum similarity.

Voxel-Based Shape Descriptor.
Voxelization is a widely used technique to adjust the state of optimal solution of similarity using GA and capture the main feature of the 3D model. Many 3D model retrieval approaches [24,25] use it as a basic way to extract the feature descriptor. For our algorithm, we propose a similarity function using VSD for adjusting population of poses, which is highly accurate and efficient due to the fact that we implement the method entirely on the GPU. Initially, the smallest AABB circumscribing the component is constructed, and then both the model and this AABB are normalized into unit cube. Decompose this AABB into × × uniform grid of voxels and set each voxel with the initial state as transparent. Here, we use voxel( , , , ) to describe the state of one voxel, where ( , , ) is the spatial position of this voxel and is the scale size of it. If the initial voxel located at ( , , ) is regarded as an opaque voxel, if there are geometric primitives intersecting this voxel, there is a voxel ( , , , 1) = 1. Otherwise, it is regarded as transparent, voxel( , , , 1) = 0. All the opaque voxels will be gathered to form a union to describe the shape of original 3D component and be used to perform the similarity measuring: where 1 ≤ , , ≤ . We denote the voxels collections of and as the sets and , respectively. We define a voxel( , , ) to belong to the union of and ( ∩ ), only if this voxel that belonged to intersects with at least one voxel in . Then the similarity measuring can be defined as For each potential pose of , the spatial position must be applied to and update the variables of similarity function. Our voxel-based similarity function does not depend on the rendering pipeline and could apply the pose to the voxels union quickly and independently.
where voxel is the new position of the voxel under the pose and is the size of the voxel. Since each voxel is a spatial axis-aligned cube with different size, the similarity computing become the intersection testing between these two voxels collections of the two objects. The whole voxels set of one object could also be divided into small parts to do the intersection testing independently, this makes our approach high parallelized and convenient to implement on GPU.

Optimal Solution of Similarity Using GA
The problem of finding the optimal pose alignment between two 3D components can now be formulated as a global optimization problem, where the task is to determine the pose to achieve the maximum similarity value in the limited 3D space. Blinded searching in the potential solution domain has a very low efficiency, even if the solution domain is limited. One more efficient way to do the heuristic searching is the optimal algorithms, so here we use the genetic algorithm.

Our GA on GPU. Genetic algorithm is a powerful, domain independent search technique inspired by Darwinian
Theory. In general, GA employs selection, mutation, and crossover to generate new search points in a state space. A genetic algorithm starts with a set of individuals that forms a population. Usually, the initial population is generated randomly using a uniform distribution or some heuristic strategy. On every iteration of the algorithm, each individual is evaluated using the fitness function and the termination function is invoked to determine whether the termination criteria have been satisfied. The algorithm ends if acceptable solutions have reached. Otherwise, the individuals in the population are manipulated by applying different evolutionary operators such as mutation and crossover. The consecutive process of replacement forms a new population for the next generation.
Although GA is very effective in solving many practical optimal problems, its execution time can become a limiting factor for some huge problems due to a lot of candidate solutions. Fortunately, the most time-consuming fitness evaluation can be performed independently for each individual in the population using various types of parallelization [26]. In our work, we implement the GPU-based GA to do the optimal aligning pose finding. The structure of our GA mapping onto the GPGPU architecture is shown in Figure 3.
In the structure on GPU shown in Figure 3,

Heuristic Initial Population.
In general, if the generations of the GA are enough, it could find the optimal solution in theory. But in order to reduce the iterations of generation, we could use some heuristic strategies to generate the better 6 Advances in Mechanical Engineering initial population. If the initial population contains more solutions contributing potentially to the optimal solution, the GA searching will terminate more sooner. For the pose of , there are some potential poses which may be the optimal pose: (3) the special rotation poses of component , such as rotations around , , axes with angles, 0.5 , , 2 , and so forth: before the components are put into the database or used, many of their transformations are simply changed with the directions of the axes or special rotation angles. Hence, the poses to inverse these operations are gathered to form the thirdly initial poses. Consider the following: where , , ∈ { /6, /4, /3, /2, . . . , }. These initial poses are combined randomly, inserted into the initial population of GA.

Experimental Results
To evaluate our proposed method, there are three aspects including VSD and its time efficiency, optimal pose alignment using GA method, and the ability to detect repetitive components in mechanical engineering models. The Princeton 3D Shape Benchmark database [27] is used for the first two tests, which is a model database dedicated to evaluate 3D model matching method. Note that one model in PSB stands for one component named in this paper. Models collected freely from the Internet are used for the third test that detect repetitive components. The hardware configuration we use is Intel Core 2 Duo 2.0 GHz, 1 G RAM, and Nvidia Quadro FX3800M.

Our VSD and Time Efficiency.
Since we use the VSD for similarity computation, the resolution of voxelization affects the accuracy of representation of a component. So what resolution we should adopt needs to be determined. And the time efficiency is also an important aspect of our optimization method using GA for optimal pose alignment. Under different resolution of voxelization, the time cost of execution on CPU and GPU, speedup of transplanting from CPU to GPU, and similarity value for each matching between two components are recorded. We choose 100 models randomly from PSB, and the average results are shown in Table 1. From the results, we can see that the average and the worst of similarity value tend to be stable when the resolution of voxelization exceeds 128, so we use resolution 128 × 128 × 128 in the following experiments. One hundred models chosen randomly from PSB were used to compute the similarity between each other under different voxel resolution of the VSD. The low resolution means the 3D outline of component is represented by the coarse voxels. Along with raising the resolution, the VSD describes the 3D outline more and more accurate. So each comparison could reach its maximum similarity value after the resolution of VSD exceeds some value. And the average similarity value and the worst of all comparisons' results tend to be stable. That is the way we determine that resolution value 128 × 128 × 128 is sufficient to the VSD to describe the component accurately. From Table 1, the average time cost of execution based on GPU is fairly small to be an optimization method using GA. And we can also find that it gains a high speed-up of transplanting from CPU to GPU.

Evaluations on Our Optimal Pose Alignment.
A comparison of our pose alignment is restricted to the most commonly used normalization technique, the PCA. Currently, there are two typical implementations of PCA, CPCA, and NPCA. The former uses the vertices of the 3D meshes to conduct the PCA. The latter uses the normal of each face or each vertex of 3D meshes to conduct the PCA. As to solving the PCA, the eigenvalues and eigenvectors of the covariance matrix of the samples, vertices (CPCA), or normals (NPCA) are needed to compute. Leting the eigenvalues be 1 , 2 , 3 , 1 ≥  correspond to the , , and axes, and then, we compute the similarity values for the rest of the six permutations of the axes' orientation. Among them, we take the orientation which has the maximum similarity value as the estimated PCA alignment. The major drawback of PCA is that the axes react sensibly to small changes in the geometry. This happens when the model has many small decoration parts. Furthermore, when the PCA confronts the degenerated cases, like sphere and cylinder, three principal axes are not certain [1,2]. The visual results of some examples using different pose alignment methods are shown in Figure 4. Obviously, our method can get better pose alignment than the PCA methods. And our method can be applied to not only the man-made objects but also the natural objects.
The PCA results are shown in Table 2. It explains the unsatisfactory worst-case results and shows that our approach could provide a better alignment. In order to test our approach more objectively, let the population size and the generation size be large enough so that we can get the optimal solution of pose alignment to achieve maximum similarity in theory. The resolution of the voxelization is 128 × 128 × 128, the size of pose population is 1024, and the max iteration count of generation is 150. We select several typical classes of models from PSB to test our method. The PSB offers some standard class files for the researchers to benchmark their methods. From the standard class file, we choose part of classes for our test and each class contains certain number of models determined by PSB. The average similarity and the worst case on each class of models are used to indicate the accuracy of pose alignment between two models. The best case of similarity means align with itself, so its value is always 1.0. The average similarity indicates the overall effect of the pose alignment method. The worst case significantly indicates if the pose alignment method has a strong ability. The result data is shown in Table 2. From the average similarity of each alignment method, our method is more stable under different cases than the other two methods. The worst case of each method shows that our method can always get an optimal pose alignment. Table 3 shows experimental results to measure our method and the method proposed by Papadakis et al. [5]. The models used in the experiments and the corresponding repetitive components searched out are shown in Figure 5.

Ability to Detect Repetitive Components.
To detect the repetitive components, the similarity measuring is of utmost importance. We propose a method based on GA to adjust the pose, so that the global maximum similarity is obtained. According to the count of the components before and after removing repetition using the two algorithms shown in Table 3, ours is more able to detect repetitive components of a model than Cai's. In other words, our method of similarity measuring is more accurate.

Advances in Mechanical Engineering
. .
(f) Figure 5: The models and the corresponding repetitive components searched out using our method. There are two main reasons that why our method is more accurate than Cai's.
(1) Our optimal pose alignment method has better efficacy than the PCA methods. The optimal pose alignment is obtained only if the two components have the global maximum similarity. It is not influenced by the resolution and the vertex distribution of the two components, while the PCA methods are sensitive to them.
(2) Our proposed feature descriptor VSD can be used to recognize the same components but different resolution, and can exactly represent the 3D outline of each component. While the vertex-to-vertex matching through nearest searching is used by Cai, it has a higher requirement of effect on pose alignment where the PCA methods usually fail when the two components are not exactly the same.
For the method for finding repetitive components, due to the elimination of redundancy, file size of model is obviously reduced and we can use lesser required components to restore the original model such that high compression ratio is obtained. It is worth noting that the compression ratio of a 3D model is determined by the number of repetitive components being found and whether these components contain a large scale of vertices and planes. Another application of this automatic detection of repetitive component may be the intelligent editing, and we believe that the potential applications of it are not confined to these.

Conclusions
In this paper, we introduced an automatic detection method of repetitive components in 3D mechanical engineering models but not limited to it. The global similarity between components is computed through a GA-based optimization method. It adjusts the pose to get an optimal pose to achieve the maximum global similarity. For similarity computation, a new VSD is proposed, using the 3D outline of components as the feature descriptor. To solve the time efficiency problem of the optimization method using GA, we implement on GPU for large data computation. And some heuristic strategies for initializing the population are also used to improve the quality of the results and to speedup the searching. The experimental results show that time efficiency, the effect of pose alignment, and the ability of repetitive components detection are all remarkably superior to existing methods.
In the future, more accurate similarity computation will be researched, such as using the segmentation techniques to flag different parts of the 3D object with different weights. On the other hand, taking the advantage of GPU, more parallelized algorithms will be imported into the domain of mechanical engineering.