This paper presents a method for breast cancer image detection and classification based on convolutional neural networks. While traditional breast cancer detection methods carry the risk of subjectivity and misclassification, machine learning can improve the accuracy and efficiency of detection by training algorithms to automatically identify breast cancer lesions in patients. The dataset of this paper includes 7909 microscopic images of breast tumor tissues with different magnifications collected from 82 patients, which are divided into two categories: benign and malignant tumors. In this paper, residual connection is designed for convolutional neural networks, which is a cross-layer connection method that can effectively solve the gradient vanishing and gradient explosion problems in deep neural networks, and at the same time, improve the generalization ability and training speed of the model. In this paper, the dataset is divided into training set, validation set and test set according to the ratio of 6:2:2. Through training and validation, the prediction accuracy of the obtained model on the test set reaches 85.5%, which achieves good prediction results in breast cancer image detection and classification. Eventually, the model's loss converged at 0.53 and the AUC was 0.832. The research results in this paper are of great significance for the early diagnosis and treatment of breast cancer. Automatic identification and classification of breast cancer images by machine learning algorithms can reduce the subjective judgment of doctors, improve the accuracy and efficiency of detection, and provide important support for the early diagnosis and treatment of breast cancer. Meanwhile, the research method and results of this paper also provide reference and reference for image detection and classification of other malignant tumors.