The computer-aided detection (CAD) systems have been developed to help radiologists with the early detection of breast cancer. This system provides objective and accurate information to reduce the misdiagnosis of the disease. In mammography, the pectoral muscle region is used as an index to compare the symmetry between the left and right images in the mediolateral oblique (MLO) view. The pectoral muscle segmentation is necessary for the detection of microcalcification or mass because the pectoral muscle has a similar pixel intensity as that of lesions, which affects the results of automatic detection. In this study, the mammographic image analysis society database (MIAS, 322 cases) was used for detecting the pectoral muscle segmentation. The pectoral muscle was detected by using the morphological method and the random sample consensus (RANSAC) algorithm. We evaluated the detected pectoral muscle region and compared the manual segmentation with the automatic segmentation. The results showed 92.2% accuracy. We expect that the proposed method improves the detection accuracy of breast cancer lesions using a CAD system.