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
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.
Microscopic Embryo Image
↓
Image Loading
↓
Resize to 150×150
↓
Dataset Shuffle
↓
Train/Test Split
↓
CNN Model
↓
Feature Extraction
↓
Softmax Classifier
↓
Predicted Class
- 🔬 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
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
| 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 |
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:
- Loaded into NumPy arrays
- Shuffled using a fixed random state
- Split into training and test sets
- Converted into categorical labels
- Used to train the CNN
The two dataset classes are represented as:
labels = ['0', '1']The labels are converted into one-hot encoded vectors using TensorFlow.
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()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.
- Python
- TensorFlow
- Keras
- Scikit-learn
- OpenCV
- Pillow
- NumPy
- Pandas
- Matplotlib
- Seaborn
- Kaggle
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 × 150image resolution. - The current evaluation focuses primarily on training and validation accuracy/loss.
- Predictions should not be used for medical decision-making.
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
Ayushi Taralkar
B.Tech Computer Science Engineering VIT Bhopal — Health Informatics