CN-121997739-A - Real-time collision detection method based on self-adaptive bounding box and machine learning
Abstract
The invention relates to the technical field of sheet metal bending processing, in particular to a real-time collision detection method based on a self-adaptive bounding box and machine learning, which comprises the steps of firstly carrying out geometric feature analysis on each three-dimensional model, by calculating the fitting degree of the model volume and the volumes of different bounding boxes (sphere, AABB, OBB), the optimal bounding box with the highest space utilization rate is adaptively selected and constructed. In the real-time detection stage, aiming at an object pair to be detected, extracting a 24-dimensional geometric relation feature vector between bounding boxes of the object pair to be detected, and inputting the feature vector into a pre-trained lightweight multi-layer perceptron model. The model outputs continuous collision probability values, and three-level intelligent classification (high probability collision, critical state and safety) is performed according to a preset threshold value, so that scheduling of accurate detection resources is guided. The method can improve the package compactness of the bounding box from the source, accurately pre-judge the boundary condition by utilizing machine learning, ensure the detection precision and simultaneously facilitate the improvement of the efficiency of real-time collision detection.
Inventors
- SHEN LANG
- HUANG YAN
- LIU KAI
- TIAN BIN
Assignees
- 江苏亚威机床股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260123
Claims (6)
- 1. A real-time collision detection method based on self-adaptive bounding boxes and machine learning is characterized by comprising the following steps: The method comprises the following steps: S1, executing a self-adaptive bounding box selection flow on the basis of the geometric characteristics of each three-dimensional model participating in collision detection, respectively calculating the volume fitting degree of each three-dimensional model and a plurality of bounding boxes of preset types, and selecting and constructing the bounding box of the optimal type for each model according to the volume fitting degree; S2, extracting geometric relation features of the bounding box constructed based on the step S1 for each pair of objects needing to detect collision relation in each detection period to generate feature vectors; s3, inputting the feature vector generated in the step S2 into a pre-trained lightweight machine learning model, and outputting a continuous collision probability value by the model; and S4, carrying out grading judgment according to the probability value output in the step S3, and guiding the scheduling and decision of the follow-up accurate collision detection.
- 2. The method for detecting the real-time collision based on the adaptive bounding box and the machine learning according to claim 1, wherein the adaptive bounding box selection process in the step S1 is specifically that for a vertex set V and a dough set F of a three-dimensional model, a model volume V_M is calculated, a spherical bounding box, an axial bounding box AABB and an oriented bounding box OBB of the model are respectively constructed, the respective volumes V_sphere, V_aabb and V_ OBB are calculated, the volume fitting degree of each bounding box and the model is calculated, namely, fitting=V_M/V_box, and the bounding box type with the highest volume fitting degree is selected as the optimal bounding box type of the model.
- 3. The method for detecting real-time collision based on adaptive bounding box and machine learning according to claim 1, wherein the geometric relationship feature extracted in the step S2 is a 24-dimensional feature vector, and the method comprises the following information: Euclidean distance between the center points of the two bounding boxes; normalized relative displacement of the two bounding boxes in the directions of three coordinate axes; a logarithmic value of the proportional relationship of the two bounding box sizes; The overall size of the two bounding boxes after being combined; the accurate axial bounding box AABB overlapping volume of the two bounding boxes and the occupation ratio thereof; when the bounding box is an oriented bounding box OBB, the bounding box corresponds to the directional consistency measurement between coordinate axes; the included angle between the main directions of the two bounding boxes and the differential norm of the rotation matrix; The angle difference of the two bounding boxes in the directions of the coordinate axes; characterizing the coding of each bounding box specific sphere, AABB, OBB; a flag that characterizes whether two bounding box types agree.
- 4. The method for real-time collision detection based on adaptive bounding box and machine learning according to claim 1, wherein the lightweight machine learning model in step S3 is a multi-layer perceptron, and the training process comprises: S3.1, generating data, namely randomly generating bounding box pairs which are in different spatial relations and comprise overlapping, far-away and critical by an algorithm, extracting the 24-dimensional feature vector for each pair of bounding boxes, marking a binarization collision label for the bounding box based on an accurate AABB intersection test, and identifying boundary samples in the bounding box pairs; and S3.2, training a model, namely using the generated labeled data set, taking the self-adaptive Focal Loss as a Loss function, applying higher weight to a boundary sample by the Loss function, and optimizing parameters of the multi-layer perceptron by adopting a back propagation algorithm until the model converges.
- 5. The method for detecting real-time collision based on adaptive bounding box and machine learning according to claim 1, wherein the step S4 of classifying comprises setting a first probability threshold and a second probability threshold, wherein the first threshold is larger than the second threshold; If the collision probability value is larger than the first threshold value, judging that the collision probability value is high probability collision, and adding the object pair into an emergency accurate detection queue; If the collision probability value is between the second threshold value and the first threshold value, judging that the collision probability value is in a critical state, and carrying out risk marking and prompting on the object pair; if the collision probability value is smaller than the second threshold value, the object pair is judged to be safe, and the object pair is filtered without further accurate detection.
- 6. The method for detecting the real-time collision based on the self-adaptive bounding box and the machine learning according to any one of claims 1 to 5 is characterized by being particularly applied to digital twin or motion control simulation in a sheet metal bending process and used for detecting potential interference among an upper bending die, a lower bending die, a sheet metal part and a machine tool moving part in real time; Triggering high-precision triangular patch intersection detection aiming at the object pair if the collision is judged to be high-probability collision; when the critical state is determined, the system highlights the corresponding area in the simulation interface and generates a risk log for review by an engineer.
Description
Real-time collision detection method based on self-adaptive bounding box and machine learning Technical Field The invention relates to the technical field of sheet metal bending processing, in particular to a real-time collision detection method based on self-adaptive bounding boxes and machine learning. Background Collision detection is a core basic technology in the fields of computer graphics, virtual simulation, robot motion planning and the like. With the improvement of the complexity of application scenes (such as large industrial digital twin and high fidelity virtual reality), the traditional collision detection algorithm faces serious challenges in precision and efficiency. Methods based on hierarchical bounding Boxes (BVH) such as AABB (axial bounding box), OBB (oriented bounding box), sphere, etc. Such methods accelerate detection by building a tree hierarchy, but their performance is highly dependent on the type selection of bounding boxes. A single type of bounding box cannot accommodate all geometries, e.g., AABB is well-compact to axis aligned objects but has reduced accuracy after rotation, OBB is highly versatile but is costly to build. Existing methods lack a mechanism to dynamically select the optimal bounding box based on model geometry. Methods based on spatial segmentation such as octree, BSP tree, uniform mesh, etc. Although the method is easy to process dynamic objects, the method has the problems of granularity selection and repeated detection of boundary objects. The existing three-dimensional collision detection technology mainly has the following three core problems, especially when processing complex and dynamically changing scenes (such as virtual reality, physical simulation and robot motion planning): The bounding box selection is stiff, the space utilization rate is low, and the existing method generally designates one bounding box (such as AABB or OBB) for the whole scene or all models uniformly and lacks pertinence. For models with different geometric characteristics (such as slender type, flat type and spherical type), the single type bounding box cannot realize optimal space wrapping, so that a large amount of invalid space exists in the bounding box, the false alarm rate of a subsequent rough detection stage is increased, and the calculation burden of accurate detection is increased. The boundary condition judgment is rough, and the performance and the precision are difficult to be compatible, so that the traditional bounding box rough detection (overlapping test) is a non-black or white Boolean judgment. For boundary conditions of "impending collision" or "light contact", no quantitative "collision risk" assessment can be provided. This results in either premature engagement of the system with accurate geometric intersection detection, consuming significant computational resources, or missing a slight touch due to judgment over conservation. A smooth, intelligent pre-decision mechanism is lacking to optimize the detection flow. The calculation overhead of the existing algorithm in the accurate detection stage is always large. While coarse detection can exclude a large number of disjoint object pairs, accurate detection of the remaining candidate pairs (typically OBB tree traversal or trigonometric intersection testing) remains a performance bottleneck. There is a lack of effective means to enable further intelligent pre-decisions at this stage to skip unnecessary accurate computations. Therefore, there is an urgent need for a comprehensive solution that can adapt to model features, intelligently pre-determine collision probability, and fully utilize the parallel capability of modern hardware to realize high-precision real-time collision detection in complex dynamic scenarios. Disclosure of Invention The invention aims to provide a self-adaptive, efficient and intelligent collision detection scheme, and the core aim is to remarkably improve the overall efficiency of collision detection in a complex dynamic scene on the premise of ensuring the detection precision. In order to achieve the purpose, the invention adopts the following technical scheme that the real-time collision detection method based on the self-adaptive bounding box and machine learning comprises the following steps: S1, executing a self-adaptive bounding box selection flow on the basis of the geometric characteristics of each three-dimensional model participating in collision detection, respectively calculating the volume fitting degree of each three-dimensional model and a plurality of bounding boxes of preset types, and selecting and constructing the bounding box of the optimal type for each model according to the volume fitting degree; S2, extracting geometric relation features of the bounding box constructed based on the step S1 for each pair of objects needing to detect collision relation in each detection period to generate feature vectors; s3, inputting the feature vector generated in the step S2