Three-dimensional model classification method based on XGBoost and representative view

Representative views are obtained through fixed projection method and Mini Batch K-means clustering, combined with MetaFormer and CNN to extract features, and using XGBoost strong classifier, the problem of feature capture and processing complexity in three-dimensional model classification is solved, and classification accuracy is improved Sex and robustness.

CN118941869APending Publication Date: 2024-11-12HARBIN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411052228.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing three-dimensional model classification methods lack objectivity and are difficult to capture deep-level features. Traditional convolutional neural networks cannot effectively handle the complexity and disorder of high-dimensional and three-dimensional models, resulting in poor classification results.

Method used

The fixed projection method is used to obtain the two-dimensional view set, and representative views are extracted through the Mini Batch K-means clustering algorithm, view features and shape features are extracted in combination with MetaFormer and CNN, and semantic classification of fusion features is used using XGBoost strong classifier.

Benefits of technology

The classification accuracy and robustness of the three-dimensional model are improved, and the traditional method has made up for the shortcomings in the description of view features and shape features, achieving higher classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure QLYQS_1
    Figure QLYQS_1
  • Figure QLYQS_2
    Figure QLYQS_2
  • Figure QLYQS_3
    Figure QLYQS_3
Patent Text Reader

Abstract

The invention provides a three-dimensional model classification method based on XGBoost and a representative view. The method comprises the following steps: firstly, extracting a two-dimensional view of a three-dimensional model by utilizing a fixed projection method, and extracting a representative view by adopting a Min Batch K-means clustering algorithm; then, using MetaFormer to extract view features of the representative view, describing shape information of the representative view through a shape distribution function, and using a one-dimensional convolutional neural network to extract shape features; and finally, fusing the view features and the shape features, and inputting the fused features into a strong classifier obtained based on XGBoost iteration to complete classification of the three-dimensional model, so that the classification performance of the three-dimensional model is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The present invention relates to a three-dimensional model classification method based on XGBoost and representative views, which has good application in the field of three-dimensional model classification and retrieval. Background technology:

[0002] With the continuous development of 3D modeling technology and computer vision, the number and complexity of 3D models are growing exponentially. In this case, how to effectively classify and manage 3D models has become a research hotspot in related fields. Traditional 3D model classification methods rely on manually designed shape descriptors to extract 3D model features, and then use machine learning technology to classify them. However, this method has some obvious problems. First, manual feature extraction requires designers to have rich experience and subjective analysis ability, so it lacks objectivity. Secondly, this method is difficult to capture the deep features of 3D models. It mainly focuses on the surface geometric characteristics of 3D models and ignores the intrinsic structure and semantic information of 3D models. In recent years, a series of convolutional neural networks have emerged in the field of deep learning, such as DenseNet, GoogleNet, ResNet, etc. These convolutional neural networks have achieved remarkable results in tasks such as image classification and natural language processing. They can better capture the features of 3D models to integrate geometric information and semantic information to improve classification quality. However, the direct application of convolutional neural networks to 3D model classification tasks faces huge challenges. This is because the dimensionality of 3D models is high and their geometric structures are usually disordered and complex. There is a clear difference between 3D models and 2D images, and traditional convolutional neural networks cannot directly process them. The representation of 3D models is very complex. Currently, there are three main solutions for 3D model classification, including voxel-based classification methods, point cloud-based classification methods, and view-based classification methods. Among them, the view-based classification method works better. In the view-based classification method, a set of 2D views is used to describe the 3D model. The 2D view is a simple expression of the 3D model, and it is relatively simple to extract features from the 2D view. A neural network is used to extract view features from the 2D view, and features from different angles are fused through pooling operations to classify the 3D model.

[0003] Due to the complexity and irregularity of the 3D model structure, the multi-view 3D model classification method will ignore the importance differences of different views in expressing the 3D model, and the classification effect using weak classifiers is poor. To address the above problems, the present invention first uses the Mini Batch K-means clustering algorithm to cluster the 2D view set to obtain representative views, and then uses MetaFormer combined with CNN to extract the view features and shape features of the representative views, and then fuses the view features with the shape features to obtain the fused features, and then uses the strong classifier based on XGBoost to complete the 3D model classification task. Summary of the invention:

[0004] In order to give full play to the technical advantages accumulated by deep learning framework in the field of two-dimensional image analysis, the present invention discloses a three-dimensional model classification method based on XGBoost and representative views.

[0005] To this end, the present invention provides the following technical solutions.

[0006] 1. A three-dimensional model classification method based on XGBoost and representative views, characterized in that the method comprises the following steps:

[0007] Step 1: Use the fixed projection method to project the 3D model to obtain a 2D view set;

[0008] Step 2: Use the Mini Batch K-means clustering algorithm to cluster the two-dimensional view set to obtain representative views;

[0009] Step 3: Use the D1 descriptor to describe the distance between the centroid of the 2D view and a random sampling point on the boundary, use the D2 descriptor to describe the distance between two random sampling points on the boundary of the 2D view, and use the D3 descriptor to describe the square root of the area of ​​the triangle formed by three random sampling points on the boundary of the 2D view. Combine the D1, D2, and D3 descriptors of the representative view to obtain the global shape feature D.

[0010] Step 4: Input the representative view set obtained in step 2 into the MetaFormer network to extract view features X1;

[0011] Step 5: Input the global shape feature D obtained in step 3 into the CNN model to extract the shape feature X2, and fuse it with the view feature X1 obtained in step 4 to obtain the fused feature X;

[0012] Step 6: Divide the 3D model set into a 3D model training set and a 3D model test set, extract representative views of the 3D model and the corresponding global shape features from the 3D model training set, use steps 4 and 5 to extract fused features, combine the labels of the 3D training model to form training data, input into the XGBoost algorithm, iteratively train the strong classifier, extract representative views of the 3D model and the corresponding global shape features from the 3D model test set, use steps 4 and 5 to extract fused features to form test data, and use the optimized strong classifier to perform semantic classification on the test data.

[0013] 2. The three-dimensional model classification method based on XGBoost and representative views according to claim 1 is characterized in that in step 1, the three-dimensional model is projected using a fixed projection method, and the specific steps are:

[0014] Step 1-1: Select a fixed angle and a fixed amount to project the 3D model, and the 3D model is fixed at the center of the virtual sphere;

[0015] Step 1-2: The virtual camera is placed above the virtual sphere, and the 3D model rotates 360 degrees in a circle, presenting a set of 2D views at each step of 15 degrees;

[0016] Step 1-3: The obtained multiple 2D views are combined into a 2D view set V(M) = {V i |1≤i≤24}.

[0017] 3. The three-dimensional model classification method based on XGBoost and representative views according to claim 1 is characterized in that in step 2, the two-dimensional view set V(M) is clustered using the Min Batch K-means clustering algorithm, and the specific steps are:

[0018] Step 2-1: Randomly select K views from V(M) as the initial clustering center C i , U i =Ф(1≤i≤K), U=V(M), K=6;

[0019] Step 2-2: For(i=1; i<=K; i++)

[0020] For(j=1;j<=24;j++)

[0021]

[0022] Among them, V jk , C ik They are view V j and C i The k-th pixel value of , where m is the number of pixels in the view;

[0023] Step 2-3: For(i=1; i<=K; i++)

[0024] Will Join U i , U=U-{V}

[0025] Where d(x,y) is the Euclidean distance between x and y;

[0026] Step 2-4: Update cluster centers

[0027] Step 2-5: Repeat steps 2-2 to 2-4 to continuously reduce the sum of squared errors SSE until SSE stops changing or converges. The calculation of SSE is as follows:

[0028]

[0029] Step 2-6: Get the representative view set VR(M) = {C i |1≤i≤K}.

[0030] 4. The three-dimensional model classification method based on XGBoost and representative views according to claim 1 is characterized in that in the step 3, the D1, D2, and D3 descriptors of the representative views are extracted, and the D1, D2, and D3 descriptors are combined to obtain the global shape features, and the specific steps are:

[0031] Step 3-1: Sample N points from the view boundary and construct a set PD1 = {p1, p2, ..., p N}, the set of D1 shape distribution is {D1_ v1 ,…,D1_ vi ,…,D1_ vBins}, D1_ vi The calculation process is as follows:

[0032] D1_v i =|{Pdist(P,O)∈(BinSize*(i-1),BinSize*i),P∈PD1}

[0033] Where, BinSize = max({dist(P,O)|P∈PD1}) / N, dist(·) is the Euclidean distance between two points, and O is the centroid of the 2D view;

[0034] Step 3-2: Sample N point pairs from the view boundary and construct a set PD2 = {(p1, q1), (p2, q2), …, (p N ,q N )}, the set of D2 shape distributions is {D2_ v1,…,D2_ vi ,…,D2_ vBins}, D2_ vi The calculation process is as follows:

[0035] D2_v i =|{(p,q)dist(p,q)∈(BinSize*(i-1),BinSize*i),(p,q)∈PD2}

[0036] Where, BinSize = max({dist(p,q)|(p,q)∈PD2}) / N;

[0037] Step 3-3: Sample N triplet points from the view boundary and construct a set PD3 = {(p1, q1, r1), (p2, q2, r2), …, (p N ,q N ,r N )}, the set of D3 shape distributions is {D3_ v1 ,…,D3_ vi ,…,D3_ vBins}, D3_ vi The calculation process is as follows:

[0038] D3_v i =|{(p,q,r)Q∈(BinSize*(i-1),BinSize*i),(p,q,r)∈PD3}

[0039] Among them, BinSize = max({H(p,q,r)|(p,q,r)∈PD3}) / N, and the calculation process of Q is as follows:

[0040]

[0041] Among them, l1=dist(p,q), l2=dist(p,r), l3=dist(q,r), a=(l1+l2+l3) / 2;

[0042] Step 3-4: Concatenate the D1 shape distribution set, the D2 shape distribution set, and the D3 shape distribution set to obtain the global shape feature D.

[0043] 5. The three-dimensional model classification method based on XGBoost and representative views according to claim 1 is characterized in that in step 4, the representative view set obtained in step 2 is input into the MetaFormer network to extract the view feature X1, and the specific steps are as follows:

[0044] Step 4-1: The view VR in the representative view set VR(M) obtained in step 2 iInput to the Patchembedding layer for Patch operation, as shown below:

[0045] G=InputEmb(VR i )

[0046] Among them, G∈R N×C represents the embedding of the input, and N represents the view VR i The number of patches, C represents the embedding dimension. In the first stage, the convolution kernel size is 7 and the stride is 4. In the remaining three stages, the convolution kernel size is 3 and the stride is 2.

[0047] Step 4-2: Input G into the first residual sub-block of the MetaFormer Block and calculate H as follows:

[0048] H=Convpw2(Convdw(σ(Convpw1(Norm(G)))))+G

[0049] Among them, Norm() represents normalization, Convpw1() and Convpw2() are point-by-point convolutions, Convdw() is depth convolution, σ() is the ReLU activation function, the convolution kernel size is set to 7, and the expansion ratio is set to 2;

[0050] Step 4-3: Input H into the second residual sub-block of the MetaFormer Block and calculate Z as follows:

[0051] Z=σ(Norm(H)W1)W2+H

[0052] Where W1∈R C×rC and W2∈R rC×C is a learnable parameter of the MLP expansion ratio r, rC is the number of input features of the second layer MLP;

[0053] Step 4-4: Repeat steps 4-1 to 4-3 for a total of 3 times, and finally obtain the view feature X1.

[0054] 6. The three-dimensional model classification method based on XGBoost and representative views according to claim 1 is characterized in that in step 5, the global shape feature D obtained in step 3 is input into CNN to extract shape feature X2, and is fused with the view feature X1 obtained in step 4 to obtain fused feature X, and the specific steps are as follows:

[0055] Step 5-1: After normalizing the global shape feature D, input it into the convolution layer for convolution to obtain the output E. The convolution kernel size is 1 and the step size is 1;

[0056] Step 5-2: Input E to the maximum pooling layer for downsampling and output the shape feature X2;

[0057] Step 5-3: Input the view feature X1 and the shape feature X2 to the flattening layer for processing, and then input the flattened features to the fusion layer, and use Concat to fuse the features to obtain the fused feature X, as follows:

[0058] X=Concat(X1,X2)

[0059] 7. The three-dimensional model classification method based on XGBoost and representative views according to claim 1 is characterized in that, in the step 6, the three-dimensional model set is divided into a three-dimensional model training set and a three-dimensional model test set, representative views of the three-dimensional model and corresponding global shape features are extracted from the three-dimensional model training set, fusion features are extracted using steps 4 and 5, and training data is formed by combining the labels of the three-dimensional training model, which are input into the XGBoost algorithm, and a strong classifier is iteratively trained, representative views of the three-dimensional model and corresponding global shape features are extracted from the three-dimensional model test set, fusion features are extracted using steps 4 and 5 to form test data, and the optimized strong classifier is used to perform semantic classification on the test data, and the specific steps are:

[0060] Step 6-1: Divide the 3D model set into a 3D model training set and a 3D model test set, and set b=1;

[0061] Step 6-2: Extract representative views of the 3D model and corresponding global shape features from the 3D model training set, and use steps 4 and 5 to extract fusion features X;

[0062] Step 6-3: Combine the fusion feature X and the category label y to form a training data set {(X i ,y i )|X i ∈X,y i ∈Y,i=1,2,...,m};

[0063] Step 6-4: Construct the root node of the decision tree, initialize the root node to contain the entire sample set, traverse all splits of all features, calculate the split gain Gain, and initialize the predicted value of each sample is 0.1, and the calculation process of Gain is as follows:

[0064]

[0065] Among them, g i With h i are respectively the i-th sample about The first and second derivative values ​​of represents the loss function logloss, I L with I R are the sample sets of the left child node and the right child node after the split, respectively, and λ and γ are hyper parameters;

[0066] Step 6-5: Select the feature with the maximum Gain value as the maximum feature, and select the split node with the maximum Gain value as the optimal split node;

[0067] Step 6-6: Split the sample set into the left and right child nodes of the node according to the optimal split node, and obtain I L with I R ;

[0068] Step 6-7: Take the left and right child nodes as root nodes respectively, repeat steps 6-4 to 6-6 for a total of 7 times, and get the decision tree f b , b=b+1;

[0069] Step 6-8: Repeat steps 6-2 to 6-7 for a total of B-1 times, modifying the predicted value of the sample each time f b (X i ) indicates that in the decision tree f b The score of the i-th sample in ;

[0070] Step 6-9: Use the tree space set consisting of the obtained K decision trees as a strong classifier

[0071]

[0072] Steps 6-10: Extract representative views of the 3D model and the corresponding global shape features from the 3D model test set, use steps 4 and 5 to extract the fused feature X as the test data, input X into the optimized strong classifier F, and then use the softmax function to convert it into a probability distribution P, as follows:

[0073]

[0074] Among them, K represents the number of views, c represents the number of categories, and p ij represents the probability that view i belongs to category j;

[0075] Step 6-11: Convert P to one-hot encoding to get R1, R2, …, R K , using R1, R2, ..., R K Construct the matrix T = {R ij |1≤i≤K,1≤j≤c}, as follows:

[0076]

[0077] Among them, R ij Indicates whether the i-th representative view belongs to the j-th category, 1 means it belongs, and 0 means it does not belong;

[0078] Step 6-12: The category to which the most representative views in VR(M) are classified is determined as the category of model M, as follows:

[0079]

[0080] Beneficial effects:

[0081] The present invention is a three-dimensional model classification method based on XGBoost and representative views.

[0082] 1. The present invention improves the three-dimensional shape distribution feature to make it applicable to two-dimensional views, and uses the shape distribution function to describe the shape information of the three-dimensional model view. For the geometric shape of the three-dimensional model, the present invention fuses the view feature and the shape distribution feature descriptor to comprehensively describe the three-dimensional model. The shape feature vector of the three-dimensional model is obtained by fusing the feature vectors D1, D2, and D3, has good rotation robustness, and can well express the geometric shape characteristics of the three-dimensional model.

[0083] 2. When using a fixed projection method to obtain two-dimensional views, a large number of projection views are usually generated at evenly distributed positions around the three-dimensional model, resulting in serious accumulation of redundant information, thereby reducing the accuracy of classification. At the same time, there is another problem, that is, treating all two-dimensional views equally in general will ignore the importance differences of different views in expressing three-dimensional models. Therefore, this paper uses a method to extract representative views and clusters the views using the Mini Batch K-means algorithm. A representative view is selected in each cluster to obtain a set of two-dimensional representative views corresponding to the three-dimensional model. This method can improve the feature representation ability of the two-dimensional view set while reducing the number of generated projection views, thereby improving classification performance.

[0084] 3. The method proposed in this paper is verified by using the public dataset ModelNet10. The results show that the method proposed in this paper has high accuracy.

[0085] 4. The present invention proposes a method for classifying three-dimensional models by combining a MetaFormer general architecture and a CNN network, and by using a strong classifier based on XGBoost iterative training. MetaFormer is used to extract view features from representative views, and the extracted features are local and do not emphasize contour boundaries. CNN is used to extract shape features from shape descriptors, and the extracted shape features are global, emphasizing contour boundaries and making up for the defects of view features. Fusion of view features with shape features can better describe the three-dimensional model. Based on XGBoost iterative training of the strong classifier, the loss function is optimized through multiple iterations, and the obtained strong classifier has higher three-dimensional model classification accuracy. Description of the drawings:

[0086] Figure 1 Three-dimensional test model in the embodiment of the present invention

[0087] Figure 2 A three-dimensional model classification network structure diagram based on XGBoost and representative views in an embodiment of the present invention

[0088] Figure 3 A two-dimensional view set of a three-dimensional test model in an embodiment of the present invention

[0089] Figure 4 A representative view set of the three-dimensional test model in the embodiment of the present invention Specific implementation method:

[0090] In order to make the technical solutions in the embodiments of the present invention clearly and completely described, Figure 1 Taking the three-dimensional test model of the bed category in the ModelNet10 test set as an example, the present invention is further described in detail in combination with the ModelNet10 data set.

[0091] The specific process of three-dimensional model classification based on XGBoost and representative views in the embodiment of the present invention is as follows: Figure 2 As shown, Figure 1 The three-dimensional test model in is classified, including the following steps:

[0092] Step 1: Use the fixed projection method to project the 3D model. The specific steps are as follows:

[0093] Step 1-1: Select a fixed angle and a fixed amount to project the 3D model, and the 3D model is fixed at the center of the virtual sphere;

[0094] Step 1-2: The virtual camera is placed above the virtual sphere, and the 3D model rotates 360 degrees in a circle, presenting a set of 2D views at each step of 15 degrees;

[0095] Step 1-3: The obtained multiple 2D views are combined into a 2D view set V(M) = {V i |1≤i≤24}, such as Figure 3 shown.

[0096] Step 2: Use the Min Batch K-means clustering algorithm to cluster the two-dimensional view set V(M). The specific steps are as follows:

[0097] Step 2-1: Randomly select K views from V(M) as the initial clustering center C i , U i =Ф(1≤i≤K), U=V(M), K=6;

[0098] Step 2-2: For(i=1; i<=K; i++)

[0099] For(j=1;j<=24;j++)

[0100]

[0101] Among them, V jk , C ik They are view V j and C i The k-th pixel value of , where m is the number of pixels in the view;

[0102] Step 2-3: For(i=1; i<=K; i++)

[0103] Will Join U i , U=U-{V}

[0104] Where d(x,y) is the Euclidean distance between x and y;

[0105] Step 2-4: Update cluster centers

[0106] Step 2-5: Repeat steps 2-2 to 2-4 to continuously reduce the sum of squared errors SSE until SSE stops changing or converges. The calculation of SSE is as follows:

[0107]

[0108] Step 2-6: Get the representative view set VR(M) = {C i |1≤i≤K}, such as Figure 4 shown.

[0109] Step 3: Extract the D1, D2, and D3 descriptors of representative views, and combine the D1, D2, and D3 descriptors to obtain the global shape features. The specific steps are as follows:

[0110] Step 3-1: Sample N points from the view boundary and construct a set PD1 = {p1, p2, ..., p N}, the set of D1 shape distribution is {D1_ v1 ,…,D1_ vi ,…,D1_ vBins}, D1_ vi The calculation process is as follows:

[0111] D1_v i =|{Pdist(P,O)∈(BinSize*(i-1),BinSize*i),P∈PD1}

[0112] Where BinSize = max({dist(P,O)|P∈PD1}) / N, dist(·) is the Euclidean distance between two points, O is the centroid of the 2D view, Figure 4 The D1 features of the representative views shown are as follows:

[0113] D1 features of VR1: [48,143,155,4,0,0,84,304,164,97]

[0114] D1 features of VR2: [21,82,102,76,31,0,0,374,173,140]

[0115] VR3’s D1 features: [19,118,126,29,0,0,82,307,193,125]

[0116] VR4’s D1 features: [26,76,94,59,35,0,0,367,190,149]

[0117] VR5’s D1 features: [31,96,142,19,0,0,40,337,184,150]

[0118] D1 features of VR6: [6,129,85,33,0,0,49,340,204,153]

[0119] Figure 4 The D1 features for the representative viewset shown are as follows:

[0120] D1=[[48,143,155,4,0,0,84,304,164,97],[21,82,102,76,31,0,0,374,173,140],[19,118,126,29,0,0,82,307,193,12 5],[26,76,94,59,35,0,0,367,190,149],[31,96,142,19,0,0,40,337,184,150],[6,129,85,33,0,0,49,340,204,153]];

[0121] Step 3-2: Sample N point pairs from the view boundary and construct a set PD2 = {(p1, q1), (p2, q2), …, (p N ,q N )}, the set of D2 shape distributions is {D2_ v1 ,…,D2_ vi ,…,D2_ vBins}, D2_ vi The calculation process is as follows:

[0122] D2_v i =|{(p,q)dist(p,q)∈(BinSize*(i-1),BinSize*i),(p,q)∈PD2}

[0123] Among them, BinSize = max({dist(p,q)|(p,q)∈PD2}) / N, Figure 4 The D2 features for the representative views shown are as follows:

[0124] D2 features of VR1: [61,78,102,156,234,136,67,117,34,13]

[0125] D2 features of VR2: [68,69,104,143,189,140,68,155,47,16]

[0126] VR3’s D2 features: [64,81,88,196,215,92,62,132,59,9]

[0127] VR4’s D2 features: [50,68,99,184,178,146,55,130,67,21]

[0128] VR5’s D2 features: [82,73,114,168,184,118,67,112,61,19]

[0129] VR6 D2 features: [60,78,88,170,205,111,52,150,72,13]

[0130] Figure 4 The D2 features for the representative viewset shown are as follows:

[0131] D2=[[61,78,102,156,234,136,67,117,34,13],[68,69,104,143,189,140,68,155,47,16],[64,81,88,196,215,92,62,132,59,9] ,[50,68,99,184,178,146,55,130,67,21],[82,73,114,168,184,118,67,112,61,19],[60,78,88,170,205,111,52,150,72,13]];

[0132] Step 3-3: Sample N triplet points from the view boundary and construct a set PD3 = {(p1, q1, r1), (p2, q2, r2), …, (p N ,q N ,r N )}, the set of D3 shape distributions is {D3_ v1 ,…,D3_ vi ,…,D3_ vBins}, D3_ vi The calculation process is as follows:

[0133] D3_v i =|{(p,q,r)Q∈(BinSize*(i-1),BinSize*i),(p,q,r)∈PD3}

[0134] Among them, BinSize = max({H(p,q,r)|(p,q,r)∈PD3}) / N, and the calculation process of Q is as follows:

[0135]

[0136] Among them, l1=dist(p,q), l2=dist(p,r), l3=dist(q,r), a=(l1+l2+l3) / 2, Figure 4 The D3 features for the representative views shown are as follows:

[0137] D3 features for VR1: [348,219,160,128,71,32,16,12,8,4]

[0138] D3 features for VR2: [303,225,182,97,58,51,32,16,19,15]

[0139] D3 features for VR3: [320,215,161,105,66,52,19,28,21,12]

[0140] D3 features for VR4: [327,178,161,121,92,44,32,13,13,18]

[0141] D3 features for VR5: [385,191,150,114,62,30,28,17,13,9]

[0142] D3 features for VR6: [292,210,161,124,78,38,28,33,20,15]

[0143] Figure 4 The D3 features for the representative viewset shown are as follows:

[0144] D3=[[348,219,160,128,71,32,16,12,8,4],[303,225,182,97,58,51,32,16,19,15],[320,215,161,105,66,52,19,28,21,12] ,[327,178,161,121,92,44,32,13,13,18],[385,191,150,114,62,30,28,17,13,9],[292,210,161,124,78,38,28,33,20,15]];

[0145] Step 3-4: Connect the D1 shape distribution set, D2 shape distribution set, and D3 shape distribution set in series to obtain the global shape feature D as follows:

[0146] D=[[48,143,155,4,0,0,84,304,164,97,61,78,102,156,234,136,67,117,34,13,348,219,16 0,128,71,32,16,12,8,4],[21,82,102,76,31,0,0,374,173,140,68,69,104,143,189,140,68, 155,47,16,303,225,182,97,58,51,32,16,19,15],[320,215,161,105,66,52,19,28,21,12,64,81,88,196,215,92,62,132,59,9,320,215,161,105,66,52,19,28,21,12],[19,118,126,29,0 ,0,82,307,193,125,50,68,99,184,178,146,55,130,67,21,327,178,161,121,92,44,32,13,13,18],[26,76,94,59,35,0,0,367,190,149,82,73,114,168,184,118,67,112,61,19,385,191, 150,114,62,30,28,17,13,9],[31,96,142,19,0,0,40,337,184,150],[6,129,85,33,0,0,49,340,204,153,60,78,88,170,205,111,52,150,72,13,292,210,161,124,78,38,28,33,20,15]];

[0147] Step 4: Input the representative view set obtained in step 2 into the MetaFormer network to extract view features X1. The specific steps are as follows:

[0148] Step 4-1: The view VR in the representative view set VR(M) obtained in step 2 i Input to the Patchembedding layer for Patch operation, as shown below:

[0149] G=InputEmb(VR i )

[0150] Among them, G∈R N×C represents the embedding of the input, and N represents the view VR iThe number of patches, C represents the embedding dimension. In the first stage, the convolution kernel size is 7 and the stride is 4. In the remaining three stages, the convolution kernel size is 3 and the stride is 2.

[0151] Step 4-2: Input G into the first residual sub-block of the MetaFormer Block and calculate H as follows:

[0152] H=Convpw2(Convdw(σ(Convpw1(Norm(G)))))+G

[0153] Among them, Norm() represents normalization, Convpw1() and Convpw2() are point-by-point convolutions, Convdw() is depth convolution, σ() is the ReLU activation function, the convolution kernel size is set to 7, and the expansion ratio is set to 2;

[0154] Step 4-3: Input H into the second residual sub-block of the MetaFormer Block and calculate Z as follows:

[0155] Z=σ(Norm(H)W1)W2+H

[0156] Where W1∈R C×rC and W2∈R rC×C is a learnable parameter of the MLP expansion ratio r, rC is the number of input features of the second layer MLP;

[0157] Step 4-4: Repeat steps 4-1 to 4-3 for a total of 3 times, and finally obtain the view feature X1 as follows:

[0158] X1=[[0.19027,-0.075592,0.11264,…],[-0.11167,0.085165,0.367452,…],[0.03811,0.050437,-0.55096,…], [0.424345,0.029114,0.019069,…],[-0.270221,0.038417,0.030849,…],[0.173147,0.149854,-0.090544,…]].

[0159] Step 5: Input the global shape feature D obtained in step 3 into CNN to extract the shape feature X2, and fuse it with the view feature X1 obtained in step 4 to obtain the fused feature X. The specific steps are:

[0160] Step 5-1: After normalizing the global shape feature D, input it into the convolution layer for convolution to obtain the output E. The convolution kernel size is 1 and the step size is 1;

[0161] Step 5-2: Input E to the maximum pooling layer for downsampling and output the shape feature X2 as follows:

[0162] X2=[[-0.15374,-0.46231,-0.31153,…],[0.03686,-0.03003,-0.00317,…],[0.29452,0.03741,0.29964,…] ,[-0.13294,-0.16206,0.02280,…],[0.22204,-0.08163,-0.08141,…],[-0.07844,-0.26409,-0.04305,…]];

[0163] Step 5-3: Input the view feature X1 and the shape feature X2 to the flattening layer for processing, and then input the flattened features to the fusion layer, and use Concat to fuse the features to obtain the fused feature X, as follows:

[0164] X=Concat(X1,X2)

[0165] The results are as follows:

[0166] X=[[0.19027,-0.075592,0.11264,…,-0.15374,-0.46231,-0.31153,…],[-0.11167,0.085165,0.367452 ,…,0.03686,-0.03003,-0.00317,…],[0.03811,0.050437,-0.55096,…,0.29452,0.03741,0.29964,…],[0 .424345,0.029114,0.019069,…,-0.13294,-0.16206,0.02280,…],[-0.270221,0.038417,0.030849,…,0.22204,-0.08163,-0.08141,…],[0.173147,0.149854,-0.090544,…,-0.07844,-0.26409,-0.04305,…]];

[0167] Step 6: Divide the 3D model set into a 3D model training set and a 3D model test set, extract representative views of the 3D model and the corresponding global shape features from the 3D model training set, use steps 4 and 5 to extract fusion features, combine the labels of the 3D training model to form training data, input into the XGBoost algorithm, iteratively train the strong classifier, extract representative views of the 3D model and the corresponding global shape features from the 3D model test set, use steps 4 and 5 to extract fusion features to form test data, and use the optimized strong classifier to perform semantic classification on the test data. The specific steps are as follows:

[0168] Step 6-1: Divide the 3D model set into a 3D model training set and a 3D model test set, and set b=1;

[0169] Step 6-2: Extract representative views of the 3D model and corresponding global shape features from the 3D model training set, and use steps 4 and 5 to extract fusion features X;

[0170] Step 6-3: Combine the fusion feature X and the category label y to form a training data set {(X i ,y i )|X i ∈X,y i ∈Y,i=1,2,...,m};

[0171] Step 6-4: Construct the root node of the decision tree, initialize the root node to contain the entire sample set, traverse all splits of all features, calculate the split gain Gain, and initialize the predicted value of each sample is 0.1, and the calculation process of Gain is as follows:

[0172]

[0173] Among them, g i With h i are respectively the i-th sample about The first and second derivative values ​​of represents the loss function logloss, I L with I R are the sample sets of the left child node and the right child node after the split, respectively, and λ and γ are hyper parameters;

[0174] Step 6-5: Select the feature with the maximum Gain value as the maximum feature, and select the split node with the maximum Gain value as the optimal split node;

[0175] Step 6-6: Split the sample set into the left and right child nodes of the node according to the optimal split node, and obtain I L with I R ;

[0176] Step 6-7: Take the left and right child nodes as root nodes respectively, repeat steps 6-4 to 6-6 for a total of 7 times, and get the decision tree f b , b=b+1;

[0177] Step 6-8: Repeat steps 6-2 to 6-7 for a total of B-1 times, modifying the predicted value of the sample each time f b (X i ) indicates that in the decision tree f b The score of the i-th sample in ;

[0178] Step 6-9: Use the tree space set consisting of the obtained K decision trees as a strong classifier

[0179]

[0180] Steps 6-10: Extract representative views of the 3D model and the corresponding global shape features from the 3D model test set, use steps 4 and 5 to extract the fused feature X as the test data, input X into the optimized strong classifier F, and then use the softmax function to obtain the probability distribution P, P is as follows:

[0181] P=[[0.0097,0.0089,0.9119,0.0093,0.0090,0.0091,0.0100,0.0103,0.0098,0.0129],[0.0109,0.0081,0.9131,0.0088,0.01 08,0.0094,0.0120,0.0081,0.0100,0.0134],[0.0097,0.0081,0.9112,0.0097,0.0091,0.0094,0.0098,0.0106,0.0098,0.0126 ],[0.0092,0.0079,0.9211,0.0048,0.0033,0.0059,0.0123,0.0011,0.0066,0.0085],[0.0094,0.0076,0.9135,0.0050,0.0143,0.0089,0.0102,0.0114,0.0118,0.098],[0.0078,0.0088,0.9139,0.0077,0.0106,0.0093,0.098,0.0101,0.0100,0.0129]];

[0182] Step 6-11: Convert P to one-hot encoding to get R1, R2, …, R K , using R1, R2, ..., R KConstruct the matrix T = {R ij |1≤i≤K,1≤j≤c}, T is as follows:

[0183]

[0184] T=[[0,0,1,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,0,0,0] ,[0,0,1,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,0,0,0]];

[0185] Step 6-12: The category to which the most representative views in VR(M) are classified is determined as the category of model M, as follows:

[0186]

[0187] Class(M)=3, M is classified as bed, Figure 1 The category of the three-dimensional model shown is bed;

[0188] The present invention is implemented in the test set of the three-dimensional model data set ModelNet10, and the classification accuracy is 92.37%.

[0189] The three-dimensional model classification method based on XGBoost and representative views implemented in the embodiment of the present invention uses a fixed-view projection method to obtain a two-dimensional view set of a three-dimensional model, then uses a clustering algorithm to extract representative views, uses MetaFormer to obtain view features from representative views, uses CNN to obtain shape features from the global shape features of representative views, fuses view features with shape features, iteratively trains a strong classifier based on XGBoost, optimizes the loss function through multiple iterations, and uses the obtained strong classifier to complete the classification of the three-dimensional model. This method has a good effect on the classification of three-dimensional models.

[0190] The above is a detailed description of the embodiments of the present invention in conjunction with the accompanying drawings, and the specific implementation methods herein are only used to help understand the method of the present invention. For those of ordinary skill in the art, according to the idea of ​​the present invention, changes and modifications can be made in the specific implementation methods and application scopes, so the present invention should not be understood as limiting the present invention.

Claims

1. A three-dimensional model classification method based on XGBoost and representative views, characterized in that: The method comprises the following steps: Step 1: Use the fixed projection method to project the 3D model to obtain a 2D view set; Step 2: Use the Mini Batch K-means clustering algorithm to cluster the two-dimensional view set to obtain representative views; Step 3: Use the D1 descriptor to describe the distance between the centroid of the 2D view and a random sampling point on the boundary, use the D2 descriptor to describe the distance between two random sampling points on the boundary of the 2D view, and use the D3 descriptor to describe the square root of the area of ​​the triangle formed by three random sampling points on the boundary of the 2D view. Combine the D1, D2, and D3 descriptors of the representative view to obtain the global shape feature D. Step 4: Input the representative view set obtained in step 2 into the MetaFormer network to extract view features X1; Step 5: Input the global shape feature D obtained in step 3 into the CNN model to extract the shape feature X2, and fuse it with the view feature X1 obtained in step 4 to obtain the fused feature X; Step 6: Divide the 3D model set into a 3D model training set and a 3D model test set, extract representative views of the 3D model and the corresponding global shape features from the 3D model training set, use steps 4 and 5 to extract fused features, combine the labels of the 3D training model to form training data, input into the XGBoost algorithm, iteratively train the strong classifier, extract representative views of the 3D model and the corresponding global shape features from the 3D model test set, use steps 4 and 5 to extract fused features to form test data, and use the optimized strong classifier to perform semantic classification on the test data.

2. The three-dimensional model classification method based on XGBoost and representative views according to claim 1, characterized in that: In step 1, the three-dimensional model is projected using a fixed projection method, and the specific steps are as follows: Step 1-1: Select a fixed angle and a fixed amount to project the 3D model, and the 3D model is fixed at the center of the virtual sphere; Step 1-2: The virtual camera is placed above the virtual sphere, and the 3D model rotates 360 degrees in a circle, presenting a set of 2D views at each step of 15 degrees; Step 1-3: The obtained multiple 2D views are combined into a 2D view set V(M) = {V i |1≤i≤24}.

3. The three-dimensional model classification method based on XGBoost and representative views according to claim 1, characterized in that: In step 2, the Min Batch K-means clustering algorithm is used to cluster the two-dimensional view set V(M), and the specific steps are as follows: Step 2-1: Randomly select K views from V(M) as the initial clustering center C i , U i =Ф(1≤i≤K), U=V(M), K=6; Step 2-2: For(i=1; i<=K; i++) For(j=1;j<=24;j++) Among them, V jk , C ik They are view V j and C i The k-th pixel value of , where m is the number of pixels in the view; Step 2-3: For (i=1; i<=K; i++) general Join U i , U = U-{V} Where d(x,y) is the Euclidean distance between x and y; Step 2-4: Update cluster centers Step 2-5: Repeat steps 2-2 to 2-4 to continuously reduce the sum of squared errors SSE until SSE stops changing or converges. The calculation of SSE is as follows: Step 2-6: Get the representative view set VR(M) = {C i |1≤i≤K}.

4. The three-dimensional model classification method based on XGBoost and representative views according to claim 1, characterized in that: In step 3, the D1, D2, and D3 descriptors of the representative views are extracted, and the D1, D2, and D3 descriptors are combined to obtain the global shape features. The specific steps are as follows: Step 3-1: Sample N points from the view boundary and construct a set PD1 = {p1, p2, ..., p N }, the set of D1 shape distribution is {D1_ v1 ,…,D1_ vi ,…,D1_ vBins }, D1_ vi The calculation process is as follows: D1_v i =|{Pdist(P,O)∈(BinSize*(i-1),BinSize*i),P∈PD1} Where, BinSize = max({dist(P,O)|P∈PD1}) / N, dist(·) is the Euclidean distance between two points, and O is the centroid of the 2D view; Step 3-2: Sample N point pairs from the view boundary and construct a set PD2 = {(p1, q1), (p2, q2), …, (p N ,q N )}, the set of D2 shape distributions is {D2_ v1 ,…,D2_ vi ,…,D2_ vBins }, D2_ vi The calculation process is as follows: D2_v i =|{(p,q)dist(p,q)∈(BinSize*(i-1),BinSize*i),(p,q)∈PD2} Where, BinSize = max({dist(p,q)|(p,q)∈PD2}) / N; Step 3-3: Sample N triplet points from the view boundary and construct a set PD3 = {(p1, q1, r1), (p2, q2, r2), …, (p N ,q N ,r N )}, the set of D3 shape distributions is {D3_ v1 ,…,D3_ vi ,…,D3_ vBins }, D3_ vi The calculation process is as follows: D3_v i =|{(p,q,r)Q∈(BinSize*(i-1),BinSize*i),(p,q,r)∈PD3} Among them, BinSize = max({H(p,q,r)|(p,q,r)∈PD3}) / N, and the calculation process of Q is as follows: Among them, l1=dist(p,q), l2=dist(p,r), l3=dist(q,r), a=(l1+l2+l3) / 2; Step 3-4: Concatenate the D1 shape distribution set, the D2 shape distribution set, and the D3 shape distribution set to obtain the global shape feature D.

5. The three-dimensional model classification method based on XGBoost and representative views according to claim 1, characterized in that: In step 4, the representative view set obtained in step 2 is input into the MetaFormer network to extract view features X1. The specific steps are as follows: Step 4-1: The view VR in the representative view set VR(M) obtained in step 2 i Input to the Patch embedding layer for Patch operation, as shown below: G=InputEmb(VR i ) Among them, G∈R N×C represents the embedding of the input, and N represents the view VR i The number of patches, C represents the embedding dimension. In the first stage, the convolution kernel size is 7 and the stride is 4. In the remaining three stages, the convolution kernel size is 3 and the stride is 2. Step 4-2: Input G into the first residual sub-block of the MetaFormer Block and calculate H as follows: H=Convpw2(Convdw(σ(Convpw1(Norm(G)))))+G Among them, Norm() represents normalization, Convpw1() and Convpw2() are point-by-point convolutions, Convdw() is depth convolution, σ() is the ReLU activation function, the convolution kernel size is set to 7, and the expansion ratio is set to 2; Step 4-3: Input H into the second residual sub-block of the MetaFormer Block and calculate Z as follows: Z=σ(Norm(H)W1)W2+H Where W1∈R C×rC and W2∈R rC×C is a learnable parameter of the MLP expansion ratio r, rC is the number of input features of the second layer MLP; Step 4-4: Repeat steps 4-1 to 4-3 for a total of 3 times, and finally obtain the view feature X1.

6. The three-dimensional model classification method based on XGBoost and representative views according to claim 1, characterized in that: In step 5, the global shape feature D obtained in step 3 is input into CNN to extract shape feature X2, and is fused with the view feature X1 obtained in step 4 to obtain fused feature X. The specific steps are: Step 5-1: After normalizing the global shape feature D, input it into the convolution layer for convolution to obtain the output E. The convolution kernel size is 1 and the step size is 1; Step 5-2: Input E to the maximum pooling layer for downsampling and output the shape feature X2; Step 5-3: Input the view feature X1 and the shape feature X2 to the flattening layer for processing, and then input the flattened features to the fusion layer, and use Concat to fuse the features to obtain the fused feature X, as follows: X=Concat(X1,X2).

7. The three-dimensional model classification method based on XGBoost and representative views according to claim 1, characterized in that: In the step 6, the 3D model set is divided into a 3D model training set and a 3D model test set, representative views of the 3D model and corresponding global shape features are extracted from the 3D model training set, fusion features are extracted using steps 4 and 5, and training data is formed by combining the labels of the 3D training model, which are input into the XGBoost algorithm, and a strong classifier is iteratively trained. Representative views of the 3D model and corresponding global shape features are extracted from the 3D model test set, fusion features are extracted using steps 4 and 5 to form test data, and the optimized strong classifier is used to perform semantic classification on the test data. The specific steps are: Step 6-1: Divide the 3D model set into a 3D model training set and a 3D model test set, and set b=1; Step 6-2: Extract representative views of the 3D model and corresponding global shape features from the 3D model training set, and use steps 4 and 5 to extract fusion features X; Step 6-3: Combine the fusion feature X and the category label y to form a training data set {(X i ,y i )|X i ∈X,y i ∈Y,i=1,2,...,m}; Step 6-4: Construct the root node of the decision tree, initialize the root node to contain the entire sample set, traverse all splits of all features, calculate the split gain Gain, and initialize the predicted value of each sample is 0.1, and the calculation process of Gain is as follows: Among them, g i With h i are respectively the i-th sample about The first and second derivative values ​​of represents the loss function logloss, I L with I R are the sample sets of the left child node and the right child node after the split, respectively, and λ and γ are hyper parameters; Step 6-5: Select the feature with the maximum Gain value as the maximum feature, and select the split node with the maximum Gain value as the optimal split node; Step 6-6: Split the sample set into the left and right child nodes of the node according to the optimal split node, and obtain I L with I R ; Step 6-7: Take the left and right child nodes as root nodes respectively, repeat steps 6-4 to 6-6 for a total of 7 times, and get the decision tree f b , b=b+1; Step 6-8: Repeat steps 6-2 to 6-7 for a total of B-1 times, modifying the predicted value of the sample each time f b (X i ) indicates that in the decision tree f b The score of the i-th sample in ; Step 6-9: Use the tree space set consisting of the obtained K decision trees as a strong classifier Steps 6-10: Extract representative views of the 3D model and the corresponding global shape features from the 3D model test set, use steps 4 and 5 to extract the fused feature X as the test data, input X into the optimized strong classifier F, and then use the softmax function to convert it into a probability distribution P, as follows: Among them, K represents the number of views, c represents the number of categories, and p ij represents the probability that view i belongs to category j; Step 6-11: Convert P to one-hot encoding to get R1, R2, …, R K , using R1, R2, ..., R K Construct the matrix T = {R ij |1≤i≤K,1≤j≤c}, as follows: Among them, R ij Indicates whether the i-th representative view belongs to the j-th category, 1 means it belongs, and 0 means it does not belong; Step 6-12: The category to which the most representative views in VR(M) are classified is determined as the category of model M, as follows: