Finding the Key Structure of Mechanical Parts with Formal Concept Analysis

: Aiming at the problem that the assembly body model is difﬁcult to classify and retrieve (large information redundancy and poor data consistency), an assembly body retrieval method oriented to key structures was presented. In this paper, a decision formal context is transformed from the 3D structure model. The 3D assembly structure model of parts is deﬁned by the adjacency graph of function surface and qualitative geometric constraint graph. The assembly structure is coded by the linear symbol representation of compounds in chemical database. An importance or cohesion as the weight to a decision-making objective on the context is deﬁned by a rough set method. A weighted concept lattice is introduced on it. An important formal concept means a key structure, since the concept represents the relations between parts’ function surfaces. It can greatly improve the query efﬁciency.


Introduction and Problem Statement
Currently, engineering drawing retrieval is mainly text-based, which makes full use of spatial relationships and properties of components between these geometric elements. Berchtold and Kriegel [1] developed the S3 system, which is a text-based retrieval system and supports local similarity search. The S3 system mainly relies on matching the contour of the graphics, while the spatial relationships are ignored. Therefore, this search method is not suitable for complex graphics. Muller and Rigoll [2] put forward a new stochastic model retrieval method, using a pseudo 2D hidden Markov model (P2DHMM). This method only supports a simple graphic search, but it is not suitable for complex graphics. Park and Um [3] proposed a complex 2D mechanical parts drawing method based on the shape of the key features. It is difficult to handle a large number of engineering drawings because of the minimum geometric components and non-efficient matching algorithm.
The similarity computing is a key issue in the engineering drawings retrieval. It is closely related to feature extraction [4]. Wang and Jiang [5] studied a retrieval method based on graph matching. The method extracted features of the structures and the shapes. Then, the pattern matching problem was transformed into a graph and sub-graph isomorphism problem. Sub-graph isomorphism has been proven to be an NP-complete problem. The time complexity of the algorithm is relatively high, and the performance of the existing solution is unstable.
Zehtaban and Roller [6] developed a shape-based symbol code Opitz and a comprehensive similarity comparison toolbox by two different techniques for data retrieval. Opitz code structure is selected as the grouping technique to classify and regulate geometric information of the CAD model.
One of the main challenges in this work is to accurately extract the GT code according to the request. Another challenge is the quality of the code generated by Opitz.
Xu and Dong [7] proposed a parts retrieval method based on similar structures. The parts geometry drawings are marked as functional surfaces. If they have a common edge, a common point or points on the edge, the functions surfaces are topologically connected. A 2D parts structure model is produced by the functional relations. They defined the "and" operation restricting common vertexes and common edges to construct a 3D parts structural model. The codes of parts structure drawings are generated by linear symbols draw representation of the chemical compound database. Through expressing the request using Boolean model of parts drawing sub-structure, matching the sub-structure code and branch structure codes, it is used to retrieve parts drawings. By comparing the overall structure codes of parts drawings with one of the 3D part model, the parts drawings model retrieval is accomplished. In this way, it is required that the user is familiar with the structures of the abstract codes. It is time-consuming and inefficient when dealing with complex and large quantities of engineering drawings.
The concept lattice theory (Formal Concept Analysis FCA) was first proposed by Wille in 1982 as a mathematical theory. Its core is the formal concepts based on the binary relations between objects and attributes in the formal context [8]. The object set, the attribute set, and binary relations between them are the three elements in the formal context. If the attribute set contains the condition attributes and decision attributes, this formal context is a decision formal context [9]. Concept lattice is becoming a powerful tool to study various decision-making problems since the decision formal context was presented by Zhang in 2005 [10]. Subsequently, various extended decision formal contexts are constantly proposed, such as: fuzzy decision formal context, the real value decision formal context, incomplete decision formal context, etc. [11][12][13][14][15]. The main purpose to propose the decision formal context is for decision analysis for relational data. Along this idea, Shao [16] and Qu et al. [15] studied the rules extraction problem of decision formal context using concept lattice. Wu et al. [11] proposed granulation rule mining methods of the decision formal context by means of granulation calculation. Recently, Li et al. [17] discussed theoretical framework construction problems to extract rules from the decision formal context, and a corresponding method is developed by using the discernibility matrix and Boolean function. The knowledge hidden in a decision formal context can compactly be unravelled in the form of implication rules.
It should be pointed out that, in the recent research on the concept lattice, it is usually assumed that all the intents are equally important, and all the nodes would be generated from the formal context. The consequence is that a large number of nodes would be generated, and hence more storage space occupation and longer building time consumption. (With the sharp increasing of the data to deal with, the amount of concept lattice node constructed from original formal context is enormous, accordingly, requiring the larger storage space and time. At the same time, users are not interested in all the intents composed of all the attribute sets. Furthermore, it takes more time to extract useful knowledge from them). Consequently, the user would take more time to extract knowledge in which he is interested from the overall concept lattice. Therefore, it becomes advantageous to introduce some weights into the intent to capture its importance. Since the value of the weight assigned to the intent quantifies its importance, the user does not need to investigate all the nodes but only those nodes he is interested in. As a result, the knowledge extraction can be accelerated, the storage space can be saved, and the time to get results can be shortened. This is the underlying idea that motivates researchers to propose a weighted concept lattice [10]. This construct inherits a structure of general concept lattices while facilitates extraction of interesting knowledge. In many situations, it is apparent that the attributes are quite different from each other when it comes to their relevance and usefulness in knowledge acquisition. For example, we note that people are more interested in recent transaction data than the past ones. In [18], Zhang et al. introduced a virtual node into the frequent weighted concept lattice (FWCL) to ensure that FWCL is retained to be complete, which is to preserve the existence of each nodes' infima and suprema in the FWCL. Some theories were provided for further applications of the weighted concept lattice [19,20].
There is a lot of research on concept lattice in graph data mining [21,22], especially using stable emerging molecular patterns and mining convex polygon patterns [23,24]. Exponential explosion makes it difficult to consider the whole concept lattice arising from data; one needs to select the most useful and interesting concepts. In [25], interestingness measures of concepts are considered and compared with respect to various aspects, such as efficiency of computation and applicability to noisy data and performing ranking correlation. A cohesion function is based on the pairwise similarity of objects from an extent.
In Ref. [7], the geometric graph of part engineering drawing is labeled as functional surface. The functional surface which is attached topologically is determined according to the fact that, whether they are in the common edge, or whether they have concurrent or point in the edge, and further the position relationship between functional surfaces is decided. The model retrieval is realized via 3D structure code matching of part engineering drawing and part 3D model.
The present work aims to give a comprehensive study on the application of weighted concept lattice in finding the key structure of mechanical parts. In Section 2, the 3D structural model of the parts and its coding were derived. This derivation naturally leads to a new set of the functional surfaces. In Section 3, a direct mapping method from parts drawing structure model to FCA was considered. Identifying important formal concepts was made in this section. In Section 4, an algorithm to find the key structure was proposed, and some examples were applied to demonstrate the new method. In Section 5, some conclusions were given.

Structure Model of Parts
The structural models of part drawings shown in [7] are based on functional surfaces. Basic types of functional surface are planar, cylindrical, conical surface, spherical, and holes. Capital letters P, C, H, and S represent the planar, cylindrical surfaces, holes and slots, respectively. Lowercase w, k, h, and r denote the threaded connection, flat key connection, semi-rotary surface, and ring structures.    The positional relation between the function surfaces can be represented by vector position relations, including orientation and field relations (see [7]).Topological relations between functional surfaces are represented by concave-convex connection edges: concave side with "0" mark, and the convex with "1". If the two connected surfaces are revolution ones, the topology can be divided into inner and outer surfaces and use the "!" mark. It can be judged whether the functional surfaces of the part drawings are topologically connected according to three criteria: they have a common edge, a common point, or points in the side. Its basic uses include orientation and domain. The orientation is defined by vectors of geometric space: parallel ( ), coaxial ( ), vertical (⊥), and skew ( ). The domain refers to the relations between the areas that functional surfaces occupy. Table 1 shows the domain relations [7]. The length of the area occupied by the surface of the plane function is 0; therefore, face encounter, overlap, and concurrent are merged into encounters between plane and revolution surfaces. The binary relations between two vertical planes are not defined and marked with the "!" mark. Sign "! " represents two functional surfaces being topologically connected, and the symbol " " indicates that the topology is not connected. The symbol "?" indicates that the positional relations between the surface features cannot be determined by a single view. The field relations are shown as Table 1. Table 1. Binary field relations between the functional surfaces.

Coaxial Parallel Vertical
Meaning

Structure Model of Part Drawings Mapping to Concept Lattice
As described above, the main component of the part drawings 3D structural model is the functional surface and their positions. If they are considered as the objects and the attributes, we can build the formal context of the part drawings structure, and then build the concept lattice.
Because the position is for the functional surface of the part, we use "Source" to represent the functional surface of the part, and "Target" to represent the position. Let Source, Relation, and Target be three components of PG (Parts Graph) with g.source, g.relation and g.target, respectively, the I constitutes (Object, Attribute) sets of the formal context. A formal context consists of a set of objects (g.source), a set of attributes (g.relation and g.target), and a binary relation I that indicates the attributes possessed by each object. There is g ∈ G =⇒ (g.target, g.source∼ g.relation) ∈ I. Mapping it makes PG's relations target become a transfer of another relation's source concept CG (Concept Graph). This transfer generates implicit map reasoning.
The algorithm works in the following sequence: First, MovingTarget and FixedTarget for each triples are initialized. Second, it calls FormBinaries through all triples iteration. Third, a corresponding formal concept pair (Object, Attribute) is formed. Each time, MovingTarget matches one target concept of the triples. Binary conversion is formed by a recursive call FormBinaries, setting MovingTarget for the current source concept, leaving FixedTarget unchanged.
Using the Algorithm 1, we can get the formal context of part model as shown in Table 2.

Weighted Concept Lattice Based on Decision Formal Context
Due to space limitations, we assume that readers are familiar with the basic concepts of formal concept analysis [8].
A formal context can be depicted visually in a tabular form with crosses (or 1) representing the pairs (g, m) ∈ I. For example, consider the cross table in Table 3.
The cross table in Table 3 depicts a formal context in which object 1 has attributes a and c, object 2 has attribute a, etc.
Let (U, A, I) be a formal context. A set pair (X, B) of (U, A, I),   The formal context is the basis of formal concept analysis. Its main objective is to form concepts and concept lattice: The concept is unity of the extension and intension. In essence, the concept lattice describes the link between objects and attributes, indicating generalization relations between concepts, The corresponding Hasse diagram is achieved for data visualization. The traditional concept lattice is based on a simple binary context. In practical application, the data are large and complex. Thus, we must extend it. Belohlávek et al. studied the concept lattice in fuzzy and uncertain data [26,27]. The critical part of concept lattice (called core concepts or important concepts) is an important part of the parts structure. As a user is usually interested in some certain attribute characteristics, according to his/her preference and requirement, the researchers establish a new concept lattice structure with the weight w(0 ≤ w ≤ 1) to identify importance of intentions: weighted concept lattice [10]. Table 4 is a formal context. Its object set U, attribute set A, and I describe the value set of attribute in A that U has. Table 5 is the weight table of a single attribute intent. Table 4. A formal context. Let K w = (U, A, I, W) be a formal context and a set of attributes is denoted by A = {a 1 , a 2 , · · · , a n }. W = {w 1 , w 2 , · · · , w n } are the weights of attributes, where w i ∈ W(0 ≤ w i ≤ 1) denotes the importance of the attribute a i . (X, B, w) is known as a weighted formal concept on (U, A, I, W) if (X, B) is a formal concept and w = W(B), w is the weight of the attribute set B, 0 ≤ w i ≤ 1. A and B are the extent, the intent of weighted formal concepts, respectively. Its super-concept and sub-concept are the same as the general concept lattice.

Example 1.
Given a value θ ∈ V, we can obtain a part of the formal concept B(U, A, I), B θ (U, A, I) = {(X, B) ∈ B(U, A, I, W)|w ≥ θ}. B θ (U, A, I)can be seen as a set of important formal concepts.   (1)The lower approximation of X with respect to B is the set of all objects, which can be for certain classified as X with respect to B and it is denoted by R B (X). That is, R B (X) = {x ∈ U|[x] B ⊆ X}.
(2)The upper approximation of X with respect to B is the set of all objects, which can be possibly classified as X with respect to B and it is denoted by R B (X). That is, R B (X) = {x ∈ U|[x] B ∩ X = ∅}.
The concept lattice of Table 3.
Computing the importance of concepts: In the decision formal context, cohesion of the equivalence classes determined by the condition attributes and decision attributes indicates that the condition attributes impact decision-making, namely the importance of attributes. Next, we will compare attributes of the concept to study the cohesion of the concept to objects (functional surfaces).
The similarity of attributes b 1 and b 2 can naturally be assessed by the similarity of their corresponding extents, i.e., similarity of {b1} ↓ and {b2} ↓ . That is, the similarity measure between attributes b 1 and b 2 is given by In our experiments, we use the following functions for sim on the decision formal context (U, A, I, D, J): is the lower approximation of in the decision attribute D. In particular, . It produces a computing formula for the general formal context. Note that sim is the number of objects that belong to both B 1 , B 2 and D s classes divided by the number of all attributes that belong to B 1 or B 2 . Definition 8. Cohesion coh(X, B) for a formal concept (X, B) ∈ B(U, A, I) on the decision formal context (U, A, I, D, J) is defined as the following: Theorem 3. The coh(X, B) satisfies: (3) For a formal concept (X, B), if X = ∅ ,X ⊆ D i and k, l ∈ {1, 2, · · · , |B|}, ({b k } ↓ ∩ {b l } ↓ ) ⊆ A, then coh(X, B) = 0. Table 7 is a decision formal context, where U = {x 1 , x 2 , x 3 , x 4 , x 5 , x 6 }is the object set, A = {a, b, c, d, e, f } is the condition attribute set. D = {g, h, k} is the decision attribute set.   Its formal concept lattice is as Figure 9. Here, the black is an important concept.  Table 4.

An Algorithm Getting the Part Key Structure and Examples.
For a formal context transformed from the part drawings structure model, the formal concept is a set pair of the positional relations (the attributes) and function surfaces (the objects). The decision attribute can be seen as the division in which experts think the function surfaces have the same properties (In other words, these functional surfaces play the same role in the part assembly structure). Thus, if given the importance or cohesion value of the concept, to determine important concepts, we can get the part key structure.
In order to verify the validity of the proposed method, five part drawings structure models [7] were calculated individually. Transformed concept lattice and the concept's extension, intent, and weights are listed below, where concept lattice nodes are denoted by (X, B), w = 1/2. The weight value marked in red in the table is the key structure (critical concept). If the weight values are all less than α, the key structure is the concept node in which w is the closest to α (As shown in Tables 8-12 and Figures 10-14).  Figure 10. The concept lattice of Table 5.
1 m, c 1/2 Figure 12. The concept lattice of Table 7.  Figure 13. The concept lattice of Table 8.  Figure 14. The concept lattice of Table 9.

Experiments
In order to verify the effectiveness of the method proposed in this paper, the author calculated and compared 7 of the 11 part engineering drawing structural models in Ref. [7]. Here, we set the node of any concept lattice as (X, B). If α = 0, w is taken as the maximum value, and the important concepts, and key structures of the three-dimensional part structure model as shown in Table 13 can be obtained.
The code of "key structure" in the table is the part drawing structure code from Ref. [7], and the part with red is the key structure calculated by the Algorithm 2 in this paper. From Table 13, it can be seen that, for most parts, the method in this paper can not only determine the important position relation (important intent), but also determine the functional surface (concept object) that constitutes this relationship, and then determine the key structure of parts. Of course, for completely symmetrical parts without "characteristics", this method also shows limitations (such as pull rod shaft). The reason is that, in these problems, the weight of position relation (concept intent) is exactly the same; that is to say, the information provided by the part drawing itself is not enough to distinguish it. Therefore, as long as the designer provides further information, this problem will be solved.

Algorithm 2:
An algorithm of the part key structure with concept lattice searching. Input (U, A, I, D, J) and α begin foreach (X, B) ∈ B(U, A, I) do Computing w by (1)or (4),compare w and α if w < α then next (X, B); else (X, B) is a key structure; end Two parts models were selected and searched in Visual C + +, ACIS, HOOPS and the part library (a total of 9010) of the self-developed mechanical parts retrieval system. The CPU of the computer is Intel 3.30 GHz, and the memory is 4.0 GB. Tables 14 and 15 are the results of the two methods.

Conclusions
This paper has developed a novel scheme for 3D mechanical structure model retrieval. A 3D model is converted into a formal context with the object as the functional surface, and the attribute indicating the positional relations between the functional surfaces. Each concept node contains a topological graph corresponding to the structure that it represents. Integrating the topology and feature structure signatures in FCA not only solves the feature interaction problem, but also accelerates the search process. Due to the significant reduction of the structure number, the graph comparison required in the similarity assessment can be finished in a polynomial time.
This work can be further improved. For example, the structure should consider engineering attributes such as tolerance, fit, and other design descriptions, so that it can capture the user's intent more accurately. In addition, AI techniques (e.g., fuzzy set, nonlinear neural network) can be applied to determine the weighting factors in our approach more systematically. It ensures that the search scheme properly reflects the user's intent. Our current research is focused on this.

Patents
Qiang Wu: The method and system of key structure modeling of equipment parts based on Weighted Concept Lattice. ZL201610884995.1.