Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🧬 Embryo Classification using Deep Learning

A deep learning project for classifying microscopic embryo images using a custom Convolutional Neural Network (CNN) built with TensorFlow and Keras.

The project explores the application of computer vision and deep learning to embryo image analysis, using a dataset containing two predefined image classes.

Project Type: Deep Learning / Computer Vision Domain: Healthcare AI • Medical Imaging


🎯 Overview

This project uses a CNN to learn visual patterns from microscopic embryo images and classify them into one of two dataset-defined classes.

The workflow covers image preprocessing, dataset preparation, CNN training, performance visualization, and single-image prediction.

Pipeline

Microscopic Embryo Image
          ↓
    Image Loading
          ↓
    Resize to 150×150
          ↓
     Dataset Shuffle
          ↓
     Train/Test Split
          ↓
       CNN Model
          ↓
   Feature Extraction
          ↓
    Softmax Classifier
          ↓
     Predicted Class

✨ Key Features

  • 🔬 Microscopic embryo image classification
  • 🧠 Custom CNN architecture using TensorFlow/Keras
  • 🖼️ Image preprocessing with OpenCV
  • ⚡ Batch normalization
  • 🛡️ Dropout regularization
  • 📊 Training and validation accuracy tracking
  • 📉 Training and validation loss visualization
  • 🔎 Single-image prediction
  • 🔀 Dataset shuffling and train/test splitting
  • 🏷️ One-hot encoded class labels

🧠 CNN Architecture

The model uses multiple convolutional layers to progressively learn visual features from the embryo images.

Input: 150 × 150 × 3
        │
        ▼
Conv2D (32)
        │
Conv2D (64)
        │
Batch Normalization
        │
MaxPooling
        │
Dropout
        │
        ▼
Conv2D (64)
        │
Conv2D (64)
        │
MaxPooling
        │
Dropout
        │
        ▼
Conv2D (128)
        │
Conv2D (128)
        │
Conv2D (128)
        │
MaxPooling
        │
Dropout
        │
        ▼
Conv2D (128)
        │
Conv2D (256)
        │
MaxPooling
        │
Dropout
        │
        ▼
Flatten
        │
Dense (512)
        │
Dense (512)
        │
Dropout
        │
        ▼
Dense (2)
        │
Softmax

Training Configuration

Parameter Value
Input Size 150 × 150 × 3
Number of Classes 2
Optimizer Adam
Loss Function Categorical Cross-Entropy
Epochs 15
Validation Split 10%
Regularization Dropout
Normalization Batch Normalization
Framework TensorFlow / Keras

🔬 Data Processing

Images are loaded from the dataset and resized to a fixed resolution before being passed to the model.

img = cv2.imread(image_path)
img = cv2.resize(img, (150, 150))

The dataset is then:

  1. Loaded into NumPy arrays
  2. Shuffled using a fixed random state
  3. Split into training and test sets
  4. Converted into categorical labels
  5. Used to train the CNN

Label Encoding

The two dataset classes are represented as:

labels = ['0', '1']

The labels are converted into one-hot encoded vectors using TensorFlow.


📊 Training & Visualization

The model is trained for 15 epochs while tracking training and validation performance.

Training accuracy and validation accuracy are visualized using:

acc = history.history['accuracy']
val_acc = history.history['val_accuracy']

plt.plot(acc, label="Training Accuracy")
plt.plot(val_acc, label="Validation Accuracy")
plt.legend()
plt.show()

Training and validation loss are also plotted to observe the model's learning behavior.

loss = history.history['loss']
val_loss = history.history['val_loss']

plt.plot(loss, label="Training Loss")
plt.plot(val_loss, label="Validation Loss")
plt.legend()
plt.show()

🔎 Image Prediction

After training, the model can be used to classify an individual embryo image.

prediction = model.predict(img_array)
predicted_class = prediction.argmax()

The model returns probabilities for the two classes through the final softmax layer, and the class with the highest probability is selected as the prediction.


🛠️ Tech Stack

Machine Learning

  • Python
  • TensorFlow
  • Keras
  • Scikit-learn

Computer Vision

  • OpenCV
  • Pillow

Data Processing

  • NumPy
  • Pandas

Visualization

  • Matplotlib
  • Seaborn

Dataset

  • Kaggle

⚠️ Limitations

This project is a deep learning prototype for image classification and is not a clinically validated medical diagnostic system.

  • The model predicts the predefined classes present in the dataset.
  • The dataset labels should not be interpreted as independent clinical diagnoses.
  • Model performance depends on the quality and distribution of the training data.
  • The current implementation uses 150 × 150 image resolution.
  • The current evaluation focuses primarily on training and validation accuracy/loss.
  • Predictions should not be used for medical decision-making.

💡 Key Takeaways

Through this project, I explored:

  • Building CNN architectures from scratch
  • Image preprocessing with OpenCV
  • Preparing image datasets for deep learning
  • Multi-class categorical classification
  • Batch normalization and dropout
  • Training and validation monitoring
  • Model inference on individual images
  • Applying computer vision techniques to healthcare-related data

👩‍💻 Author

Ayushi Taralkar

B.Tech Computer Science Engineering VIT Bhopal — Health Informatics

GitHubLinkedIn

About

Deep learning model for classifying microscopic embryo images using a custom CNN built with TensorFlow and Keras.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors