File size: 2,758 Bytes
6808c54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
license: unknown
---

# **Cats, Dogs, and Snakes Dataset**

## **Dataset Overview**

The dataset contains images of **three animal classes**: Cats, Dogs, and Snakes. It is **balanced and cleaned**, designed for supervised image classification tasks.

| Class  | Number of Images | Description                                    |
| ------ | ---------------- | ---------------------------------------------- |
| Cats   | 1,000            | Includes multiple breeds and poses             |
| Dogs   | 1,000            | Covers various breeds and backgrounds          |
| Snakes | 1,000            | Includes multiple species and natural settings |

**Total Images:** 3,000

**Image Properties:**

* Resolution: 224×224 pixels (resized for consistency)
* Color Mode: RGB
* Format: JPEG/PNG
* Cleaned: Duplicate, blurry, and irrelevant images removed

---

## **Data Split Recommendation**

| Set        | Percentage | Number of Images |
| ---------- | ---------- | ---------------- |
| Training   | 70%        | 2,100            |
| Validation | 15%        | 450              |
| Test       | 15%        | 450              |

---

## **Preprocessing**

Images in the dataset have been standardized to support machine learning pipelines:

1. **Resizing** to 224×224 pixels.
2. **Normalization** of pixel values to [0,1] or mean subtraction for deep learning frameworks.
3. **Label encoding**: Integer encoding (0 = Cat, 1 = Dog, 2 = Snake) or one-hot encoding for model training.

---

## **Example: Loading and Using the Dataset (Python)**

```python
import os
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator

# Path to dataset
dataset_path = "path/to/dataset"

# ImageDataGenerator for preprocessing
datagen = ImageDataGenerator(
    rescale=1./255,
    validation_split=0.15  # 15% for validation
)

# Load training data
train_generator = datagen.flow_from_directory(
    dataset_path,
    target_size=(224, 224),
    batch_size=32,
    class_mode='categorical',
    subset='training',
    shuffle=True
)

# Load validation data
validation_generator = datagen.flow_from_directory(
    dataset_path,
    target_size=(224, 224),
    batch_size=32,
    class_mode='categorical',
    subset='validation',
    shuffle=False
)

# Example: Iterate over one batch
images, labels = next(train_generator)
print(images.shape, labels.shape)  # (32, 224, 224, 3) (32, 3)
```

---

## **Key Features**

* **Balanced:** Equal number of samples per class reduces bias.
* **Cleaned:** High-quality, relevant images improve model performance.
* **Diverse:** Covers multiple breeds, species, and environments to ensure generalization.
* **Ready for ML:** Preprocessed and easily integrated into popular deep learning frameworks.