Giter Site home page Giter Site logo

ancv_sf_uh21's Introduction

AnCv_SF_UH21


Logo

WREF

Mobile Agriculture Application
Provide the best services to Vietnamese farmers and pesticide shops

Prototype · MVP Product · Report Bug

Table of Contents
  1. About The Project
  2. Tech Stack
  3. How to run this project
  4. Technology in detailed
  5. References

About The Project

AnCv team created the WREF Mobile Agriculture App to provide the best services to Vietnamese farmers and pesticide retailers. We use technology to help Vietnamese farmers, especially those in the Central region, overcome productivity challenges.

The app connects with retailers so they know the farmers' agricultural performance to improve their business and help sell the right products through a dedicated app for retailers odd.

Main screen

You can visit our website for more information.

Main screen

Application for farmers


Main screen flood prediction productivity prediction pest identification

Farmers need a cheap product that solves all their problems: natural disasters, diseases, wrong pesticide products and low yields.

  • Use AI to recognize images and analyze diseases on trees, therefore recommending solutions and products to use. (code here)
  • Use RS and AI to predict crop yields. (code here)
  • Use OpenWeather API and AI for flood prediction and early weather forecast. (code here)
  • Use OpenWeather API to display the weather forecast for the next 24h, 5 days. (code here)
  • Agricultural knowledge is obtained from Harvest Helper. (code here)
  • Agricultural social networks help farmers to share beautiful and happy moments when achieving results. (code here)

In addition, farmers can also directly order agricultural tools, fertilizers, pesticides, etc. from the retailers in the app.

This is the intro video for this app.

Video intro

Application for pesticides retailers


Order import goods product information

Pesticides retailers will use a sub-application to be able to post the products being sold in the store to the system, if a farmer places an order, they can clearly see the farmer's information. when they order products on the app.

  • Statistics of the store's business activities. (code here)
  • Register to open an app store. (code here)
  • Order Management. (code here)
  • Import goods from companies providing products. (code here)

Tech Stack

Platform used

Core technologies

How to run this project

Setup API Server

To run the API Server on your local, your environment must have Node.js and NPM installed on your computer.

  1. Open Server-wref folder and create node environment using command:
npm install
  1. Run server in dev mode using command:
npm run dev

This action will start the server in port 3000 with Nodemon inspector.

The API Server provide many APIs for the mobile app including WREF app and WREF app for retailers.

  1. Now, you can continue develop this server by add some new custom API. Or you can add, remove or modify some requests provided in the server router.
// Some API using in this server
// You can find this code in `app.js` file

app.use('/api', apiLogin);
app.use('/api', apiInforAgri);
app.use('/api', passport.authenticate('jwt', { session: false }), apiPosts);
app.use('/api', passport.authenticate('jwt', { session: false }), apiUser);
app.use('/api', passport.authenticate('jwt', { session: false }), apiComment);
...
app.use('/', (req, res) => {
  res.render('index.ejs');
});
  1. When you are ready to public this server, you can use Heroku to host on the cloud.

Here is the server we have developed on the cloud: https://wref.herokuapp.com/ >

Api

Setup WREF app

To run this app. You must have installed Android Studio and make sure Android SDK with API Level 29 installed.

The app is located in WREF-app folder. User your Android Studio to open it.

Setup WREF app for retailers

This app is developed by Flutter Framework. You must have installed it to continue develop it or run.

The app is located in retail_agent_werf folder.

Technology in detailed

In this section, we will present the details of all the core technologies using in this project.

AI Workflow

Data collection:

There are all the datasets we use to train some models.

All the datasets located in AI/datasets folder.

This dataset contains rainfall, temperature and humidity day by day from 1979 - 2012.

This image is the rainfall dataset from 2010 to 2016. In each frequency, temperature, humidity and rain fall is almost repeat the same in each year.

This dataset contains rainfall and water flow day by day from 1978 - 2006.

This image is the rainfall dataset from 2000 to 2006. In each frequency, rainfall and water flow is almost repeat the same in each year.

This dataset contains temperature, humidity, precipitation and yield area month by month from 1997 - 2014. In each year, it has data from 17 districts.

This image is the crop yield dataset from 2010 to 2014.

We also have a crop yield dataset from more than 200 districts in Quang Nam Province. You can find it here.

We use the PlantVillage dataset consisting of about 87,000 healthy and unhealthy leaf images. It is divided into 38 categories by species and disease. We also end up transfer learning from MobileNet and use the weights from pre-training on ImageNet.

Data Processing

Because almost all of the models are using RNN as core AI. So we divided the dataset into many row. Each row contain 5 - 10 history data inside the dataset.

We also use time as a field in the training data because the type of dataset is time series.

Model Creation

Rainfall AI model

In this model, we use Rain Fall dataset to training. This model using RNN including Bidirectional LSTM Network and Fully Connected Network. The model structure is display below.

We trained this model in 100 epochs. Here is metrics' chart of this model calculated by MSE function:

As we can see, the result of this model is not good because the data in 1976 to 2014 is old and because of climate change, the model can't predict as much as a perfect model when the climate is normal.

But the model can predict a acceptable result with a small difference with the real value.

This is the result when we test this model on the testing dataset. The blue line is the real rainfall (mm) in real life and the orange line is the prediction ones.

Water Flow AI model

In this model, we use Water Flow dataset to training. This model just using normal Neural Network include many Fully Connected Network to build. The model structure is display below.

We trained this model in 100 epochs. Here is metrics' chart of this model calculated by MSE function:

As we can see, the result of this model good. The model can predict a result that is closing to the real value.

This is the result when we test this model on the testing dataset. The blue line is the real water flow (m3/s) in real life and the orange line is the prediction ones.

Crop Yield AI Model

In this model, we use Crop Yield dataset to training. This model combine of 2 small model:

  1. Normal Neural Network contain many Fully Connected Network to get the specific properties of the data.
  2. RNN using Word Embedding to extract feature and remember these features of the dictionary data including Soil Types, Districts, Plant's Types and Seasons.

The result of this 2 small model is combine to the main model and go throwing many Fully Connected Networks to predict the result.

We trained this model in 100 epochs. Here is metrics' chart of this model calculated by MSE function:

As we can see, the result of this model is so good. The model can predict a result that is very closing to the real value with difference about 3 - 5 hundredweight.

This is the result when we test this model on the testing dataset. The blue line is the real Crop Yield Harvest (hundredweight/ha) in real life and the orange line is the prediction ones.

Plant Disease AI model

In this model, we use Plant Village Dataset to training. This model is transferred learning from Mobile Net v1.0 model developed by Google.

We have just replace and add some Fully Connected Network in the output of Mobile Net model. The result of this model is the plant disease predicted from the input image. It is displayed as the one-hot vector with 1 is the position of plant's disease name in the dictionary label.

The model structure is display below.

We trained this model in 25 epochs. Here is metrics' chart of this model calculated by Categorical Cross Entropy function:

As we can see, the result of this model good. The model can predict a result that is closing to the real value.

This is the result when we test this model.

Model Deployment

All the models above is converted to TFlite format to easily import to android devices. You can found them in the WREF-app\app\src\main\assets folder.

You can also found some notebook we used to develop AI in the AI\models\notebooks folder.

Remote Sensing

This app will using Remote Sensing to get the data and predicting highly accuracy in the next generation app.

References

Mobile Net v1: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md

Plant Village Dataset: https://knowyourdata-tfds.withgoogle.com/#tab=STATS&dataset=plant_village

Fully Connected vs Convolutional Neural Networks: https://medium.com/swlh/fully-connected-vs-convolutional-neural-networks-813ca7bc6ee5

Harvest Helper: https://github.com/damwhit/harvest_helper

Remote Sensing: https://en.wikipedia.org/wiki/Remote_sensing


If you like this project please do give a star. Thank you!

Made by AnCv Team - UAVS Hackatrix 2021.

ancv_sf_uh21's People

Contributors

nabatti99 avatar nmthangdn2000 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.