Inspiration

Climate change has an impact on farmers' capacity to provide the food we all require. Weather volatility and more extreme occurrences, such as floods and droughts, alter growing seasons, limit water availability, allow weeds, pests, and fungus to thrive, and can impair agricultural yield. Soil erosion reduces the amount of land accessible for agriculture, and decreased biodiversity has an impact on crop pollination. Farmers are also under pressure to save water and use fewer agricultural inputs. Farmers must adjust to these changes while simultaneously reducing greenhouse gas emissions from agriculture through smart methods.

Farmers must fulfill our planet's evolving demands as well as the expectations of regulators, customers, food processors, and merchants. Climate change, soil erosion, and biodiversity loss are growing challenges, as are customers' changing food tastes and concerns about how it is produced. And the natural environment in which farming operates - plants, pests, and diseases – continues to present its own set of obstacles.

While conventional agriculture offers a wide range of options, the results are not always consistent because each farm is unique in terms of landscapes, soils, accessible technology, and prospective yields. We strive to mobilize and give the wand right in the hands of farm owners who should solely decide the next steps in pursuit of their biggest harvest.

What it does

'Kronia' signifies the Roman festival of Harvest in the honor of the god of harvest Cronus, is a one-stop-all mobile side ecosystem to maximize the harvest outputs. Kronia aims to deliver the following set of robust and agriculture revolutionizing features for the future of farming:

  • Kronia's crop advisor strives to recommend the maximum probable yielding crops and suitable fertilizers after detecting the farm's soil and assessing the present-day climate conditions taking everything as attributes in our specific and custom devised torch ANN and CNN models.
  • For a more research-oriented and precision-loving lot of farm scientists we have a dedicated fill up which they are required to attend to get the most recommended crops for the soil and field in concern.
  • Kronia can detect yield destructing diseases such as Bacterial Blights in cotton, stem rusts in the wheat plants, yellow mosaic in the okra leaves, brown spots in rice, infections in corn yields, and a wide array of other viral, fungal and bacterial plant and leaf diseases. This will assist the farmers with an apt trigger warning, giving them a possible list of symptoms and treatment plan at once.
  • For the unknowns and variables, we have our fruit detector demystifying the myths and traps, detecting the fruits in uncharted orchards, and bringing them to light for our farmers. We house an in-app video player for playing videos describing how-tos for fruit plantations.

How we built it

React Native javascript framework is used to build the farmer side android mobile application and deliver a fast, responsive, interactive, and efficient user experience. Firebase Authentication API is used to authenticate new users visiting the app first time.

The APIs serving torch weight and inference files are exposed via the Flask framework running to scale on Heroku Cloud Servers. Every model powering Kronia features is tested to the best of accuracy and performance on a real-life dataset of crops, soils, diseased leaves, and fruits. The torch ANN and CNN models serve the following features:

Important Link!: Click here to access Kronia Torch Model Codebase Repository

  1. Crop Recommender

    • Problem at hand: We strive to advise the best crops to the farmers and research-based agriculturists based on their soil and fertilizer attributes including NPK and ph level of the soil using our ANN models driven by PyTorch.
    • Model Architecture:
      1. Click here for Raw Data
      2. Defined a 3-layer feed-forward network with dropout and batch-norm.
      3. Used the nn.CrossEntropyLoss because this is a multiclass classification problem.
      4. No requirement of log_softmax layer after our final layer because nn.CrossEntropyLoss does the job.
  2. Fertilizer Recommender

    • Problem at hand: We strive to advise the best fertilizers and quick buy portal to the farmers and research-based agriculturists based on their soil NPK values and climate conditions in the area using our ANN models driven by PyTorch.
    • Model Architecture:
      1. Click here for Raw Data
      2. Defined a 3-layer feed-forward network with dropout and batch-norm.
      3. Used the nn.CrossEntropyLoss because this is a multiclass classification problem.
      4. No requirement of log_softmax layer after our final layer because nn.CrossEntropyLoss does the job.
  3. Wheat Disease Classifier

    • Problem at hand: We strive to detect the wheat plant diseases using our CNN models driven by torch and torchvision and classify the same.
    • Model Architecture:
      1. Click here for Raw Data or you find a resized version of the dataset here
      2. We use 4 blocks of Conv layers. Each block consists of Convolution + BatchNorm + ReLU + Dropout layers.
      3. Used the nn.CrossEntropyLoss to get the probabilities of output being 0, 1 or 2 where 0 is healthy, 1 is leaf rust and 2 is stem rust.
      4. No requirement of log_softmax layer after our final layer because nn.CrossEntropyLoss does the job.
  4. Rice Disease Classifier

    • Problem at hand: We strive to detect the rice plant diseases using our CNN models driven by torch and torchvision and classify the same.
    • Model Architecture:
      1. Click here for Raw Data
      2. We use a pre-trained AlexNet model(feature-extraction) with customizations in the final layer to make predictions on the dataset
      3. Using the Logarithmic Softmax function we get the probabilities of output being :
        • 0 is Bacterial Blight
        • 1 is Blast
        • 2 is Brownspot
        • 3 is Tungro
  5. Corn Disease Classifier

    • Problem at hand: We strive to detect the corn plant diseases using our CNN models driven by torch and torchvision and classify the same as infected or healthy corn.
    • Model Architecture:
      1. Click here for Raw Data or you can find a resized version of the dataset here
      2. We use a pre-trained AlexNet model(feature-extraction) with customizations in the final layer to make predictions on the dataset
      3. Using a logarithmic softmax layer we get the probabilities of output being 0 or 1 where 0 is healthy and 1 is infected
  6. Plant Leaf Disease Classifier

    • Problem at hand: We strive to detect the plant leaf diseases using our CNN models driven by torch and torchvision and classify the same into a wide array of disease classes.
    • Model Architecture:
      1. Click here for Raw Data
      2. We use 4 blocks of Conv layers and 2 Residual blocks to create a "Mini ResNet" model. Each conv block consists of Convolution + BatchNorm + ReLU
      3. The above layers are followed by a Fully Connected Linear layer
      4. Used the Logarithmetic Softmax function to predict diseases ranging from Potato's early blights to scabs in Apples
  7. Yellow Mosaic Disease Detector

    • Problem at hand: We strive to detect the yellow mosaic plant disease using our CNN models driven by torch and torchvision and classify the Okra Leaf as diseased or healthy.
    • Model Architecture:
      1. Click here for Raw Data or you can find the resized form of the data here
      2. We use 4 blocks of Conv layers. Each block consists of Convolution + ReLU + Max Pooling Layers
      3. The 4 Conv Blocks are followed by 2 fully connected linear layers
      4. Used the logarithmic softmax function to get the probabilities of output being :
        • 0 is Diseased Okra Leaf
        • 1 is Fresh Okra Leaf
  8. Cotton plant Disease Classifier

    • Problem at hand: We strive to detect the cotton plant diseases using our CNN models driven by torch and torchvision and classify the same.
    • Model Architecture:
      1. Click here for Raw Data
      2. We use 5 blocks of Conv layers. Each block consists of Convolution + ReLU + MaxPool layers.
      3. The Conv layers are followed by 2 fully connected linear layer
      4. Used the Logarithmic Softmax function to get the probabilities of output being :
        • 0 is Bacterial Blight
        • 1 is Curl Virus
        • 2 is Fussarium Wilt
        • 3 is Healthy
  9. Fruit Plant Classifier

    • Problem at hand: We strive to detect the fruit plants from uncharted and exotic orchards using our CNN models driven by torch and torchvision and classify the same.
    • Model Architecture:
      1. Click here for Raw Data
      2. We use 3 blocks of Conv layers. Each block consists of Convolution + ReLU + Max Pooling Layer.
      3. The 3 Conv blocks are followed by 2 fully connected layers
      4. Used the Logarithmic Softmax function to classify among several fruits ranging from Apples to Huckleberries
  10. Soil Outlier Detector

    • Problem at hand:We strive to detect the soil outlier and filter the same before the image is run on the native Soil classifier API using our CNN models driven by torch and torchvision.
    • Model Architecture:
      1. Click here for Raw Data
      2. We use a pre-trained AlexNet model(feature-extraction) with customizations in the final layer to make predictions on the dataset
      3. Using a logarithmic softmax layer we get the probabilities of output being :
        • 0, where 0 is Non Soil Images
        • 1, where 1 is Soil Images
  11. Soil Classifier

    • Problem at hand: We strive to detect the soils present in the farm fields and extract significant attributes like the NPK value and ph level found in the classified soil using our CNN models driven by torch and torchvision.
    • Model Architecture:
      1. Click here for Raw Data
      2. We use 5 blocks of Conv layers. Each block consists of Convolution + ReLU + Max Pooling layers.
      3. Used the Logarithmic Softmax Function to get the probabilities of output being :
        • 0 is Black Soil
        • 1 is Clayey Soil
        • 2 is Loamy Soil
        • 3 is Red Soil
        • 4 is Sandy Soil

Challenges we ran into

  • Optimizing the native React-native libraries for multiple SDK support making the software implementation on the client side more robust across different platforms.
  • Building Outlier detectors for the seamless working of our native ANN and CNN classifiers.
  • Optimizing the torch models to be run on the cloud server in the scenario of the minimum possible availability of computing resources.

Accomplishments that we're proud of

  • Devised a fully automated, responsive, and easily navigable farmer-friendly mobile side android application.
  • We preprocessed, implemented, trained, and deployed the state-of-the-art ANN and CNN torch models solving all the farming dilemmas.
  • Implemented a custom soil detector to avoid outlier images from breaching the soil classification model underneath.

What we learned

Implementing this project from the idea phase to designing the product and making it shippable has given our team a great learning curve. Some of the highlights are:

  • Pytorch Multiclass Image Classification using torchvision.
  • Data Preprocessing, Cleaning, and analysis.
  • Continuous integration and deployment of torch ANN and CNN models at scale.

What's next for Kronia

We strive to deliver the following set of updates in the future patches of our application:

  • Drought Forecast
  • Improve existing models and optimization
+ 8 more
Share this project:

Updates