Data-driven quality prediction method has been widely used in product estimation of batch processes. However, the initial conditions of different batches in batch process are different, and the multiphase characteristics and nonlinearity in batch are not conducive to the quality prediction. To solve these problems, a model for batch process quality prediction based on a convolutional neural network (CNN) is proposed. Firstly, in order to enhance data characteristics and reduce model computing time, a maximum information coefficient (MIC) method based on mutual information is used to select variables according to the correlation between process variables and quality variables. Secondly, the quality prediction model of CBAM-CNN based on the attention mechanism is established. On the one hand, an improved convolutional block attention module (CBAM) is added to the CNN. The input feature mapping is re-calibrated to focus on useful feature information and weaken irrelevant redundant information in each sliding window. On the other hand, by introducing an improved convolutional module with double-band skip connection lines, the backpropagation speed of the CBAM-CNN model is increased, which can effectively avoid the occurrence of the overfitting problem. Finally, the data of batch process is used as the input of the prediction model. The superiority and effectiveness of the proposed model are verified by predicting the quality variable of the penicillin fermentation process simulation benchmark and the industrial-scale penicillin fermentation process. It is proved that the proposed model has better generalization performance in the quality prediction of the penicillin fermentation process with different control strategies.