Increasing Profitability and Monitoring Environmental Performance: A Case Study in the Agri-Food Industry through an Edge-IoT Platform

Globalization has led to a new paradigm where the traditional industries, such as agriculture, employ vanguard technologies to broaden its possibilities into what is known as smart farming and the agri-food industry 4.0. This industry needs to adapt to the current market through an efficient use of resources while being environmentally friendly. The most commonly used approaches for analyzing efficiency and sustainability on farms are production efficiency based analyses, such as Data Envelopment Analysis and Stochastic Frontier Analysis, since they allow to see how efficient the outputs are generated regardless of the units of measurement of the inputs. This work presents a real scenario for making farms more profitable and sustainable through the analysis of the Data Envelopment Analysis and the application of the Internet of Things and Edge Computing. What makes this model interesting is that it allows monitoring the ambient conditions with real-time data from the different sensors that have been installed on the farm, minimizing costs and gaining robustness in the transmission of the data to the cloud with Edge Computing, and then to have a complete overview in terms of monthly resource efficiency through the Data Envelopment Analysis. The results show that including the costs of edge and non-edge data transfer have an impact on the efficiency. This small-scale study set the basis for a future test with many farms simultaneously.


Introduction
In terms of agriculture production, the differences between developed and developing countries are becoming less noticeable as the market becomes increasingly globalized and competitive [1]. For European Union (EU) countries, the Common Agricultural Policy (CAP) [2] manages and finances, at European level, resources from the EU budget regarding the support for farmers' incomes, market orientation and the environment. The CAP also regulates the evolution of quotas for agricultural industries. For example, in 2015 with the abolition of the milk quota and the correspondent policies [3], or more recently, the end to the sugar quota in 2017 [4], as well as evaluating the post-quota trade environment. Even though the quotas have come to an end, there are important concerns among agricultural lobbies and the real effects in time change of those quotas as well as the economic impact of years with a market in apparently perfect competition [5,6]. The European Union is one of the leading producers of dairy products worldwide [7]. However, Europe's milking yields per dairy cow, for example, vary considerably among EU regions (5290 and 8702 kg/head in Ireland and Spain, respectively) [8]. Moreover, milk share is quite different for the milk of livestock other than cattle (15.2% in Spain, 5.4% in Portugal or 0% in Ireland). Furthermore, cloud is interrupted; something frequent in scenarios where the Internet connectivity is limited (e.g., farming environments in rural areas) [12].
This research aims to develop a strategy on how farms can track their environmental efficiency and evaluate their possibilities for increasing their profitability as is shown in Figure 1. Due to all the regulations and production levels allowed and their implications, this research presents an efficiency-oriented case study on a mixed farm in Spain. In this regard, there are many different approaches to measure the profitability and the environmental efficiency, being the Stochastic Frontier Analysis (SFA) and the Data Envelopment Analysis (DEA) two of the most practiced, as Lansink and Wall [22] shown. The DEA is a data-driven approach to evaluate the performance of different units, known as Decision Making Units (DMU) [23]. DMU represent how efficiently are the inputs converted into outputs. Equally, the inputs and outputs can be measured in different units, being used in many studies in the field of environmental and ecological efficiency [24,25], and also, which makes it an interesting approach for the current efficiency analysis.
Considering the previous mentioned advances in research, this work presents the analysis of profitability and environmental monitoring in a mixed dairy farm where an Edge-IoT platform has been implemented to monitor livestock and crops, as well as to manage farming resources (i.e., irrigation and data transfer). The platform has been presented by Alonso et al. [12] and its design follows the Global Edge Computing Architecture, specially designed for the implementation of Edge Computing (EC) solutions in Industry 4.0 scenarios [26]. To conduct the analysis, two main components have been developed. On the one hand, the track of the meteorological conditions is performed by placing different sensors connected to the Edge-IoT platform. On the other hand, the efficiency of the inputs' analysis is conducted through the DEA. Moreover, the efficiency measures provided by the DEA permit to rank the different DMU [27].
The rest of this paper is organized as follows. Section 2 presents a review of the state-of-the-art of economic and environmental effects of technology in the agricultural industry. Section 3 describes how IoT and EC can help to increase the efficiency and profitability in Smart Farming scenarios. After that, Section 4 analyzes the profitability and environmental performance of an Edge-IoT platform in a Smart Farming scenario. Section 5 covers the experimentation and initial results. Lastly, Section 6 presents the conclusions and future work.

Economic and Environmental Effects of Information Technology in the Agricultural Industry
There is strong evidence that new technologies and incentives for sustainable production have had an economic impact in the agricultural industry, which affect production efficiency [28]. In recent years, companies are focusing on using suppliers that meet sustainability requirements and not only considering the product efficiency itself [29]. Another approach centers in quantifying the environmental factors with computer science and, more precisely, machine learning applications when companies select a supplier [30]. Therefore, being a sustainable farm has become an added value, not only in terms of expenditure reduction, but also for being suitable for new partners. Different methodologies are being developed to identify methods of assessing sustainable value chains [31]. The last European Horizon project launched by CAP is to set into legislation the political ambition of being the world's first climate-neutral continent by 2050 [32]. To achieve this goal, there is a planned road-map, and from this year the European Commission will launch the European Climate Pact, following its Green Deal strategy, which will be a lever to give citizens a voice and a role in designing new actions for Europe's environmental goals. Therefore, those incentives are at political and policy levels, even though companies are also moving towards environment management policies. To face those realities, the different processes within the agriculture industry have become something much more precise. Authors such as Pedersen et al. [33] review the different applications and benefits of the new Precision Agriculture (PA) concept. In this regard, the addition of Decision Support Systems (DSS) to PA represents the combination of data for optimal decision making [34]. Nonetheless, those PA measurements have been addressed not only to the production process itself but also to the yield being produced [35].

Optimal Production and Profitability in Terms of Technology Application
According to different econometric metrics, the measurement of the Optimal Production can be translated into a production function as Equation (1), where K is the capital such as machinery (including IoT devices), L is the land and while W represents the labor. With the years and the technological advances, this K contains more and more variables, which will be disaggregated later in this Section. Where Q is the dependent output variable as shown in Equation (1). Among years, the growth on the returns to scale (which is the function that describes what happens to long-term returns as the scale of production increases) [36] was a piece of evidence on how the farms in the agricultural sector were performed, with little changes in industry or machinery [37]. Now, agriculture is also benefitting from IoT solutions and machine learning, which can be considered as a hybrid between industry improvements and globalization possibilities.
Another approach that can be considered to understand the productivity and efficiency in production in the 21st century due to the proliferation of the new technologies is the Total Factor Productivity (TFP). TFP is the part of the production that is not explained by the number of inputs used in production. It measures the residual growth in the total output of a firm, industry or national economy that cannot be explained by the accumulation of traditional inputs, such as labor and capital. As such, its level is determined by the efficiency and intensity with which inputs are used in production. TFP growth is usually measured by Solow's residual as in Equation (2), but the productivity variable is usually attached to the labor variable in the Solow-Swan model presented by Solow [38], Swan [39], Van Beveren [40].
where t denotes time, α ∈ [0, 1] is the elasticity of output with respect to capital, and Q(t) represents total production. A refers to labor-augmenting technology or knowledge, thus A · W represents effective labor. All factors of production are fully employed, and initial values A(0), K(0), and W(0) are given. The number of workers, i.e., labor, as well as the level of technology grow exogenously at rates n and g, respectively: Moreover, in the case of our study, the demand is inelastic and therefore the Cobb-Douglas [41] function has been an interesting approach. Inelastic demand is considered because even the end of the milk quotas in 2015 mentioned in the introduction, the year after, in 2016, the European Commission launched a policy instrument for the dairy sector to reduce the quantity of milk available on the market [42]. The Cobb-Douglas function can be estimated as a linear relationship using the Equation (5), where the I respresents the Inputs and the Q is the production and the a are the model coefficients: Once production optimizations are reached, financial profitability can be used to measure the company's ability to keep producing benefit. The financial profitability of a company or a farm can be calculated with the Returns on Assets (ROA), which is described in Equation (6), and where the Total Assets represent all the assets that the farm uses to produce the products.

ROA =
Net Income Average Total Assets (6) While production levels and effectiveness at production frontiers incorporate variables that are more aligned to the environment and the macroeconomic situation, when it comes to measuring profitability, any economic instability is a determining factor in the equation, as shown in studies such as Machek and Špička [43]. Another approach that could be used to forecast the Optimal Production levels are Long Short-Term Memories (LSTM), a type of artificial recurrent neural networks (RNN). This solution has been proposed in studies such as Cao et al. [44], with successful results. A summary of the different economic metrics and contributions considered regarding the production limitations is shown in Figure 2.

Environmental Performance
In the mid-nineties, authors such as Schmidheiny and Timberlake [45] started examining the terms and concepts of the eco-efficiency. The eco-efficiency is the ability to produce more goods and services with less environmental impact and less consumption of natural resources [46]. The eco-efficiency ratio is normally measured as the ratio of the added value of what has been produced (e.g., GDP) and the added environmental impacts of the product or service produced (typically using the CO 2 emissions). In the context of eco-efficiency, the OECD [47] sets different metrics to evaluate the environmental progress at different levels. Those environmental indicators conformed types of policies and indicators which can be conceptualized as a ratio, expressed as an indicator of economic value divided by an indicator of environmental impact. To evaluate those measures, IoT sensors are a key instrument to monitor the different environmental conditions and evolution. In the last 20 years, and aligned with the concept of eco-efficiency, different authors such as Tiwari et al. [48] developed a system using multi-criteria decision-making techniques to achieve economic-environmental efficiency including sustainability and economic environmental criteria. Likewise, Simar and Wilson [15] demonstrated that environmental efficiency was negatively related to farm size, age of farmers and crop subsidies, and positively to crop rotation. They also introduced the variability of meteorological conditions (levels of temperature and precipitation) to capture the effect of production uncertainty on environmental efficiency, founding that it has a significant impact. Lansink and Wall [22] presented an overview regarding the evaluation of frontier models and their environmental efficiency. Currently, there are different ways to consider environment measurement, such as non-parametric DEA and SFA, which are models that have been widely used for measuring economic and environmental efficiency [49]. Particularly DEA has become increasingly popular in the analysis of productive efficiency, as demonstrated by Reinhard et al. [50], which is the basis for the model proposed by Simar and Wilson [15].
The following Section depicts some of the principal approaches where IoT and EC technologies have been applied in the field of Precision Agriculture and Smart Farming. One of these solutions is the Edge-IoT platform that has been used in the mixed dairy farm scenario of the case study analyzed in this work.

Industrial Internet of Things and Edge Computing Technologies in Smart Farming Scenarios
IoT provides multiple solutions to each of its application areas. Some of the most important functionalities are: multiple-communication-protocol management, data processing, real-time information and response, big data storage, security and data privacy [17]. However, the application of these features brings with it a series of challenges that must be addressed: data source heterogeneity, security, privacy, latency, real-time response, use of shared computing resources, etc. [51]. Although the application of IoT data ingestion layers makes it possible to tackle the problem of heterogeneity, other issues need to be solved. One of them is the large amount of data that hundreds, thousands or even millions of devices can transfer to an IoT platform. In this sense, to reduce the data traffic between the IoT layer and the cloud, solutions such as the Edge Computing paradigm arise. The Edge Computing paradigm allows the reduction of congestion due to the demand of computing, network or cloud storage resources [18]. With this strategy, the computing and service infrastructures are closer to the data sources, and also to the end-users, by migrating the filtering, processing or storage of data from the cloud to the edge of the network [52].
Moreover, there is a wide variety of scenarios in which solutions based on IoT and Edge Computing are applied. Among the most relevant applications there are Industry 4.0 [26], smart energy [53] or, in the case of this work, smart farming [12], among many others. Besides, although there are scenarios in which Edge Computing is applied to a single environment as an ad-hoc system, there are also advancements aimed at providing edge functionalities as a platform (Edge as a Platform). In this way, the reproducibility of the solution increases. On the other hand, there are reference architectures whose guidelines can be followed to design and implement systems and platforms based on Edge Computing [26].
Precision agriculture considers only the variability of crop data. However, Smart Farming provides a more comprehensive analysis, predictions and recommendations, as well as task automation, taking into account historical and real-time information about crops, machinery, livestock or humans [54]. There are specific use cases where IoT and Edge Computing are applied to intelligent agriculture, such as the work of Agrawal et al. [55], which measure the quantity and quality of the grain in the silos; Cambra et al. [56], which control the irrigation with bicarbonate for precision hydroponic agriculture; Chien and Chen [57], which use RFID sensors and egg detectors to process locally and in the cloud the behavior and welfare of hens; ElMasry et al. [58], which analyze multi-spectral images to control crop quality; Jia et al. [59], which apply neural networks, SVM (Support Vector Machines) and electronic smell techniques for the rapid detection and recognition of moldy apples; as well as the work of Potamitis et al. [60], which propose an insect surveillance system in open fields using vibroacoustic sensors.
Nevertheless, Edge-IoT-based solutions usually consist of integral platforms. In this sense, Khan et al. [61] presented a multi-layer architecture formed by a perception layer or Perception Layer (i.e., data ingestion), a network layer or Network Layer, a middleware layer (i.e., service management), an application layer and a business layer (i.e., systemwide management). One of its main shortcomings is that it does not take into account aspects such as security. Therefore, it may not be the best option for data management and applications for value chain traceability. Jones et al. [62] proposed a framework aimed at building intelligent agricultural systems. However, in their work they do not present an implementation in a specific case study. On the other hand, Ryu et al. [63] proposed a complete solution for the implementation of a connected farm, using an IoT Service Server to create virtual IoT devices and a middleware management module installed on the physical devices. Kamilaris et al. [64] proposed a multilevel framework composed of a low level (i.e., IoT and communication devices), an intermediate level (i.e., data management and analysis) and a higher level (i.e., the application), which were tested in two scenarios (livestock and crops). Other authors such as Popović et al. [65] also proposed multilayer platforms, while Suma et al. [66] introduced a basic IoT-Edge architecture to facilitate access to intelligent agriculture in developing countries. Finally, Park et al. [67] proposed a scalable framework for data analysis in which the edge nodes pre-process and analyze the private data collected before sending the results to a remote server, to estimate and predict the total crop yield.
Likewise, there are different reference architectures within the scope of Edge Computing applied in industrial environments or Industry 4.0. One of them is the Global Edge Computing Architecture (GECA) presented by Sittón-Candanedo et al. [26], an Edge-IoT platform on which this work is based. GECA introduces Edge Computing functionalities that reduce the use of computational, storage and network resources in the Cloud. Moreover, it includes blockchain technologies that provide security and warrant the integrity and traceability of data. This architecture, in turn, was the result of analyzing four of the most important reference architectures in the field of Edge-IoT in Industry 4.0: FAR-Edge [68], INTEL-SAP [69], Edge Computing Consortium architecture [70], and the Industrial Internet Reference Architecture (IIRA) [71]. GECA is structured in three layers: the IoT layer (IoT layer), the Edge layer and the Business Solution layer.
The mentioned architecture was utilized to implement the SmartDairyTracer platform (see Figure 3) trained at the traceability of agro-industry processes. The first stage of the SmartDairyTracer platform was deployed and tested in a real scenario by Alonso et al. [12], which validated the benefits of the Edge Computing, reducing the data traffic by 46.72%, which can be translated into a potential reduction of costs. The experimentation presented in Alonso et al. [12] shown that it was possible to decrease the costs associated with data transfer between the IoT layer and the remote cloud by introducing design rules from a reference architecture, such as GECA, into an agro-industrial platform designed for the monitoring, traceability and optimization of resources and processes performed in the value chain in a mixed dairy scenario. In addition, the introduction of the Edge nodes improved the reliability of communications with the cloud by reducing the number of values missing from the database. In the next Section, the profitability and environmental performance of the SmartDairyTracer are analyzed for the same mixed dairy farm scenario.

Profitability and Environmental Performance of an Edge-IoT Platform in a Smart Farming Scenario
This research aims to implement and deploy a real scenario for making farms more profitable and sustainable through the application of IoT and Edge Computing. The proposed solution takes into account some of the most important variables from the Environmental Performance Index [72] and how to reduce its consumption with and Edge-IoT platform. The methods proposed to achieve and evaluate this goal are presented in Figure 4. Some of those methods will be applied in Section 5. Three direct effects are considered in the research with the proposed methodology. Different sensors have been placed in the farm, and other variables have been used as inputs to track the information (Table 1). Table 1. Attributes on which the analysis of monitoring and efficiency will be performed.

Description Economic Variation Environment Implication
Reduction in data traffic to the cloud Water consumption prediction and expenditure reduction

Sensor Monitoring
The system proposed incorporate different sensors to track multiple variables in a given period. The variables considered for measuring the Environmental Performance Index (EPI) and, more precisely, the ones regarding the ecosystem vitality are those described in Table 2, were it had been marked the ones that this study affects: Table 2. Variables from the Environmental Performance Index-Ecosystem Vitality.

Description Impact
Water resources Agriculture Forests Fisheries Biodiversity Climate and Energy Therefore, to track the three variables mentioned in Table 2, Table 3 presents the variables that have been analyzed. Being able to trace this information, and considering that it is a mixed-farm, two main benefits are expected. On the one hand, the traceability allows saving water costs coming from both the irrigation's and cattle's water consumption. On the other hand, for the mixed-farms, the sensor monitoring enables to react when temperatures are inadequate and may affect the health or welfare of cows, involving a decrease in their milk production.

Reduction in Data Volume Transmitted from the IoT and Edge Layers to the Cloud
GECA's Edge nodes filter and pre-process data from the devices in the IoT layer [26]. In addition, they are responsible for discarding values which have been repeated due to frame relaying from physical sub-layers (i.e., ZigBee, Wi-Fi) to the IoT layer. They can also perform averaging and analysis of regression data that takes place on the same Edge layer. In both cases, the amount of data and the cost of its transmission to the cloud is reduced, decreasing the costs of data traffic, as well as the need for computing and storage in the Cloud.
The experiments and results presented by Alonso et al. [12] demonstrate that applying the GECA reference architecture when building the platform for agribusiness, and providing the Edge layer to it, allows reducing the total amount of data transferred to the cloud in a mixed dairy farm scenario with the same usage and sensor conditions by 46.72% (38.86% in the uplink and 64.10% in the downlink). This reduction can be even more significant in other scenarios where, due to their characteristics, take advantage of the use of the filtering and/or pre-processing stages in the GECA architecture.

Efficiency Measures including Sustainability
SFA and DEA have been compared as measurement tools for agricultural economics for many years [49]. For example, Theodoridis and Anwar [24] conducted an experiment in Bangladesh crop farms where the SFA results are supported by the DEA results. In this study, the DEA has been selected because is a non-parametric method for estimating production frontiers and evaluating the efficiency of a sample of production units, and also because in this case, the outputs are fixed. The DEA is a frontier method that tries to optimize the efficiency measure of each unit analyzed, Charnes et al. [73] defined, in their basic DEA model, the objective function Decision Making Units (DMU). While in our case the outputs O are crops production, multiplied by their respective weights and divided by the inputs I, that is, water consumption, the seeds and the data storage costs and multiplied by their respective weights. The efficiency score is under the constrains k = 1, . . . , K, no efficiency score exceeds 1 as in Equation (7) and where the output values have to be positive: To make predictions on the efficiency regarding resources availability, the tracking of the IoT has been analysed, comparing both the initial costs and the costs after the IoT implementation. The variation per year is expressed in number of sales, and not in monetary terms due to the previously mentioned quotas and prices issues.

Experimentation and Initial Results
The purpose of this research is to enable the monitoring of the meteorological conditions through wireless agro-meteo weather stations to avoid uncertain situations and to measure the farm's efficiency. The experiments conducted are divided into two parts. The first one is related to the monitoring of the meteorological conditions, performed through the IoT and Edge Computing platform. The second one concerns the measurement of the efficiency through the DEA. To accomplish the first part, three different quantities (rain, temperature and air humidity) have been considered among those gathered by the set of wireless agro-meteo weather stations installed in the farm [12]. The data collected from these stations is transferred to the cloud, taking into account daily average measures. Figure 5 presents an overview of the values tracked in the conducted experiment. The data transferred to the Cloud has been measured both in the previous version of the system (i.e., not using the Edge Computing platform) and the new version of the monitoring system (i.e., based on the GECA Edge-IoT platform) to compare the effect in the efficiency; considering the variations of costs as inputs for the production. Alonso et al. [12] demonstrated a reduction in data transfer costs when applying Edge Computing to filter and pre-process data using the new GECA-based platform. Other authors such as Chen et al. [74] and Guillén et al. [75], also demonstrated a reduction in data transfer to the cloud in Precision Agriculture.
To analyse the efficiency we consider the variable inputs (those that have a variation within the production process) and the technology applied in a mixed-farm: Data transfer between the IoT and Cloud layers (KiB) (The Data transfer between the IoT and Cloud layers has been presented in KiB, according to the International System Units [76]).
The efficiency is calculated by analysing the DEA. To carry out the DEA analysis, Table 4 presents the input and output data considered for the experiment. The descriptive statistics on production inputs and outputs are displayed per month (N = 12) in Table 5.
Once the descriptive statistics are examined, the analysis of the DEA is presented in Table 6. To conduct the experiment, an estimation has been made for those months in which the Edge was not available so that the two scenarios proposed can be compared. Therefore, from November until May, an estimation without Edge has been included; and from June until September, an estimation with Edge has been added. As presented in Table 6, the most efficient DMU are April and August. Being more precise, when considering the technological inputs, such as the data transferred to the Cloud, only August is the most efficient DMU. The calculation of the DMUs serves, above all, to identify if the DMUs are efficient or not, even though a variation in the decimal values is important, the great difference of the model, and where is possible to see if it is being efficient or not, which is when it is closer to 1.

Conclusions
Almost 20 years ago, in 2002, Nuthall [77] conducted an experiment to understand how technology was affecting the farms' profitability and performance; and, in that case, having access to a computer already meant an increase in their benefit. Several years later, Piedra-Muñoz et al. [78] took different experiments and reviewed years of improvements in the application of technology and its compatibility with sustainability. This study provides the results of tracking different variables from the Environmental Performance Index with real-time sensors and the application of an Edge-Computing platform that reduces the data traffic to the Cloud. This reduction affects farms' efficiency. Considering that technology is already a reality in the agricultural sector and that in the following years the data transferred to the Cloud is an input that will be used because it affects the output's efficiency. This study shows that the application of vanguard techniques, such as IoT and Edge-Computing, in the long-term it can represent a competitive advantage when measuring the efficiency of the Decision Making Units. This study incorporates the data traffic to the Cloud as an input, reflecting the importance of technology when analysing the DEA production. The results are presented after analysing the DEA, showing the most efficient values in terms of efficiency of the DMU when there are variations in the data traffic to the Cloud, being a representative asset. The agri-tech paradigm is leading to large scale scenarios (i.e., farms with millions of ha with a vast number of sensors) which translates into an increase of data traffic to the Cloud. In future research lines, the authors will carry out further experiments where the efficiency of the livestocks in mixed-farms will be measured. This will conducted in scenarios where the inputs will include all the information collected by the IoT sensors for real-time monitoring (i.e., in terms of sustainable milk production). Moreover, the authors would like to continue contributing on how to make farms more efficient and also to include Machine Learning to forecast the future levels of resources consumption. The authors will investigate the application of technologies that allow the monitoring of crops or livestock without requiring excellent connections to the network, as well as the efficiency analysis in the most inclusive way at a technological and resource level.