A three-dimensional mesh segmentation method based on boundary perception and contrast learning
By employing boundary awareness and contrastive learning methods, the segmentation quality of 3D mesh boundary regions has been improved, solving the problem of inaccurate boundary region segmentation in existing technologies and achieving more efficient segmentation results.
Patent Information
- Application Number
- CN202610705137.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-06-19
AI Technical Summary
Existing 3D mesh segmentation methods are not accurate enough in boundary regions, and there is a lack of specific improvement methods, which leads to frequent missegmentation, especially in boundary-sensitive fields such as medical diagnosis and industrial inspection.
By employing boundary awareness and contrastive learning methods, a deep learning model is constructed by annotating the boundary regions of a 3D mesh. The model then utilizes topological relationships and a contrastive learning loss function to improve the segmentation quality of the boundary regions.
It significantly improves the segmentation accuracy of 3D mesh boundary regions, reduces labor and time costs, and maintains overall segmentation performance, making it suitable for practical scenarios such as medical analysis and computer-aided design.
Smart Images

Figure CN122244339A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D segmentation in computer graphics and 3D vision, and more particularly to a 3D mesh segmentation method based on boundary awareness and contrastive learning. Background Technology
[0002] 3D mesh segmentation refers to dividing a mesh model into several semantically or geometrically meaningful regions based on its topological and geometric characteristics. Accurate segmentation of 3D meshes is widely needed in various industries such as medical analysis, computer-aided design, and industrial quality inspection, and has a significant impact on downstream tasks such as 3D reconstruction, mesh simplification, geometric compression, and transmission.
[0003] The segmented boundary region is the intersection of multiple semantically labeled regions, often more semantically ambiguous and less distinguishable from surrounding labeled regions. Therefore, segmenting the boundary region is often more difficult and more prone to missegmentation compared to the interior region. Accurate segmentation of boundary regions is crucial in boundary-sensitive fields such as medical diagnosis and industrial inspection. However, most existing research focuses more on the overall mesh segmentation while neglecting the segmentation quality of the boundary region, lacking specific methods to improve segmentation quality. In practical applications, a method to improve the segmentation quality of mesh boundaries is needed. Summary of the Invention
[0004] In view of the shortcomings of existing technologies, the purpose of this invention is to address the problem that existing 3D mesh segmentation methods are not accurate enough in boundary regions. It innovatively proposes a 3D segmentation method based on boundary awareness and contrast learning, which can improve the segmentation quality of mesh boundary regions and has high application value.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a 3D mesh segmentation method based on boundary awareness and contrastive learning, comprising the following steps:
[0006] S1, Data Acquisition: The constructed 3D mesh is segmented and labeled. Each segmented region is labeled with a separate integer label. Each edge of the 3D mesh is labeled with a label category. The dataset consists of several labeled 3D meshes and the entire dataset is divided into training set and test set.
[0007] S2, determine the boundary and train the deep learning network using the contrastive learning method, construct the deep learning model, input the 3D mesh training data from step S1 into the model, determine the boundary region, perform contrastive learning on the boundary region, calculate the loss function and backpropagate, and supervise iterative training until the loss function converges.
[0008] S3, Model Segmentation, obtains the trained model, inputs other 3D meshes into the model, and finally outputs the mesh segmentation result.
[0009] Preferably, step S2 includes:
[0010] S21, Original Mesh Boundary Awareness: This function performs boundary awareness on the original 3D mesh of the input model, determining its boundary regions. For any edge in the mesh... Let the actual label obtained in step S1 be... Define the edges that have common points with it. For its adjacent edges, The real label is ,set up The set of all adjacent edges is Therefore, the boundary region can be determined according to the following formula:
[0011]
[0012] in, This represents the set of boundary edge regions in the actual labels of the mesh.
[0013] Preferably, step S2 includes:
[0014] S22, Sub-mesh Boundary Awareness: Based on the topological relationships of the mesh, it performs boundary awareness on sub-meshes of different resolutions generated by pooling the original mesh during model training, and identifies the boundary regions of the sub-meshes.
[0015] The edge labels in the original mesh are manually annotated, while the sub-mesh has no labels. Therefore, it is necessary to first infer the labels of each edge in the sub-mesh, assuming a set of edges in the parent mesh. During the pooling process, an edge in the sub-mesh is obtained through aggregation. ,So The true label can be inferred using the following formula:
[0016]
[0017] in, Represents subgrid edges speculative tags, The label representing the parent grid. express Any edge in the grid, i.e., a subgrid edge. The speculative tags, by The set of parent mesh edges before topology aggregation The grid labels are obtained by calculating the average value of each edge label. , Both refer to soft labels, which are vector-based and contain the possibilities for each category.
[0018] Preferably, step S2 includes:
[0019] S23, Contrastive learning: After obtaining the boundary regions of the original mesh and each sub-mesh based on S21 and S22, the feature vectors of the boundary edges contained in the boundary regions are extracted. For each edge in the boundary region... ,by As anchor points, positive and negative samples are constructed, and comparative learning is performed on the positive and negative samples. The comparative learning loss function is calculated to guide the model to narrow the distance between positive samples and distance the negative samples.
[0020] Preferably, step S2 includes:
[0021] S24, Model Training: Use the training set from step S1 as training data; input the training data into the deep learning model to obtain the model's output; calculate the cross-entropy loss by comparing the model output with the true labels; obtain the boundary regions of the original grid and sub-grids in the deep learning model according to steps S21 and S22, and calculate the contrastive learning loss function according to step S23; add the contrastive learning loss and the cross-entropy loss as the final loss function, and then backpropagate to update the model parameters; periodically input test set data and calculate the overall intersection-union ratio, boundary region intersection-union ratio, and B-IoU as evaluation metrics for the model.
[0022] Preferably, the method for constructing positive and negative samples in step S23 is as follows: assuming the edges in a certain boundary region on the grid... The corresponding feature vector is , tag as Its adjacent area is One of the edges The feature vector is , tag as So, with As anchor points, positive and negative samples are constructed for... Each adjacent edge ,like and If they are the same, then and Positive sample pairs are formed; conversely, negative sample pairs are formed. This is the set of the original mesh or sub-mesh boundary edge regions obtained in step S21.
[0023] Preferably, the specific calculation formula for the contrastive learning loss function in step S23 is as follows:
[0024]
[0025] in, This refers to the set of original mesh or sub-mesh boundary edge regions obtained in step S21. This represents the temperature parameter in comparative learning. This indicates calculating the distance between two vectors. Indicated by The set of positive samples constructed for the anchor points. express The adjacent area, The feature vector of the edge is represented by the formula. The formula compares the boundary elements of the 3D mesh. For positive sample pairs with the same label, the smaller the distance between the feature vectors, the smaller the loss function. Negative samples are relatively suppressed, thereby guiding the model to bring the positive samples closer together and distance the negative samples away.
[0026] Preferably, the The specific formula for calculating the function is:
[0027]
[0028] That is, the distance between two vectors is calculated using L2 distance.
[0029] Preferably, in step S24, the final loss function of the model is obtained by adding the contrastive learning loss and the cross-entropy loss, specifically as follows:
[0030]
[0031] in, This represents a common cross-entropy loss function. For from the first The contrastive learning loss is calculated from subgrids of each resolution. Represents the original mesh. It is a weighting factor that controls the contrastive learning loss.
[0032] An electronic device includes: a memory for storing computer-executable instructions; and a processor for executing the computer-executable instructions to implement the 3D mesh segmentation method based on boundary awareness and contrastive learning.
[0033] Compared with existing technologies, the beneficial effects of this invention are as follows: The 3D mesh segmentation method based on boundary awareness and contrastive learning designed in this invention provides a solution to improve the accuracy of boundary region segmentation for 3D meshes. This method innovatively combines mesh topological characteristics to construct a boundary-oriented feature awareness mechanism, achieves sub-mesh-level boundary awareness by combining different mesh pooling methods, and guides the deep learning model to pay more attention to the boundary regions of the mesh segmentation through contrastive learning, thereby improving the model's segmentation quality of boundary regions. This method can more accurately segment the boundary regions of 3D meshes, significantly reducing the required manpower and time costs. Attached Figure Description
[0034] Figure 1 This is a flowchart of the steps of the present invention;
[0035] Figure 2 This is a schematic diagram of the deep learning model of the present invention;
[0036] Figure 3 This is a comparison chart of the segmentation results of the Cooperative Segmentation (COSEG) dataset in this invention. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.
[0038] Example 1
[0039] The core technology of this invention is to generate relatively accurate semantic segmentation regions based on 3D meshes, and it can support the processing of non-manifold or non-watertight 3D meshes. The 3D mesh segmentation method based on multi-scale information fusion in the spatial and spectral domains of this invention is mainly divided into the following... Figure 1 The three steps shown are: data acquisition, boundary determination and training a deep learning network using a contrastive learning method, and using the model for segmentation.
[0040] S1, Data Acquisition: The constructed 3D mesh is segmented and labeled. Each segmented region is categorized with a separate integer label. Each edge of the 3D mesh is also labeled with a category. The dataset consists of several labeled 3D meshes, and the entire dataset is divided into a training set and a test set. In this embodiment, the publicly available dataset COSEG is used, which has already been labeled and divided into training and test sets according to the above method.
[0041] S2, determine the boundary and train the deep learning network using a contrastive learning method to construct the deep learning model. Input the 3D mesh training data from step S1 into the model, determine the boundary region, perform contrastive learning on the boundary region, calculate the loss function, perform backpropagation, and supervise iterative training until the loss function converges. In this embodiment, the deep learning model uses the publicly available model MeshCNN, to which the method described in this invention is applied, with the structure as follows: Figure 2 As shown.
[0042] S21, Original Mesh Boundary Awareness: This function performs boundary awareness on the original 3D mesh of the input model, determining its boundary regions. For any edge in the mesh... Let the actual label obtained in step S1 be... Define the edges that share common points with it. For its adjacent edges, The real label is .set up The set of all adjacent edges is Therefore, the boundary region can be determined according to the following formula:
[0043]
[0044] in, This represents the set of boundary edge regions in the actual labels of the mesh.
[0045] The core logic of this judgment formula is to identify boundaries based on the label differences of grid edges. Utilizing the local topological relationships of the 3D grid, it accurately locates the boundary edges by determining whether the labels of a single edge differ from those of its adjacent edges. This method can quickly and efficiently traverse the entire original 3D grid, identifying all boundary edges at the intersection of different semantic segmentation regions without omission. This lays the foundation for subsequent feature learning for boundary regions. Furthermore, the judgment process relies solely on the labels and adjacency relationships of grid edges, resulting in low computational complexity and allowing for rapid integration into the preprocessing stage of model training.
[0046] S22, Sub-mesh Boundary Awareness: Based on the topological relationship of the mesh, it performs boundary awareness on sub-mesh of different resolutions generated by pooling the original mesh during model training, and determines the boundary region of the sub-mesh.
[0047] The edge labels in the original mesh are manually annotated, while the sub-mesh has no labels. Therefore, it's necessary to first infer the labels of each edge in the sub-mesh. Let's consider a set of edges in the parent mesh. During the pooling process, an edge in the sub-mesh is obtained through aggregation. ,So The true label can be inferred using the following formula:
[0048]
[0049] in, Represents subgrid edges speculative tags, The label representing the parent grid. express Any edge in the grid. That is, a subgrid edge. The speculative tags, by The set of parent mesh edges before topology aggregation The average value of each edge label is calculated. Here, the grid labels... , Both refer to soft labels, which are vector-based and contain the possibilities for each category.
[0050] Using the method described above, the labels of each sub-mesh can be sequentially inferred from the labels of the original mesh. Subsequently, for the sub-mesh whose labels have been obtained, the boundary edge regions of the sub-mesh can be inferred according to the method in S21.
[0051] During model training, pooling operations generate sub-grids at different resolutions to extract multi-scale grid features and improve the model's ability to learn global and local grid features. However, these sub-grids lack manual labels, making direct boundary awareness impossible. This step proposes a sub-grid label inference method based on the topological aggregation relationship of the pooling process. This method transfers the label information of the parent grid to the sub-grids and calculates the soft labels of the sub-grid edges by calculating the mean of the parent grid's edge labels. This preserves the category probability distribution characteristics of the labels while ensuring the consistency and continuity of label information across grids of different resolutions. After obtaining the sub-grid labels, the boundary determination method of the original grid is reused to achieve boundary awareness across all grid scales. This allows the model to focus on boundary regions during multi-scale feature learning, further improving the accuracy of boundary segmentation.
[0052] S23, Contrastive learning: After obtaining the boundary regions of the original mesh and each sub-mesh based on S21 and S22, the feature vectors of the boundary edges contained in the boundary regions are extracted. For each edge in the boundary region... ,by Positive and negative samples are constructed as anchor points. Comparative learning is performed on the positive and negative samples, and the comparative learning loss function is calculated to guide the model to narrow the distance between positive samples and distance the negative samples.
[0053] The specific method for constructing positive and negative samples is as follows: assume that the edges in a certain boundary region on the grid... The corresponding feature vector is , tag as Its adjacent area is One of the edges The feature vector is , tag as So, with As anchor points, positive and negative samples are constructed for... Each adjacent edge ,like and If they are the same, then and Positive sample pairs are formed; conversely, negative sample pairs are formed. This is the set of the original mesh or sub-mesh boundary edge regions obtained in step S21.
[0054] The specific formula for calculating the contrastive learning loss function is as follows:
[0055]
[0056] in, This refers to the set of original mesh or sub-mesh boundary edge regions obtained in step S21. This represents the temperature parameter in comparative learning. This indicates calculating the distance between two vectors. Indicated by The set of positive samples constructed for the anchor points. express The adjacent area, This represents the feature vector of an edge. The formula compares the boundary elements of a 3D mesh. For positive sample pairs with the same label, the smaller the distance between the feature vectors, the smaller the loss function. Negative samples are relatively suppressed, thus guiding the model to bring positive samples closer together and distance negative samples away.
[0057] Specifically, the The specific formula for calculating the function is:
[0058]
[0059] That is, the distance between two vectors is calculated using L2 distance.
[0060] This step designs a dedicated contrastive learning strategy for the boundary regions of 3D meshes. The core of this strategy is to construct positive and negative sample pairs to allow the model to learn the discriminative features of boundary edges. First, samples are constructed only for the edges of the boundary regions, avoiding interference from features in non-boundary areas and allowing the model to focus its learning on the more challenging boundary regions. The construction of positive and negative samples is based on the adjacent regions and label information of the boundary edges, ensuring local correlation and class differences between sample pairs, consistent with the topological characteristics of 3D meshes. A temperature parameter τ is introduced into the contrastive learning loss function to adjust the discriminative degree of sample similarity, while the L2 distance calculation method accurately quantifies the Euclidean distance between feature vectors, reflecting feature similarity. Through this contrastive learning process, the model can learn the commonalities of features among boundary edges of the same class and the differences in features among boundary edges of different classes, making the feature representation of the boundary regions more discriminative and solving the problems of semantic ambiguity and weak feature discriminability in traditional methods.
[0061] S24, Model Training: The training set from step S1 is used as training data; the training data is input into the deep learning model to obtain the model's output; the cross-entropy loss is calculated by comparing the model output with the true labels; the boundary regions of the original mesh and sub-mesh are obtained in the deep learning model according to steps S21 and S22, and the contrastive learning loss function is calculated according to step S23; the contrastive learning loss and the cross-entropy loss are added together as the final loss function, and backpropagation is used to update the model parameters; test set data is input periodically, and the overall intersection-union ratio, boundary region intersection-union ratio, and B-IoU are calculated as evaluation metrics for the model. Specifically, the final loss function of the model is obtained by adding the contrastive learning loss and the cross-entropy loss, as follows:
[0062]
[0063] in, This represents a common cross-entropy loss function. For from the first The contrastive learning loss is calculated from subgrids of each resolution. Representing the original mesh, in this example, the MeshCNN model will generate four sub-meshes with different resolutions, therefore The value is 4. These are weighting factors that control the contrastive learning loss, set in the embodiment. .
[0064] This step employs a multi-loss fusion training strategy, combining cross-entropy loss with multi-scale contrastive learning loss to achieve synergistic optimization of the model's global segmentation performance and boundary segmentation performance. Cross-entropy loss is a classic loss function in semantic segmentation tasks, guiding the model to learn the category semantic features of the entire 3D mesh and ensuring the overall segmentation accuracy. Multi-scale contrastive learning loss, on the other hand, specifically targets the boundary regions of the original mesh and sub-mesh at various resolutions, compensating for the shortcomings of cross-entropy loss in boundary region learning. The weight factor ω balances the contributions of the two losses; in this embodiment, it is set to 0.1, allowing the model to focus on feature learning in boundary regions while preventing the contrastive learning loss from excessively dominating model training, which could lead to a decline in segmentation performance in non-boundary regions. During training, by periodically inputting test set data and calculating multi-dimensional evaluation metrics, the training effect of the model can be monitored in real time. This not only focuses on the overall segmentation capability of the model but also emphasizes tracking changes in boundary region segmentation performance, promptly determining whether the model has converged, and ensuring that the trained model possesses excellent performance in boundary segmentation.
[0065] S3, Model Segmentation: The trained model can take other 3D meshes as input and output the segmentation results. In this example, the test set from the COSEG dataset is used as input; these meshes were not used in the training, but the trained model can already achieve good segmentation results for them.
[0066] After model training, the actual segmentation application stage begins. This stage eliminates the need for loss calculations and parameter updates; the 3D mesh data to be segmented is simply input into the trained model. The model sequentially performs mesh feature extraction, multi-scale boundary awareness, and category prediction, ultimately outputting segmentation labels for each mesh region and edge, achieving semantic segmentation of the 3D mesh. The model trained in this invention demonstrates excellent segmentation performance on the Cooperative Segmentation (COSEG) test set, which was not used in the initial training. This proves the model's strong generalization ability, adaptability to different 3D mesh data, and eliminates the need to retrain the model for new mesh data. This effectively reduces time and computational costs in practical applications and can be directly applied to 3D mesh segmentation tasks in real-world scenarios such as medical analysis and computer-aided design.
[0067] Example 2
[0068] To demonstrate the improvement in boundary region segmentation quality brought about by this invention, the segmentation performance of the model before and after incorporating the method of this invention was compared. The Cooperative Segmentation (COSEG) test set, including aliens, vases, and chairs, is one of the most widely used datasets for 3D mesh segmentation. These three categories were selected for the experiment, and the average values of various metrics were calculated, as shown in Table 1. Overall Accuracy Based on Surfaces (OACC), Overall Intersection over Union (IoU), Boundary Region Intersection over Union (BA-IoU), and Boundary Intersection over Union (B-IoU) were chosen as evaluation metrics.
[0069] Table 1
[0070] method Overall accuracy Overall intersection and union ratio Boundary region intersection ratio Boundary intersection ratio diffusion network 95.4% 92.3% 65.2% 54.9% Grid CNN 94.2% 90.0% 65.3% 54.5% Grid CNN + This Invention 95.4% 92.3% 69.4% 60.7%
[0071] The experimental results show that after incorporating this invention, the original MeshCNN's OACC improved by 1.2%, Overall-IoU by 2.3%, BA-IoU by 4.1%, and B-IoU by 6.2%, thereby improving the accuracy of segmenting boundary regions and surpassing the performance of existing models.
[0072] The comparison of experimental data shows that the method of this invention significantly improves the performance of boundary segmentation compared to the overall segmentation performance. Specifically, B-IoU, the core boundary segmentation evaluation metric, shows an improvement of 6.2%, fully demonstrating that the boundary awareness and contrastive learning mechanism proposed in this invention can accurately address the pain points of traditional models in boundary region segmentation. Simultaneously, the overall segmentation performance (OACC, Overall-IoU) of the model is also improved, reaching the level of existing excellent models like DiffusionNet. This indicates that this invention optimizes boundary segmentation without sacrificing the model's overall segmentation capability, achieving a dual improvement in both boundary and overall segmentation. Experiments were conducted using three types of mesh data—aliens, vases, and chairs—with different topological and geometric features, ensuring the representativeness and reliability of the results. This demonstrates that the method of this invention has good adaptability and optimization effects on different types of 3D mesh data.
[0073] Figure 3 This paper demonstrates the improved segmentation performance compared to the original MeshCNN by incorporating the present invention. With the method of this invention, the model's predictions at segmentation boundaries are more consistent with the ground truth, while no significant degradation in performance within the segmented regions is observed. For boundary regions, the method of this invention can more accurately locate the segmentation boundaries, making the predicted boundaries closer to the ground truth.
[0074] The visual comparison more intuitively demonstrates the optimization effect of this invention. The original MeshCNN model is prone to segmentation blurring and boundary offset at the intersection of 3D mesh boundaries. However, the model incorporating the method of this invention can accurately locate the segmentation boundary, ensuring that the predicted boundary line coincides with the ground truth baseline, resulting in a superior visual effect. Simultaneously, the prediction results within the segmented region do not show significant degradation, indicating that the feature learning strategy of this invention only optimizes the boundary region and does not negatively impact the model's existing internal region segmentation capabilities, thus guaranteeing the overall quality of the model's segmentation results. The improvement in visual effect and the enhancement in quantitative indicators mutually reinforce each other, fully demonstrating the effectiveness and practicality of this invention's method in improving the quality of 3D mesh boundary segmentation.
[0075] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A 3D mesh segmentation method based on boundary awareness and contrastive learning, characterized in that, Includes the following steps: S1, Data Acquisition: The constructed 3D mesh is segmented and labeled. Each segmented region is labeled with a separate integer label. Each edge of the 3D mesh is labeled with a label category. The dataset consists of several labeled 3D meshes and the entire dataset is divided into training set and test set. S2, determine the boundary and train the deep learning network using a contrastive learning method to construct the deep learning model. Input the 3D mesh training data from step S1 into the model, determine the boundary region, perform contrastive learning on the boundary region, calculate the loss function, perform backpropagation, and supervise iterative training until the loss function converges; specifically including: Perform boundary awareness on the original 3D mesh of the input model to determine its boundary regions; Based on the topological relationship of the grid, boundary awareness is performed on sub-grids of different resolutions generated by pooling the original grid during model training to determine the boundary regions of the sub-grids. Based on the original mesh and the boundary regions of each sub-mesh, the feature vectors of the boundary edges contained in the boundary regions are extracted. Perform model training; S3, Model Segmentation, obtains the trained model, inputs other 3D meshes into the model, and finally outputs the mesh segmentation result.
2. The 3D mesh segmentation method based on boundary awareness and contrastive learning according to claim 1, characterized in that, Step S2 includes: S21, Original Mesh Boundary Awareness: This function performs boundary awareness on the original 3D mesh of the input model, determining its boundary regions. For any edge in the mesh... Let the actual label obtained in step S1 be... Define the edges that have common points with it. For its adjacent edges, The real label is ,set up The set of all adjacent edges is Therefore, the boundary region can be determined according to the following formula: in, This represents the set of boundary edge regions in the actual labels of the mesh.
3. The 3D mesh segmentation method based on boundary awareness and contrastive learning according to claim 2, characterized in that, Step S2 includes: S22, Sub-mesh Boundary Awareness: Based on the topological relationships of the mesh, it performs boundary awareness on sub-meshes of different resolutions generated by pooling the original mesh during model training, and identifies the boundary regions of the sub-meshes. The edge labels in the original mesh are manually annotated, while the sub-mesh has no labels. Therefore, it is necessary to first infer the labels of each edge in the sub-mesh, assuming a set of edges in the parent mesh. During the pooling process, an edge in the sub-mesh is obtained through aggregation. ,So The true label can be inferred using the following formula: in, Represents subgrid edges speculative tags, The label representing the parent grid. express Any edge in the grid, i.e., a subgrid edge. The speculative tags, by The set of parent mesh edges before topology aggregation The grid labels are obtained by calculating the average value of each edge label. , Both refer to soft labels, which are vector-based and contain the possibilities for each category.
4. The 3D mesh segmentation method based on boundary awareness and contrastive learning according to claim 3, characterized in that, Step S2 includes: S23, Contrastive learning: After obtaining the boundary regions of the original mesh and each sub-mesh based on S21 and S22, the feature vectors of the boundary edges contained in the boundary regions are extracted. For each edge in the boundary region... ,by As anchor points, positive and negative samples are constructed, and comparative learning is performed on the positive and negative samples. The comparative learning loss function is calculated to guide the model to narrow the distance between positive samples and distance the negative samples.
5. The 3D mesh segmentation method based on boundary awareness and contrastive learning according to claim 4, characterized in that, Step S2 includes: S24, Model Training: Use the training set from step S1 as training data; input the training data into the deep learning model to obtain the model's output; calculate the cross-entropy loss by comparing the model output with the true labels; obtain the boundary regions of the original grid and sub-grids in the deep learning model according to steps S21 and S22, and calculate the contrastive learning loss function according to step S23; add the contrastive learning loss and the cross-entropy loss as the final loss function, and then backpropagate to update the model parameters; periodically input test set data and calculate the overall intersection-union ratio, boundary region intersection-union ratio, and B-IoU as evaluation metrics for the model.
6. The 3D mesh segmentation method based on boundary awareness and contrastive learning according to claim 5, characterized in that, The method for constructing positive and negative samples in step S23 is as follows: assuming that the edges in a certain boundary region on the grid... The corresponding feature vector is , tag as Its adjacent area is One of the edges The feature vector is , tag as So, with As anchor points, positive and negative samples are constructed for... Each adjacent edge ,like and If they are the same, then and Positive sample pairs are formed; conversely, negative sample pairs are formed. This is the set of the original mesh or sub-mesh boundary edge regions obtained in step S21.
7. The 3D mesh segmentation method based on boundary awareness and contrastive learning according to claim 6, characterized in that, The specific calculation formula for the contrastive learning loss function in step S23 is as follows: in, This refers to the set of original mesh or sub-mesh boundary edge regions obtained in step S21. This represents the temperature parameter in comparative learning. This indicates calculating the distance between two vectors. Indicated by The set of positive samples constructed for the anchor points. express The adjacent area, The feature vector of the edge is represented by the formula. The formula compares the boundary elements of the 3D mesh. For positive sample pairs with the same label, the smaller the distance between the feature vectors, the smaller the loss function. Negative samples are relatively suppressed, thereby guiding the model to bring the positive samples closer together and distance the negative samples away.
8. The 3D mesh segmentation method based on boundary awareness and contrastive learning according to claim 7, characterized in that, The The specific formula for calculating the function is: That is, the distance between two vectors is calculated using L2 distance.
9. The 3D mesh segmentation method based on boundary awareness and contrastive learning according to claim 8, characterized in that, In step S24, the final loss function of the model is obtained by adding the contrastive learning loss and the cross-entropy loss, specifically as follows: in, This represents a common cross-entropy loss function. For from the first The contrastive learning loss is calculated from subgrids of each resolution. Represents the original mesh. It is a weighting factor that controls the contrastive learning loss.
10. An electronic device, characterized in that, include: Memory is used to store executable instructions for a computer; A processor for executing the computer-executable instructions to implement the three-dimensional mesh segmentation method based on boundary awareness and contrastive learning as described in any one of claims 1 to 9.