Breast cancer is one of the most common types of cancer among women all over the world, which leads to the death of many women every year due to misdiagnosis and late treatment. Therefore, in this research, a new deep learning model was developed based on Python and using the mini-MIAS dataset. Initially image contrast optimization operations and segmentation were performed to enhance image and extract the region of interest (breast region) in order to improve the performance of the model and increase the accuracy of diagnosis and then extract the features using the transfer learning technique and based on a set of pre-trained networks. A comparison was made between a set of pre-trained convolutional network architectures (VGG16, ResNet50, MobileNetV2, InceptionV3) where the VGG16 network gave the best performance in the phase of extracting features and then building the final hybrid model by merging the VGG16 network with the random forest classifier. Our model achieved 94.25% average accuracy and the Area under curve (AUC) is 98% for all three classes, in addition to reducing the time required to build the system.