Similarity measurement of the geometry variation sequence of intermediate process model

The reuse of machining process, by which the process for a new mechanical part is determined by referencing to the existing and matured processes, is an effective way of improving manufacturing and supporting innovation. To conduct the effective reuse, it is necessary to express and retrieve a specific process. A kernel technique of the expression and the retrieval is to measure the similarity of part’s geometry variation during the machining. To address this problem, a general framework of measuring the similarity between parts is proposed in this work. The geometry variation sequence of intermediate process model was established, and then a method to measure its similarity was invented. Two case studies are rendered and the result reveals that the proposed method is effective and can provide the support for the process retrieval and reuse in industry.


Introduction
The manufacturing of mechanical parts is undergoing a major strategic shift from "automation" to "intelligence", and the latter has become a popular topic. To pursue intelligent manufacturing, it is important to design a manufacturing process that matches the products' design and capacities of a specific manufacturing enterprise. Manufacturing enterprises will accumulate more and more machining instances with the continuation of their production, and these instances will become the valuable data and knowledge resources. Being able to excavate and apply the instance resources reasonably is one of the most effective ways to improve manufacturing and support innovation. If similar machining instances from previous processing cases can be retrieved, the new processing scheme can be generated by revising, supplementing and perfecting the obtained retrieved result, which can increase efficiency and shorten the development cycle. Meanwhile, the similarity measurement of the machining process is also the precondition of mining manufacturing knowledge and rule, and this can provide support and information to create manufacturing a knowledge base, which can lay a good foundation for replacing people with computers and realizing intelligent manufacturing.
Many researches have focused on process retrieval and reuse, and the similarity measurement of machining process is usually the core issue and key technology in this field. Traditionally, research on evaluating the similarity between process instances is based on threedimensional (3-D) model retrieval. Chang et al. [1] built an individual index for each part in the case base, and this index contained geometric shape information of the part. A part with geometrically similar shape can be efficiently searched by using the index from the similar cases. El-Mehalawi et al. [2] used an attributed adjacency graph (AAG) method to represent a 3-D model, and then the AAG is further stored and measured in order to conduct process similarity retrieval and reuse. Cuillière et al. [3] applied a vector method to represent 3-D model to automatically compare vectors. Zhang et al. [4] developed a system for the indexing and retrieval of 3D models. In the system, some features, such as the cord histogram and the 3-D shape spectrum, are utilized to calculate the similarity between 3-D models. The active learning method is used to improve the annotation efficiency. Hou et al. [5] proposed a semi-supervised semantic clustering method based on support vector machines (SVM) to organize the 3D models semantically. A unified search strategy is employed, in which semantic constraints are applied to the retrieval by using the resulting clusters. Ohbuchi et al. [6] explored a method to improve feature distance computation by employing unsupervised learning of the subspace of 3-D shape features from a corpus. Among above researches, the similarity of 3-D models was the main basis for process searching. Unfortunately, the geometry change of part model during the manufacturing processes is ignored. In fact, the geometry change caused by machining operation is closer to the nature of manufacturing. Besides the 3-D model retrieval and machining operation sequence retrieval are also an available method of process retrieval and reuse. Biundo et al. [7] provided a process planning system based on deductive reasoning mechanism. The system consists of the deductive reasoning module and the planning reuse module. Kambhampati [8] focused on the selection of the reusable process from more alternative planning schemes and developed a method to calculate the distance between alternative planning schemes and target object. Liu et al. [9] established a mathematical model of machining process route and then measured the similarity between two process routes by the Manhattan distance. Jiang et al. [10] described a hybrid method combining rough set and case-based reasoning for remanufacturing process planning, where case-based reasoning is employed for similarity calculation to effectively identify the most suitable solution from a case database. In these machining operation retrieval methods, although the similar operation planning scheme could be retrieved from the case base, the geometry change of part model caused by machining operation was not analyzed. Meanwhile, one machining operation might correspond to various forms of geometry change, but their process implementation could be not quite similar. To summarize, existing methods lack consideration of the geometric change of the part model. This can cause decreases in the suitability and effectiveness in reusing the manufacturing instances.
Here in this research, a novel method of similarity measurement is proposed in order to provide better support for process instance retrieval. The proposed methodology contains the following three parts: 1) The geometry change of part model caused by machining operation is extracted and described using the attributed adjacency graph. Based on graphical representation of geometry change, the graph model is transformed into a unique string.
2) After all machining operations in process are represented by strings, the geometry variation sequence is built with all the geometry changes in processing sequence.
3) A method to measure similarity of the geometry variation sequence is developed to evaluate the process similarity of parts.
Because the similarity of process instances is evaluated based on the geometry change of intermediate process models, the machining process retrieved from case base is more consistent with the target object. As a result, process reuse is improved.

General framework of similarity measurement of geometry variation sequence
In the modeling of the geometry variation of intermediate process models, the geometry change between the former and the current procedures needs to be extracted and expressed. Then the whole intermediate process models in a machining example are analyzed identically, and all the geometry changes extracted from intermediate process models constitute the geometry variation sequence in the processing sequence. After obtaining the geometry variation sequence, the process similarity of parts can be obtained by measuring the similarity of geometry variation sequences. The general framework of similarity measurement of geometry variation sequence is given in Fig. 1. The intermediate process models parsed by process instance are the input and the geometry variation sequence is the objective for process similarity measurement.

Acquisition of geometry change
In machining, the part is gradually changed from a prismatic billet to the design model. A machining operation in the process corresponds to a reduction of material, which can be perceived as a geometry change of a 3-D model. Based on the relation between machining operation and geometry change, the geometry change caused by the ith machining operation op i is defined as follows: where GV i represents the geometry change corresponding to op i , g j i represents the material removed by the jth suboperation in op i , IPM i represents the intermediate process model generated by op i , n i is the number of sub-operations in op i . Obviously, IPM 0 represents the initial billet model. IPM can be generated in two ways: a) the IPMs are generated manually by using the model based definition (MBD) technique [11,12]; or b) they can be automatically computed. In the first way, human-machine interaction is involved and its efficiency is low. The automatic generation techniques of intermediate process model described in Refs. [13,14] are adopted in this work.
For one machining operation, the number of its suboperations typically represents the cutting times in this operation, that is, the number of the removed 3-D solids from the former IPM. As a result, combining these removed 3-D solids is equivalent to boolean subtraction between the former and the current IPM. Considering the geometry change is the collection of these removed 3-D solids, it can be regarded as the result of boolean subtraction. But, in reality, the extraction of geometry change can have various ways. For example, identifying and extracting the removed 3-D solids based on the secondary development of the existing 3-D CAD systems. Also we can summarize and define the form of 3-D solids according to the types and characteristics of machining operation and use the corresponding 3-D solid directly when it is required. A common mechanical part, the transmission shaft, is provided as an example shown in Fig. 2. The geometry change caused by the first machining operation, rough turning, is shown in Fig. 3.
As shown in Fig. 3, the rough turning operation changes the geometric construction, which makes the intermediate process model of the transmission shaft turned from IPM 0 into IPM 1 . Because this operation contains ten sub-operations--eight cylindrical lathe cuttings and two face cuttings--the GV 1 has corresponding ten 3-D solids g j 1 (j = 1,2,...,10): eight cylindrical rings and two cylinders. Extracting the ten 3-D solids to form a collection realizes the acquisition of GV 1 .

Graphical representation of geometry change
As seen in Fig. 3, the geometry change can be treated as a collection of 3-D solids, so the representation of geometry change is transformed into the representation of the corresponding 3-D solid. Generally, representing the 3-D solid by using AAG is a widely adopted approach. Thus, the graphical representation of 3-D solid is defined as follows: where V is the collection of vertexes in AAG, and the vertex in AAG represents the surface of the 3-D solid. For each surface of solid model, there is an existing vertex v i corresponding to it. E is the collection of edges in AAG, and the edge in AAG represents the adjacency relation between the surfaces of solid model. If there are two existing adjacent surfaces v i and v j , there is an existing edge e ij ∈E. VAS is the attribute collection of the vertex in AAG, including the connectivity of the surface, the type of the surface and the area of the surface. EA is the type attribute of the edge in AAG. If e ij is a straight line, its corresponding attribute value is 0, if e ij is a plane curve, its corresponding attribute value is 1, space curve corresponds to 2. The graphical representation model of geometry change is constructed the following three steps.
Step 1: Based on Sec. 3.1, the geometry change GV i between IPM i-1 and IPM i is extracted.
Step 2: By traversing all 3-D solids in GV i , the AAG (V, E, VAS, EA) for each 3-D solid is created.
Step 3: When all 3-D solids in GV i have been expressed as their corresponding AAG, GV i can be expressed as a collection of AAG that For the geometry change GV 1 shown in Fig. 3

String representation of geometry change
The mathematical representation of geometry change is the foreshadowing of subsequent similarity calculation, but the graph representation model is not easy to store and analyze. Therefore, a method of transforming the graph representation model into a unique string is provided here. Compared to the graph representation, the string is easy to store, and the efficiency in similarity calculation can be improved dramatically.
The transforming method is as follows: Step 1: To reorder the vertexes in AAG, three sub-steps are designed as follows.
Step 1.1: The vertexes in AAG are ordered by the connective number (or connectivity). If the number of neighbor faces of v i  is greater than the number of neighbor faces of v j , v i should be arranged prior to v j .
Step 1.2: For those vertexes whose connectivity is the same, they should be ordered by the occurrence probability of the type of the surface. Assuming that the connectivity of v i and v j is equal, if the occurrence probability of the type of v i is greater than that of v j , v i should be arranged prior to v j . For 3-D models, the occurrence probability of a plane is assumed greater than that of a cylindrical surface, the cylindrical surface is greater than the cone surface, and the cone surface is greater than the other surface.
Step 1.3: For those vertexes whose connectivity and types are same, they are ordered by their areas. Assuming that the connectivity and types of v i and v j are both equal, if the area of v i is greater than that of v j , v i should be arranged prior to v j .
Based on step 1, the collection of vertexes is reordered, and a sorted collection of vertexes is represented by Step 2: The relation set of sorted vertexes is defined as VA v denote the types of the sorted vertexes ′ i v and ′ j v , respectively. In this work, the plane is represented as the string P l , the cylindrical surface C y , cone surface C i , and the flank of thread T h . ′ Vere v v is obtained to represent the AAG. The AAG of the example shown in Fig. 4 is ordered and its vertexes are plotted in Fig. 5. As seen in Fig. 5, AAG 1 1 and AAG 5 1 are expressed as a unique string C y 1P l P l _P l . AAG 3 1 , AAG 4 1 , AAG 6 1 , AAG 7 1 , AAG 8 1 , AAG 9 1 and AAG 10 1 is expressed as a unique string P l _P l P l 1C y C y _C y . After all 3-D solids in GV 1 are expressed as their corresponding strings, GV 1 is transformed into a string collection that includes two strings: C y 1P l P l _P l and P l _P l P l 1C y C y _C y .

Establishment of geometry variation sequence
Suppose the machining process of a part is OL( Then GV i can be expressed as a collection of AAGs based on Sec. 3.2, by the following equation: where AAG j i is the graphical representation of g j i . On this basis, AAG j i can be transformed into a string collection based on Sec. 3.3, as shown in Eq. (5).
where Str j i is the string representation of AAG j i . After all machining operations in OL have been expressed as their corresponding strings, the geometry variation sequence (GVS) of OL can be constructed as follows:  Fig. 4. Graphical representation of geometry change.
The geometry variation sequence created in this way can fully and precisely describe the geometric evolution situation of all IPMs. However, some machining operations do not cause significant topological change of a 3-D model. For example, finishing and grinding are adopted for the requirement of dimensional precision, and these operations do not lead to an obvious change of the part model. Thus, these geometry changes are eliminated in the construction of GVS.

Similarity computation of 3-D solid
According to Sec. 3.3, 3-D solids can be transformed into unique strings, so the similarity computation of a 3-D solid is translated into the similarity computation of strings. Traditionally, research on similarity computation of string is based on Levenshtein distance, the counting process of this method is as follows: Step 1: The matching relation matrix Step 2: All the elements in Ld are recursively calculated according to the following equation: where d xy represents the editing times. If the x th character in Str 1 and the y th character in Str 2 are equal, then d xy = 0, otherwise d xy = 1.
Step 3: The lower-right element is selected as the Levenshtein distance ld between Str 1 and Str 2 .
The above counting process is the classical similarity measurement method based on Levenshtein distance. However, this method takes only the editing times into consideration, the impact of the common substring of two strings on the similarity is ignored. As a result, the suitability of classical Levenshtein method is low. Suppose there are three strings: P l P l 1, C y 1P l and C y _C y . Although the lengths of the three strings are all 3, P l P l 1 and C y 1P l have substring P l or 1 in common, while P l P l 1 and C y _C y have no substring in common. Based on intuitive experience, the similarity between P l P l 1 and C y 1P l should be greater than that between P l P l 1 and C y _C y . Nevertheless, the similarities obtained using Eqs. (8) and (9)  , which cannot reflect the actual situation. Therefore, the Levenshtein method is improved in this work. The improved Levenshtein distance method is different in an important aspect from the classical method. In addition to the consideration of the editing times, the common substring of two strings is also considered as an important factor for the similarity computation. The improved equation replacing Eqs. (8) and (9) is as follows: where lcs represents the length of the common substring of Str 1 and Str 2 , κ represents the length of common prefix of Str 1 and Str 2 . Based on Eq. (10), the length of common substring of P l P l 1 and C y 1P l is 1, the length of common substring of P l P l 1 and C y _C y is 0. Meanwhile, P l P l 1 and C y 1P l have no prefix in common, and P l P l 1 and C y _C y neither. Then the similarity of strings by using Eq. (10) is obtained as follows: To demonstrate the validity of the proposed method, two 3-D solids shown in Fig. 5 are evaluated. Based on Sec. 3.3, the cylinder is translated into the unique string C y 1P l P l _P l and the ring-shaped solid is translated into the unique string P l _P l P l 1C y C y _C y . Then Ld(7×10) between C y 1P l P l _P l and P l _P l P l 1C y C y _C y is calculated based on Eq. (7), as shown in Fig. 6.
As seen in Fig. 6, Ld between C y 1P l P l _P l and P l _P l P l 1C y C y _C y is 6. Meanwhile, C y 1P l P l _P l and P l _P l P l 1C y C y _C y have no common prefix, then κ = 0. They have substring P l _P l in common, resulting in lcs = 3. The similarity between the cylinder and the ring-shaped solid is calculated by using Eq. (10), and the result is sm str (C y 1P l P l _P l , P l _P l P l 1C y C y _C y ) = 0.3.

Similarity computation of geometry changes
For two geometry changes, suppose their collection repre-sentations are Str is formulated as follows: And the similarity computation of geometry change can be translated into the problem of solving the matching with maximum weighted sum in the bipartite graph, so the classical algorithm of Kuhn-Munkres [15,16] is applied to solve the problem.
For GV and GV′, if the numbers of strings contained by them are equal, the Kuhn-Munkres algorithm can be applied directly to solve the matching with maximum weighted summation, and the maximum weighted summation is the similarity between GV and GV′. When the number of strings in GV is not equal to the number of strings in GV′, say q is greater than p, all combinations with selecting p strings from GV′ are analyzed in order to find the matching with maximum weighted summation between each combination and GV by Kuhn-Munkres algorithm. Finally, the maximum value from all maximum weighted summation is chosen as the similarity between GV and GV′.
The pseudo-code of calculating similarity of geometry change is shown in Fig. 8.

Similarity computation of geometry variation sequences
When calculating the similarity of geometry variation sequences, if the partial difference of two sequences is larger, the global similarity error may be larger. To avoid this disadvantage, a revision of the blast algorithm [17] is constructed. The revised method contains the following two steps: (1) search for the optimum matching sequences of two geometry variation sequences, and (2) calculate the similarity of the optimum matching sequences.
Given two geometry variation sequences: GVS need to be extracted from GVS 1 , and then the geometry changes from GVS 2, which is the most similar to * 1 GVS , are adopted to form the matching sequence 2 ′ GVS . On this basis, the similarity between GVS 1 and GVS 2 can be represented by the similarity between GVS is constructed as follows: Step 1: Initialize i = 1. Similarity computation of geometry changes The most similar geometry change Fig. 9. Acquisition process of the matching sequence.  Step 2: Select the geometry change ′ j GV from GVS 2 that is most similar to the ith geometry change GVS is greater than i and the updated GVS 2 is nonempty, go to Step 2. Otherwise, select the new generated sequence The aforementioned algorithm is shown in Fig. 9. After obtaining the matching sequence, the similarity between GVS 1 and GVS 2 is calculated based on Eq. (12). where Sim(GVS 1 , GVS 2 ) represents the similarity between GVS 1 and GVS 2 , ；sm gv represents the similarity of geometry changes based on Sec. 5.2,

Case study
In this section, two cases are rendered to demonstrate the feasibility and effectiveness of the proposed method for similarity retrieval of the machining process.

Case I
The part shown in Fig. 2, together with two parts shown in Figs. 10 and 11, are taken as examples. Obviously, two shaft parts in Figs. 2 and 10 are similar in shape and the cover part in Fig. 11 is different from them.
Based on Sec. 4, the geometry variation sequences GVS 1 , GVS 2 and GVS 3 that are corresponding to the three parts shown in Figs. 2, 10 and 11, respectively, can be constructed and then * 1 GVS can be extracted from GVS 1 , as shown in Fig. 12.
Based on Sec. 5.3, the geometry changes from GVS 2 , which two four 1 GV ′′= {C y 1P l P l _P l , P l _P l P l 1C y C y _C y , P l _P l P l 1C y C y _C y , P l _P l P l 1C y C y _C y , C y 1P l P l _P l , P l _P l P l 1C y C y _C y } four 2 GV ′′= {P l _P l P l 1C y C y _C y , P l _P l P l 1C y C y _C y , P l _P l P l 1C y C y _C y , P l _P l P l 1C y C y _C y } one 3 GV ′′= {P l 0P l P l _P l P l 0C y C y 2C y C y _C y } rough turning Semi-finish turning finish milling ...  two two 1 GV ′′= {C y 1P l P l _P l , C y 1P l P l _P l , P l _P l P l 1C y C y _C y , P l _P l P l 1C y C y _C y } two 2 GV ′′= {P l _P l P l 1C y C y _C y , P l _P l P l 1C y C y _C y } two 3 GV ′′= rough turning Semi-finish turning turning ...

GVS′
{P l _P l P l 1C y C y _C y , P l _P l P l 1C y C y _C y } is similar to * 1 GVS the most, are chosen to form the matching sequence 2 ′ GVS , and the geometry changes from GVS 3 , which is similar to The similarities between GVS 1 and GVS 2 , and GVS 1 and GVS 3 , are evaluated using Eq. (12). The result is shown in Table 1.
Out of our intuition, the similarity of similar parts should be greater than that of different types of parts. The result in Table 1 is confirmed by intuition. Meanwhile, if two parts in the same type have some different geometric structures and corresponding evolution process, the similarity of the two parts obtained by measuring the geometry variation sequence is less than the similarity obtained by evaluating the machining operations. This makes the similarity measurement more detailed and comprehensive, which can provide more accurate matching results when the similar manufacturing process needs to be retrieved from the matured processes.
To further verify the availability of the proposed method, the traditional method based on the similarity of machining operation route is used to compare and analyze. First, we extract the corresponding machining operation routes of three parts in case I, as shown in Table 2. Then we adopt our previous research achievement [18] to obtain their optimal alignments and to calculate the similarity of machining operation routes. Fig. 15 shows the solution procedure of the optimal alignments by applying dynamic programming algorithm, and Table 3 gives the computed result of the similarity of machining operation   Rough turning → semi-finish turning → drilling → turning (inner circle) → milling → drilling Table 3. The computed result of the similarity of machining operation routes. i The similarity between parts shown in Fig. 2    Rough turning → semi-finish turning → finish turning → rough milling → semi-finish milling → finish milling → grinding {two C y 1P l P l _P l , eight P l _P l P l 1C y C y _C y } → {four P l _P l P l 1C y C y _C y , two P l _P l P l 1C y C y _T h } → {two P l 0P l P l _P l P l 0C y C y 2C y C y _C y , one P l 0P l P l _P l P l 0P l P l _P l P l 1T h } P 2 Stepped shaft Rough turning → semi-finish turning → finish turning → milling {two C y 1P l P l _P l , four P l _P l P l 1C y C y _C y } → {one P l 0P l P l _P l P l 0C y C y 2C y C y _C y } P 3 Cylinder liner Casting → rough turning → semi-finish turning → boring {two C y 1P l P l _P l , two P l _P l P l 1C y C y _C y } → {one C y 1P l P l _P l } P 4 Guide sleeve Rough turning → semi-finish turning → drilling → boring → grinding {two C y 1P l P l _P l , two P l _P l P l 1C y C y _C y } → {two C y 1P l P l _P l } → {two P l _P l P l 1C y C y _C y } P 5 Bearing cover Rough turning → semi-finish turning → drilling → turning (inner circle) → milling → drilling {two C y 1P l P l _P l , two P l _P l P l 1C y C y _C y } → {two C y 1P l P l _P} → {two P l _P l P l 1C y C y _C y } → {two P l 0C y C y 1P l P l _P l } → {four C y 1P l P l _P l } P 6 Flange Casting → rough turning → semi-finish turning → finish turning → drilling → rough turning(inner circle) → finish turning(inner circle) → drilling {two C y 1P l P l _P l , one P l _P l P l 1C y C y _C y } → {one C y 1P l P l _P} → {one P l _P l P l 1C y C y _C y } → {six C y 1P l P l _P l } P 7 Valve cover Casting → rough turning → semi-finish turning → finish turning → boring(center hole) → drilling {two C y 1P l P l _P l , three P l _P l P l 1C y C y _C y } → {one C y 1P l P l _P l } → {four C y 1P l P l _P l } P 8 Close lid Casting → rough turning → semi-finish turning → milling → drilling(reaming) {one P l _P l P l 1C y C y _C y } → {one P l _P l P l 1C y C y _C y } → {eight C y 1P l P l _P l } P 9 Triangular bearing box Casting → milling → milling → rough boring → finish boring → milling → drilling → milling → drilling {two P l _P l P l 0P l P l _P l P l 0P l P l _P l } → {two P l _P l P l 0P l P l _P l P l 0P l P l _P l } → {one P l _P l P l 1C y C y _C y } → {two P l _P l P l 1C y C y _C y } → {six C y 1P l P l _P l } → {two P l _P l P l 0P l P l _P l P l 0P l P l _P l } → {two C y 1P l P l _P l } P 10 Valve body Casting → milling → milling → milling → rough boring → finish boring → rough boring → drilling(tapping) → drilling(tapping) {two P l _P l P l 1C y C y _C y } → {one P l _P l P l 1C y C y _C y } → {one P l _P l P l 1C y C y _C y } → {six P l _P l P l 1C y C y _C y } → {one P l _P l P l 1C y C y _C y } → {one C y 1P l P l _P l } → {eight C y 1P l P l _P l } routes.
Compared Table 1 with Table 3, although the similar parts can have similar machining operation sequences, the variation of geometric structure during the machining process can be reflected easily by using the proposed method in this paper. This ensure that the retrieved similar instance can be closer to reuse requirements of technicists, and avoid pushing excessive and unsatisfactory instances. For the parts belonging to different types, their manufacturing process have obvious differences, so the similarity calculation results obained by using different methods are fairly close, which also illustrates the effectiveness of the proposed method.

Case II
In the second case, the process base is obtained from a manufacturing enterprise as an example. Ten processes in the base are selected at random. The geometry variation sequences of the parts are constructed based on Secs. 3 and 4, as shown in Table 4.
Based on Sec. 5, the similarities of geometry variation between two machining instances are calculated and shown in Table 5. In Table 5, the similarity of geometry variation between P i (0 ≤ i ≤ 10) and P j (0 ≤ j ≤ 10) is listed at the i th row and the j th column, and the values enclosed in red wireframes represent the similarities of geometry variation between two parts in the same type. As seen in Table 5, for the two parts belonging to the same type, their similarity of geometry variation caused by machining processes may be high. Meanwhile, for the parts belonging to different types, their similarity of geometry variation could be low.

Conclusions
To address the process reuse, a similarity measurement method for geometry variation sequence is proposed in this work. The similarity between processes was evaluated based on their geometry variation instead of the part's geometry itself, so as to improve the reuse. The geometric construct of the part has also been taken into the consideration, which provides a new idea for process retrieval. The case studies show that the proposed method has a certain application potential in machining process planning. Meanwhile, as a way of mining common knowledge and data among different manufacturing.