Keywords

1 Introduction

Maintaining and increasing food production to feed growing populations in the face of changing environmental conditions is a global problem. Changing patterns of temperature and precipitation due to climate change, soil degradation from over-production, inappropriate fertiliser use or crop rotation mismanagement, and water quality reduction from nutrient inputs, all contribute to this problem [6, 9]. The impact of climate change on agricultural production is already being felt more severely in developing countries as emerging economies tend to have a lower capacity to adapt [4]. Long-established farming practices may be ill-equipped to sustain production in the face of significantly changing conditions, so guidance and support in the adoption of innovative practices is increasingly important.

In many parts of the developing world, farming is characterised by smallholder farming, partly for subsistence but also looking to cash-crop income [10]. Crop failure in these conditions can be catastrophic, with most farmers having little in the way of resources to buffer them from these consequences. Such farming has traditionally been guided by personal experience, in family and community. In the face of changing environmental conditions of increasing scale and severity, the use of data analytics and decision support technologies may be of increasing benefit, if they can be made readily available, relevant and usable [15].

In this paper, the application of a Bayesian Belief Network (BBN) to aquaculture - agriculture farming in the Mekong delta in Vietnam is presented. Extraction of knowledge from the BBN by a process of data mining is described, and the design of a decision support app for smartphones is shown.

The remainder of this paper is organised as follows. Section 2 describes Bayesian Belief Networks and their application to the case study. Section 3 describes the process of extracting knowledge from the BBN. Section 4 shows the design of the smartphone app and its operation. Finally, Sect. 5 concludes and describes future work.

2 Bayesian Belief Networks

The global environment, encompassing the natural environment and human interventions through agriculture, are governed by complex interrelationships. Often non-linear and probabilistic, there are many ways to attempt to understand interactions in these systems, one of which is Bayesian Belief Networks [7, 11]. A BBN is a directed, acyclic graph, each node of which contains a conditional probability table that gives the probability of specified output states, given the input conditions from parent nodes. Considering the network as a whole, root parent nodes define the conditions of the environment, or scenario, for the model, while leaf nodes show the probability of a set of outcomes given the conditions of the parent nodes.

BBNs have been applied to better understand many ecological, environmental and agricultural systems. Of particular relevance to the work described in this paper, they have been used to elicit expert knowledge from farmers attempting to simultaneously harvest rice and shrimp from the same combined aquaculture-agriculture system [16].

2.1 Using a BBN for Rice/Shrimp Farming

In their paper, Stewart-Koster et al. [16] described a combined aquaculture-agriculture system in which farmers in the Mekong delta, in Vietnam, attempt to use the same fields to grow rice – on a central, raised platform – and shrimp in a surrounding ditch. While both are grown submerged in water, rice requires lower water salinity than shrimp which, of course, presents challenges for production of both crops, as attempted by farmers at some times during the year.

The BBN in Stewart-Koster et al. [16] was developed following several iterative stages of expert elicitation workshops with farmers and government extension officers in the region held over a two year period. The participants in the workshops were those already involved in an ongoing research program into the sustainability of the farming process. The network was designed to establish the perceptions of farmers and extension officers of key risk factors to production and their understanding of how the system works. Consequently, the expert elicitation followed a process based initially on asking open ended questions to identify key processes that drive the system, followed by conditional ones that identified the causality among these different processes. Having used this approach to define and verify the structure of the network and the thresholds of the states of each node in the network, a series of workshops were held to ascertain the probabilities in the conditional probability tables (CPTs) in the network. With the exception of the rainfall nodes in the BBN, all CPTs were derived from the expert opinion of the farmers.

Defining CPTs in a BBN is an important process and when based on expert elicitation it requires careful approaches to ensure the resulting probabilities accurately reflect the perceptions of the experts involved [13]. Challenges include ensuring dominant personalities do not prevent quieter experts from voicing their opinion, avoiding biases from the subjectivity of expert knowledge, which may manifest as subjective biases due to the experts’ personalities or cognitive biases due to not understanding the requirements of the process [2, 8]. To overcome these challenges, Stewart-Koster et al. [16] used three different approaches to expert elicitation of the CPTs, a survey method, direct elicitation of probabilities and indirect elicitation approaches. Having derived the CPTs for the relevant nodes in the network, a final round of verification was conducted to ensure the network reflected the knowledge and experience of the farmers. This ultimately results in a BBN that represents the farmers’ expectations of the probability of rice and shrimp crop failure under certain conditions. This is essentially an expert system that encapsulates the collective understanding of the conditions necessary to achieve desired outcomes (minimising risk of crop failure for both crops) given varying conditions, such as timing and volume of monsoonal rainfall, quality of the shrimp stock, and perceived soil and water quality at various points during the growing season. For reference, the final BBN from Stewart-Koster et al. [16], upon which we base our decision support system, is reproduced in Fig. 1.

The cultural circumstances of this modelling exercise should be noted. While some of the conditions imposed could be quantified, e.g., shrimp stocking density could be specified in larvae applied per square metre, others are very subjective. Farmers expressed conditions, e.g., water and soil salinity, in subjective, but generally collectively understood terms. In the field, they do not have access to sophisticated measurements: water salinity is determined by whether the water tastes salty, brackish or fresh. While the collected data cannot be calibrated in objective terms, e.g., water pH or soil electrical conductivity, the relative measures and consequent outcomes can be understood by the end users, the farmers.

The work described in this paper consists of two major parts: extracting the knowledge from the BBN, and presenting it in a form suitable for easy use by the farmers.

Fig. 1.
figure 1

The BBN as used by Stewart-Koster et al. [16], and as a basis for this paper.

3 Data Mining the Expert System

From Fig. 1 it may be seen that the BBN has two leaf nodes, delivering the conditional probability of success or failure of the rice and shrimp crops. While these nodes provide the probability of several outcomes expressed in terms of “Crop failure” through to “Low risk”, it was decided to simplify the outcome to the probability of a successful crop = 1 - probability of crop failure. While this removes some of the nuances of the impact of actions taken, it considerably simplifies the presentation of the data and outcomes.

By systematically varying input conditions it is possible to discover the conditions that minimise the probabilities of crop failures – discovering relationships by inspection of data. In this regard, this is essentially an exercise in data mining [5].

Further inspecting Fig. 1 a number of root nodes can be seen. (Note: these may not be displayed at the top of the figure, but can be distinguished by their lack of any incoming links from parent nodes.) Two, coloured darker blue, specify the governing climatic conditions for the season – when, and how heavy was the monsoonal rainfall. Together with the “Soil nutrient load”, they set the scenario farmers experience prior to planting, at which time they can make a number of decisions about “pre-planting” actions.

At “planting” time, farmers can make a number of estimations of environmental conditions, including such things as soil salinity, water temperature etc. These are shown in bright green in Fig. 1. At this stage in the season such nodes “cut out” the direct effect of their parent nodes, setting the scenario for the planting season. Farmers have a more limited set of decisions now, e.g., it is too late to decide to till the soil.

In the “post-planting” period, the set of cut-out nodes could be further lowered. However, to do so would require overly subjective judgements to be made in the field, such as whether wet season water quality was “good for shrimp”. By keeping the cut-out nodes from the previous period, based on simple observations and assessments, and adding the actions already taken, the post-planting scenario is defined, and becomes highly constrained. Farmers’ actions are now limited to assessing rice colour (as part of the scenario), which will determine the level of fertiliser applied, and choosing water colour management actions.

The insight leading to separate consideration of different stages in the growing season simplifies interpretation of the data. At the pre-planting stage the 1728 different states of the model are reduced to 96 alternative strategies by dealing with just one of the 18 environmental scenarios at a time. It might be possible to provide this model to end users so they can interrogate the data directly and find the results of different actions and strategies. However, this lacks guidance to lead users to optimal outcomes. A simple form of optimisation was employed. Knowledge was extracted from the BBN by repeatedly running the model with scenario input conditions fixed, and the possible actions varied across all their possibilities. The corresponding conditional probability of crop failures was recorded and graphed against the input variables. As an example, the output for the “pre-planting” analysis is shown in Fig. 2.

The data was reordered so probability of shrimp crop failure was monotonically increasing. (Shown as the solid line in the top ‘trace’ in Fig. 2.) This allows the graph to be inspected easily to determine the point at which the probability of crop failures of rice and shrimp were at simultaneous minima, designated the “sweet spot”. (Shown as the small circles on the top trace.) The plot was annotated with the scenario conditions and the actions corresponding to the sweet spot. This “inspection” was subsequently automated using an R script [17] during data preparation.

Extracting optimal farming practices directly from the BBN can be complex, cumbersome and confusing. Despite the simplification delivered by automatic extraction of data from the BBN and display via graphs, extracting simple advice is still not straightforward. In order to deliver a tool that was easy for the end-users, the Mekong delta farmers, to use and interpret, it was decided to develop a smartphone app.

Fig. 2.
figure 2

Sample data extracted from the BBN

4 The Decision Support App

Decision support apps for agriculture are growing in popularity. While decision support systems for agriculture are not new – prototype systems can be found in the literature from the late 1970s [14] – delivery to the end-user has been problematic. As decision support systems should be evaluated on their contribution to improved outcomes [3] getting easy-to-use tools with clear, understandable advice to the end-user is critical. Smartphones, provided they are readily available, offer the potential of wide penetration with minimal marginal cost. Thus the proliferation of smartphones in developing countries presents a rapidly increasing but largely untapped resource. In Vietnam in 2017 about 60% of the rural population, some 22.5 million people were smartphone users (as measured by Facebook user data [19].) While there are increasing numbers of smartphone users, their usage is largely confined to social networking, messaging, music and entertainment. Only about 25% use productivity tools on a daily basis [1].

The majority of these users have Android smartphones, so a decision support app was developed for Android by converting the CSV (comma separated values) data extracted from the BBN to JSON, and the R data extraction and comparison operations were replicated in React Native [12]. Development only proceeded after usability workshops based on conceptual wireframe diagrams were conducted with end-users from the region around Ca Mau in Vietnam.

Typical end-users for the app, mainly farmers who have an average age of about 49 with limited formal education [18], dictated labels and text should be brief and straightforward. Wherever possible, terminology familiar to the users should be used, fonts should be large and clear, and buttons and other interaction elements should also be easy to see and use. The overall layout and operation of the app aimed to be intuitive with the ability to select a clearly defined stage in the growing season, then describe it in simple terms drawn from the actual experience of farmers and allow for subjective descriptors that do not require any instruments to define. Outputs use visual aids to enhance comprehension, with colour coding of bar charts to match crops (rice or shrimp). Recommended actions are described in similarly clear terms. The whole app has been developed in English and Vietnamese language versions. Screenshots of the opening page (after the “splash screen”) are shown in Fig. 3.

Since the data and knowledge incorporated in the app are specific to a particular region, the Mekong delta in Vietnam, it has also been considered important to warn prospective users of this localised nature of the advice provided. A test has been included in the app, using GPS location data from the mobile device, which triggers a disclaimer if it detects the app is being used too far from its intended target area. This warning can be seen in Fig. 4a. (Note: the warning is posted immediately the app starts, and is only available at present in Vietnamese.)

From the opening page, an appropriate period (pre-planting, planting or post-planting) may be chosen. On the following screen (see, for example, Fig. 4b) scenario conditions can be entered in the area above the “START” button.

Once the START button is pressed, corresponding probabilities of successful crop outcomes appear below (see, for example, Fig. 5a) and the user can scroll down to read the actions required to achieve these outcomes (see Fig. 5b).

Should a user wish, they can alter the recommended actions to a preferred alternative (see Fig. 6a, in which a user chooses a High shrimp stocking density, rather than the recommended Medium density.) This will then display the corresponding change in crop outcome probabilities resulting from the change (see Fig. 6b, showing the probability of shrimp crop failure, due to over-stocking.) The optimal action list can be restored by pressing the START button again.

In-app instruction is provided, with a step-by-step guide and illustration of how data is input. The app is packaged and delivered as an Android Package Kit (APK). When installed and run, at each startup the app checks for access to a server on the Internet, and availability of any software updates. By this means, the app in the field can be provided with revisions and new functionality automatically. However, access to the server is not necessary for the app to function.

Fig. 3.
figure 3

The decision support app

Fig. 4.
figure 4

Running the decision support app

Fig. 5.
figure 5

Running the decision support app (cont.)

Fig. 6.
figure 6

Running the decision support app (cont.)

While yet to be released, in conjunction with a second-phase app to be based on scientific studies and field trials of innovative farming practices, the app has been shown in a pre-release preview to water management practitioners at an Asian Development Bank Water Learning Week workshop and to members of the International Water Centre. It was very well received and complimented by representatives and researchers from government ministries and NGOs, from Australia, Cambodia, China, France, Georgia, India, Indonesia, Japan, Korea, the Marshall Islands, Mongolia, the Philippines, Sri Lanka, Uzbekistan, Vanuatu and Vietnam. In addition, it has been demonstrated to a large group of farmers from the Mekong delta and collaborating scientists. Responses were uniformly positive and the release of the app is keenly awaited. Members of the International Water Centre have since invited presentation of the app to policy officers at the Vietnamese Ministry of Agricultural and Rural Development.

5 Conclusions

Efficient farming practices, particularly for smallholder farmers, is important in a time of climate change and competition for resources. Improved data analytic and decision support tools can be used by people in the Mekong delta region to help with planning for optimising rice and shrimp crops. The work in this paper has shown that the results of complex modelling, scientific trials and research can be delivered in readily usable form to farmers and regional authorities, to assist in planning and day-to-day farming practice.

Given the work presented here, it is planned that extensive user evaluation of the app will be undertaken. This will include both a qualitative and quantitative analysis to determine how effective it is in the field and whether users require modifications or additions to the app. At the same time, a revised version of the BBN is being developed. This will be based on scientific principles rather than just the beliefs of the farmers themselves. It is believed that the app itself will only require small changes, as it is produced in such a way that outcomes derived from belief networks can be readily swapped in and out of the app.