Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,96 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: unknown
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: unknown
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# **Cats, Dogs, and Snakes Dataset**
|
| 6 |
+
|
| 7 |
+
## **Dataset Overview**
|
| 8 |
+
|
| 9 |
+
The dataset contains images of **three animal classes**: Cats, Dogs, and Snakes. It is **balanced and cleaned**, designed for supervised image classification tasks.
|
| 10 |
+
|
| 11 |
+
| Class | Number of Images | Description |
|
| 12 |
+
| ------ | ---------------- | ---------------------------------------------- |
|
| 13 |
+
| Cats | 1,000 | Includes multiple breeds and poses |
|
| 14 |
+
| Dogs | 1,000 | Covers various breeds and backgrounds |
|
| 15 |
+
| Snakes | 1,000 | Includes multiple species and natural settings |
|
| 16 |
+
|
| 17 |
+
**Total Images:** 3,000
|
| 18 |
+
|
| 19 |
+
**Image Properties:**
|
| 20 |
+
|
| 21 |
+
* Resolution: 224×224 pixels (resized for consistency)
|
| 22 |
+
* Color Mode: RGB
|
| 23 |
+
* Format: JPEG/PNG
|
| 24 |
+
* Cleaned: Duplicate, blurry, and irrelevant images removed
|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## **Data Split Recommendation**
|
| 29 |
+
|
| 30 |
+
| Set | Percentage | Number of Images |
|
| 31 |
+
| ---------- | ---------- | ---------------- |
|
| 32 |
+
| Training | 70% | 2,100 |
|
| 33 |
+
| Validation | 15% | 450 |
|
| 34 |
+
| Test | 15% | 450 |
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## **Preprocessing**
|
| 39 |
+
|
| 40 |
+
Images in the dataset have been standardized to support machine learning pipelines:
|
| 41 |
+
|
| 42 |
+
1. **Resizing** to 224×224 pixels.
|
| 43 |
+
2. **Normalization** of pixel values to [0,1] or mean subtraction for deep learning frameworks.
|
| 44 |
+
3. **Label encoding**: Integer encoding (0 = Cat, 1 = Dog, 2 = Snake) or one-hot encoding for model training.
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## **Example: Loading and Using the Dataset (Python)**
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
import os
|
| 52 |
+
import tensorflow as tf
|
| 53 |
+
from tensorflow.keras.preprocessing.image import ImageDataGenerator
|
| 54 |
+
|
| 55 |
+
# Path to dataset
|
| 56 |
+
dataset_path = "path/to/dataset"
|
| 57 |
+
|
| 58 |
+
# ImageDataGenerator for preprocessing
|
| 59 |
+
datagen = ImageDataGenerator(
|
| 60 |
+
rescale=1./255,
|
| 61 |
+
validation_split=0.15 # 15% for validation
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
# Load training data
|
| 65 |
+
train_generator = datagen.flow_from_directory(
|
| 66 |
+
dataset_path,
|
| 67 |
+
target_size=(224, 224),
|
| 68 |
+
batch_size=32,
|
| 69 |
+
class_mode='categorical',
|
| 70 |
+
subset='training',
|
| 71 |
+
shuffle=True
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
# Load validation data
|
| 75 |
+
validation_generator = datagen.flow_from_directory(
|
| 76 |
+
dataset_path,
|
| 77 |
+
target_size=(224, 224),
|
| 78 |
+
batch_size=32,
|
| 79 |
+
class_mode='categorical',
|
| 80 |
+
subset='validation',
|
| 81 |
+
shuffle=False
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
+
# Example: Iterate over one batch
|
| 85 |
+
images, labels = next(train_generator)
|
| 86 |
+
print(images.shape, labels.shape) # (32, 224, 224, 3) (32, 3)
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## **Key Features**
|
| 92 |
+
|
| 93 |
+
* **Balanced:** Equal number of samples per class reduces bias.
|
| 94 |
+
* **Cleaned:** High-quality, relevant images improve model performance.
|
| 95 |
+
* **Diverse:** Covers multiple breeds, species, and environments to ensure generalization.
|
| 96 |
+
* **Ready for ML:** Preprocessed and easily integrated into popular deep learning frameworks.
|