How yakhyobek1997/cats-and-dogs-resnet50 works
Project type and purpose
• Type: A machine-learning image classification pipeline implemented in a Jupyter notebook.
File structure
• Top-level:
• README.md – describes project goals and functionality
• “cats dogs” directory – contains subfolders for each class (train/test images)
• resnet.ipynb – the single Jupyter notebook hosting the entire pipeline
• No additional source directories, config files, or microservices. All logic lives in the notebook.
Key architecture insights from README
• Stages: Data Preparation → Model Creation → Training → Evaluation → Visualization
• Uses standard image transforms, cross-entropy loss, Adam optimizer, and confusion matrix.
Main components & their interactions
a. Data Storage
• Raw image folders (“cats dogs”) split into train/test subdirectories.
b. Data Ingestion & Preprocessing
• Jupyter Notebook cells load images via a DataLoader, apply Resize, CenterCrop, ToTensor, Normalize transforms.
c. Model Definition
• ResNet50 backbone with final fully-connected layer adjusted for 2 classes.
d. Training Engine
• Training loop: forward pass, loss computation, backward pass, optimizer step; logs train/val loss & accuracy.
e. Evaluation Module
• Runs model on test set; computes predictions and constructs a confusion matrix.
f. Visualization Module
• Plots loss/accuracy curves across epochs and displays the confusion matrix.
Architectural patterns & design principles
• Pipeline pattern: sequential dataflow through well-defined stages.
• Modularity within the notebook: separate code cells for each stage.
• Reuse of a pre-trained backbone (transfer learning).
Technologies and frameworks
• Python & Jupyter Notebook
• PyTorch (torchvision.models, DataLoader, transforms)
• matplotlib or seaborn for plotting
• scikit-learn (confusion_matrix)
Putting it all together
• “Metrics Store” (train/val curves)