File size: 1,463 Bytes
7245d3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e27a76
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
# Soil Type Image Classifier 🌱🧠

This model is a Convolutional Neural Network (CNN) trained to classify different types of soil from images using TensorFlow and Keras. It helps automate soil type identification, which can be useful for agriculture, environmental monitoring, and research.

## 🏷️ Soil Categories
The model can identify the following 11 soil types:
- Alluvial soil
- Black Soil
- Cinder Soil
- Clayey soils
- Laterite soil
- Loamy soil
- Peat Soil
- Sandy loam
- Sandy soil
- Yellow Soil

## 📁 Dataset
The training dataset consists of soil images stored in category-specific folders. It was split into 80% training and 20% validation sets. Data augmentation techniques (rotation, zoom, flips, etc.) were applied to improve generalization.

## 🧠 Model Architecture
- 4 Convolutional layers with increasing filters (32 → 128)
- MaxPooling after each conv layer
- Flatten layer followed by:
  - Dense(512) + ReLU
  - Dropout(0.5)
  - Dense output layer with Softmax activation

## ⚙️ Training Configuration
- Image size: 224x224
- Batch size: 32
- Epochs: 15
- Loss: categorical_crossentropy
- Optimizer: Adam

## 📈 Results
Training and validation accuracy were tracked, and results are plotted in the included `training_results.png`.

## 🧪 Prediction
You can use the `predict_soil_type()` function to classify a new image:
```python
soil_type, confidence = predict_soil_type(model, 'path/to/image.jpg', class_indices)