Brain tumors pose a significant health concern globally, with their detection and diagnosis being crucial for timely intervention and treatment planning. These abnormal growths can develop within the brain or originate from other parts of the body, spreading to the brain. They can be benign or malignant, and their impact on cognitive and physical function can vary widely depending on their location, size, and type. Detecting brain tumors involves a combination of imaging techniques and clinical assessment. Magnetic Resonance Imaging (MRI) is one of the primary imaging modalities used for this purpose due to its ability to provide detailed images of the brain's anatomy and pathology. Advanced image processing techniques and machine learning algorithms play an increasingly important role in enhancing the accuracy and efficiency of brain tumor detection. This study presents a comprehensive approach for enhancing brain tumor detection in MRI images using a combination of advanced techniques. Firstly, an improved K-means clustering algorithm is introduced to segment tumor regions effectively. Following this, Median Filtering is applied to refine image quality and reduce noise interference. Subsequently, a deep neural network architecture is employed for precise tumor classification utilizing the BRATS dataset. The proposed methodology aims to improve the accuracy and efficiency of brain tumor detection, offering potential advancements in medical image analysis and diagnosis. Experimental results demonstrate promising outcomes, indicating the effectiveness of the proposed approach in accurately identifying tumor regions in MRI scans.