• A more comprehensive image dataset of crop pests and diseases (CPD) was created. • Transfer learning based on the CPD image dataset (TLDP) was compared with ImageNet pre-training. • A novel Decoupling-and-Attention network was proposed to further improve the accuracy of TLDP. • DANet trained with the TLDP method achieved the highest classification accuracy on various open pest and disease. Pests and diseases are the two primary reasons for poor crop yields. Farmers have traditionally relied on manual methods to identify pests and diseases, which is time-consuming and costly. The Internet and pervasiveness of camera-enabled mobile devices, however, have made image acquisition more convenient and cheaper than ever before, and have launched a wave of research into how to use deep learning models to recognize pests and diseases in field. However, the datasets used in these studies were customized for only one or a few crop types. ImageNet pre-trained models were usually adopted to obtain high accuracy, regardless of the attributes of the target image datasets. A more comprehensive image dataset of crop pests and diseases was created. Transfer learning based on this disease and pest image dataset (TLDP) was compared with ImageNet pre-training. From experiments, we observed that TLDP has a similar effect to ImageNet pre-training. In addition, the performance of transfer learning largely depended on model performance on the source image dataset. To further improve the accuracy of TLDP, a novel convolutional neural network backbone called Decoupling-and-Attention network (DANet) was developed. DANet trained with the TLDP method achieved the highest classification accuracy on a strawberry pests and diseases image dataset (96.79%), followed by ImageNet pre-trained ResNet-50 (96.56%). In terms of computational cost, DANet was only a quarter of ResNet-50. The pre-trained DANet was also tested on other open pests and diseases image datasets. It still shows comparable performance to ImageNet pre-trained models.