Industrial scattered part instance segmentation method based on improved DGCNN network
Through the improved DGCNN network and 3D vision system, combined with statistical methods and CAD model processing, the accuracy and speed problems of 3D instance segmentation under scattered accumulation of industrial parts are solved, efficient industrial part segmentation and data set generation are achieved, significantly improving Computational efficiency and model training effect.
Patent Information
- Application Number
- CN202410853314.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-06-28
AI Technical Summary
It is difficult for the existing technology to efficiently and accurately complete the task of segmenting three-dimensional industrial scene instances when industrial parts are scattered and partially obscured. Especially in disordered robot sorting scenarios, traditional two-dimensional image technology cannot meet the needs of the parts grabbing process. Precise location required.
The improved DGCNN network is used, combined with a three-dimensional vision system and statistical methods, to achieve instance segmentation of industrial scattered parts through outlier elimination, virtual data set generation, CAD model processing and feature extraction. Specific steps include point cloud data collection, data preprocessing, feature extraction and instance segmentation, using multi-layer feature connections and EdgeConv operations to enhance the network's processing capabilities for point cloud data.
It improves the accuracy and speed of 3D industrial scene instance segmentation, reduces the need for manual annotation, generates high-quality data sets, reduces computational complexity and processing time, and significantly improves the training effect and computational efficiency of the model.
Smart Images

Figure CN118747801A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and industrial robots, and in particular to an industrial scattered parts instance segmentation method based on an improved DGCNN network. Background Art
[0002] In the scenario of robot disorderly sorting, many objects of the same category are stacked together, and traditional two-dimensional image technology cannot meet the requirements of the precise position of parts in the robot's grasping process. Three-dimensional vision sensors have gradually become the focus of research, and their applications have also been expanded in the fields of intelligent driving and smart homes. At present, research on three-dimensional instance segmentation tasks is still in its infancy. Different methods include feature clustering-based and bounding box-based deep learning methods, but they all face the challenge of improving accuracy and speed.
[0003] How to make full use of the 3D point cloud scene information obtained by the 3D vision system to robustly complete the 3D industrial scene instance segmentation task in real time when industrial parts are scattered and partially occluded is a technical problem that needs to be solved urgently in this field. Summary of the invention
[0004] To solve at least some of the above problems, the present invention provides an industrial scattered parts instance segmentation method based on an improved DGCNN network. To achieve the above objectives, the following technical solutions are provided:
[0005] An industrial scattered parts instance segmentation method based on an improved DGCNN network includes the following steps:
[0006] Step 1: Collect M point cloud images of real industrial scenes with a number of parts ranging from 0 to N based on a 3D vision system;
[0007] Step 2: Use an outlier elimination algorithm based on statistical methods to eliminate the more common outliers in the real point cloud image and use them as training sets and test sets respectively;
[0008] Step 3: Use the improved virtual dataset production algorithm to generate a large amount of point cloud data that meets the requirements of instance segmentation network training;
[0009] Step 4: Import the CAD model of the corresponding parts, generate the collision model according to the V-HACD algorithm, and generate the urdf file and uniform sampling point cloud file corresponding to the model;
[0010] Step 5: Set the data set generation parameters: the maximum number of parts per cycle N, the data collection period K, the maximum size of the part, and the box size;
[0011] Step 6: Start Pybullet drop items, create a pybullet virtual scene with a box, drop N parts in sequence, record the part pose, RGB image, depth image, clear the scene, and then repeat N+1 times until the maximum limit is reached;
[0012] Step 7: Use Open3D to reconstruct the complete scene based on the .ply point cloud file generated in step 2 and the pose in step 4. Add the model point cloud size transformation function to adjust the input point cloud to the actual size of the workpiece to meet the actual grasping requirements;
[0013] Step 8: Calculate the center score based on the object model of each point and generate a center score and segmentation index;
[0014] Step 9: Filter and reconstruct the scene point cloud data in step 5 according to the camera focal length, and save the filtered data into a .H5 file;
[0015] Step 10: After voxel downsampling and random sampling of the dataset produced in steps 3-9, the original 3D point cloud in the dataset is transformed into a new coordinate system and input into the improved DGCNN feature extractor to extract point-by-point features;
[0016] Step 11: The point features extracted in step 10 are respectively sent to the embedding feature branch and the center score branch to generate an embedding feature of size N×128 and a predicted center score of size N×1;
[0017] Step 12: Perform non-maximum suppression on points with center scores to obtain the center of each instance, and then generate a predicted instance based on the distance from the feature to the center point to obtain the classification result.
[0018] Preferably, the specific process of removing outliers based on statistical methods in step 2 is as follows:
[0019] Step 2.1: Set the number of points k to be calculated in the neighborhood and the standard deviation weighting coefficient β representing the threshold;
[0020] Step 2.2: For point p with sequence number i in the point cloud i , calculate the average distance to the nearest k points, recorded as d i ;
[0021] Step 2.3: Count the average distance of all points and calculate the mean and standard deviation of the distribution of d, denoted as μ and ε respectively;
[0022] Step 2.4: Calculate the filter distance threshold ds = μ + β·ε;
[0023] Step 2.5: The points pi whose average distance di is greater than the filter distance threshold ds are considered as outliers and removed.
[0024] Preferably, the specific steps of the improved virtual data set preparation algorithm for generating a large amount of point cloud data that meets the training requirements of the instance segmentation model in step 3-9 are as follows:
[0025] Since the point cloud feature extraction algorithm DGCNN used in this paper is insensitive to the density of point clouds, the density of workpiece point clouds in actual industrial scenes and simulated industrial scenes varies greatly and the point cloud density is uneven. Therefore, by adding a collision function in step a and uniformly sampling the model, the network can be trained in a wider density range, thereby improving its adaptability to point clouds of different densities.
[0026] Step a: Import the CAD model of the workpiece, first calculate the vertex normals of the model, uniformly sample from the model, generate the model.ply file of the model, then use the V-HACD (Volumetric Hierarchical Approximate ConvexDecomposition) algorithm to generate collisions, set the parameter alpha that controls the accuracy of the model, and a smaller alpha value will result in leaf nodes being retained. Set the resolution parameter that determines the level of detail of the generated collision mesh, so as to generate a more accurate collision model; finally, write the basic information, inertia, vision, collision and other properties of the workpiece into the urdf file;
[0027] Step b: Set the simulation environment such as physical engine parameters, ground model, box size, object drop range, set the number of cycles M, place the box in each cycle, randomly place 0-N objects every 0.25 seconds, and use a virtual camera to capture the view image of the object in each cycle, including RGB image, depth image (depth) and segmentation image (segmentation). Save the generated image to the specified folder, and save the object pose information (xyz coordinates and quaternion) and pose matrix (4x4 matrix) to a text file;
[0028] Step c: Read the pose information in step b, generate the point cloud model instance into the scene through matrix transformation, and process the generated scene with labels (instance labels and center scores). Save the point cloud (xyz) and labels of each instance into the corresponding scene file. The file format is that each line represents a point, including coordinates (x, y, z), instance labels and center scores;
[0029] Step d: First, define a scene cropping function (scene_crop) to crop the scene point cloud in step c so that it is within the camera field of view; define a point cloud normalization function (samples_normalize d) to normalize the sampled point cloud data and map the data to the range of [0,1]; then define a save_h5 function to save the normalized point cloud data as an H5 file, which contains the coordinates, center score and label information of the point cloud; finally, loop through each cycle and each object, read the original point cloud data, perform cropping, sampling, and normalization, and save the cropped point cloud file (scene_cropped) and H5 file;
[0030] Step e: First, perform voxel downsampling and label processing on the N real industrial scene point cloud images collected in step 1 through step c, save the real industrial scene point cloud (xyz), label and center score into the scene (scene_cam) file, and then perform cropping, sampling and normalization on the scene (scene_cam) through step d to obtain the cropped point cloud file and the H5 file for training.
[0031] Preferably, in step 10, the 3D point cloud in the data set is subjected to mixed sampling of voxel downsampling and random sampling, and the sampled point cloud is sent to the feature extraction network after coordinate system conversion. The specific steps are as follows:
[0032] Step 10.1: Perform voxel downsampling on the point cloud data with a voxel size of 0.005, and then define a random sampling function to randomly sample the point cloud data after voxel downsampling.
[0033] Step 10.2: The specific process of 3D point cloud coordinate system conversion is as follows:
[0034] First, the original 3D point cloud (N×3) coordinates p i =(x i ,y i ,z i ),i=1,2,...,N is converted to the new coordinate system by the following formula:
[0035]
[0036] Each point in the converted point cloud (N×6) is The six-dimensional vector (6D) and the normalized position n of the entire scene x ,n y ,n z , the converted point cloud (N×6) is fed into the feature extraction network.
[0037] Step 10.3: The specific process of extracting point-by-point features using the improved DGCNN algorithm in step 10 is as follows:
[0038] When extracting features from point clouds of workpieces in industrial scenes, the DGCNN network uses local geometric structures to construct local neighborhood graphs and applies edge convolution (EdgeConv) operations on the edges connecting adjacent point pairs to exploit local geometric structures.
[0039] (1) The present invention adopts the segmentation network of the DGCNN network and improves the network. Through multi-layer feature connection, the graph convolution of the current layer is used to learn new features from previous features. First, the point features after spatial transformation are input to EdgeConv1 and connected to the EdgeConv2 and EdgeConv3 modules to extract edge features. The output of net1 is input to EdgeConv2 to extract edge features to achieve multi-layer feature connection. Then, the feature B×1×1×1024 obtained after the fusion of net1, net2, and net3 is expanded to each point B×N×1×1024 after mlp{1024} and maximum pooling. The features of net1, net2, and net3 are spliced with the expanded features B×N×1×1024 along the feature channel to output B×N×1×1216 to complete global feature expansion and splicing. And remove the last two layers of the segmentation network.
[0040] (2) Spatial Transformation Module: The point cloud input is aligned to the canonical space by applying an estimated 3×3 matrix, which is estimated using a tensor that connects the coordinate differences between each point and its k neighboring points.
[0041] (3) EdgeConv is an innovative convolution operation designed to effectively extract local geometric features from point cloud data. Unlike traditional convolution operations that operate on a regular grid structure, EdgeConv builds a dynamic k-nearest neighbor (k-NN) graph at each layer, enabling it to capture complex local geometric relationships. This operation significantly enhances the ability of neural networks to process unstructured data such as point clouds by dynamically updating the adjacency graph at each layer based on the learned feature space.
[0042] Given an input point cloud feature X∈R N×F , vertex set:
[0043]
[0044] Where N is the number of points and F is the feature dimension.
[0045] Given a directed graph G = (υ, ξ) representing the local point cloud structure, the vertices and edges are υ = {1, 2, ..., n}, ζ∈υ×υ. With X as the vertex, constructF The k-nearest neighbor (k-nn) graph G in , and recompute the k-nn graph of the points in the graph of this layer at each layer.
[0046] d) EdgeConv operation
[0047] For each point i, its eigenvector is x i , the feature vector x of its neighbor point j , EdgeConv calculates the edge features between point i and its neighbor point j:
[0048] e ij =h θ (x i ,x j -x i )
[0049] =LeakyReLU(α n ·(x j -x i )+β n ·x i )
[0050] Among them, h θ It is a learnable function (usually a multilayer perceptron) that combines the features of the point itself and the differences in features relative to its neighbors. It explicitly combines the global shape structure captured by the coordinates of the point center xi with the local neighborhood information captured by xj-xi.
[0051] e) Feature aggregation operation
[0052] By adding the edge feature e between point i and its neighbor point j ij Perform aggregation (such as maximum pooling or average pooling) to obtain a new feature representation x' of the point i :
[0053] x′ i =max j∈Ν(i) e ij
[0054] Among them, N(i) is the set of k points closest to each point i, including j1,j2,...j n .
[0055] Preferably, in step 11, the point features extracted in step 10 are respectively sent to the embedding feature branch and the center score branch, the features of each point in the feature embedding space are encoded respectively, and the specific process of inferring the center score of each point is as follows:
[0056] Step 11.1: In the center score branch, the point direction features generated by the feature extractor in step 10 are activated by the sigmoid function after passing through two MLPs. Then, the predicted center score of size N×1 is obtained.
[0057] Step 11.2: In the embedding feature branch, the 256-dimensional features extracted in step 10 are processed by mlp to generate an embedding feature of size N × 128. The embedding feature branch introduces the feature distance matrix, effective distance matrix, and attention mechanism to train the instance segmentation model, and calculates the embedding feature loss and center score loss to supervise the training process.
[0058] (1) Feature distance matrix FDM
[0059] In the feature embedding space, points belonging to the same instance should be close, while points from different instances should be separated. In order to make the features of points in the same instance similar, the following feature distance matrix D is introduced F ∈R N×N .
[0060]
[0061] (2) Effective distance matrix VDM
[0062] Effective distance matrix D V ∈R N×N It is a binary matrix, each element in the matrix is 0 or 1. The effective distance matrix is used to determine whether two points within a certain Euclidean distance belong to the same instance. If the Euclidean distance between the two points exceeds the maximum distance d max twice, then the two points do not belong to the same instance.
[0063]
[0064] The above formula indicates whether the Euclidean distance between points is within a reasonable range.
[0065] (3) Attention Score Mechanism ASM
[0066] In the FPCC method, we introduce the attention score matrix to improve the effect of point cloud clustering and segmentation. Specifically, the score matrix S is constructed as the sum of the scores of each point pair, and its symmetry and reasonable value range are ensured through symmetry and clipping operations. Finally, the attention score matrix is used to adjust the similarity matrix loss so that more important point pairs have a greater weight in the loss calculation, thereby improving the accuracy of clustering and segmentation. The specific process is as follows:
[0067] Construct the score mask matrix: S represents the score matrix, the shape is [B, N, 1], where B is the batch size and N is the number of points, and expand it to the shape [B, N, N].
[0068] S i,j =s i +s j
[0069] S exp anded =Re peat(S i,j , dim=2, num=N)
[0070] where s i is the score of point i, s j is the score of point j.
[0071] Symmetrize the score mask matrix and clamp it between [0,1]:
[0072]
[0073] S i,j =min(max(S i,j ,0),1)
[0074] Apply score mask matrix: Apply score mask to similarity matrix loss
[0075] L simmat =L simmat ⊙S
[0076] where ⊙ represents element-wise multiplication.
[0077] Calculate the average loss: the average loss of the similarity matrix
[0078]
[0079] The above attention mechanism weights the similarities between feature points, allowing the model to pay more attention to important feature points, enhance the model's expressiveness, and improve overall performance.
[0080] (4) Center score
[0081] The center score reflects the distance between a point and its corresponding center, and points close to the center of the object have higher scores than points on the boundary. i The center score of is calculated as follows:
[0082]
[0083] Where β is a positive constant, c i are the geometric center coordinates of the instance.
[0084] (5) Embedded feature loss
[0085] In the instance segmentation scenario, a point pair (i, j) can only have two relationships: 1) belonging to the same instance; 2) belonging to different instances. In view of this, the embedding feature loss L is defined EF :
[0086]
[0087] Among them, ω (i,j) It is through D V and D A W∈R obtained by element-by-element multiplication N×N an element of .
[0088] ω (i,j) =d V(i,j) s A(i,j)
[0089] K (i,j) It is a loss based on point-to-point relationships and is defined as:
[0090]
[0091] Among them, ∈1 and ∈2 are constants and satisfy 0<∈1<∈2,
[0092] (6) Center score loss
[0093] Due to the robustness of the L1 loss function, smooth L1 loss is used as the center score branch loss function and L is defined as CS as follows:
[0094]
[0095] in, Represents the predicted center score
[0096]
[0097] Preferably, in step 12, non-maximum suppression is performed on the points with center scores to obtain the center of each instance, and then a prediction instance is generated according to the distance from the feature to the center point. The specific steps for obtaining the classification result are as follows:
[0098] Step 12.1: After predicting the center scores, we use the NMS algorithm to find the points of the geometric center of each object and use these points as reference points in the clustering process.
[0099] Perform non-maximum suppression (NMS) on all points with center scores to find the center of each instance. The center score is higher than θ th= 0.6 is considered as a candidate for the center point. The point with the highest center score is selected as the first candidate for the center point, and the points with a radius of γd around the candidate point are removed. max Other points on the sphere, where d max is the maximum distance from the geometric center to the farthest point of the object, and γ is the screening factor. This process is repeated until there are no more points left.
[0100] Step 12.2: Generate a prediction instance based on the distance from the feature to the center point. The specific steps to obtain the classification result are as follows:
[0101] After being processed by the non-maximum suppression (NMS) algorithm, the feature distance between the center point and other points is calculated:
[0102]
[0103] in, Represents the features of the kth center point selected in the NMS algorithm, Represents the feature of the i-th point among the remaining points. All points except the center point are clustered with the center point closest to the feature. Find point p in the feature embedding space i The nearest center point c k , calculate p in 3D space i and c k The Euclidean distance d(p i ,c k ), if d(p i ,c k ) is greater than d max , then pi is considered as noise and no instance label is assigned.
[0104] The beneficial effects of the present invention are:
[0105] 1. Provide high-quality datasets for instance segmentation model training and testing phases through preprocessing, data enhancement and other means.
[0106] 2. In view of the lack of actual workpiece data sets and the time-consuming manual labeling, the present invention proposes a method for automatically generating workpiece instance segmentation data sets without manual labeling, which can automatically generate various workpieces according to CAD models and save a lot of manpower.
[0107] 3. The present invention proposes to perform mixed sampling of voxel downsampling and random sampling before the point cloud data is fed into the model, which effectively reduces the density of the point cloud, reduces the amount of data, accelerates the subsequent processing speed, and improves the stability and accuracy of the processing.
[0108] 4. The present invention uses the FPCC-Net instance segmentation network as a basis, and improves the shape characteristics of the research object DB9 from multiple aspects. First, DB9 contains a large number of vertices and faces, and the model will have unreasonable jitter, jump or jamming in the simulation. A collision model is added to generate a simplified and accurate convex hull model to ensure that the generated data set accurately reflects the physical properties of the object, thereby improving the quality of the data set and the training effect of the model; then the present invention can learn new features from previous features through multi-layer feature links; by improving the DGCNN network layer structure, the complexity of the model is reduced and the computational efficiency is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0109] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0110] Figure 1 A flowchart of an industrial scattered parts instance segmentation method based on an improved DGCNN network of the present invention;
[0111] Figure 2 This is a comparison of point clouds before and after preprocessing, where: Figure 2 (a) is a point cloud image of a real industrial scene taken by an industrial camera. Figure 2 (b) is the point cloud after outliers are removed based on statistical strategy;
[0112] Figure 3 is the instance segmentation network structure diagram, where Figure 3 (a) Improve the DGCNN segmentation network structure, Figure 3 (b) is the structure diagram of the FPCC-Net instance segmentation network based on the improved DGCNN feature extractor;
[0113] Figure 4 Visualize the instance segmentation results, including real scene RGB image, 3D point cloud image, center score point cloud image, and segmentation result point cloud image;
[0114] Figure 5 To compare the results of different algorithms on different data sets, the segmentation results of 4 algorithms on DB9 and round hole iron sheets are included. DETAILED DESCRIPTION
[0115] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0116] The scene point cloud of scattered parts described in the present invention is obtained by scanning the working environment with the LED structured light three-dimensional sensor Gocator3110, and contains the three-dimensional coordinate information of the points of the scene point cloud of industrial scattered parts. As an application example, the present invention gives the test results of a self-made data set with the instance segmentation target as the DB9 serial connection port. The data set contains 8,000 scattered parts scenes, including 500 real industrial scene point cloud images, 400 of which are used as training sets and 100 as verification sets; 7,500 synthetic industrial scene point cloud images, 5,000 of which are used as training sets and 2,500 as verification sets. Each scene point cloud image in the training set contains 1-30 parts, and each scene point cloud image in the test set contains 10-30 parts.
[0117] like Figure 1 As shown, it is a flow chart of an industrial scattered parts instance segmentation method based on an improved DGCNN network of the present invention, comprising the following steps:
[0118] Step 1: Collect M point cloud images of real industrial scenes with a number of parts ranging from 0 to N based on a 3D vision system;
[0119] Step 2: Use an outlier elimination algorithm based on statistical methods to eliminate the more common outliers in the real point cloud image and use them as training sets and test sets respectively;
[0120] The specific steps of the elimination method are as follows:
[0121] 2.1: Set the number of points to be calculated in the knn neighborhood search method k = 20, and the standard deviation weighting coefficient of the threshold β = 0.1;
[0122] 2.2: For the i-th point p i The average distance d to the k nearest points i ;
[0123] 2.3: Count the average distance p of all points i , calculate the mean and standard deviation of the distribution of d, denoted as μ and ε respectively;
[0124] 2.4 Calculate the filter threshold distance d s =μ+β·ε;
[0125] 2.5 The average distance d i Greater than the filter distance threshold d s The points are considered as outliers and removed;
[0126] Step 3: Use the improved virtual dataset production algorithm to generate a large amount of point cloud data that meets the requirements of instance segmentation network training;
[0127] Step 4: Import the CAD model of the corresponding parts, generate the collision model according to the V-HACD algorithm, and generate the urdf file and uniform sampling point cloud file corresponding to the model;
[0128] Step 5: Set the data set generation parameters: the maximum number of parts per cycle N, the data collection period K, the maximum size of the part, and the box size;
[0129] Step 6: Start Pybullet drop items, create a pybullet virtual scene with a box, drop N parts in sequence, record the part pose, RGB image, depth image, clear the scene, and then repeat N+1 times until the maximum limit is reached;
[0130] Step 7: Use Open3D to reconstruct the complete scene based on the .ply point cloud file generated in step 2 and the pose in step 4. Add the model point cloud size transformation function to adjust the input point cloud to the actual size of the workpiece to meet the actual grasping requirements;
[0131] Step 8: Calculate the center score based on the object model of each point and generate a center score and segmentation index;
[0132] Step 9: Filter and reconstruct the scene point cloud data in step 5 according to the camera focal length, and save the filtered data into a .H5 file;
[0133] Furthermore, the specific steps of the improved virtual data set production algorithm for generating a large amount of point cloud data that meets the training requirements of the instance segmentation model in step 3-9 are as follows:
[0134] Since the point cloud feature extraction algorithm DGCNN used in the present invention is insensitive to the point cloud density, the density of the workpiece point cloud map in actual industrial scenes and simulated industrial scenes varies greatly and the point cloud density is uneven. Therefore, by adding a collision function in step a and uniformly sampling the model, the network can be trained in a wider density range, thereby improving its adaptability to point clouds of different densities.
[0135] Step a: Import the CAD model of the workpiece, first calculate the vertex normals of the model, uniformly sample 100,000 points from the model, generate the model.ply file of the model, then use the V-HACD (Volumetric Hier archical Approximate Convex Decomposition) algorithm to generate collisions, set the parameter alpha that controls the accuracy of the model to 0.04, a smaller alpha value will cause leaf nodes to be retained, and set the resolution parameter that determines the level of detail of the generated collision mesh to 50,000, so as to generate a more accurate collision model; finally, write the basic information, inertia, vision, collision and other attributes of the workpiece into the urdf file;
[0136] Step b: Set the simulation environment such as physical engine parameters, ground model, box size, object drop range, set the number of cycles M, place the box in each cycle, randomly place 0-N objects every 0.25 seconds, and use a virtual camera to capture the view image of the object in each cycle, including RGB image, depth image (depth) and segmentation image (segmentation). Save the generated image to the specified folder, and save the object pose information (xyz coordinates and quaternion) and pose matrix (4x4 matrix) to a text file;
[0137] Step c: Read the pose information in step b, generate the point cloud model instance into the scene through matrix transformation, and process the generated scene with labels (instance labels and center scores). Save the point cloud (xyz) and labels of each instance into the corresponding scene file. The file format is that each line represents a point, including coordinates (x, y, z), instance labels and center scores;
[0138] Step d: First, define a scene cropping function (scene_crop) to crop the scene point cloud in step c so that it is within the camera field of view; define a point cloud normalization function (samples_normalize d) to normalize the sampled point cloud data and map the data to the range of [0,1]; then define a save_h5 function to save the normalized point cloud data as an H5 file, which contains the coordinates, center score and label information of the point cloud;
[0139] Step e: First, perform voxel downsampling, random sampling, and label processing on the N real industrial scene point cloud images collected in step 1 through step c, and save the real industrial scene point cloud (xyz), label, and center score into the scene (scene_cam) file. Then, perform cropping, sampling, and normalization on the scene (scene_cam) through step d to obtain the cropped point cloud file and the H5 file for training.
[0140] Furthermore, in step 10, the 3D point cloud in the data set is subjected to mixed sampling of voxel downsampling and random sampling, and the sampled point cloud is sent to the feature extraction network after coordinate system conversion. The specific steps are as follows:
[0141] Step 10.1: Perform voxel downsampling on the point cloud data with a voxel size of 0.005, and then define a random sampling function to randomly sample the point cloud data after voxel downsampling.
[0142] Step 10.2: The specific process of 3D point cloud coordinate system conversion is as follows:
[0143] First, the original 3D point cloud (N×3) coordinates p i =(x i ,y i ,z i ),i=1,2,...,N is converted to the new coordinate system by the following formula:
[0144]
[0145] Each point in the converted point cloud (N×6) is The six-dimensional vector (6D) and the normalized position n of the entire scene x ,n y ,n z , the converted point cloud (N×6) is fed into the feature extraction network.
[0146] Step 10.3: The specific process of extracting point-by-point features by the improved multi-layer feature fusion network in step 10 is as follows:
[0147] First, the features after coordinate transformation are added to the second and third edge convolution modules respectively, and the output features of net1 are added to the edge convolution outputs (local descriptors) of net2 and net3. Through multi-layer feature fusion, the graph convolution of the current layer is used to learn new features from previous features. Then, the fused features B×N×1×192 of net1, net2, and net3 are expanded to each point B×N×1×1024 after mlp{1024} and maximum pooling. The features of ner1, net2, and net3 are spliced with the expanded features B×N×1×1024 along the feature channel to output B×N×1×1216 to complete global feature expansion and splicing. And remove the last two layers of the segmentation network.
[0148] In step 11, the specific process of sending the point features extracted in step 8 to the embedding feature branch and the center score branch respectively is as follows:
[0149] First, the multi-layer feature fusion network proposed in the present invention is used to extract the point features of the points and send them into two branches. The features of each point in the feature embedding space are encoded respectively, and the center score of each point is inferred in the center score branch. In the embedded feature branch, the 256-dimensional features extracted in step 10 are processed by mlp to generate embedded features of size N×128. The embedded feature branch introduces the feature distance matrix, the effective distance matrix, and the attention mechanism to train the instance segmentation model, and calculates the embedded feature loss and the center score loss to supervise the training process. In the center score branch, the point direction features extracted in step 10 are activated by the sigmoid function after passing through two MLPs. Then, the predicted center score of size N×1 is obtained.
[0150] Step 12: Perform non-maximum suppression on points with center scores to obtain the center of each instance, and then generate a predicted instance based on the distance from the feature to the center point. The specific steps to obtain the classification result are as follows:
[0151] Use the NMS algorithm to find the geometric center of each object and use these points as reference points in the clustering process. The center score is higher than θ th = 0.6 is the candidate point. Select the point with the highest score as the first candidate point of the center point, and remove the candidate point with a radius of γd max Calculate the characteristic distance between the center point and other points:
[0152]
[0153] in, Represents the features of the kth center point selected in the NMS algorithm, Represents the feature of the i-th point among the remaining points. All points except the center point are clustered with the center point closest to the feature. Find point p in the feature embedding space i The nearest center point c k , calculate p in 3D space i and c k The Euclidean distance d(p i ,c k ), if d(p i ,c k ) is greater than d max , then pi is considered as noise and no instance label is assigned.
[0154] Experimental setup
[0155] The instance segmentation network in this paper is implemented in the Pytorch framework and trained using the Adam optimizer with an initial learning rate of 0.0001, a batch size of 2, and a momentum of 0.9. All training and testing are performed on an Nvidia GTX3060 GPU and an Intel Corei7-12700 with 16GB RAM. During the training phase, the d max They are 0.12, 0.08, and 0.08 respectively. The network is trained for 30 epochs.
[0156] Set multi-layer feature fusion, mixed sampling as improved points A and B, and FPCC-Net original network as BaseLine. The method combinations that need to be verified in the ablation experiment are as follows:
[0157] Table 1: Instance segmentation results of industrial objects
[0158]
[0159]
[0160] Table 1 shows the standard instance segmentation indicators of gear shaft, round hole iron sheet, and DB9, the metrics are precision (%) and recall (%), and the IoU threshold is 0.5. When using the improved DGCNN as the backbone network, FPCC-Net achieved the best results, which is competitive with the results of other networks. From the ablation experiment, it can be seen that in terms of accuracy indicators, the improved FPCC network after multi-layer feature fusion is better than the original FPCC network. On the gear shaft dataset used by the original algorithm, the improved network has an accuracy improvement of 9.99% over the original network.
[0161] Table 2 Comparison of calculation speed
[0162]
[0163] Table 2 reports the average computation time for each scene. The DB9 dataset contains 25 to 30 objects per scene, and the iron sheet dataset contains 55 to 60 objects per scene. As can be seen from the table, multi-layer feature fusion is the most computationally intensive improvement method. Mixed sampling can reduce inference time to a certain extent.
[0164] Figure 4 The results of instance segmentation and center score prediction of three types of industrial objects by the instance segmentation network of the present invention are shown. Points close to the center have higher scores than edge points. The instance segmentation network of the present invention can clearly distinguish different instances even when the workpiece is severely covered. For objects such as DB9, round hole iron sheet, gear shaft, etc., whose geometric centers are on the parts, our clustering algorithm is suitable for objects whose centers are on the parts, and the reference points used for clustering will not deviate from the center of the object. In real scenes, many objects of the same category are stacked together, and the 3D point cloud is used to represent the center of the object. Represented, and then input into the instance segmentation network of the present invention. The result of instance segmentation is shown in the last column.
[0165] Figure 5 The segmentation results of 3D-BoNet, PointGroup, FPCC and the instance segmentation network in the present invention are shown. The objects in each scene are the same, and different predicted instances are displayed in different colors. In the process of identifying and segmenting iron sheets and DB9 parts, 3D-BoNet has the worst effect among the four algorithms. When objects are stacked and overlapped, the same object is often identified as different objects. PointGroup performs poorly in iron sheet segmentation. Compared with the original FPCC network, the improved FPCC network has more accurate recognition and segmentation, and different instances obviously correspond to different colors.
[0166] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A method for instance segmentation of industrial scattered parts based on an improved DGCNN network, characterized in that: The method comprises the following steps: Step 1: Collect M point cloud images of real industrial scenes with a number of parts ranging from 0 to N based on a 3D vision system; Step 2: Use an outlier elimination algorithm based on statistical methods to eliminate the more common outliers in the real point cloud image and use them as training sets and test sets respectively; Step 3: Use the improved virtual dataset production algorithm to generate a large amount of point cloud data that meets the requirements of instance segmentation network training; Step 4: Import the CAD model of the corresponding parts, generate the collision model according to the V-HACD algorithm, and generate the urdf file and uniform sampling point cloud file corresponding to the model; Step 5: Set the data set generation parameters: the maximum number of parts per cycle N, the data collection period K, the maximum size of the part, and the box size; Step 6: Start Pybullet drop items, create a pybullet virtual scene with a box, drop N parts in sequence, record the part pose, RGB image, depth image, clear the scene, and then repeat N+1 times until the maximum limit is reached; Step 7: Use Open3D to reconstruct the complete scene based on the .ply point cloud file generated in step 2 and the pose in step 4; add the model point cloud size transformation function to adjust the input point cloud to the actual size of the workpiece to meet the actual grasping requirements; Step 8: Calculate the center score based on the object model of each point and generate a center score and segmentation index; Step 9: Filter and reconstruct the scene point cloud data in step 5 according to the camera focal length, and save the filtered data into a .H5 file; Step 10: After performing voxel downsampling and random sampling on the data set produced in steps 3-9, the original three-dimensional point cloud in the data set is transformed into a new coordinate system and input into an improved DGCNN feature extractor to extract point-by-point features; the improved DGCNN algorithm includes multi-layer feature fusion; Step 11: The point features extracted in step 10 are respectively sent to the embedding feature branch and the center score branch to generate an embedding feature of size N×128 and a predicted center score of size N×1; Step 12: Perform non-maximum suppression on points with center scores to obtain the center of each instance, and then generate a predicted instance based on the distance from the feature to the center point to obtain the classification result.
2. The method for industrial scattered parts instance segmentation based on three-dimensional vision according to claim 1 is characterized in that: The specific process of removing outliers based on statistical methods in step 2 is as follows: Step 2.1: Set the number of points k to be calculated in the neighborhood and the standard deviation weighting coefficient β representing the threshold; Step 2.2: For point p with sequence number i in the point cloud i , calculate the average distance to the nearest k points, recorded as d i ; Step 2.3: Count the average distance of all points and calculate the mean and standard deviation of the distribution of d, denoted as μ and ε respectively; Step 2.4: Calculate the filter distance threshold d s =μ+β·ε; Step 2.5: Set the average distance d i Greater than the filter distance threshold d s Point p i Considered as outliers and removed.
3. The method for industrial scattered parts instance segmentation based on three-dimensional vision according to claim 1 is characterized in that: By adding a collision function and uniformly sampling the model, the network can be trained in a wider density range, thereby improving its adaptability to point clouds of different densities.
4. The method for segmenting industrial scattered parts instances based on three-dimensional vision according to claim 1 is characterized in that: In step 10, the three-dimensional point cloud in the data set is subjected to mixed sampling of voxel downsampling and random sampling, and the sampled point cloud is sent to the feature extraction network after coordinate system conversion. The specific steps are as follows: Step 10.1: Perform voxel downsampling on the point cloud data with a voxel size of 0.005, and then define a random sampling function to randomly sample the point cloud data after voxel downsampling; Step 10.2: The specific process of 3D point cloud coordinate system conversion is as follows: First, the original 3D point cloud coordinates p i =(x i ,y i ,z i ),i=1,2,...,N is converted to the new coordinate system by the following formula: Each point in the converted point cloud is The six-dimensional vector and the normalized position n of the entire scene x ,n y ,n z ,The converted point cloud is fed into the feature extraction network; Step 10.3: The specific process of extracting point-by-point features using the improved DGCNN algorithm in step 10 is as follows: (1) The segmentation network of the DGCNN network is adopted and improved. Through multi-layer feature connection, the graph convolution of the current layer is used to learn new features from previous features. First, the point features after spatial transformation are input to EdgeConv1 and connected with EdgeConv2 and EdgeConv3 modules to extract edge features. The output of net1 is input to EdgeConv2 to extract edge features to achieve multi-layer feature connection. Then, the feature B×1×1×1024 obtained by fusion of net1, net2, and net3 after mlp{1024} and maximum pooling is expanded to each point B×N×1×1024. The features of net1, net2, and net3 are spliced with the expanded feature B×N×1×1024 along the feature channel to output B×N×1×1216 to complete global feature expansion and splicing. The last two layers of the segmentation network are removed. (2) Spatial Transformation Module: Aligns the point cloud input to the canonical space by applying an estimated 3×3 matrix, which is estimated using a tensor that connects the coordinate differences between each point and its k neighboring points; (3) EdgeConv convolution operation is designed to effectively extract local geometric features from point cloud data. Unlike traditional convolution operations that run on a regular grid structure, EdgeConv builds a dynamic k-nearest neighbor (k-NN) graph at each layer, enabling it to capture complex local geometric relationships. This operation significantly enhances the ability of neural networks to process unstructured data by dynamically updating the adjacency graph at each layer based on the learned feature space.
5. The method for segmenting industrial scattered parts instances based on three-dimensional vision according to claim 4 is characterized in that: The EdgeConv convolution operation is: a) Dynamic K-NN graph construction Given an input point cloud feature X∈R N×F , vertex set: Where N is the number of points and F is the feature dimension; Given a directed graph G = (υ, ξ) representing the local point cloud structure, the vertices and edges are υ = {1, 2, ..., n}, ζ∈υ×υ; construct a point cloud in R with X as the vertex F The k-nearest neighbor graph G in the layer and recalculate the k-nn graph of the points in the graph of the layer at each layer; b) EdgeConv Operation For each point i, its eigenvector is x i , the feature vector x of its neighbor point j , EdgeConv calculates the edge features between point i and its neighbor point j: e ij =h θ (x i ,x j -x i ) =LeakyReLU(α n ·(x j -x i )+β n ·x i ) Among them, h θ It is a learnable function (usually a multilayer perceptron) that combines the features of the point itself and the differences in features relative to its neighbors; it explicitly combines the global shape structure captured by the coordinates of the point center xi with the local neighborhood information captured by xj-xi; c) Feature aggregation operation By adding the edge feature e between point i and its neighbor point j ij Perform aggregation (such as maximum pooling or average pooling) to obtain a new feature representation x' of the point i : x′ i =max j∈Ν(i) e ij Among them, N(i) is the set of k points closest to each point i, including j1,j2,...j n .
6. The method for industrial scattered parts instance segmentation based on three-dimensional vision according to claim 1 is characterized in that: In step 11, the point features extracted in step 10 are sent to the embedding feature branch and the center score branch respectively, and the features of each point in the feature embedding space are encoded respectively, and the specific process of inferring the center score of each point is as follows: Step 11.1: In the center score branch, the point direction features generated by the feature extractor in step 10 are activated by the sigmoid function after passing through two MLPs; then, a predicted center score of size N×1 is obtained; Step 11.2: In the embedding feature branch, the 256-dimensional features extracted in step 10 are processed through mlp to generate an embedding feature of size N×128.
7. The method for segmenting industrial scattered parts instances based on three-dimensional vision according to claim 6 is characterized in that: The embedding feature branch introduces a feature distance matrix, an effective distance matrix, and an attention mechanism to train an instance segmentation model, and calculates the embedding feature loss and the center score loss to supervise the training process.
8. The method for segmenting industrial scattered parts instances based on three-dimensional vision according to claim 7 is characterized in that: Effective distance matrix D V ∈R N×N It is a binary matrix, each element in the matrix is 0 or 1. The effective distance matrix is used to determine whether two points within a certain Euclidean distance belong to the same instance. If the Euclidean distance between the two points exceeds the maximum distance d max twice, then these two points do not belong to the same instance, The above formula indicates whether the Euclidean distance between points is within a reasonable range.
9. The method for segmenting industrial scattered parts instances based on three-dimensional vision according to claim 7, characterized in that: p i The center score of is calculated as follows: Where β is a positive constant, c i are the geometric center coordinates of the instance; Define the embedding feature loss L EF : Among them, ω (i,j) It is through D V and D A W∈R obtained by element-by-element multiplication N×N an element of oh (i,j) =d V(i,j) s A(i,j) K (i,j) It is a loss based on point-to-point relationships and is defined as: Among them, ∈1 and ∈2 are constants and satisfy 0<∈1<∈2 Due to the robustness of the L1 loss function, smooth L1 loss is used as the center score branch loss function and L is defined as CS as follows: in, Represents the predicted center score 10. The method for industrial scattered parts instance segmentation based on three-dimensional vision according to claim 1, characterized in that: In step 12, NMS is performed on the points with center scores to obtain the center of each instance, and then a prediction instance is generated based on the distance from the feature to the center point. The specific steps to obtain the classification result are as follows: Step 12.1: After predicting the center scores, we use the NMS algorithm to find the geometric center points of each object and use these points as reference points in the clustering process; Perform NMS on all points with center scores to find the center of each instance; points with center scores higher than the center score threshold are considered as candidates for the center point; select the point with the highest center score as the first candidate for the center point, and remove the point with a radius of γd centered on the candidate point max Other points on the sphere, where d max is the maximum distance from the geometric center to the farthest point of the object, and γ is the screening factor; repeat this process until there are no more points left; Step 12.2: Generate a prediction instance based on the distance from the feature to the center point. The specific steps to obtain the classification result are as follows: After NMS algorithm processing, the characteristic distance between the center point and other points is calculated: in, Represents the features of the kth center point selected in the NMS algorithm, Represents the feature of the i-th point among the remaining points. All points except the center point are clustered with the center point closest to the feature; find point p in the feature embedding space i The nearest center point c k , calculate p in three-dimensional space i and c k The Euclidean distance d(p i ,c k ), if d(p i ,c k ) is greater than d max , then pi is considered as noise and no instance label is assigned.
Citation Information
Patent Citations
Scattered workpiece recognition and positioning method based on point cloud processing
CN108830902A
Point cloud segmentation method and device, computer readable storage medium and computer equipment
CN109886272A
Human hand three-dimensional posture estimation method and device based on three-dimensional point cloud
CN110222580A
Three-dimensional object detection for autonomous robotic systems using image proposals
US20190147245A1
Simulating physical interactions for automated systems
US20230294276A1
Cited By
Deep learning-based pose solving method for weak-texture disordered stacked parts
CN119540346A
