Skip to content

SkSumaiyaSamreen/tree-species-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌳 Tree Intelligence Assistant

This AI-powered app helps students and nature enthusiasts identify and explore tree species based on image, location, and tree attributes.


🧠 Features

🌲 Recommend Trees by Location
  • Input GPS coordinates (latitude, longitude)
  • Specify tree diameter, native status, city, and state
  • Returns the top 5 tree species likely found in that area
πŸ“ Find Locations for a Tree
  • Choose a tree species from a dropdown
  • Displays cities and states where the species is most commonly found
πŸ“· Identify Tree from Image
  • Upload an image of a tree
  • CNN model predicts the species
  • If found in the dataset, shows common locations for that species

πŸ“Š Dataset Description

πŸ—‚οΈ Tree Metadata
  • Source: Open tree surveys from multiple cities (e.g., Louisville, Chicago)
  • Total records: ~1.38 million
  • Key columns:
    • common_name: Tree species (e.g., Bur Oak)
    • scientific_name: Botanical name (e.g., Quercus macrocarpa)
    • latitude_coordinate, longitude_coordinate
    • city, state, address
    • native: Whether the tree is native to the area
    • diameter_breast_height_CM: Tree height/width measure
πŸ–ΌοΈ Tree Image Dataset
  • Structure: Folder-based, each folder named after a tree species
  • Use: Used to train the CNN for species recognition
  • Preprocessing:
    • Images resized to 224x224
    • Normalized pixel values
    • Augmented with flips, zoom, and rotation

πŸ§ͺ Algorithms Used

πŸ” Recommender System
  • Algorithm: K-Nearest Neighbors (KNN)
  • Library: sklearn.neighbors.NearestNeighbors
  • Inputs: location, diameter, native status, city/state
  • Output: Most common tree species nearby
🧠 CNN Classifier
  • Model: Sequential CNN (Conv2D + MaxPooling + Dense layers)
  • Library: tensorflow.keras
  • Input: 224x224 image
  • Output: Predicted tree species with probability
  • Loss: Categorical Crossentropy
  • Optimizer: Adam
πŸ“Š Preprocessing & Encoding
  • Categorical Encoding: LabelEncoder
  • Scaling: StandardScaler for lat/lon/diameter
  • Data Splits: 80% training, 20% validation

βœ… How to Run

  1. Run 5M_trees.ipynb to train the recommender and save:

    • tree_data.pkl
    • scaler.joblib
    • nn_model.joblib
  2. Run tree_CNN.ipynb to train the image classifier and save:

    • basic_cnn_tree_species.h5
  3. Launch the app:

streamlit run streamlit_integrated.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors