You are on page 1of 31

CHUKA UNIVERSITY

FACULTY OF SCIENCE ENGINEERING AND TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE

BRIAN ABEA MOGAKA

EB1/32973/17

COSC 482: COMPUTER SYSTEM PROJECT 1

SMARTFARMKE

MR. OTULA

SUBMITTED TO THE DEPARTMENT OF COMPUTER SCIENCE IN A PARTIAL FULFILLMENT OF THE


REQUIREMENTS FOR THE DEGREE OF BACHELOR OF SCIENCE COMPUTER SCIENCE
Table of Contents
LIST OF FIGURES........................................................................................................................iii
ACRONYMS..................................................................................................................................iv
CHAPTER 1: INTRODUCTION....................................................................................................5
1.0 Introduction............................................................................................................................5
1.1 Background of The Study......................................................................................................5
1.2 Problem Statement.................................................................................................................6
1.3 Proposed Solution..................................................................................................................7
1.3.1 Aim of The Project.........................................................................................................7
1.3.2 Objectives.......................................................................................................................7
1.4 Significance of Project...........................................................................................................7
CHAPTER 2: LITERATURE REVIEW.........................................................................................9
CHAPTER 3: METHODOLOGY.................................................................................................11
3.1 Introduction..........................................................................................................................11
3.2 System Development Life Cycle (SDLC) Methodology.....................................................11
3.2.1 Waterfall Model............................................................................................................11
3.2.2 Data-Collection Methodology......................................................................................12
3.2.3 Data Analysis Methodology.........................................................................................13
3.3 Design Methodology...........................................................................................................14
3.4 Implementation Methodology.............................................................................................15
3.5 Testing Methodology...........................................................................................................15
3.6 Deployment Methodology...................................................................................................16
3.7 Maintenance Methodology..................................................................................................16
CHAPTER 4: RESOURCES REQUIRED / BUDGET................................................................17
4.1 Project Resources.................................................................................................................17
4.1.1 Hardware Requirements...............................................................................................17
4.1.2 Software Requirements.................................................................................................17
4.1.3 Human Resources.........................................................................................................17
4.2 Project Budget.....................................................................................................................17
CHAPTER 5: TIME PLAN...........................................................................................................18
5.2 Time Plan: Project Schedule................................................................................................19

i
CHAPTER 6: EXISTING SYSTEM INVESTIGATION AND ANALYSIS..............................20
6.0 Introduction..........................................................................................................................20
6.1 Environment Specification..................................................................................................20
CHAPTER 7: CURRENT SYSTEM INVESTIGATION AND DATA COLLECTION.............21
CHAPTER 8: THE INTENDED SYSTEM..................................................................................22
8.1 System Analysis...................................................................................................................22
8.2 Requirements Definition......................................................................................................22
8.2.1 Functional Requirements..............................................................................................23
8.2.2 Non-Functional Requirements......................................................................................23
CHAPTER 9: DIFFERENT ASPECTS OF THE DESIGN..........................................................24
9.0 INTRODUCTION...............................................................................................................24
9.1 PROCESS AND DATA FLOW DIAGRAMS....................................................................24
9.2 UML DIAGRAMS..............................................................................................................25
9.2.1 USE CASE DIAGRAM...............................................................................................25
9.2.2 GET PREDICTED CROP TO PLANT SEQUENCE DIAGRAM..............................26
9.3 MODEL TRAINING...........................................................................................................26
9.3.1 DATASET COLLECTION..........................................................................................26
9.3.2 DATA TRANSFORMATION.....................................................................................27
9.3.3 MODEL BUILDING....................................................................................................27
9.3.4 MODEL DEPLOYMENT............................................................................................27
9.4 DATASET FILE HEADERS..............................................................................................27
REFERENCES..............................................................................................................................28

ii
LIST OF FIGURES
Figure 1: Waterfall model………………………………………………………………….11
Table 1: Project Budget ……………………………………………………………………….17
Table 2: Gannt Time Chart…………………………………………………………………….18
Table 3 Project Schedule …………………………………………………………………….19
Figure 2 Use case Diagram……………………………………………………………………25
Figure 3 Get Predicted Sequence Diagram……………………………………………………26
Table 4 Data file headers……………………………………………………………………….27

iii
ACRONYMS
UML – Unified Modelling Language
CSV – Comma Separated Values
API - Application Programming Interface
SDLC- Software Development Life Cycle
ICT- Information Communication and Technology
IoT- Internet of Things
NARS- National Agriculture Research Systems
NASEP- National Agriculture Sector Extension Policy

iv
CHAPTER 1: INTRODUCTION

1.0 Introduction
Since the evolution of agriculture in Mesopotamia, agriculture has been essential in
human history. It is indispensable because it provides resources like food, medicine, energy. The
industrial revolution has contributed to unprecedented population growth, especially in
developed countries, due to increased food supply. This phenomenon triggered new agricultural
practices that led to the emergence of capitalist farmers to exceed their peaks to sustain their
countries' rise of industrial preeminence. Most developed countries have emphasized the
agricultural industry's roles and adopted new and emerging technologies to maximize their farm
products. They have deployed heavy machinery, farming robots, and engineered productive
seeds supplied to farmers, gradually increasing agricultural productivity.
On the contrary, developing and third world countries are still facing challenges in
providing enough products to their rising population because we are still using the mundane old
farming practices. Kenya is a third world country with an economy that is pivoted on agriculture;
75% of the 49.2 million is engaged in farming labor in different parts of the country. As the
mainstay of the Kenyan economy, agriculture contributes up to 60% of the total foreign
exchange earnings. Major agricultural products in Kenya include tea, coffee, horticulture, corn,
wheat, sugarcane, dairy products, beef, pork, poultry, and eggs. Since Farming is majorly based
on predictions that fade as time falls, most of our farmers lack proper knowledge, making
Farming and agricultural activities more erratic.
Advancements of other industries, especially Information Communication and
Technology (ICT), and the verge of a technological revolution called Machine learning and the
Internet of Things (IoT), the agricultural industry is accelerating to develop by intensely
employing these technologies. In particular, this project (SmartFarm KE) is to create an android
application that will help farmers focus on the efficiency of the production process and maximize
production of all agricultural products to transform agricultural productivity to achieve food
security to reduce poverty by monitoring the environmental and ecological conditions, analyzing
the current weather data, then suggesting the best plantation time and type of crops for a given
region across the country. The idea is to digitize Farming and its practices to help farmers check
on crop requirements and predict their growth. The implementation depends on farmers'
awareness and can be quickly adopted due to the project's numerous advantages.

1.1 Background of The Study


Agriculture is a significant driver of the world's economy, especially in developing
countries, and is a dominant income source. 75% of Kenyans earn part of their income from the
agricultural sector. This contributes to 33% of the national gross domestic product (GDP). In our
country, the agricultural sector employs over 80% of the rural workforce who do small scale
farming, accounting for more than 20% of formal employment by providing income, and

5
products for home consumption, therefore playing a pivotal role in reducing poverty. The Kenya
Vision 2030 recognizes the importance of transforming and modernizing the farming sector to
address the current challenges with different policies like National Agriculture Research Systems
(NARS) and the National Agriculture Sector Extension Policy (NASEP)
However, agricultural production has drastically reduced over the years due to a lack of
proper know-how on production factors; for instance, the climatic conditions of the region have
recently changed, resulting from changes in seasons, which has affected most farmers in the
country. Kenyan farmers, minimal scale, lack ease and direct access to the information
concerning environmental and ecological conditions suitable to various crops and animal species
(livestock), which makes them make poor decisions resulting in losses. Most farmers fail to
diversify production due to a lack of knowledge on what should be grown or reared apart from
what is on the stock after the latter fails to give returns. These perpetual losses have killed their
morale, making them quit Farming, resulting in lower production in the country, posing a risk on
food security. Therefore, there is a need to provide a suitable, accessible, and informative
solution to all farmers at different scales to help them make the most suitable decisions to
maximize agricultural products' production and transform agricultural productivity to achieve
food security to reduce poverty.
To eradicate this whole problem affecting farmers, we will develop an android application that
will help farmers across the country know what crops to grow in the given region and at what
time. SmartFarmKE focuses on analyzing crop diversification and crop trends based on available
datasets. Analyzing ecological conditions, environmental changes, and weather conditions with
the help of machine learning and Artificial intelligence will help farmers gain insight into the
strongest and weakest section of their farm fields, especially small scale to get profits from their
agricultural products, transform agricultural productivity to achieve food security to reduce
poverty.

1.2 Problem Statement


Our country is still lacking in adopting new technologies in the farming sector, unlike in
developing countries that have invested and adopted the technologies into Farming. Most
farmers, especially small scale lacks the appropriate data and information to carry out their
Farming more appropriately. They do not rely on the prediction patterns and available data to
know the most suitable time to carry out different activities in their fields. Their ignorance and
innocence have led to losses and low productivity, leading to the whole country's food shortage.
Only a few self-centered mediators are using technological advancements in Farming like IoT,
Machine Learning, and Artificial Intelligence to accurately predict the requirements, Market
trends, and climate conditions in Farming. The following are the problems that farmers face in
Kenya:
1. IoT hardware and installation is expensive.
2. Lack of analyzed data on weather and ecological conditions

6
3. Farmers lack the knowledge to predict patterns due to changing climate.
4. Ignorance, especially to small scale farmers of weather forecasting
5. Farmers do not know the appropriate crops to plant at a given time.
6. Food Security.

1.3 Proposed Solution


This project intends to design an application that will provide necessary information to
farmers regarding ecological conditions that support various crops in different parts of the
country. SmartFarmKE will drive farmers towards increasing agricultural products by intensifying
and yielding. The project works hard to remove constraints to increase yield expectations to
increase food security and achieve vision 2030 plans. Analyzing of collected data existing data

1.3.1 Aim of The Project


The project does target not only extensive farming exploitation but also small-scale
farmers with fewer funds. Since IoT is not popular and expensive to install, a simple android app
that analyzes all ecological conditions will help farmers with suggestions of what to plant and the
appropriate time in different regions. These will help farmers on the efficiency of the production
process and maximize production and transform agricultural productivity and increase food
security in the country. Smart Farming can also provide significant benefits in terms of
environmental issues, such as more efficient water use or optimization of treatments and inputs.

1.3.2 Objectives
The project's main objective is to develop an android application that analyzes ecological
and weather conditions, then suggests specific crops that can be grown in a given region over a
given time and help farmers choose suitable crops to increase productivity and yields not to incur
unnecessary losses.
Specific Objectives
1. To analyze and visualize all the data and present it with ease on a satellite map.
2. To analyze ecological conditions and then suggest most suitable crop and planting
season.
3. To show Weather analysis and prediction for early detection of the affected region.
4. To provide Field and finance data available in the same place showing the profits, yields,
and patterns with simple reports.

1.4 Significance of Project


This project aims to provide an essential contribution to farmers in Kenya to successfully
practice climate-smart Farming to tackle current food security and climate change challenges.
Smart Farming is a pathway towards the country's development and food security built towards

7
achieving Vision 2030. This smart, informative Farming has been incorporated with modern
farming concepts that look into increasing productivity, incomes, enhancing the resilience of
farmers' livelihoods, and removing greenhouse gas emissions. Since smart Farming with IoT is
expensive to install and heavily dependent on types of machinery like sensors, cables, and high
maintenance operations, SmartFarmKE will be a simple android app that analyzes ecological
conditions from available datasets, precision farming, predictive analytics, and raw data to
monitor climate conditions and predict future calamities. It is rooted in sustainable Farming and
rural development objectives, which would contribute to achieving the Sustainable Development
Goals (SDGs) of reducing hunger and improved environmental management.

8
CHAPTER 2: LITERATURE REVIEW

In most developing countries, agriculture is the backbone of the economy for sustainable
development. In the last 10- 15 years, technology has been developed and is being adopted and
interjoined with other fields to enhance production efficiency (Lwoga. E, 2010). Agriculture has
been given emphasis by researchers to apply technology in agriculture, and this is called Smart
farming (Wolfert et al., 2017). This is a concept that emphasizes farm management concepts
based on data acquired through various sources (historical, geographical and instrumental)
analyzed with technologies like IoT, robotics, drones, big data and analytics and machine
learning (Big-Data Analytics for Cloud, IoT and Cognitive Computing, 2013). The main goal of
smart farming is to provide the optimum conditions to maximize growth and the harvest capacity
through using computers and modern technology to control temperature, humidity, water sprays
and sunlight.
The climate smart agriculture was first launched in 2010 by FAO in a paper prepared by
Hague Conference on Agriculture, Food Security and Climate change. According to a report by
FAO, it has estimated that there will be a population of 8.5 billion human beings on the planet
and 9.6 billion inhabitants by 2050 (Alexandratos & Bruinsma, 2012). To feed this population,
food production must increase by 70% considering the challenges of climate change, rural-urban
migration, scarcity of fresh water and global warming. This challenge can be addressed by
improving the quality and quantity of agricultural products by adopting different smart farming
technologies to achieve the 4.0 Green Revolution. In most developed countries like the USA
80% and 24% of the farmers in the UK are already using Smart Farming Tools (SFT) ad have
added value to the farming ecosystem (Ayre et al., 2019). Smart farming techniques can be
applied to large scale in other developing countries whose economy strongly depends on
agricultural products.
Smart Farming is based on different technologies and tools that optimize the human labor
to increase the quality and quantity of agricultural products. The Internet of Things (IoT)
applications collect data through sensors, the data is analyzed through specialized software that
target specific farming demands on the IoT platforms and internet clouds. Connectivity is either
through cellular networks or cables that have a purpose of connecting and exchanging data with
all the systems that have been connected to the system. There are also standalone data analytics
solutions that are interconnected with data pipelines for downstream solutions. This helps
farmers to monitor field conditions at your comfort. IoT connects smart machines and sensors
that have been integrated to make farming processes that are data driven and data enabled (Ayaz
et al., 2019).
Also, Smart Farming has been enhanced through Precision Agriculture that uses Big
Data, Data mining and IoT techniques to improve the crop yield in agriculture through

9
measuring ecological factors. Precision Farming has been incorporated with IoT sensors,
machine to machine (M2M) GPS communication and analysis techniques like regression
techniques, CLARA, PAM, and DBSCAN. PF focuses on identifying critical factors from cluster
data and adopts each sensor to different cluster data (Khanna & Kaur, 2019). The system
includes Decision Support Systems (DSS) that optimizes returns on inputs while preserving
resources that are enabled by use of GPS, aerial images, GNSS, and drones that are provided by
Sentinel satellites that create maps of the Spatial Variability of many variables that can be
measured like crop yield, terrain features, matter content, nitrogen and moisture levels.
Other systems that emphasize the use of information and communication technology in
Smart Farming and go beyond primary production to the entire food production chain through
predictive insight in farming operations. Cost management and waste reduction is easily
controlled due to the ability to see anomalies on crop growth and livestock health. Climate
monitoring systems have been developed and installed in farming and weather stations.
Predictive analytics has helped farmers to know crop harvesting times, risks, diseases and
infections and act upon them (Hubbard et al., 1983).

10
CHAPTER 3: METHODOLOGY

3.1 Introduction
This chapter describes the different fact finding and software development methodologies
that are to be used in order to achieve the goals and objectives of the intended system such as
SDLC, data collection, data analysis, literature review, system design, implementation, testing,
deployment and maintenance.

3.2 System Development Life Cycle (SDLC) Methodology

3.2.1 Waterfall Model


This is a linear sequential flow model which is easy to use and understand. The model
has different phases, each phase must be completed before the next phase can begin, so that there
is no overlapping in the phases.

Requirement Analysis

System Design

Implementation

Testing

Deployment

Maintenance

Figure 1: Waterfall model

The sequential phases of the Waterfall Model are:


1. Requirement Gathering and Analysis: All customer requirements of the system that
are to be developed are collected and captured, then documented in a requirement

11
specification document. It should have a good requirement gathering, efficient
examination of requirement and a clear documentation.
2. System Design: System requirement specifications that have been collected are studied
and a system design is prepared. In this phase, all hardware and system requirements are
defined, and also the overall system architecture. In this process we define, develop and
design system that satisfies needs and requirements of the customer requirements.
3. Implementation: All inputs from the system design are taken and developed into small
unit programs, which are integrated in the next phase. Each unit is developed and tested
for functionality also known as Unit Testing. In this phase nothing is yet distributed to the
customer or organization.
4. Integration and Testing: All the units that have been developed are integrated into a
system after each unit has been tested. Then post integration testing is done to expose any
defects and failures in the interaction between these software modules.
5. Deployment of the System: Once the functional and non-functional testing is done; the
product is deployed in the customer environment or released into the market.
6. Maintenance: Once the system has been handed over to the client, issues may arise. To
fix the errors or issues, patches are released. Hence system maintenance is done to deliver
the changes to the customer environment.

3.2.2 Data-Collection Methodology


To achieve the project’s objectives, there is need to collect data and analyze it. Data to be
collected will help in knowing more about the current system that farmers employ in determining
what to plant. The factors that farmers consider in deciding what to plant is what the machine
learning datasets file will be made of.
The following methods of data collection were intended to be used:
a) Observation
Observation is carefully watching the things and trying to understand them in depth, in
order to get some information about them. Eye observation qualitative data collection
method will be used because it acts as a most trustworthy medium for making an
observation. People do not usually believe in what they hear, they only trust what they
have observed with their own eyes. After observation, it is necessary to keep a record of
what was observed. A mobile handset will be used to keep track of the observations made
by taking pictures or video.
Reasons for using observation:
i. Problem of depending on respondents is decreased. It is a very direct method for
collecting data or information.
ii. Enables one to observe what people actually do or say, rather than what they say they
do. People are not always willing to write their true views on a questionnaire or tell
what they really think at interview.

12
iii. It is the simplest method of data collection. Everybody in this world observes many
things in their daily life.

b) Reviewing documentation
Documentation analysis is a form of qualitative research in which documents are
interpreted by the researcher to give voice and meaning around an assessment topic.
Reasons for using document review:
i. Document review will enable one to get access to information that would be
difficult to get in any other way, such as people who might not be willing to talk
during interview or information about past problems.
ii. It will help collect larger samples of data than might be collected from
questionnaires or interviews.
iii. It is a relatively low-cost method of data collection. This is because the
documents are easily accessible and already located on the internet.
c) Public datasets.
A public dataset is any dataset that is stored and made available to the general public.
These datasets are what data scientists use to develop algorithms and train models. These
public datasets can be found in repositories such as Kaggle. These datasets are provided
for free. For this project datasets about crops and weather will be used.

3.2.3 Data Analysis Methodology


Data to be collected for this system will be to only capture the necessary data. Content
and narrative analysis techniques will be used. Content analysis will be used to analyze
documented information in the form of texts and media while narrative analysis will be used to
analyze content from various interviews. The needs of the end user will also be analyzed to
ensure that the new system meets their requirements.

3.2.3.1 Content Analysis


Content analysis is an interpretive and naturalistic approach that includes both
observational and narrative in nature, and also relies less on experimental elements that are
associated with scientific research (reliability, validity and generalizability). It also includes a
research technique for the objective, systematic and quantitative description of the manifest
content of communication (Berelson, 1952). Sources of data in content analysis include
interviews, open-ended questions, field research notes, conversations, or literally any occurrence
of communicative language (such as books, essays, discussions, newspaper headlines, speeches,
media, historical documents). Any content must be coded, or broken down into manageable code
categories for analysis.

13
3.2.3.2 Uses of Content Analysis
1. It is used to identify the intentions, focus or communication trends of an individual, group
or institution.
2. Determines psychological or emotional state of persons or groups.
3. Reveals patterns in communication content.
4. Its analysis focuses on group interviews and open-ended questions to complement
quantitative data.
5. Pre-test and improve an intervention or survey prior to launch.

3.3 Design Methodology


Design is a creative activity in which one identifies software components and their relationships,
based on given requirements.
i. Relationships
Relationship is a meaningful association between two or more entities. Class diagrams
will be used because they help in describing the classes and relationships in the problem
domain.
ii. Data model
Microsoft word will be used to design a conceptual data model. It shows how the
information is viewed by the database system and is how it is processed and conveyed to
the end user.
iii. Normalization
Normalization is a data analysis technique for producing a set of relations with desirable
properties. First, second and third levels of normalization will be used which will help to
remove partial and transitive dependency, improve data integrity and eliminate data
redundancy.
iv. Interface
This will be used to ensure interaction between users and system for effective operation
and control of the system functionalities.
The main objective is to understand the system and its phases of the SDLC. They include:
1. Planning: This is a process of understanding how the system should be built, and
understanding its user requirements. It includes a feasibility study from different
perspectives, technical, economic, and organizational feasibility aspects.
2. Analysis: It includes activities such as problems identifying and analysis, and even
predicting potential problems that may arise in future regarding the system. The
outcome of this phase how the system will be built and guided the developers’ works.
3. Design: System analysis leads to designed decision, which exactly determines how the
system will operate in terms of process, data, hardware, network infrastructures, user
interface, and other important factors in the system environment.

14
4. Implementation: This will be probably the most resource, cost, and time-consuming
phase of all. This is when the system is built, tested, and finally installed. It will also
include activities such as user training and system maintenance.

3.4 Implementation Methodology


During implementation phase, the following programming languages will be used:
i. Dart: It is a programming language mainly used for developing applications. It supports
development of android mobile applications.
ii. Flutter: which google UI kit for developing cross platform mobile applications.

MySQL: MySQL is the world's most popular open-source database. This the database that data
from the app will be store to. MySQL is free, user friendly and secure.

Other tools that will be used:


i. Apache web server. Which comes bundled together with XAMPP
ii. Android Emulator for application testing
iii. Web browser (Mozilla Firefox Chrome) for managing MySQL database instances.
iv. Android phone for testing the application on a physical device.

3.5 Testing Methodology


Testing involves running new or revised programs to determine if they process all data
properly and gives the desired output. The test will be done using test data given by users and
developer of the system. This process will help to test the efficiency of the software product. The
testing data will contain a set of wide range of valid data and also a sample of data that is against
the conditions. Verification and validation are important in this stage to ensure the system meets
the needs of the user and also performs its tasks effectively.
The following testing methods will be used:
 Unit testing
The test is carried out during programming stage itself. In this step, each module is found
to be working satisfactory as regards to the expected output from the module
 Component testing
In this step, several unit components will be integrated to create composite component
which will later be tested focusing on component interfaces.
 System testing
System testing ensures that the entire integrated software system meets requirements and
it is based on process descriptions and flows, emphasizing pre-driven process links and
integration point.

15
 White Box Testing
White Box Testing is a testing in which the software tester has knowledge of the inner
workings, structure and language of the software, or at least its purpose. It is used to test
areas that cannot be reached from a black box level.
 Black Box Testing
Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of
tests, must be written from a definitive source document, such as specification or
requirements document. It is a testing in which the software under test is treated as a
black box, you cannot “see” into it. The test provides inputs and responds to outputs
without considering inner part of the software.

3.6 Deployment Methodology


Deployment involves all of the activities that make software available for use. Once the system is
implemented, it will be deployed on a python web server. The application will be made available
on Google Play Store for farmers to download it into their phones.

3.7 Maintenance Methodology


Once a system is designed, implemented and deployed, it requires to be maintained for it to
provide smooth running of activities.
The system maintenance is divided into the four main sections of maintenance as will be
routinely carried out in the lifecycle of the system.
a) Corrective Maintenance
Corrective maintenance involves those activities dedicated to fix potential bugs not initially
detected and foreseen by the designers and will involve:
i. Having a help desk assistant to assist in error report logging as will be reported by
users of the system
ii. A provision for notifying the development team of the error to have the error fixed
iii. Testing fixes of bugs and their impacts
b) Adaptive Maintenance
Changes in the organization will impact on the system and call for maintenance activities.
Such activities that fall under adaptive maintenance are:
i. Reorganizing and restructuring the database to reflect new admission criteria
ii. Addition of new tables in the database
iii. Integrating new technologies in the system
c) Perfective Maintenance
This will be necessitated by the organization’s desire to improve and realize more
functionality from the system and will involve tasks as:
i. Upgrading from one database server to another
ii. Adding more functionalities

16
17
CHAPTER 4: RESOURCES REQUIRED / BUDGET

4.1 Project Resources


In this project, various resources will be required to carry out the project tasks. The resources
include:

4.1.1 Hardware Requirements


i. Processor 2.0 GHz processor speed
ii. Memory 4GB RAM
iii. 30 GB Hard Disk free space
iv. Monitor (1024x728px)
v. Internet connection

4.1.2 Software Requirements


i. Microsoft Office Suite
ii. Ubuntu Linux
iii. MySQL Database Server
iv. Web Browser: Chromium Based

4.1.3 Human Resources


i. System supervisor
ii. System analyst
iii. System developer

4.2 Project Budget


ITEM DESCRIPTION COST (KSH)
Computer 20, 000
Printing and Binding 1000
Internet 2000
Antivirus 1500
Documentation 500
Stationary 1000
Visual Studio Code Free
MySQL Server Free
Total 26, 000

Table 1: Project Budget

18
CHAPTER 5: TIME PLAN

January February March July 2021 August 2021September


Month 2021
2021 2021 2021
Activities

1 2 3 4 6 5 7 8 10 11 12 13 14 15 16 17 1 19 20 21
8
Planning
Requirement
Gathering
System Analysis
System Design
Submission
of project
documentation
Oral presentation
Coding
Testing
Integration
Presentation

Table 1: Gannt Time Chart

19
5.2 Time Plan: Project Schedule
Task no Description Duration Start time End time Deliverable

1 Brainstorming and coming up with 1 day 08/01/2021 09/01/2021


a project idea
2 Writing down the project idea 1 day 09/01/2021 09/01/2021

3 Writing a project proposal 1 week 18/01/2021 25/01/2021 Project proposal


document
4 Proposal presentation 10 mins 05/02/2021 05/02/2021 Approved proposal

5 System requirement specification 1 day A list of


06 /02/2021 06 /02/2021 requirements

5.1 Data collection 5 days 08/02/2021 12/02/2021 Raw data


5.2 Data analysis 5 days 15/02/2021 19/02/2021 Processed data
5.3 Preparation of SRS 3 days 22/02/2021 24/02/2021 SRC document
6 System Design Specification System design
2 days 25/02/2021 26/02/2021 specifications
6.1 Logical design 7 days 01/03/2021 08/03/2021 SDS
6.2 Physical design 5 days 9/03/2021 13/03/2021 Document
7 Project progress review and oral 3 days 22/03/2021 24/03/2021 Project progress
presentation
report
8 System development 15 days 1/04/2021 16/04/2021 Running system
and coding
9 Test the system 3 days 19/04/2021 21/04/2021 Test report

10 System Documentation 5 days 03/05/2021 07/05/2021 SYS document and


user manual

11 System implementation 2 days 10/05/2021 11/05/2021

12 System presentation 1 day 01/07/2021 01/07/2021 Final system and


document

Table 3: Time Plan

20
CHAPTER 6: EXISTING SYSTEM INVESTIGATION AND ANALYSIS

6.0 Introduction
In this chapter, existing systems are studied in details. The chapter will also discuss about
system investigations findings that were carried out. Weaknesses of the existing system are
established and strengths of the proposed system are discussed.

6.1 Environment Specification


System design will be the process of defining the elements of a system such as the
architecture, modules and component, the different interface of those components and the data
that goes through the system. Phases used in analysis design include:
5. Planning: This is a process of understanding how the system should be built, and
understanding its user requirements. It includes a feasibility study from different
perspectives, technical, economic, and organizational feasibility aspects.
6. Analysis: It includes activities such as problems identifying and analysis, and even
predicting potential problems that may arise in future regarding the system. The outcome
of this phase how the system will be built and guided the developers’ works.
7. Design: System analysis leads to designed decision, which exactly determines how the
system will operate in terms of process, data, hardware, network infrastructures, user
interface, and other important factors in the system environment.
8. Implementation: This will be probably the most resource, cost, and time-consuming
phase of all. This is when the system is built, tested, and finally installed. It will also
include activities such as user training and system maintenance.
Waterfall model is a linear sequential flow model which is easy to use and understand. The
model has different phases, each phase must be completed before the next phase can begin, so
that there is no overlapping in the phases.

Requirement Analysis

System Design

Implementation

Testing

Deployment

21 Maintenance
CHAPTER 7: CURRENT SYSTEM INVESTIGATION AND DATA COLLECTION
Weather forecasting for agriculture can be grouped into different rages depending on the
forecast range. This can be short range forecast (up to 48 hours), medium range forecast (3- 10
days) and long-range forecast (one week to entire season). Each range plays an important to
farmers in farm operations and planning of agricultural activities.
Farmers across the Kenya, still use traditional weather forecasting techniques to make
decisions on what to plant. Farmers plan their farming activities based on past weather patterns
and nature pattern. Farmers observe patterns such as the shift in the rhythm of the nightly frog-
croaking to tell when the rain is coming. Farmer have however found that those methods are
becoming unreliable. This prediction method has resulted in losses in crops planted and a
reduction in harvest quantity.
Due to climate change impacts those observations do not seem to be accurate anymore.
Farmers have not yet utilized information from the Kenya Meteorological Department. The
meteorological department is responsible for giving up-to-date weather information ("Kenya
Meteorological Department", n.d.). Only a two-third of farmers in the country use weather
information in from the Kenya Meteorological Department. Most farmers still do not use
information from the department. Farmers still trust customs over science.
The meteorological department tries to get weather forecasting information to farmers by
providing sending out agents to the locals (Barrett et al., 2020). The agents work is to hold
meetings with farmers while they share the forecasts and tips on how farmers can prepare their
farms for the coming weather. The department is not able to send out agents to every village in
the country thus not all locals get the information.
Farmers who able to get weather forecasting information have found it to be very
technical and too complicated. Information presented to the farmers as generalized information is
of little help to the farmer. Farmers are more interested in information that is covers their own
area so that they can plan accordingly (Aura et al., 2015).

22
CHAPTER 8: THE INTENDED SYSTEM
The intended system is a mobile application that provides suggestions on what a farmer can
plant. The application will recommend what crop to plant at a certain period using machine
learning. The system will be geared towards offering farmers with easily digestible information
about what crop to plant to increase yield expectations.

8.1 System Analysis


From the investigations carried out the current systems through which farmers make their
decision on what plant to plant is flawed. The system has the following weaknesses:
i. Traditional ways of deciding what to plant are unreliable.
ii. The meteorological department works on a tight budget and it not able to send out agents
to all the locals.
iii. Weather forecasting information is not easily available to all farmers.
iv. Meteorological department reports on weather and climate cannot be easily understood
by farmers as farmers find them technical.
The strengths of the intended system are:
i. Farmers will get access to crop suggestions easily from their phones.
ii. The information about what crop to plant at what time will be presented to farmers in an
easily understandable language.
iii. Information about what crop to plant will be based on the region that the farmer has
selected and not generalized information.
iv. The mobile application will have an easy to interface.

8.2 Requirements Definition


Requirement’s definition can either be functional or non-functional requirements. Functional
requirements are system features that users interact with. Functional requirements describe how
the system responds to user inputs and system behavior in various situations. Nonfunctional
requirements define system attributed such as security, reliability, performance, maintainability,
scalability and usability. They serve to increase the operation efficiency of the system as a
whole.

23
8.2.1 Functional Requirements
The mobile application will be used by farmers. Farmers will be able to:
- Provide time of the year to predict
- Provide pH scale
- Select the region to offer predictions
- Select the soil type
- Retrieve crop predictions

8.2.2 Non-Functional Requirements

Non-functional requirements are:

i. The user interface for the system should be user friendly and information should
be presented in the most accurate form possible.
ii. The application should scale appropriately to handle increase in traffic on
prediction API calls.
iii. Downtimes on the system should be resolved as fast as possible without any lose
to data on the system.

24
CHAPTER 9: DIFFERENT ASPECTS OF THE DESIGN

9.0 INTRODUCTION
System Design is the stage in software development cycle where diagram representation of the
concepts developed during the system analysis are developed. The diagrams help to visualize
how the functionalities of the final product. The diagrams are created using a standard known as
Universal Modelling Language (UML).

9.1 PROCESS AND DATA FLOW DIAGRAMS


The table below illustrates the symbol graphically used to model the dataflow diagrams of the
proposed system functionally.

SYMBOL NAME DESCRIPTION


Entity Used to denote start/stop i.e.

Beginning or ending of a
process
Data It indicates the user expected
input/output of a given
process

Dataflow Used to indicate the direction


of flow of data within the
process
Decision Indicates the criteria to be met
before an input is produced

Process Indicates the presence of a


transformation that accepts
input and then gives the
required output
On page reference It is used as a connector

25
Actor It represents a system entity

9.2 UML DIAGRAMS

9.2.1 USE CASE DIAGRAM


Use case diagram communicates the system behavior in users’ terms by specifying all external
visible system behavior.

SMARTFARMKE

gather dataset
and known response

enter period of year

prepare dataset

enter climatic conditions


delete dataset

Farmer pick algorithm and


validation method Developer
get crop recommendation

examine and
update till satisfied

use model with


new data for
prediction

Figure 2: Use case Diagram

26
9.2.2 GET PREDICTED CROP TO PLANT SEQUENCE DIAGRAM

trained_
farmer app model API
model

1. enter details for prediction()

2. send prediction parameters()

3. fetch possible crop()

4. model result()

5. serve model result()

6. show predicted result()

Figure 3: Get predicted crop sequence diagram

9.3 MODEL TRAINING

9.3.1 DATASET COLLECTION


Picking the right dataset is crucial to the success of the model. Dataset will be collected as raw
data supplemented with readily available weather information datasets. The data obtained will
cover different parameters, these parameters are:
- Soil type
- Crops
- Fruit
- Grain
- Herbs
- Spices
27
- Vegetables
- Average rainfall
- Average temperature

9.3.2 DATA TRANSFORMATION


Raw data is usually coupled with inconsistencies. These inconsistencies affect the output of the
model. Missing values from datasets will be removed from the dataset. Spelling aberrations
causes data inconsistences. Spellings will be normalized to a single value to improve the model
accuracy. Redundant data will be discarded as they do not add any significant value to the model
predictions.
Data from different datasets will be combined into one dataset to ease the process of building and
computation.
Since machine learning models work only with numbers the string values will be converted into
numerical values. To make this change on the data, label encoder technique will be employed.
Label encoder is a tool provided by SciKit Learn which helps one to encode the categorical
features/variables into their numerical features. The encoder targets variables between 0 to
n_classes-1 where n is the number of distinct labels (Chugh, 2019).

9.3.3 MODEL BUILDING


The model o be used to train the data is Ensemble Learning Model. Ensemble learning approach
uses multiple learning algorithms in statistics and machine learning to achieve greater predictive
efficiency than either of the consistent learning algorithms alone might obtain (Brownlee, 2020).
Algorithms that will be employed for model building are:
- Random Forest Algorithm
- Gaussian Naïve Bayes Algorithm
- K-Nearest Neighbors Algorithm
- Decision Tree Algorithm

9.3.4 MODEL DEPLOYMENT


For farmers to consume the trained model a mobile application interface will be built to expose
the model. Datasets will be store as CSV files and also in the database. The user interface and the
backend will be integrated together using an API built with flask.

9.4 DATASET FILE HEADERS


This are CSV file headers that represent columns that will be used in the CSV files.
Crop Sowing Region Min Max Soil pH Soil Max Max
time temp temp type rainfall rainfall

Table 4: Data file headers

28
REFERENCES
Albig, W. (1952). BERELSON, BERNARD. Content Analysis in Communication Research. Pp.
220. Glencoe, Ill.: The Free Press, 1952. $3.50. The ANNALS of the American Academy
of Political and Social Science, 283(1), 197-198.
Alexandratos, N., & Bruinsma, J. (2012). World agriculture towards 2030/2050: the 2012
revision.
Aura, S., Muthama, N., Karanja, F., Kahuha, S., Chanzu, B., & King’uyu, S. (2015). Making
Meteorological Services More Beneficial to Farmers. World Meteorological
Organization. Retrieved 09 March 2021.
Ayaz, M., Ammad-Uddin, M., Sharif, Z., Mansour, A., & Aggoune, E. H. M. (2019). Internet-of-
Things (IoT)-based smart agriculture: Toward making the fields talk. IEEE Access, 7,
129551-129583.
Ayre, M., Mc Collum, V., Waters, W., Samson, P., Curro, A., Nettle, R., ... & Reichelt, N.
(2019). Supporting and practising digital innovation with advisers in smart
farming.  NJAS-Wageningen Journal of Life Sciences, 90, 100302.
Balaji, S., & Murugaiyan, M. S. (2012). Waterfall vs. V-Model vs. Agile: A comparative study
on SDLC. International Journal of Information Technology and Business Management,
2(1), 26-30
Barrett, S., Ndegwa, W., & Maggio, G. (2020). The value of local climate and weather
information: an economic valuation of the decentralised meteorological provision in
Kenya. Climate and Development, 13(2), 173-188.
Brownlee, J. (2020). Why Use Ensemble Learning? Machine Learning Mastery. Retrieved 07
March 2021.
Chugh, A. (2019). ML | Label Encoding of datasets in Python - GeeksforGeeks. GeeksforGeeks.
Retrieved 07 March 2021.
Hubbard, K. G., Rosenberg, N. J., & Nielsen, D. C. (1983). Automated weather data network for
agriculture. Journal of Water Resources Planning and Management, 109(3), 213-222.
Kenya Meteorological Department. Meteo.go.ke. Retrieved 09 March 2021.

Khanna, A., & Kaur, S. (2019). Evolution of Internet of Things (IoT) and its significant impact
in the field of Precision Agriculture. Computers and electronics in agriculture, 157, 218-
231.

29
Lwoga, E. T., Ngulube, P., & Stilwell, C. (2010). Managing indigenous knowledge for
sustainable agricultural development in developing countries: Knowledge management
approaches in the social context. The International Information & Library Review, 42(3),
174-185.
Wolfert, S., Ge, L., Verdouw, C., & Bogaardt, M. J. (2017). Big data in smart farming–a
review. Agricultural systems, 153, 69-80.

30

You might also like