考虑到汉字结构的复杂性,特别是笔划之间的连接和相交,汉字笔划提取和识别的准确率低,以及不清楚的分割。本研究建立在YOLOv8n-seg模型的基础上,提出了YOLOv8n-seg-CAA-BiFPN汉字笔划精细分割模型。提出的协调感知注意力机制(CAA)将骨干网络输入特征图分为四个部分,对水平应用不同的权重,垂直,和渠道关注计算和融合关键信息,从而捕捉紧密排列的笔划位置的上下文规律性。网络的颈部集成了增强的加权双向特征金字塔网络(BiFPN),增强各种大小的笔划特征的融合效果。采用Shape-IoU损失函数代替传统的CIoU损失函数,重点关注笔划边界框的形状和比例,以优化边界框回归过程。最后,Grad-CAM++技术用于生成分割预测的热图,促进有效特征的可视化,并更深入地了解模型的重点领域。在公共汉字笔划数据集CCSE-Kai和CCSE-HW上进行培训和测试,该模型的平均准确率为84.71%,平均召回率为83.65%,平均准确率为80.11%。与原始的YOLOv8n-seg和现有的主流分割模型如SegFormer相比,BiSeNetV2和MaskR-CNN,平均精度提高了3.50%,4.35%,10.56%,和22.05%,平均召回率分别提高了4.42%,9.32%,15.64%,和24.92%,平均精度分别提高了3.11%,4.15%,8.02%,和19.33%,分别。结果表明,YOLOv8n-seg-CAA-BiFPN网络可以准确地实现汉字笔划分割。
Considering the complex structure of Chinese characters, particularly the connections and intersections between strokes, there are challenges in low accuracy of Chinese character stroke extraction and recognition, as well as unclear segmentation. This study builds upon the YOLOv8n-seg model to propose the YOLOv8n-seg-CAA-BiFPN Chinese character stroke fine segmentation model. The proposed Coordinate-Aware Attention mechanism (CAA) divides the backbone network input feature map into four parts, applying different weights for horizontal, vertical, and channel attention to compute and fuse key information, thus capturing the contextual regularity of closely arranged stroke positions. The network\'s neck integrates an enhanced weighted bi-directional feature pyramid network (BiFPN), enhancing the fusion effect for features of strokes of various sizes. The Shape-IoU loss function is adopted in place of the traditional CIoU loss function, focusing on the shape and scale of stroke bounding boxes to optimize the bounding box regression process. Finally, the Grad-CAM++ technique is used to generate heatmaps of segmentation predictions, facilitating the visualization of effective features and a deeper understanding of the model\'s focus areas. Trained and tested on the public Chinese character stroke datasets CCSE-Kai and CCSE-HW, the model achieves an average accuracy of 84.71%, an average recall rate of 83.65%, and a mean average precision of 80.11%. Compared to the original YOLOv8n-seg and existing mainstream segmentation models like SegFormer, BiSeNetV2, and Mask R-CNN, the average accuracy improved by 3.50%, 4.35%, 10.56%, and 22.05%, respectively; the average recall rates improved by 4.42%, 9.32%, 15.64%, and 24.92%, respectively; and the mean average precision improved by 3.11%, 4.15%, 8.02%, and 19.33%, respectively. The results demonstrate that the YOLOv8n-seg-CAA-BiFPN network can accurately achieve Chinese character stroke segmentation.