A simple Convolutional Neural Network (CNN) built with TensorFlow/Keras to distinguish between cats and dogs.
download_images.py: Downloads 100 images (50 cats, 50 dogs) from public APIs.train_model.py: Preprocesses images and trains the CNN model.predict.py: Script to run inference on individual images.requirements.txt: List of dependencies.cat_dog_model.h5: The trained model file (generated after training).
pip install -r requirements.txtTrain the AI model on the downloaded images:
python train_model.pyUse the prediction script to identify an image:
python predict.py path/to/your/image.jpgThe model uses a sequential CNN architecture with:
- Rescaling layer (normalization)
- 3 Convolutional blocks with MaxPooling
- A Dense layer with 128 units
- A final output layer for 2 classes (Cats, Dogs)