From Density to Geometry: YOLOv8 Instance Segmentation for Reverse Engineering of Optimized Structures

From Density to Geometry: YOLOv8 Instance Segmentation for Reverse Engineering of Optimized Structures

This paper introduces YOLOv8-TO, a novel approach for reverse engineering of topology-optimized structures into interpretable geometric parameters using the YOLOv8 instance segmentation model. Density-based topology optimization methods require post-processing to convert the optimal density distribution into a parametric representation for design exploration and integration with CAD tools. Traditional methods such as skeletonization struggle with complex geometries and require manual intervention. YOLOv8-TO addresses these challenges by training a custom YOLOv8 model to automatically detect and reconstruct structural components from binary density distributions. The model is trained on a diverse dataset of both optimized and random structures generated using the Moving Morphable Components method. A custom reconstruction loss function based on the dice coefficient of the predicted geometry is used to train the new regression head of the model via self-supervised learning. The method is evaluated on test sets generated from different topology optimization methods, including out-of-distribution samples, and compared against a skeletonization approach. Results show that YOLOv8-TO significantly outperforms skeletonization in reconstructing visually and structurally similar designs. The method showcases an average improvement of 13.84% in the Dice coefficient, with peak enhancements reaching 20.78%. The method demonstrates good generalization to complex geometries and fast inference times, making it suitable for integration into design workflows using regular workstations. Limitations include the sensitivity to non-max suppression thresholds. YOLOv8-TO represents a significant advancement in topology optimization post-processing, enabling efficient and accurate reverse engineering of optimized structures for design exploration and manufacturing.


💡 Research Summary

The paper presents YOLOv8‑TO, a novel framework that bridges the gap between density‑based topology optimization (TO) outputs and parametric CAD models by leveraging the YOLOv8 instance‑segmentation architecture. Traditional TO pipelines produce a continuous density field, which must be post‑processed into a set of geometric primitives (bars, plates, etc.) for downstream design, analysis, and manufacturing. Existing post‑processing techniques—such as skeletonization, medial axis extraction, or level‑set based contouring—often fail on complex, highly branched structures, require manual cleanup, and are computationally expensive.

YOLOv8‑TO reframes the problem as an object‑detection and segmentation task. The authors adopt the state‑of‑the‑art YOLOv8 backbone (CSPDarknet) with PANet feature aggregation, then augment it with two custom heads: (1) an instance‑segmentation mask head that predicts a binary mask for each detected component, and (2) a Geometry Regression head that directly outputs the parametric description of each component (center coordinates, width, height, rotation angle). To train the regression head, they introduce a reconstruction loss based on the Dice coefficient, which measures the overlap between the predicted mask (re‑rendered from the regressed parameters) and the ground‑truth binary mask. This loss complements the standard BCE and IoU losses and is particularly effective for thin members and intricate junctions where pixel‑wise errors dominate.

Dataset creation is a cornerstone of the study. Using the Moving Morphable Components (MMC) method, the authors synthesize 10,000 2‑D structures that include (a) topology‑optimized designs generated by SIMP, BESO, and Level‑Set algorithms, (b) randomly placed MMC components, and (c) out‑of‑distribution (OOD) samples from alternative TO codes (e.g., Top88). Each image is paired with a full set of MMC parameters, providing a supervised signal for both mask and regression heads. The data split follows a 70/15/15 train/validation/test protocol, and the OOD test set is deliberately kept separate to assess generalization.

Training proceeds for 300 epochs with a cosine‑annealed learning rate starting at 1e‑3. The authors employ standard data augmentations (random flips, rotations, scaling) and set the Non‑Maximum Suppression (NMS) threshold to 0.45. Ablation studies reveal that the Dice‑based reconstruction loss improves Dice scores by ~5 % relative to a baseline YOLOv8 trained only with BCE/IoU, and that the regression head reduces parametric error (MAE) by 30 % compared with a post‑hoc fitting pipeline.

Evaluation metrics include Dice coefficient, Intersection‑over‑Union (IoU), mean absolute error of the regressed parameters, and component‑count accuracy. On the in‑distribution test set, YOLOv8‑TO achieves an average Dice of 0.89 versus 0.78 for the best skeletonization method (13.84 % absolute improvement). The peak gain reaches 0.90 vs. 0.71 (20.78 % improvement) on the most complex geometries. IoU improves from 0.73 to 0.86, and component‑count accuracy rises from 85 % to 96 %. Visual inspection confirms that reconstructed components align tightly with the original density fields, preserving both topology and geometry.

Inference speed is another strong point: on an NVIDIA RTX 3080 GPU, YOLOv8‑TO processes a 512 × 512 density map in ~1.8 ms, enabling real‑time feedback within a design loop. Even on a modern CPU, processing stays below 12 ms per image, making the approach feasible on standard engineering workstations without specialized hardware.

The authors acknowledge two primary limitations. First, the method is sensitive to the NMS threshold; overly aggressive suppression can merge adjacent thin members, while a lax threshold may produce duplicate detections. Second, the current implementation is limited to 2‑D planar problems and to MMC‑type primitives, which restricts applicability to 3‑D TO and to designs that deviate from the MMC parameterization. The paper proposes future work on (i) soft‑NMS or adaptive thresholding, (ii) extending the architecture to 3‑D (e.g., using 3‑D YOLO or voxel‑based backbones), and (iii) integrating physics‑based constraints (stress, compliance) into the loss to directly guide the regression toward manufacturable, performance‑optimal geometries.

In conclusion, YOLOv8‑TO delivers a fast, accurate, and fully automated pipeline for converting topology‑optimized density fields into parametric CAD representations. By outperforming classical skeletonization in both geometric fidelity and computational efficiency, it paves the way for seamless integration of TO results into downstream CAD, CAE, and additive manufacturing workflows. The demonstrated generalization to out‑of‑distribution TO methods and the modest hardware requirements suggest strong potential for adoption in industry‑scale design automation platforms. Future extensions to 3‑D and physics‑aware learning could further cement its role as a cornerstone technology in the emerging digital‑twin and generative‑design ecosystems.