Model

Our ML Model

An in-depth look at the architecture, frameworks, and innovative techniques behind our AI-powered plant disease detection.

Explore More

Model Overview

Our machine learning model is built on a Convolutional Neural Network (CNN) architecture. It has been trained on a large dataset of plant images to detect disease symptoms early and accurately. We leverage frameworks such as PyTorch and TensorFlow to design, train, and optimize our model.

Architecture

  • Convolutional layers to extract image features
  • MaxPooling layers for spatial downsampling
  • Fully connected Dense layers for classification
  • Dropout layers to reduce overfitting

Framework & Tools

  • PyTorch & TensorFlow
  • Python for prototyping and training
  • Scikit-learn for model evaluation
  • GPU acceleration for efficient training

Our CNN Architecture

Below is an important snippet from our model’s CNN architecture.

class Plant_Disease_Model(ImageClassificationBase):

            def __init__(self):
              super().__init__()
              self.network = nn.Sequential(
                  nn.Conv2d(3,32,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.Conv2d(32,64,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.MaxPool2d(2,2), #output : 64*64*64

                  nn.Conv2d(64,64,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.Conv2d(64,128,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.MaxPool2d(2,2), #output : 128*32*32

                  nn.Conv2d(128,128,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.Conv2d(128,256,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.MaxPool2d(2,2), #output : 256*16*16

                  nn.Conv2d(256,256,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.Conv2d(256,512,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.MaxPool2d(2,2), #output : 512*8*8

                  nn.Conv2d(512,512,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.Conv2d(512,1024,kernel_size=3,stride=1,padding=1),
                  nn.ReLU(),
                  nn.MaxPool2d(2,2), #output : 1024*4*4
                  nn.AdaptiveAvgPool2d(1),

                  nn.Flatten(),
                  nn.Linear(1024,512),
                  nn.ReLU(),
                  nn.Linear(512,256),
                  nn.ReLU(),
                  nn.Linear(256,38)
                  )

            def forward(self,xb):
              out = self.network(xb)
              return out

          model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
          model.summary()

Transfer Learning

Utilized pretrained weights from ResNet50 and EfficientNet architectures

Deep CNN Architecture

8 convolutional layers with max pooling and batch normalization

Optimization

Adam optimizer with learning rate scheduling and early stopping

Model Architecture

Model Architecture Component Placeholder

Key Components

  • 5 Convolutional Blocks
  • Batch Normalization
  • Max Pooling
  • Global Average Pooling
  • 0.5 Dropout Rate
  • 38-class Output

Performance Metrics

99.7%
Training Accuracy
99.2%
Validation Accuracy
98.9%
Precision
99.1%
Recall

Layer-wise Feature Extraction

See how different layers contribute to the overall feature extraction in our model.

Conv1
Pool1
Conv2
Pool2
Dense

Training & Evaluation

Our model was trained on over 75K annotated plant images using advanced data augmentation and transfer learning techniques to boost performance. Extensive cross-validation and hyperparameter tuning ensured a detection accuracy of over 99%.

© 2025 PhytoSense. All rights reserved.