This Colab notebook showcases an image classification model trained to classify images into different categories. The model has been trained on a dataset comprising images from various classes, including anacephaly, congi, down_syndrome, encephalocele, and placenta.
This project aims to showcase the process of building an image classification model and provide a starting point for further exploration and experimentation. if you want what i do , juse data, found in dataset folder extract subfolder
The dataset used for training, validation, and testing the model is loaded using the tf.keras.utils.image_dataset_from_directory function. It is organized in a directory structure where each class has its own subdirectory containing the corresponding images. The dataset is divided into training, validation, and test sets using a 70-20-10 split.
-
Clone the repository:
git clone https://github.com/abelyo252/Image-Classification.git cd image-classification -
Install the required dependencies:
pip install -r requirements.txt
-
Usage
Prepare your dataset: Organize your images into separate directories for each class. use this notebook to train based on your custom data, but make sure change hyper-parameter of this model.
-
Inference:
import tensorflow as tf import numpy as np import cv2 # Load the trained model model = tf.keras.models.load_model('load_your_model.h5') # Load and preprocess the input image image = tf.keras.preprocessing.image.load_img('path/to/image.jpg', target_size=(224, 224)) image = tf.keras.preprocessing.image.img_to_array(image) # Preprocess the image image = cv2.resize(image, (256, 256)) img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # Preprocess the image input_image = np.expand_dims(img_rgb, axis=0) # Add a batch dimension input_image = input_image / 255.0 # Normalize the image # Make predictions predictions = model.predict(input_image) # Get the predicted class labels predicted_labels = tf.argmax(predictions, axis=1) # Map the predicted labels to class names predicted_class_names = [class_names[label] for label in predicted_labels] # Print the predicted class names print("Predicted Class Names:", predicted_class_names) Replace 'path/to/image.jpg' with the path to your input image.
You can ask questions and join the development discussion:
- @ Telegram t.me/@benyohanan
You can also post bug reports and feature requests (only) in GitHub issues.
We welcome contributions! Before opening a PR, please read our contributor guide.

