Breast cancer has become the second leading cause of death among women worldwide. In India, a woman is diagnosed with breast cancer every four minutes. There has been no known basis behind it, and detection is extremely challenging among medical scientists and researchers due to unknown reasons. In India, the ratio of women being identified with breast cancer in urban areas is 22:1. Symptoms for this disease are micro calcification, lumps, and masses in mammogram images. These sources are mostly used for early detection. Digital mammography is used for breast cancer detection. In this study, we introduce a new hybrid wavelet filter for accurate image enhancement. The main objective of enhancement is to produce quality images for detecting cancer sections in images. Image enhancement is the main step where the quality of the input image is improved to detect cancer masses. In this study, we use a combination of two filters, namely, Gabor and Legendre. The edges are detected using the Canny detector to smoothen the images. High-quality enhanced image is obtained through the Gabor-Legendre filter (GLFIL) process. Further image is used by classification algorithm. Animal migration optimization with neural network is implemented for classifying the image. The output is compared to existing filter techniques. Ultimately, the accuracy achieved by the proposed technique is 98%, which is higher than existing algorithms.