Background and objectiveMedicine image classification are important methods of traditional medical image analysis, but the trainable data in medical image classification is highly imbalanced and the accuracy of medical image classification models is low. In view of the above two common problems in medical image classification. This study aims to: (i) effectively solve the problem of poor training effect caused by the imbalance of class imbalanced data sets. (ii) propose a network framework suitable for improving medical image classification results, which needs to be superior to existing methods. MethodsIn this paper, we put in the diffusion model multi-scale feature fusion network (DMSFF), which mainly uses the diffusion generation model to overcome imbalanced classes (DMOIC) on highly imbalanced medical image datasets. At the same time, it is processed according to the cropped image augmentation strategy through cropping (IASTC). Based on this, we use the new dataset to design a multi-scale feature fusion network (MSFF) that can fully utilize multiple hierarchical features. The DMSFF network can effectively solve the problems of small and imbalanced samples and low accuracy in medical image classification. ResultsWe evaluated the performance of the DMSFF network on highly imbalanced medical image classification datasets APTOS2019 and ISIC2018. Compared with other classification models, our proposed DMSFF network achieved significant improvements in classification accuracy and F1 score on two datasets, reaching 0.872, 0.731, and 0.906, 0.836, respectively. ConclusionsOur newly proposed DMSFF architecture outperforms existing methods on two datasets, and verifies the effectiveness of generative model inverse balance for imbalance class datasets and feature enhancement by multi-scale feature fusion. Further, the method can be applied to other class imbalanced data sets where the results will be improved.