{"id":28209760,"url":"https://github.com/45harry/cat_or_dog_classification_using_cnn","last_synced_at":"2025-06-10T21:32:15.443Z","repository":{"id":280794595,"uuid":"943186890","full_name":"45Harry/Cat_or_Dog_classification_using_CNN","owner":"45Harry","description":"Cat or Dog Binary Classifier using CNN.  This project is a Convolutional Neural Network (CNN) built with TensorFlow and Keras to classify images of cats and dogs. ","archived":false,"fork":false,"pushed_at":"2025-03-05T10:26:22.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T16:15:14.727Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/45Harry.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-05T09:56:40.000Z","updated_at":"2025-03-05T10:26:25.000Z","dependencies_parsed_at":"2025-03-05T11:22:54.598Z","dependency_job_id":"4e5bf117-91b7-4a6d-ac6d-76d0d6425f4a","html_url":"https://github.com/45Harry/Cat_or_Dog_classification_using_CNN","commit_stats":null,"previous_names":["45harry/cat_or_dog_classification_using_cnn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCat_or_Dog_classification_using_CNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCat_or_Dog_classification_using_CNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCat_or_Dog_classification_using_CNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCat_or_Dog_classification_using_CNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/45Harry","download_url":"https://codeload.github.com/45Harry/Cat_or_Dog_classification_using_CNN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCat_or_Dog_classification_using_CNN/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259154461,"owners_count":22813603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-17T16:13:22.114Z","updated_at":"2025-06-10T21:32:15.436Z","avatar_url":"https://github.com/45Harry.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cat or Dog Binary Classifier using CNN\n\nThis project is a binary image classifier that distinguishes between cats and dogs using a Convolutional Neural Network (CNN) built with TensorFlow and Keras.\n\n## Table of Contents\n- [Summary](#Summary)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Dataset](#dataset)\n- [Model Architecture](#model-architecture)\n- [Training](#training)\n- [Prediction](#prediction)\n- [License](#license)\n\n## Summary\nThis project demonstrates how to build and train a CNN model to classify images of cats and dogs. The model is trained on a dataset of cat and dog images and can predict whether a new image contains a cat or a dog.\n\n## Installation\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/your-username/cat-dog-classifier.git\n   cd cat-dog-classifier\n\n    Install the required dependencies:\n \n     pip install tensorflow numpy\n\nUsage\n\n    Prepare the Dataset:\n\n        Organize your dataset into the following structure:\n        Copy\n\n        Datasets/\n          train/\n            cat/\n            dog/\n          test/\n            cat/\n            dog/\n\n        Replace the paths in the code with your dataset paths.\n\n    Train the Model:\n\n        Run the provided script to train the CNN model:\n\n        python train.py\n\n    Make Predictions:\n\n        To predict whether an image contains a cat or a dog, place the image in the Datasets/prediction_data/ folder and run the prediction code.\n\nDataset\n\nThe dataset should contain images of cats and dogs organized into train and test directories. Each directory should have subdirectories for cat and dog images.\n\nExample structure:\n\nDatasets/\n  train/\n    cat/\n      cat1.jpg\n      cat2.jpg\n    dog/\n      dog1.jpg\n      dog2.jpg\n  test/\n    cat/\n      cat3.jpg\n    dog/\n      dog3.jpg\n\nModel Architecture\n\nThe CNN model consists of the following layers:\n\n    Two Conv2D layers with ReLU activation.\n\n    Two MaxPooling2D layers.\n\n    A Flatten layer.\n\n    Two Dense layers with ReLU activation.\n\n    A final Dense layer with sigmoid activation for binary classification.\n\nTraining\n\nThe model is trained using the Adam optimizer and binary cross-entropy loss. Data augmentation is applied to the training dataset to improve generalization.\nPrediction\n\nTo predict whether an image contains a cat or a dog:\n\n    Place the image in the Datasets/prediction_data/ folder.\n\n    Run the prediction code:\n    \n    img = tf.keras.preprocessing.image.load_img('path_to_image.jpg', target_size=(64, 64))\n    img = tf.keras.preprocessing.image.img_to_array(img)\n    img = np.expand_dims(img, axis=0)\n    prediction = cnn.predict(img)\n    if prediction[0][0] \u003e 0.5:\n        print(\"Dog\")\n    else:\n        print(\"Cat\")\n\nLicense\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F45harry%2Fcat_or_dog_classification_using_cnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F45harry%2Fcat_or_dog_classification_using_cnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F45harry%2Fcat_or_dog_classification_using_cnn/lists"}