SoilScan is a research project building an end-to-end pipeline for non-destructive soil nutrient analysis using field photography and deep learning. It targets smallholder farms in the Cordillera Administrative Region of the Philippines (Atok, La Trinidad, Benguet), where lab soil testing is inaccessible or cost-prohibitive.
The repository is split into focused branches. This page is your map.
Field researcher
|
v
[ AgriCapture app ] ──── captures geotagged photos + metadata ────> CSV + images
| |
| v
| [ Soil BG Remover tool ]
| (optional preprocessing)
| |
v v
[ SoilScan app ] <──── on-device inference ──── [ ML Training Pipeline ]
(end-user) model/classification-models
- AgriCapture collects the raw data (photos + GPS + weather + labels) in the field.
- The ML pipeline trains deep learning models on that data to predict N, P, K levels.
- The SoilScan app delivers predictions to end-users via an on-device or API-backed interface.
- The Soil BG Remover is a preprocessing tool for cleaning controlled-environment images before training.
| Branch | What it is | Stack | README |
|---|---|---|---|
model/classification-models |
Deep learning training pipeline. Predicts N, P, K (Low/Medium/High) from field photos. Supports ResNet-50, EfficientNet-B4, ConvNeXt-Tiny, ViT-B/16. Full TensorBoard, AMP, early stopping. | Python · PyTorch · timm | README |
tool/agricapture-camera-directory |
Android field data collection app. Camera + GPS + compass + weather per capture. Exports ZIP archives (CSV + images) for handoff to the ML pipeline. | React Native · Expo · Android | README |
feature/soil-bg-remover |
Desktop GUI for removing backgrounds from soil sample photos. Supports AI full removal, AI + lasso, zoom edit, and field mode for outdoor images. | Python · Tkinter | README |
| Branch | What it is | Stack |
|---|---|---|
main (this page) |
Original SoilScan app. Soil texture classification (ResNet-50) + fertilizer recommendation (ExtraTreeClassifier). Hugging Face Spaces backend. | React Native · Expo · Hugging Face |
version/soilcan-texture-build |
Soil texture + crop recommendation variant (ResNet-50 + XGBoost). | React Native · Expo |
version/SoilScan-GIS-Web |
Web-based GIS version of the SoilScan interface. | Web |
| Branch | What it is |
|---|---|
tool/agricapture-camera |
Earlier single-camera variant of AgriCapture. |
feature/lens-cap-camera |
Experimental lens-cap detection feature. |
prototype/soilscan-GIS |
Early GIS integration prototype. |
I want to collect soil field data → tool/agricapture-camera-directory
I want to train or evaluate an NPK prediction model → model/classification-models
I want to preprocess controlled-environment images → feature/soil-bg-remover
I want to run the end-user soil scanner app → you are on the right branch — see How to Run below.
The original SoilScan mobile app. A user points their phone camera at soil, and the app returns the soil texture classification and fertilizer recommendations.
| Layer | Technology |
|---|---|
| Mobile app | React Native (Expo) |
| Soil classification | ResNet-50 CNN |
| Fertilizer recommendation | ExtraTreeClassifier |
| Backend / inference | Python on Hugging Face Spaces |
Soil Image Classification — upload or capture a photo to get soil texture, description, and properties.
Fertilizer Recommendation — input NPK values, temperature, moisture, and crop type to get a fertilizer recommendation and description.
Prerequisites: Node.js, npm 10.9+, Expo Go on your device.
# 1. Clone and install
git clone https://github.com/ljiro/SoilScan.git
cd SoilScan
npm install
# 2. Start (local network)
npx expo start
# 3. Start (over the internet / tunnel)
npx expo start --tunnelScan the QR code with Expo Go on your Android or iOS device.
This project supports agricultural research in the Cordillera Administrative Region, Philippines. The primary study areas are Atok and La Trinidad, Benguet — highland vegetable-farming communities where soil health directly determines crop yields and food security.
The goal is to replace or supplement expensive laboratory soil testing with a phone camera, making nutrient-level assessment accessible to individual farmers in the field.




