Skip to content

About

A deep learning web application that identifies soil types from images using a MobileNetV2 convolutional neural network, built with Streamlit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🌱 Soil Identification

A deep learning web application that identifies soil types from images using a MobileNetV2 convolutional neural network, built with Streamlit.

Overview

This project classifies soil images into seven categories using a fine-tuned MobileNetV2 model. The app also includes an Exploratory Data Analysis (EDA) page to explore the dataset used for training.

Soil classes:

  • Alluvial Soil
  • Arid Soil
  • Black Soil
  • Laterite Soil
  • Mountain Soil
  • Red Soil
  • Yellow Soil

Features

  • Exploratory Data Analysis (EDA) — view the dataset overview and the image distribution across classes.
  • Prediction — upload an image file or paste an image URL to classify the soil type, with a confidence score and per-class probability breakdown.
  • The trained model is automatically downloaded from Google Drive on first run if it isn't already present locally.

Dataset

The dataset used for training is a comprehensive soil classification dataset sourced from Kaggle (ai4a-lab/comprehensive-soil-classification-datasets). Image counts per class:

Class Images
Arid Soil 284
Black Soil 255
Laterite Soil 219
Mountain Soil 201
Red Soil 109
Yellow Soil 69
Alluvial Soil 51

Tech Stack

  • Python
  • Streamlit
  • TensorFlow / Keras (MobileNetV2)
  • Pandas, NumPy
  • Matplotlib, Plotly, Altair
  • Pillow (PIL)
  • gdown

Project Structure

Soil-Identification/
├── README.md
├── requirements.txt
└── src/
    ├── streamlit_app.py       # Main Streamlit entry point
    ├── eda.py                 # Exploratory Data Analysis page
    ├── prediction.py          # Soil image prediction page
    ├── model_MobileNetV2.h5   # Trained model (or downloaded at runtime)
    └── Original-Dataset.csv   # Dataset metadata (file paths and labels)

Installation

  1. Clone the repository:

    git clone https://github.com/nhf14/Soil-Identification.git
    cd Soil-Identification
  2. Install the dependencies:

    pip install -r requirements.txt

Usage

Run the Streamlit app from the project root:

streamlit run src/streamlit_app.py

Then open the app in your browser and choose a page from the sidebar:

  • EDA — explore the dataset and class distribution.
  • Prediction — upload an image or paste an image URL to get a soil type prediction.

Model

The classification model is a MobileNetV2-based CNN trained on 224x224 RGB soil images. If the model file (model_MobileNetV2.h5) is not found locally, it will be automatically downloaded from Google Drive the first time the Prediction page is used.

Notes

  • Predictions are for informational/educational purposes and should not be treated as a substitute for professional soil analysis.

About

A deep learning web application that identifies soil types from images using a MobileNetV2 convolutional neural network, built with Streamlit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages