How nargesmohammadi/dog-and-cat-classification-using-transfer-learning-mobilenet-v2- works
Project Type and Purpose
• This project is a machine learning / computer vision application focused on classification.
• The purpose is to build and evaluate a model that distinguishes between dog and cat images using transfer learning.
Analyzing the File Structure
• The file tree shows mainly Jupyter notebooks (including checkpoint files) and a README file.
• The notebooks encapsulate all steps from dataset exploration to model evaluation.
Key Steps (as outlined in the README)
• Data Ingestion: Loading images from the dataset.
• Data Preprocessing:
• Counting and displaying image samples.
• Resizing images and saving processed versions.
• Assigning labels and analyzing class distributions.
• Model Building:
• Loading a pre-trained MobileNet-V2 model from TensorFlow Hub.
• Adding a dense classification layer.
• Training:
• Compiling the model and training it on the processed dataset.
• Evaluation:
• Running evaluations on a test set.
• Prediction:
• Using the trained model to make predictions on custom images.
• Main Components:
• Data Source / Dataset: Represents the dog and cat image dataset (Kaggle).
• Data Preprocessing Pipeline: Steps like file counting, sample visualization, resizing, and labeling.
• Model Definition and Loading: The MobileNet-V2 transfer learning setup along with the additional classification layers.
• Training Module: Model compilation, training loop, and parameters/settings.
• Evaluation & Testing Module: For assessing accuracy and performance on unseen data.
• Prediction / Deployment (optional): A segment showing how the trained model is applied for new predictions.
• Supporting Libraries & Frameworks: TensorFlow, TensorFlow Hub, OpenCV, PIL, Matplotlib, etc.
• Relationships & Interactions:
• Preprocessing to Model Definition, showing that processed images (and their labels) feed into the training module.
• Optionally, add a feedback loop from Evaluation back to Training to illustrate model tuning.
• Architectural Patterns:
• Even though this is a notebook-based project, conceptually you are following a typical machine learning pipeline “ETL → Model Training → Evaluation → Deployment.”
• Transfer learning design pattern: a pre-trained foundational model (MobileNet-V2) is used as a feature extractor, and a custom classifier is appended.
• Relevant Technologies:
• Frameworks and libraries such as TensorFlow, TensorFlow Hub, OpenCV, PIL, Matplotlib, etc. near the corresponding components.
• Mention that MobileNet-V2 is being used specifically for its robust feature extraction in vision tasks.