The processing of grinding data and the prediction of accuracy are extremely complex; this paper proposes a novel prediction method to ensure the machining accuracy of computer numerical control (CNC) grinding machines. It consists of two components, namely the filter decomposition recurrence plot (RP) transformation (FDRP) and the deep inverted residual attention network (DIRAN). A pipeline named FDRP has been designed to address the issues in the processing of data and the shortcomings of RP. Firstly, the displacement signals undergo filtering to preserve essential grinding information while effectively removing noise. Secondly, long-time series signals are decomposed and augmented based on the characteristics of the machining process. Lastly, an RP transformation is applied to one-dimensional time series data, resulting in the generation of images that accurately represent the grinding process. Furthermore, this paper proposes a novel machining accuracy prediction model. The DIRAN uses a multi-layer inverse residual network structure combined with attention mechanism to extract the features of two-dimensional RP, and its performance is better than other typical prediction methods. It can be applied to predict the polar angle of the workpiece in industrial processing and reduce the defect rate.