Our ML Model
An in-depth look at the architecture, frameworks, and innovative techniques behind our AI-powered plant disease detection.
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
Key Components
- 5 Convolutional Blocks
- Batch Normalization
- Max Pooling
- Global Average Pooling
- 0.5 Dropout Rate
- 38-class Output
Performance Metrics
Layer-wise Feature Extraction
See how different layers contribute to the overall feature extraction in our model.
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%.