MASENO UNIVERSITY SCHOOL OF COMPUTING AND INFORMATICS DEPARTMENT OF COMPUTER SCIENCE UNIT CODE: CCS323 UNIT NAME: GROUP PROJECT PROJECT TITLE: E-KULIMA SYSTEM REGISTRATION NO. NAME CI/00099/016 ABRAHAM OMONDI CI/00038/018 VICTOR KIOGORA CI/00102/018 ONYANGO BENSONS THIS PROJECT PROPOSAL IS HEREBY PRESENTED FOR EXAMINATION WITH THE APPROVAL OF THE PROJECT SUPERVISOR. DECLARATION We hereby declare that this proposal is our original work and has not been presented for development on any platform. NAME SIGNATURE DATE Abraham Omondi ………………………… ………... ……………………….. Victor Kiogora ………………………… ………. …………………………. ……….. ………………………… Onyango Bensons ……………………….. ii ABSTRACT The internet was opened to general users in 1994 and this new era of information and communication technology has played an important role in the field of expert systems. The Web technologies allowed the knowledge engineers and domain experts to build the expert systems that were having dynamic knowledgebase capabilities. The domain experts could update the knowledge at the central server and the users had an access to the recent knowledgebase through a Web interface. Expert systems have the capability to transfer location specific technology and advice to the farmers efficiently and effectively. This in turn will reduce losses due diseases and pests’ infestation, improve productivity with proper variety selection and increase income of the farmer. The taxonomy and identification of crop infection have the foremost technical and economic importance in the Agricultural Industry. However, disease detection needs incessant observing of specialists which might be prohibitively costly in big farms region. Automatic recognition of plant diseases is necessary to research themes as it may benefit in monitoring huge fields of crops and thus automatically detect the symptoms of diseases as soon as they appear on plant leaves. The goal of this application is to develop a system which will recognize crop diseases. In this user will have to take an image through a mobile phone, Image processing starts with the digitized color image of the diseased leaf. Finally, by applying the SVM (Support Vector Machines) plant disease would be predicted: It will simulate human reasoning about a problem domain, rather than simulating the domain itself. It will perform reasoning over representations of human knowledge. It will solve problems by heuristic or approximate methods. The expert system will apply to the problems of diagnosing Soybean diseases, one of the earliest expert systems developed in agriculture. A unique feature of the system is that it will use two types of decision rules: The rules representing expert’s diagnostic knowledge The rules obtained through inductive learning from several hundred cases of disease. iii ACKNOWLEDGEMENT I would like to express my deep gratitude to my project supervisor (Mr. Adongo) for his valuable and constructive suggestion during the project. I would like to appreciate the school of computing for offering us an opportunity to take the course and develop this system. Our next acknowledgement is to the group members for extensive research and dedication towards developing the development of the project iv TABLE OF CONTENTS Contents DECLARATION ............................................................................................................................................... ii ABSTRACT..................................................................................................................................................... iii ACKNOWLEDGEMENT .................................................................................................................................. iv CHAPTER ONE ............................................................................................................................................... 1 1.0 INTRODUCTION. ................................................................................................................................. 1 1.1 PROBLEM STATEMENT. ...................................................................................................................... 1 1.2 PURPOSE OF THE STUDY .................................................................................................................... 2 1.3 OBJECTIVES OF THE STUDY ................................................................................................................ 4 1.4 SIGNIFICANCE OF THE STUDY ............................................................................................................ 4 1.5 SCOPE OF THE PROJECT...................................................................................................................... 5 CHAPTER TWO .............................................................................................................................................. 6 2.0 LITERATURE OVERVIEW ..................................................................................................................... 6 2.1 Agriculture in Kenya ........................................................................................................................... 6 2.2 Agricultural extension ........................................................................................................................ 7 2.3 Existing information systems in Kenya .............................................................................................. 8 CHAPTER THREE.......................................................................................................................................... 12 3.0 METHODOLOGY................................................................................................................................ 12 3.1 METHODOLOGY................................................................................................................................ 12 3.1.1 Object-oriented analysis and design (OODA)........................................................................... 12 3.1.2 Object oriented analysis (OOA) ................................................................................................ 12 3.1.3 Object oriented design (OOD) .................................................................................................. 12 3.2 REQUIREMENTS GATHERING. .......................................................................................................... 16 3.2.1 Case Based Reasoning ............................................................................................................... 16 3.2.1 Non-functional Requirements .................................................................................................. 18 3.3 SYSTEM ANALYSIS. ........................................................................................................................... 19 3.3.1 Feasibility study ......................................................................................................................... 20 3.4 System Design. ................................................................................................................................. 22 3.4.1 Knowledge Base ........................................................................................................................ 24 3.4.2 Working Memory ...................................................................................................................... 24 v 3.4.3 Inference Engine ........................................................................................................................ 24 3.4.4 Diagnostic System ..................................................................................................................... 25 3.4.5 Backend (CBR) ........................................................................................................................... 25 3.4.6 Frontend .................................................................................................................................... 26 3.5 Coding and Debugging. .................................................................................................................... 29 3.6 Testing For The Prototype................................................................................................................ 30 3.6.1 Test on Functional Requirements ............................................................................................. 31 3.6.2 Module Testing .......................................................................................................................... 32 3.6.3 Regression Testing..................................................................................................................... 32 3.6.4 System Testing........................................................................................................................... 32 CHAPTER FOUR ........................................................................................................................................... 33 4.0 RESOURCES, BUDGET ESTIMATE AND PROJECT PLAN. ................................................................... 33 4.1 RESOURCES. ...................................................................................................................................... 33 4.1.1 Hardware Platform.................................................................................................................... 33 4.1.2 Software Development Platform: ............................................................................................ 33 4.1.3 Database: ................................................................................................................................... 33 4.1.4 Programming languages: .......................................................................................................... 33 4.1.5 Communication: ........................................................................................................................ 34 4.2 BUDGET ESTIMATE. .......................................................................................................................... 34 4.3 PROJECT PLAN. ................................................................................................................................. 34 4.3.1 ACTIVITIES. ................................................................................................................................ 34 4.3.2 GANT CHART.............................................................................................................................. 35 CHAPTER FIVE ............................................................................................................................................. 36 5.0 CONCLUSION .................................................................................................................................... 36 5.1 REFERENCES ...................................................................................................................................... 37 vi CHAPTER ONE 1.0 INTRODUCTION. 1.1 PROBLEM STATEMENT. In spite of the various approaches to improve production by clearing and diagnosing plant diseases in Kenya, diseases are still a problem towards food production. One of the reasons for limited impacts in farmers’ income is the modern farmer often relies on agricultural specialists and advisors to provide information for decision making. Despite the deployment of extension officers to offer agricultural diagnostic services to farmers, the ratio of extension officers to farmers still stands at 1:1500 farmers. In addition, there are challenges encountered including: inadequate budgetary allocation to agriculture, which eventually trickles down to the low budgetary allocation to the operations and movement of extension officer to offer services to the farmers. Moreover, Kenya is characterized by poor road infrastructure which raises the cost of ware and tare and making some areas inaccessible to extension officers. On the other hand, service providers in the telecommunication industry such as Safaricom have expanded their networks to over 80percent of the country. The Government has facilitated internet connectivity through fiber optic cables to major towns. The policy of provision of computers to every child joining class one, is projected to transform the destiny of future generations in terms of ICT education and application in all sectors of the economy. Food and income insecurity have been attributed to limited access to production inputs such as diseases, pesticides and insects. This has resulted in wastage of produce and low prices to smallholder farmers. This study therefore seeks to establish technological efficacy of extension officers to guide the development of an artificial intelligent system for agricultural diagnostics. 1 1.2 PURPOSE OF THE STUDY Agriculture dominates the Kenyan economy, accounting for 70 percent of the workforce and about 25 percent of the annual gross domestic product (GDP). As the financial system of Kenya is relayed on farming production, the extreme concern of food production is essential. The issue of improving agriculture in order to increase its productivity has been given due weight and attention in Kenya. A shift towards self-sufficiency in food production in Kenya depends to a greater extent on the improvement of agriculture. Agricultural production has evolved into a complex business requiring the accumulation and integration of knowledge and information from many diverse sources. In order to remain competitive, the modern farmer often relies on agricultural specialists and advisors to provide information for decision making. Unfortunately, agricultural specialist assistance is not always available when the farmer needs it. In order to alleviate this problem, expert systems were identified as a powerful tool with extensive potential in agriculture. Expert Systems (ES) development is considered as a division of the Artificial Intelligence fraternity. Expert system (ES) is an intelligent software which works in one particular domain. It uses knowledge and inference capability to solve problems. The core idea of ES development is to convert the available human knowledge into the computer. So, this knowledge can be used when required. The expert system provides the knowledge in the usable form. The expert systems proved powerful tool to solve many real-world problems of technological, social, agricultural and life science spheres. This has been resulted in the ES development as a prominent area of research not only for the Artificial Intelligence branch but also for many interdisciplinary research works. As expert system is based upon knowledge so this is also known as knowledge-based system. Knowledge residing in knowledge base of expert system consists of domain facts and associated heuristics. This knowledge is collected from human experts who are not available every time. Moreover, one or two experts are not enough for some working areas just like agriculture where so many fields are part of one major field. That is why knowledge is gathered from more than one expert and accumulated to a software, which is called expert system. As expert systems have been using in different fields of life like medicine, process controlling etc. so agriculture field has also not been left affected by these knowledge-based systems. These systems are being used by agricultural decision makers at different levels: “operation level and planning level. On the operation level, the extension workers in the village, district, and/or governorate can use the system to support him in making his decision in giving the appropriate advice to the growers. On the 2 planning level, the decision makers can use the expert system to predict the needs of water, fertilizers, and pesticides. Baloyi (2010) showed that considerable changes would be required in small holders farming operations if the economic benefits of increased incomes would be fully realized. These changes entail producing good-quality, high-value crops on a large scale and accessing high-value markets. This will only happen if smallholder farmers have access to comprehensive and holistic agricultural support services. Pests like the germ, fungus, and microorganisms are the origin of the disease to plants through a failure in excellence and extent of production. There is a great quantity of loss of farmer in making the crops. Hence proper care of plants is necessary for same. Research on the discovery of plant disease is gaining importance nowadays, which may prove useful in 1 observing the large area and consequently mechanically finding the symptoms as they come out on plant. This project will give a general idea of with image processing technique to identify a variety of plant diseases. It will offer more capable ways to discover infection created by fungus, microorganisms or germ on plants. Simple interpretation by eyes to identify ailment is not precise. An overindulge of pesticides create destructive chronic diseases in human beings as not cleaned correctly. It also damages plants nutrient superiority. Which come out to be an enormous defeat of production to the farmer. Hence the image processing techniques can bring into play to discover and categorize diseases in agricultural applications is supportive. 3 1.3 OBJECTIVES OF THE STUDY The general objective of this study is to increase the food production by bringing a 24/7 access to agricultural advice to the farmer. The project also intends to increase the income of the modern farmer which inclines to increase of the annual GDP to improve the living standards and the lifestyle of the farmers in Kenya. 1.4 SIGNIFICANCE OF THE STUDY The adoption of knowledge driven expert system will increase food production and income of the modern farmer since plant pathology solutions are brought to the farmer without limitations of distance or interaction with an agricultural officer. The program recognizes that increases in agricultural productivity with a defined market will result in improved incomes of the farmers. The assessment will be done on the production, pre-handling process of the goods, easy access to high quality medications, credit facility and the acceptability of their produce to highly competitive trading systems on the income of the smallholder farmers. The research work will ascertain the effectiveness of the approach in easy access to production inputs, finance and markets in augmenting incomes for smallholder farmers, the level of participation of both the large-scale farmer and small-scale farmers, document the success factors for the sustainability of the approach for up scaling in other projects and investigate, strengths weaknesses, opportunities and threats of the approach via conventional approaches. 4 1.5 SCOPE OF THE PROJECT The scope of the study was to develop and implement diseases/pest diagnostic system based on knowledge-based reasoning where by previously solved cases are used to solve the current problems. The system supports several languages including English and Swahili. The system can be accessed through two user interfaces namely: Dynamic Website. PWA (Progressive Web Application 5 CHAPTER TWO 2.0 LITERATURE OVERVIEW This study was a multi-disciplinary study touching on various academic areas ranging from agriculture and agricultural extension, crop protection, communication and computerized expert systems development. This section provides a comprehensive literature review and highlights the gaps which exist on the mentioned sectors. 2.1 Agriculture in Kenya The agricultural sector in Kenya has recently recoded improved performance especially in important commodities and enterprises such as horticulture, tea, dairy and maize. The agricultural sector is reviving and is on a trajectory of further development. However, challenges remain in some commodities such as coffee, sugar, pyrethrum and exploiting livestock and fisheries potential. Emerging constraints to agricultural growth need to be addressed. Challenges and constraints facing the sector vary with commodity and region. The effects of some of these challenges and constraints were accelerated by the worldwide food price crisis and its underlying drivers in 2008. Some of the general challenges include inadequate budgetary allocation; reduced effectiveness of extension services; low absorption of modern technology; high cost and increased adulteration of key inputs; pre- and post-harvest crop losses; livestock losses to diseases, pests and insecurity; limited capital and access to affordable credit; low and declining soil fertility; Inappropriate legal and regulatory framework; Inadequate disaster preparedness and response and inadequate infrastructure (GoK, 2010). Some of the challenges outlined above are a pointer to the fact that Kenya has inadequate human resource capacity. This could be attributed to first, insufficient budgetary allocation which leads to reduced operation budgets and hence inability of extension officers to access all farmers. Secondly was reduced effectiveness of extension services due to inappropriate methods. The information flow from researchers to farmers through extension officers provides a room for distortion. Thirdly, pre- and post-harvest crop losses due to mainly lack of correct and timely diagnostic information services which is brought about by high extension officer to farmer ratio. 6 Lastly, heavy livestock losses to diseases and pests due to low surveillance and understaffing (GoK, 2010). Several of the above challenges are information and knowledge related. The agricultural sector extension service plays a key role in disseminating knowledge, technologies, agricultural information and linking farmers with other actors in the economy. Extension service is one of the critical change mediums required in transforming subsistence farming to modern, commercial and smart agriculture. The transformation is required to promote household food security, improve income and reduce poverty. 2.2 Agricultural extension Extension approaches in Kenya include Focal Area Approach (FAA)– (Use of common interest groups (CIGs); Farmer Field Schools – Farmer to Farmer Extension; Commodity-based approach - commercial enterprises; Multidisciplinary Mobile Extension Teams especially in arid and semiarid areas (FAO, 2011). Despite the various extension approaches employed by the private and public sector, several challenges exist. These include reduced staffing and funding for operations and maintenance (GoK, 2010), extension and dissemination of conflicting messages (World Bank 2011), unnecessary competition and duplication of efforts and lack of synergy (World Bank 2011). Extension officers play an important role in provision of diagnostic services to farmers. Despite the various extension approaches employed by the private and public sector, several challenges are encountered in public sector. These challenges include: reduced staffing and funding for operations and maintenance of extension service delivery. In private sector the challenges include dissemination of conflicting messages, s; unnecessary competition, duplication of efforts, and general lack of synergy among extension service. These challenges have led to limited access to credible extension services in most parts of the country. The national extension staff to farmer ratio is 1:1,500 (Africa Science News Saturday, 16 November 2013). An agricultural system is considered sustainable when it satisfies producers ‘needs and preserves natural resources for current and future generation. Development of the system should be based on three pillars: economic feasibility, social fairness and environmental sustainability (Carlos, 2006). This study was designed with the objective of enhancing provision of extension services, by developing a computerized artificial intelligent information system that 7 meets economic, social, and environmental feasibility. The system was designed to improve delivery of diagnostic and management services for maize diseases in Kenya. An agricultural system can be considered sustainable when it satisfies producers ‘needs and preserves the natural resources for the present and subsequent generations. Development of the system should be based on three pillars: economic feasibility, social fairness and environmental sustainability (Carlos, 2006). Given the challenges facing the delivery of extension services in Kenya, the country is still far from achieving sustainability. 2.3 Existing information systems in Kenya ICT in Kenya is growing at a rapid rate. The penetration of mobile service in Kenya reached 64.2 percent by 2012 (Okyere, 2012). Kenya ‘s high mobile penetration rate and subscription number indicates that mobile technology is a promising business opportunity, and an indispensable tool for empowering the country ‘s citizens, especially its rural poor. The services widely used include use of MPesa which is a mobile money transfer service owned by Safaricom and launched in 2007. It allows users to use their mobile phones to send, receive and transfer money; MFarm, an agribusiness software solution which was started in 2010 and offers information to farmers on farming and market information to improve their productivity through sending an SMS (short messaging service) to 20225; iCOW. This is an SMS and voice-based mobile application launched in 2013 and used by dairy farmers to access information on the cows ‘gestation period, veterinary information and record keeping; Airtel Kilimo is a unique and innovative service aimed at providing phone-based agricultural information, advice and support to smallholder farmers over Airtel ‘s mobile network, launched in 2011. This service is utilizing Africa ‘s mobile network and technologies to bridge the knowledge gap in rural areas. The service can be subscribed on *760# for free SMS subscription where a customer is charged KSh3 per SMS and on Interactive Voice Response (IVR) for KSh3 per minute (Maritz, 2011). Another ICT program is the Kenya Agricultural Commodity Exchange (KACE), established in 1997, which has offers and bids. These services are prominently displayed on blackboard and are disseminated via SMS and Internet. KACE collects, updates, analyses and provides reliable and 8 timely market information and intelligence on a wide range of crop and livestock commodities, targeting actors in commodity value chains, with particular attention to smallholder farmers and small-scale agribusinesses (KACE, 2011). The components of the KACE links are: market resource centers, mobile phone short messaging service (SMS), interactive voice response service, internet database system, radio and the KACE headquarters central hub in Nairobi. All these applications help in accessing information on daily wholesale buying prices for over 20 commodities as well as offers to sell and bids to buy (KACE, 2011). Mobile phones are also used to distribute agricultural insurance products to farmers, most of whom cannot afford conventional insurance. A product called Kilimo Salama, Swahili for ‗safe agriculture ‘, enables smallholder farmers in Kenya to insure their agricultural inputs against adverse weather conditions, such as drought or too much rain. Developed by UAP Insurance, the Syngenta Foundation for Sustainable Agriculture and Safaricom, Kilimo Salama allows smallholder farmers to insure their inputs and produce. To be covered under the scheme, farmers only need to pay an extra 5percent for a bag of seed, fertilizer or other inputs. Mobile technology plays a central role in the scheme as it is used both for registration of new policies as well as for payouts (Okeene, 2012). Kilimo Salama is distributed mostly through agro dealers that have been equipped with a camera phone that scans a special bar code at the time of purchase, which immediately registers the policy with UAP Insurance over Safaricom mobile data network. This innovative application then sends a SMS message confirming the insurance policy to the farmer ‘s handset. Payouts are determined by automated weather stations that monitor the rainfall. Based on the stations ‘measurements and a predefined formula of crop rainfall needs, payouts are automatically made to farmers using Safaricom mobile money transfer service, MPesa. Farmers do not have to fill out any claim forms. Since its official launch in 2010, the scheme has already made payouts to numerous farmers (Okyere, 2012). It is expected that products like Kilimo Salama will increase productivity since only about half of Kenyan farmers invest in improved seeds and soil inputs (Okyere, 2012). A key reason for the low demand is the fear among farmers that poor conditions, such as drought, will render their investment worthless, robbing them of both their crops and their savings. The literature indicates systems in various agricultural value chains; however, none of the existing systems provide agricultural diagnostics. In addition, the SMS based systems have limited words 9 since an SMS cannot take more than 150 letters. Because of this reason, huge information on diagnostics and prescription might not fit through the existing systems. On the other hand, the existing systems are not user centered but only technologically center. It is important to develop systems which are user driven for ease of adoption. Mittal (2009) studied the role of mobile technology in improving small farm productivity in India by looking at the potential solution mobile phones could have in information asymmetry in agricultural sector. The study used focus group discussions and in-depth interviews with farmers to find answers to the use and impact of mobile phones and mobile-enabled services on agricultural productivity. The results showed that although mobile phones can act as catalyst to improving farm productivity and rural incomes, the quality of information, timeliness of information and trustworthiness of information are the three important aspects that have to be delivered to the farmers to meet their needs and expectations. This implies that the major factors for adoption of the technology were timeliness, quality of information and trust (Mittal, 2009) The literature identified several gaps in Kenya agriculture which includes low budgetary allocation, ineffective extension services, low adoption of modern technologies; pre and postharvest crop losses to diseases and pests, inadequate disaster preparedness, high cost and increased adulteration of farm inputs, low and declining soil fertility and inadequate infrastructure. The literature review identified several gaps in the extension system in Kenya which includes reduced staffing and funding for operation and maintenance, dissemination of conflicting messages, reduced mobility due to poor road infrastructure, and low usage of modern communication technologies in extension among others. The various types of research and indicated that evaluative and developmental research are two research approaches directed toward solving problems (Ackoff, 2005). The developmental type of research "involves the search for (and perhaps construction or synthesis of) instructions" that yield a better course of action (Ackoff, 2005). Developmental research has largely been ignored by some researchers. However, without research efforts directed toward developing new solutions and systems, there would be little opportunity for evaluative research. Information system development is a credited research methodology. This study will adopt the information system development research methodology for the development of the artificial intelligent system. Use of modern ICTs 10 in the medical field; where ICTs have been used successfully to support diagnosis of disease. However, these ICTs have only been used to provide information to physicians (and not the patient) that eventually makes decisions on diagnosis and management. This study will be designed to develop an artificial intelligent system that will use the symptoms observed by farmers to diagnose disease and provide necessary prescription to be administered. Literature also highlights the importance of maize crop to the Kenyan economy and society at large, the challenges affecting maize production in relation to disease diagnostics and management. The findings/outcomes of this study will eliminate most of the challenges through provision of information to farmers. The study will aim at providing a fully functional prototype of an agricultural computer aided diagnostic system for crop diseases. The study will be guided by several theories/ models. The theory guiding the study will be the system theory. The umbrella methodology for the study would be the system development research methodology. Within the system development research methodology, traditional waterfall system development model will be used to develop the system. Literature identifies the gap in the existing agricultural extension communication model; long communication chain which hinders the achievement of effective communication. 11 CHAPTER THREE 3.0 METHODOLOGY 3.1 METHODOLOGY. Object oriented analysis and design will be adapted for the system design. 3.1.1 Object-oriented analysis and design (OODA) This is a software engineering approach that models a system as a group of interacting objects. Each object represents some entity of interest in the system being modeled, and is characterized by its class, state (data elements) and behavior. 3.1.2 Object oriented analysis (OOA) This applies object modeling techniques to analyze the functional requirements for a system. Object-oriented design (OOD) elaborates the analysis models to produce implementation specifications. The outcome of object-oriented analysis is a description of what the system is functionally required to do, in a form of a conceptual model. 3.1.3 Object oriented design (OOD) This transforms the conceptual model produced in object-oriented analysis to take account of the constraints imposed by the architecture and any non-functional requirements. The concepts in the analysis model are mapped onto implementation classes and interfaces. The result is model of the solution domain, a detailed description of how the system is to be built. 12 Database Schema 13 Entity relationship diagram 14 Sequence Diagram 15 Activity Diagram 3.2 REQUIREMENTS GATHERING. 3.2.1 Case Based Reasoning 1.Capture problems and solutions This module provides an interface which allows the system manager to key in problems, their corresponding solution and explanation as given by the expert. It also enables the manager to perform administrative tasks for the system. Inputs The parameters include: Case description (symptoms, disease names, images of the symptoms), Solutions to the described cases and explanation and locations on where to purchase the prescribed solution. Operations a) This module provides the user with an interface to capture each of the inputs specified above. 16 b) The module validates the captured input. c) The module provides an interface for deleting the unwanted cases and updating the existing cases and their corresponding solutions. Outputs The module displays a message indicating that the status of the operation has been completed 2.Processing user problems This module allows users to post problems through two interfaces namely: WAP application and Website application Inputs User problem description in a case format. Operations a) Retrieve – Upon receiving the new case from the user, the case base reasoning searches the database to find the most approximate case to the current problem. The retrieval starts with description and ends when the best matching from previous case handled by the system. b) Reuse – This is where the case-based reasoning uses the retrieved case and adapting it to the new situation. The case-based reasoning proposes a solution for each retrieved case, the corresponding strategy used and the results obtained are looked up, at the end of the process. c) Revise – In case a case generated by the reuse phase is not correct, an opportunity for learning from failure a rise. The case solutions are evaluated via expert feedback and if successful, learning from the success, otherwise repair the case solution using domain-specific knowledge. d) Retain – This process enables CBR to learn and create a new solution and a new case that should be added to the case base. It incorporates what is useful to retain from the new problemsolving episode into the existing knowledge. The learning from success or failure of the proposed solution is triggered by the outcome of the evaluation and possible repair. It involves selecting which information from the case to retain, in what form to retain it, how to index the case for later retrieval from similar problems, and how to integrate the new case in the memory structure. 17 3.2.1 Non-functional Requirements Performance Requirements The artificial intelligent system for maize disease diagnostic and management supports real time processing and communication. Security Requirements Access to the artificial intelligent system for maize diagnostic and management is limited to authenticated users whose roles have been defined at the database level. Software Quality Attributes Below are key expected software quality attributes of the artificial intelligent system for maize disease diagnostic and management. Availability The artificial intelligent system for maize disease diagnostic and management is expected to operate continuously from time of installation. The artificial intelligent system for maize disease diagnostic and management is expected to run 24 hours a day, 7 days a week, 365.25 days a year and throughout its lifetime. Reliability The artificial intelligent system for maize disease diagnostic and management is expected to handle system failures elegantly. Flexibility The addition of new modules or upgrading of existing sub system should not cause interference with existing modules. Assumptions and Dependencies The users have the necessary technology which enables them to access and use the system 18 They farmers have access to the internet that is reliable, that is available all the time they want it. 3.3 SYSTEM ANALYSIS. This study will be conducted in the sample counties Uasin Gishu (the largest maize producer in Kenya), Kericho (the largest tea producer in Kenya) and Bomet (the largest potato producing county). Uasin Gishu County one of the 47 counties and the second largest maize producer in Kenya. The 2009 population census in was estimated at 894,179 people and 202,291 households. (http://www.scribd.com/doc/36672705/Kenya-Census-2009). There are two rainy seasons with an annual rainfall ranging between 900 to 1200 mm. Seated on a plateau; the county has a cool and temperate climate, with annual temperatures ranging between 8.4 °C and 27 °C. The wet season is experienced between April and May, while the dry season is encountered between January and February. The county is purposively selected due to its favorable climate to maize production, the large number of experienced maize farmers and extension officers and the high prevalence/incidence of diseases and pests affecting maize occurrence. Kericho is endowed with ideal climate; tropical, volcanic red soils; well distributed rainfall ranging between 1200mm to 1400mm per annum favorable for tea growing. The task of managing small scale holder lies with the Kenya Tea Development Agency (KTDA). KTDA reports 66 tea factories serving over 500,000 small scale farmers cultivating over 100,000 ha. Of the tea produced over 60% is managed by KTDA. Potato is the second most important food crop after maize in Kenya. It is cultivated by over 800,000 growers who are mostly small holder. Potato production in Kenya is currently about Sh 50 billion. This figure can be increased if production is optimized. Potato has capability of providing staple food requirements since maize decline upon Maize Lethal Necrosis Disease (MLND). Bomet has favorable climatic conditions for potato with annual rainfall of between 8501200mm and altitudes of between 1500m and 2800m above sea level. Data to be collected using interview guide. The study sample size would be estimated using the formula proposed by Mugenda and Mugenda (2003): 19 Where; n = the desired sample size for N>10,000, Z = constant associated with the required confidence level p = proportion of the population that possessed the target characteristics. The target characteristics will include farmer with and without access to extension services. d = the level of precision estimated Systematic random sampling technique would be applied to select the households. The sampling interval (k) would be determined using the formula = /n, where N is the population size and n is the sample size. The operation of the proposed system is to collect data on the spot using automated system that is being designed. All that the user needs are to login to the interface using the appropriate uniform resource locator and upload the data at a time using the registration form and the data will be saved and can be accessible immediately at the head office that is it is real time. 3.3.1 Feasibility study The types of feasibility study include: 1.Operational feasibility Operational feasibility is performed to determine whether the operations of the e-kulima system will be acceptable to the users and if the intended users will be well trained and experienced to work with the system efficiently or there is need to recruit the existing users and employ new instructors. It is determined that there are computer literate personnel who needed only to be introduced and guided on how to use the system so as to be able to navigate through it. A good number of instructors and farmers we interviewed were in full support of the project, as there will be improvement in the farming sector in general with time as more people begin to use the system. The implementation of functional requirements and non-functional requirements of the system ensured better easy learning was achieved. 20 2. Economic feasibility The economic feasibility was carried to determine the cost of developing, operating and maintaining the e-kulima System and its economic viability in relation to return on investment and service delivery. It is proposed that the Complementary e-kulima System was feasible because the developers of this project who are also the sole sponsors and managers have enough financial resources to support the implementation of the new system and farming standards would greatly improve with introduction of a new system that is well equipped hence the system is economically feasible. 3.Technical feasibility Technical feasibility is concerned with the availability of hardware and software required for the development of the system, to see compatibility and maturity of the technology proposed to be used and to see the availability of the required manpower to develop the system. After the study we came up with the tools and development environment chosen by us. This was important in our case as we were working together on two various phases of the department that will need to be integrated future to make and extended system 21 3.4 System Design. The waterfall model highlights processes which developers have to follow. These processes are categorized in phase namely Requirements specification (Requirements analysis); Software design; Implementation and Integration; Testing (or Validation); Deployment (or Installation) and Maintenance. In a strict Waterfall model, after each phase is finished, it proceeds to the next one. Reviews may occur before moving to the next phase which allows for the possibility of changes (which may involve a formal change control process). Reviews may also be employed to ensure that the phase is indeed complete; the phase-completion criteria are often referred to as a "gate" that the project must pass through to move to the next phase. Waterfall discourages revisiting and revising any prior phase once it is complete. This "inflexibility" in a pure Waterfall model has been a source of criticism by supporters of other more "flexible" models (Kent, 2000). This study therefore will use the traditional waterfall system development model because of the nature of this project and the advantages the model has over all other models. Diagnostics of crops pests and diseases is one of the major roles of extension officer. It always involves extension officers going to visit the farms, viewing the symptoms on the crops and from their knowledge of pests and diseases, identifying the specific disease. The extension officer then proceeds to prescribe curative measures to the farmers for the plan based on their knowledge of existing management option. This service has however been hindered by under staffing of extension officer, low budgetary allocation to the agricultural sector, poor road infrastructure among other. Because of these challenges, there is always more often delay or some time complete failure in the delivery of the diagnostics services to farmers which eventually result into loose of crop productivity. With the advances made in ICT in Kenya and the development of several artificial intelligent system which can perform like humans on decision making, it was necessary to rethink the delivery of these services to the farmers in a more speedy, efficient and cost-effective manner. A study will be done to establish a module which can drive an Artificial Intelligent System for Agricultural Diagnostics. The study will involve a review of the modules of already existing system for diagnostics in both agriculture and human medicine. Some of the systems reviews will include Rice-Crop Doctor, Cattle Disease Diagnostic System (CaDDiS), Agricultural Pest 22 Diagnosis Using Imaging Technologies, Mobile Interfaced Crop Diagnosis Expert System (MICDES), Computer assisted Medical diagnostic systems (CAMD) and Computer Aided Diagnostics (CAD) in Medical Imaging. MOCDES module was adopted wholly without any alterations A comprehensive farmer and extension officer requirements and the electronic database for crop diseases and their management provides satisfactory information for the artificial intelligent system modeling. An artificial intelligent is an application which contains the knowledge of a human expert about solving problems in a bounded environment. Such applications have been developed such as manufacturing, medicine, business procedures or engineering. The most important goals of an expert system are: To conserve the knowledge of human experts. To provide help to laymen and experts in solving problems. To make information readily available that is difficult to recall. Major Components of Artificial intelligent systems An artificial intelligent system consists of three major modules: The knowledge base The inference engine Working memory This portioning is deduced from how human expert problem solving works. 23 3.4.1 Knowledge Base The highly specialized knowledge of the problem area is located in the knowledge-base. This module will contain problem facts, rules, concepts and relationships. The first step to build the knowledge base is to gather the knowledge from human experts. After this step, the knowledge must be coded in a form which is useful for automatic processing. Several techniques of knowledge representation are available including a rule-based representation and case-based representation. 3.4.2 Working Memory The working memory contains the facts about a problem that are collected during one consultation of the artificial intelligent system. When a new problem has to be solved, the user enters information about the problem in the working memory. The artificial intelligent system then uses this information together with the facts in the knowledge base to infer new facts. The content of the working memory can also consist of facts that have been collected from external storage like databases, spreadsheets, or sensors, beside the information that is taken from knowledge base. 3.4.3 Inference Engine The reasoning of the expert is molded in the knowledge processor, usually named the inference engine. The engine uses knowledge base as the source of information for reasoning. Together with the other available information to draw conclusions and or give recommendations as to how specific problem can be solved. Another task for the inference engine is to reason with uncertain data. The certainty associated with a value is usually described by a numeric value, and various mathematical rules are employed to derive the joint confidence across sets of values. 24 In this section the focus is given on the previously developed artificial intelligent systems which are used to disseminate information and SMS based systems. 3.4.4 Diagnostic System The Diagnostic System will be divided into two components: The backend – Case-based reasoning (CBR) system The frontend – Interfaces for accessing the backend 3.4.5 Backend (CBR) Case-based Reasoning means to use previous experience in form of cases to understand and solve new problems. A case-based reasoning remembers former cases similar to the current problem and attempts to modify their solutions to fit for the current case. The underlying idea is the assumption that similar problems have similar solutions. Though this assumption is not always true, it holds for many practical domains. CBR consist of four modules: RETRIEVE REUSE REVISE RETAIN When a new problem is matched against cases in the case base and one or more similar cases are retrieved. A solution suggested by the matching cases is then reused and tested for success. Unless the retrieved case is a close match the solution will probably have to be revised producing a new case that can be retained and this will be done by the case Manager. 25 CBR directly addresses the following problems found in rule-based technology. CBR does not require an explicit domain model and so elicitation becomes a task of gathering case histories Implementation is reduced to identifying significant features that describe a case, an easier task than creating an explicit model By applying database techniques largely volumes of information can be managed CBR systems can learn by acquiring new knowledge as cases thus making maintenance easier. 3.4.6 Frontend The proposed system will provide two modules through which users will interact with it and these include: 1. Website (response will be both in text format and picture format) 2. PWA (work as the usual offline mobile application) Through these interfaces user diversities will be taken care of, making the system more accessible and acceptable to the users. Website: The system provides a web interface through which users will key in a new problem either in text mode or a picture template. If a match to the posted problem is found the proposed solution will be presented in either text format, picture or video format. The process is shown in the diagram below: 26 The knowledge processing module will have Rule based Identification and Ontology based Problem Identification sub modules. In Rule based Identification, the users will enter the question answering mode where he/she will feed in the symptoms of the diseased plant. Here, the platform is in text format. This session will yield the solution of the problem such as of disease diagnosis or identification of pests. In Ontology based Problem Identification the user will also enter the question answering session, but here the platform is allowed in picture form. The user will be able to input by either capturing a picture of the affected plant or will be an option of uploading a picture file from gallery or any file from the phone storage. An Image recognition system is incorporated: the photo taken by the farmer should be recognized by the system and critical accurate decisions made upon it. The image data will be fed into the system once uploaded, the closest measurements will be used to classify the image data and diagnosis given upon it. The presented expert system will be based on the n-tier model of the web applications. This model will allow different components of the system to be built by different experts, specialized in their 27 domain. Knowledge base and inference engine are the two most important components of an expert system. The basic principal of the separation of the knowledge from its treatment is of prime importance in the building of every expert system. The building and maintenance of an expert system is greatly facilitated by trying to adhere to this principal as closely as possible. 1. The Knowledge Base Layer (KBL): the knowledgebase will be built using ontology. It will contain knowledge about plant varieties, diseases and insect-pests. 2. The Database Layer (DBL): this layer will be implemented using MS SQL Server 8.0 database. This will contain the authorization information about users and crop specific information. 3. The Reasoning Engine: the reasoning engine will accept user input queries and responses to questions through the I/O interface and uses this dynamic information together with the static knowledge stored in the knowledge base. The knowledge in the knowledge base will then be used to derive conclusions about the current case or situation as presented by the user’s input. JENA is used here for this purpose. 4. Server-Side Application Layer (SSAL): application layer will be built using Java Server Pages (JSP). The JSP provides the web developers with a framework to create dynamic content on the server using HTML, XML, Java classes, which is secure, fast and independent of server platform. 5. Client-Side Interface Layer (CSIL): it will be implemented using HTML, CSS and JavaScript. The CSIL consists of forms for accepting information from the user and validation those forms using JavaScript. It also provides the explanatory interface to the users of expert system. 28 Web container SPARQL KNOWLEDGE BASE SQL JEN User interface (Web browser) internet DATABASE SERVER 3.5 Coding and Debugging. Artificial intelligent system for agricultural diagnosis, a case study of farmers in Kenya is carry home expert system which is based on reasoning for diagnosing crop diseases using the previous resolved cases. The system supports two input platforms which include: text and picture to make it more acceptable, usable and accessible. The system performs diagnosis of known crop diseases and pests. The system is accessible through the mobile devices for example WAP enabled mobile phones and dynamic website. The system has the ability to learn from the unsolved cases. The system alerts the expert when it fails to diagnose a case via email who then tries to solve the case so that the next time users present the same the system will be able to diagnose. 29 Artificial intelligent system for agricultural diagnosis, a case study for farmers has been implemented using PHP, SQL, Java and XML and uses an open source database. The realization of the system was through interaction with farmers and extension officers in Kenya through interviews and issuing of questionnaires. A validation of the system was conducted to establish the soundness and completeness of the indicated solutions. Expert systems have the capability to transfer location specific technology and advice to the farmers efficiently and effectively. This in turn reduces losses due diseases and pests’ infestation, improve productivity with proper variety selection and increase income of the farmer. The taxonomy and identification of crop infection have the foremost technical and economic importance in the Agricultural Industry. However, disease detection needs incessant observing of specialists which might be prohibitively costly in big farms region. Automatic recognition of plant diseases is necessary to research 3.6 Testing For The Prototype. To ensure a reasoning veracity and completeness of the artificial intelligent system, a number of tests were conducted. Testing was iterative and incremental in nature. Of concern in this testing were both the functional and non-functional requirements which had been identified during the analysis stage. The tests were performed on an emulator for the mobile client before deploying the application on the mobile phone. For the web client, it was done on a local server before hosting in a public domain. One approach will be applied to test the system: Explore the capabilities of the system adding and removing symptoms. At each stage, check the results given along with the calculated probabilities of the diseases to see whether they match the analysis of which diseases are most likely to be implicated in causing these symptoms. If at any point inaccurate information is presented, corrections were made. A set of possible observed symptoms were defined. The signs were used as input specification and the results compared with the mental picture of sensible diagnosis. A set of scenarios were evaluated. 30 3.6.1 Test on Functional Requirements A sample test data shown below in table 7.1 was prepared to test the functional requirements of the system. It shows the expected behavior before the test and the actual behavior after the implementation of the system Sample Tests for Functional Requirement Test No. Description Expected Behavior 1. Veracious diagnostic The results Actual Behavior application The should diagnostic results generate match the intuitive opinion diagnosis results that of the individual doing the are complete and tests. genuine 2. Exhibit some learning The application With with a variance in should vary weights. results addition symptoms 3. of of the symptoms, the confidence confidence rating of rating the addition varied and the with number of possible new problems fell until a solution was found Add or subtract input It should be possible The users could provide specification for a user to add or additional symptoms or remove symptoms or remove and submit for a input specifications as diagnosis. they wish. 31 3.6.2 Module Testing Each module will be tested on its own. This is done to ensure that every unit/module works properly on its own. Some of the tests carried out include entering wrong data or submitting blank fields for required fields in order to test the outcome e.g. submitting an empty form when the administrator is entering crop name the following error message is displayed. 3.6.3 Regression Testing In the process of cording, new changes are sometimes made and incorporated into a module. The new changes and the entire module are tested again to ensure that the changes did not affect the functioning of previously verified codes. 3.6.4 System Testing The module will be integrated after the sub modules were completed, tested and found to function as per the expectation. The entire system is then tested to ensure that the system performed according to specification. 32 CHAPTER FOUR 4.0 RESOURCES, BUDGET ESTIMATE AND PROJECT PLAN. 4.1 RESOURCES. 4.1.1 Hardware Platform The hardware specifications below are chosen for the successful completion of the project since they are sufficient to meet the functional and non-functional requirements of the system, especially with regard to processing and response times. A WAP enabled phone was used as a minimum requirement since GPRS enabled phone could be used alternatively. Pentium V Dual Core 3.0 GHz Processor 80Gb hard disk 512 MB RAM 100 Kbps LAN 4.1.2 Software Development Platform: Wamp 5_1.6.1 (Windows) Windows Vista environment Macromedia Dreamweaver 8 Internet Explorer version 6.0 NetBeans Open source Open wave SDK version 6.2.2 Visual Studio. 4.1.3 Database: MySQL database 4.1.4 Programming languages: XML 33 XHTML Java PHP SQL 4.1.5 Communication: TCP/IP, GPRS wireless connectivity 4.2 BUDGET ESTIMATE. Required Unit Quantity Unit Price Total Price Item 1. Laptop Each 1 40,000.00 40,000.00 2. Backup Disk TB 1 7,500.00 7,500.00 3. Internet Usage GB 10 2,000.00 20,000.00 4. TOTAL 67500.00 4.3 PROJECT PLAN. 4.3.1 ACTIVITIES. Requirement gathering Analysis Design Coding and Debugging Testing 34 4.3.2 GANT CHART. WEEK/DATE 1st August 2021 5th September 2021 3rd to to October 2021 2nd September 2021 30th October 2021 to 21st Nov 2021 S. No. Project Activities 1 Requirement gathering 2 Analysis 3 Design 4 Coding and Debugging 5 Testing 1 2 3 4 5 35 6 7 8 9 10 11 12 13 CHAPTER FIVE 5.0 CONCLUSION As an economical aspect, expert systems can clearly affect over all agricultural production. Similarly, we can preserve our natural resources instead of being polluted because of excessive and wrong usage of chemicals and fertilizers. Moreover, better training of extension workers through these systems can also be beneficial. These systems are completely computer based. The theory of Expert System is well developed and matured and can be applied to a wide spectrum of agricultural problem. Perhaps one of the greatest hindrances in increasing crop production today is that of transferring new agriculture technologies developed at laboratories to the farmer’s field. Expert System technology is an ideal approach for transferring the crop production technologies to the farmer’s level, the ultimate consumer of agriculture research. Expert systems are not static but dynamic devices as there is always scope for improvement and up gradation. The approach for the development of Expert System is not difficult to understand and tools for developing expert system are readily available, even some are freely available on internet. The careful development and logical use of Expert System in agriculture can help bridge the gap between research worker and extension worker. This view of the future is the result of studies and experience gained through the Expert System currently being developed and implemented. Therefore, „Expert System in Agriculture‟ aims to train extension workers and distribute the Expert System to all extension sites nation-wide. Taking the reducing prices of computers/mobiles into consideration, internet connectivity at village level for the said purpose can be achieved. 36 5.1 REFERENCES Africa Science News Saturday, (16 November 2013) http://www.africasciencenews.org/en/index.php?option=com_content&id=596:howtorevolutionise-kenyan-agriculture-the-greenhouse-way-&Itemid=113 Ammenwerth, E., F. Ehlers, U. Kutscha, A. Kutscha and Eichstadter R., 2002: Supporting patient care by using innovative information technology. Disease Manage. Health Outcomes, 10: 479-487. DOI:10.2165/00115677-200210080-00004 Anderson J., Feder G.C 2005: Agricultural Extension, Handbook of Agricultural Economics; Agricultural Development: farmers, Farm Production and Farm Markets, Volume 3 Arden, B. W. (ed) 2006: "What can be automated?" The Computer Science and Engineering Research Study (COSERS). Cambridge, MA: MTT Press. Arokoyo Tunji 2002: ICTs In the Transformation of Agricultural Extension, The Case of Nigeria. International journal of Agricultural Extension Volume 3 Issue 5 Basili, V. R.; Selby, R. W.; and Hutchens, D. H. 2004: Experimentation in software engineering. IEEE Transactions on Software Engineering SE-12, 7, 733-743. Benbasat, I. 2008: An analysis of research methodologies. In the Information Systems Research Challenge, Harvard Business School Press. Blake, S. P. 2009, Managing for Responsive Research and Development. San Francisco: W. H. Freeman and Company. Blalock, A. B., and Blalock, H. M., Jr.2003 Introduction to Social Research, 11th edition. Englewood Cliffs, NJ: Prentice-Hall. Boehm, B. W. 2005, Improving software productivity. IEEE Computer, 20, 9. Boehm, B. W. 2007, Software Engineering Economics. Englewood Cliffs, NJ: PrenticeHall. Booch, 2004. Object-oriented development. Interactions on software Engineering, SE-12, Chen, M. 2008, The Integration of Organization and Information Systems Modeling: A Metasystem Approach to the Generation of Group Decision Support Systems and Computer- Aided Software Engineering. Unpublished doctoral dissertation. University of Arizona, Tuc- son, AZ,. 37 Chen, M.; Nunamaker, Jr. J. F. and Weber, E. S, 2009. Computer-aided software engineering: present status and future directions. Newsletter, ACM SIGMIS Database Volume 20 issue 1, page 7-13 Computer Science and Technology Board (CSTB). 2010, Scaling up: a research agenda for software engineering. Communications of the ACM, 33, 3, 281-293. Creswell, J.W., 2011. Educational Research: Planning, Conducting and Evaluating Quantitative and Qualitative Research. 4th Edn., Pearson Education, Boston, ISBN-10: 0132613948, pp: 650. Curtis, B. 2004. Tutorial: Human Factors in Software Development. Los Alamitos, CA: IEEE Computer Society Press,. Curtis, B. 2007: Introduction to empirical research on the design process in MCC's software technology program: MCC Technical Report Number STP-260- 87, Austin, TX,. Curtis, B.; Krasner, H.; and Iscoe, N. November 2008: A field study of the software design process for large systems. Communications of the ACM, 31, 11 , 1268-1287. Davis, F. D. 2007, "Perceived usefulness, perceived ease of use, and user acceptance of information technology", MIS Quarterly, 13(3): 319–340 38