面向图数转化的曲线提取与细化神经网络
摘 要
目的 曲线图是数据呈现的重要形式,但在没有原始数据的情况下难以查询其中的具体数值。现有的图数转化算法需要大量的人工辅助操作去除图表中网格线等干扰,具有机械重复性且需大量人力的缺点。另外,图像压缩与缩放等攻击会降低图像质量,导致图数转化的准确度进一步降低。为了解决上述问题,本文提出了一个基于曲线提取与细化神经网络的图数转化算法。方法 首先,提出了基于侧结构引导与拉普拉斯卷积的曲线提取神经网络(side structure guidance and Lapla ceconvolution based curve extraction neural network,SLCENet),以轻量化的模型解决了现有曲线提取方法中的池化操作导致的边界模糊问题,提高了曲线提取的准确度。其次,为了减小曲线线宽对图数转化造成的误差,并平衡计算复杂度和准确度,设计了10个能够反映曲线走势的特征,提出了基于曲线走势特征和多层感知机的曲线细化方法(curve trend features and MLP based curve thinning method,CMCT),实现了曲线细化的高精度。最后,利用PaddleOCR(paddle optical character recognition)定位并识别坐标轴上的坐标标签,建立起坐标轴坐标与像素坐标的变换关系,通过坐标变换完成图数转化任务。结果 在曲线提取方面,本文方法SLCENet的全局最优阈值指标(optimal dataset scale,ODS)达到了0.985,在分辨率为640×480像素的图像上的运行速度达到了0.043s/幅,在兼顾曲线提取准确度和运行速度的情况下达到了最好的性能。在图数转化方面,本文方法的归一化均值误差(normalized mean error,NME)达到了0.79,运行速度达到了0.83s/幅。结论 提出的方法实现了全自动高精度的图数转化目标。与现有方法相比,在保持较小计算量的情况下兼具准确度高和运行速度快的特点,摆脱了图数转化需要大量人工交互辅助的限制。
关键词
Curve extraction and thinning based curve-to-data conversion neural network
Zhou Qidang1, Liu Chunxiao2, Lyu Jinlong2, Feng Caibo2(1.School of Information and Electronic Engineering, Zhejiang Gongshang University, Hangzhou 310018, China;2.School of Computer Science and Technology, Zhejiang Gongshang University, Hangzhou 310018, China) Abstract
Objective Curve image is an important form of data presentation;however,querying the specific values embedded into curve image is difficult without the original data.The existing curve-to-data conversion methods require consider-able manual assistance to remove such interference in curve images,such as grid lines and axes.Thus,they exhibit the disadvantage of being mechanically repetitive and labor-intensive.In addition,attacks,such as image compression and scaling,can degrade image quality,leading to the decrease of curve-to-data conversion accuracy.The curve has a certain line width,and the same X coordinate corresponds to multiple pixel points.Therefore,obtaining the exact position of the point to be measured in the curve is difficult.To solve the aforementioned problems,this study proposes a curve extraction and thinning based curve-to-data conversion neural network.Method First,we propose the side structure guidance and Laplace convolution based curve extraction neural network(SLCENet).SLCENet uses ResNet as its backbone network and enhances curve extraction performance with side structure guidance.It uses deep supervision to make each layer of the network learn the details in the curve mask better.The side structure guidance contains four different scales,and each scale consists of four residual blocks.To obtain clearer curve details,we add the multi-scale dilation module(MDM)to enrich the multi-scale curve features and the noise reduction module(NRM)to reduce the noise in the feature map.Moreover,we specially design the Laplace module(LM)to enhance the curve extraction performance in side structure guidance.In general,the number of curve pixels is considerably smaller than the number of non-curve pixels,and thus,this study uses the cross-entropy loss with weights to balance the penalty of the loss function for the curve and non-curve pixels.Consequently,SLCENet solves the problem in which the pooling operation in existing curve extraction methods lead to blurred curve edges,improving curve extraction accuracy.Second,to reduce the error caused by the curve line width on curve-to-data conversion and balance computational complexity and curve thinning accuracy,we design 10 features that can reflect the curve trend and propose a curve trend feature and MLP based curve thinning method(CMCT),which achieves curve thinning results with high accuracy.Finally,PaddleOCR is used to identify the coordinate labels on the coordinate axes and establish the coordinate transformation formula between axis coordinates and pixel coordinates.Result A huge amount of experimental results show that our algorithm achieves superior accuracy and speed.In curve extraction,SLCENet achieves the optimal dataset scale(ODS)of 0.985 and only takes 0.043 seconds for an image with a resolution of 640 × 480.For the curve images degraded by JPEG compression,scaling,and noising attack,SLCENet still achieves the ODS of 0.902.Although the speed of our SLCENet is slightly slower than holistically-nested edge detection(HED),richer convolutional features for edge detection(RCF),and dense extreme inception network(DexiNed),they fail to achieve high curve extraction accuracy.Therefore,when combining accuracy and running speed,SLCENet achieves the best performance.In curveto-data conversion,our algorithm obtains the normalized mean error(NME)of 0.79 and a running speed of 0.83 seconds per image.In model size,SLCENet achieves high accuracy with a lightweight model which is only about 17MB.To balance curve thinning accuracy and computational costs,this study compares typical machine learning methods for the curve thinning task.The experimental results show that decision tree exhibits the best performance in the curve-to-data conversion accuracy.Nevertheless,considering curve-to-data conversion accuracy,model size,and running speed,MLP is chosen with the best comprehensive performance.Conclusion Our algorithm achieves the goal of fully automatic curve-to-data conversion with high accuracy and exhibits greater advantages over existing methods in curve images with JPEG compression,image scaling,and noise attacks.Compared with existing methods,our algorithm is free from the limitation of requiring considerable manual interaction assistance for curve-to-data conversion,which has high accuracy and fast running speed.
Keywords
curve-to-data conversion curve extraction curve thinning Laplace convolution convolutional neural network(CNN)
|