--- license: apache-2.0 --- # ๐Ÿง  Brain MRI Classification with TensorFlow and Streamlit ## ๐Ÿ‡ฌ๐Ÿ‡ง English This project is a deep learning-based solution for classifying Brain MRI images into four categories: **Glioma**, **Meningioma**, **Pituitary**, and **Normal**. The classification model is trained using TensorFlow/Keras and can be used either programmatically or with a Streamlit web interface. ### ๐Ÿงช Model Information - Input shape: `(224, 224, 3)` - Model format: `.keras` (SavedModel) - Output classes: - 0: Glioma - 1: Meningioma - 2: Normal - 3: Pituitary --- ### ๐Ÿง  Example Usage (Python Script) ```python from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing import image import numpy as np # Load the trained model model = load_model('brainmri.keras') # Load and preprocess the image img = image.load_img('example.jpeg', target_size=(224, 224)) img_array = image.img_to_array(img) / 255.0 img_array = np.expand_dims(img_array, axis=0) # Define class labels classes = { 0: "Glioma", 1: "Meningioma", 2: "Normal", 3: "Pituitary" } # Make prediction result = model.predict(img_array) predicted_class = np.argmax(result) # Print result print("Predicted Class:", classes.get(predicted_class))