Ontologies and Artificial Intelligence Systems for the Cooperative Smart Farming Ecosystem

Cyber-Physical Systems (CPS) and Internet of Thing (IoT) generate large amounts of data spurring the rise of Artificial Intelligence (AI) based smart applications. Driven by rapid advancements in technologies that support smart devices, agriculture and farming sector is shifting towards IoT connected ecosystem to balance the increase in demand for food supply. As the number of smart farms reach critical mass, it is now possible to include AI assisted systems at a cooperative (co-op) farming level. Today, in the United States alone there are about 1,871 co-ops serving 1,890,057 member farmers. Hence, such advanced technologies and infrastructure when incorporated in the co-op farming ecosystem can immensely benefit small member farmers who operate and maintain these independent co-op entities. In this paper, we develop a connected cooperative ecosystem which defines sensors and their communication among different entities along with cloud supported co-op hub. We develop member farm and co-op ontologies to capture data and various interactions that happen between shared resources, member farms, and the co-op that are stored in the cloud. These can then help generate AI supported insights for farmers and the cooperative. Several co-op farming use case scenarios have been discussed to demonstrate the functioning of our smart cooperative ecosystem. Finally, the paper describes various AI applications that can be deployed at the co-op level to aid member farmers.


I. INTRODUCTION
Over the past few years, there has been a drop in agricultural growth per capita income [1]. This is a result of various environmental factors such as soil degradation, excessive use of fertilizers, etc. along with social issues such as lack of technological investment in the agricultural sector. According to the United States Department of Agriculture (USDA), there would be a 20% decline in global food production and a 10% projected increase in world population by 2050 [2]. Therefore, the demand for food is expected to increase in the The associate editor coordinating the review of this manuscript and approving it for publication was Muhammad Afzal . range of 59% to 98% [3]. This shows a negative indication towards shortage and disruption of the food supply chain in the foreseeable future. Moreover, long term effects such as climate change, depletion of water levels, reduction in farm land, economic crisis, etc. impose a global threat to agriculture sectors.
In order to combat this crisis and to serve future generations, effective strategies are required to meet the growing demands [4] for food especially to ensure equitable food security. Hence, agriculture communities are showing keen interest in adopting modern approaches like precision agriculture and smart farming by integrating farming with Internet of things (IoT) platform [5]. Incorporating connected sensors VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ together with cloud and edge enabled services in the agricultural domain will help augment agricultural productivity and efficiency. Data collected from various ground based sensors deployed on a farm and aerial drones provide details such as soil moisture, temperature, water content, etc. farmers can monitor field crops, maintain quality and mitigate risks. For example, NatureSweet Tomatoes, 1 Del Campo 2 stated that they have observed reduction in water consumption of about 30%. Similar approaches have also limited the overuse of fertilizers that in turn reduced the effect on the crop yield [6]. In Brazil, control of herbicide-resistant weed [7] was achieved by identifying and spraying on the target weed in real time using precision agriculture tools like Weedit 3 and WeedSeeker. 4 Simultaneously, aerial images provided by an agricultural drone helped farmers identify anomalies in irrigation, plant health indices, etc. For example, farmers can address high priority issues like reduced water content in the soil early enough to make an adjustment based on aerial images. As an added advantage, fertilizers can be sprayed 40 to 60 times faster across the farm using drones. 5 Data collected from various sensors have a positive impact on optimizing agricultural productivity. Consequently, connecting on farm devices to the Internet and automating the data collection helps farmer make smarter decisions. Also, reports [8], [9] show that connected farms are expected to generate as many as 4.1 million data points each day by 2050. Such smart farm ecosystems not only deal with on-field data but also have access to a wider ecosystem that includes all the farming operations and the entire food supply chain. The projected exponential growth of global smart farm market is about 38.1 billion by the end of 2024 [10] due to the growing use of cloud analytical tools by the farmers.
As more CPS and data assisted technologies have been adopted by various individual farms, their capital investment and maintenance costs have increased. Though most farmers have keen interest towards technological advancements in the agriculture sector, it is still a drawback for small farmers as it exceeds their investment and technical skills. Therefore, procurement and deployment of sensors and AI based solutions from farming cooperatives can add value to small member farmers who are a part of co-op organizations [11]. Current co-op organizations and ecosystem lack such connected technologies that have potential to help member farms and offer them same services which are usually used by larger farmers with more resources and capital. For example, an individual member farmer can monitor sowing of seeds for an overall better crop harvest by borrowing the smart precision seeding equipment with IoT-enabled sensors from pooled co-op resources for a certain time period. It is expected that technological investment in these organizations will bolster individual member farmers in rural communities.
In terms of statistics and its broader societal impact, agriculture and farm-related industries are one of the key drivers that contribute to the economic growth of several countries around the globe. With almost 40% of the area covered in farmland, the state of Tennessee in the US has around 75000 farms, reflecting its economic importance for the state. Several farming cooperatives have been setup across the state which further aid the rural economy by offering supplies and resources to farming community. These co-ops enable small farmers in rural areas to pool their machinery, resources, etc. and have on average a thousand member farmers [12]. Currently more than 75% of Tennessee's rural residents are served by a cooperative [13]. These numbers are consistent with other agriculture intensive states and jurisdictions. In the United States, there are about 1,871 co-ops serving 1,890,057 member farmers [14]. Members of these co-ops utilize them for access to greater annual use of large machines, efficient labor use during peak fieldwork times, produce transportation, price negotiation, equipment repair and maintenance [15]. These co-ops generally have multitude of individual farmers who sign a co-op agreement detailing its mission and operational rules. These agreements describe, types of memberships, cost/machine/labor sharing rules, types of crops to be grown, record keeping, etc.
Currently, these co-ops use legacy databases and various enterprise resource planning (ERP) systems to schedule machine use and maintenance, hiring farm labor, specialized machine operators, coordinating market visits, price/purchase data etc.
[16], [17]. With the emergence of fast interconnected technologies, it is now possible to connect various individual smart farms with the cooperatives, using cloud and edgebased technologies that will provide immense benefits to the farming community.
Our work is based on creating this connected cooperative ecosystem that will provide more accurate and a data driven dimension to precision agriculture. Further, such technologies must be resilient against cyber threats and call for the development of tailored security solutions [18], [19]. Also, these cooperatives work on well-defined membership agreements signed by individual member farmers. The proposed ecosystem needs to ensure compliance by individual members for machine use, labor policies, and enforce rules regarding data sharing, ownership and member privacy. This includes the development and adoption of multi-layered cyber physical system technologies to connect individual smart farms to the cooperative cloud/headquarters. In order to be efficient, the ecosystem also needs to utilize technologies that are available and viable in rural communities. To achieve this goal, we present a co-op ontology for the proposed multi-layered internet connected ecosystem and express how complex situations are handled by the proposed ecosystem with the help of use case scenarios. We also explore various AI applications that can use the collected data to diagnose critical conditions of the farm such as crop diseases, soil conditions, etc., and also assist the individual farmers in tackling critical problems. In this paper, we present an overview of the co-op smart farming ecosystem shown in Figure 1 and various services that can be beneficial to member farmers.
The main contributions of this paper are: • We propose an architecture of smart farming cooperative ecosystem and describe different interactions between the components. The developed ecosystem will ensure seamless integration of computational and physical components which include on-farm sensors, autonomous tractors, drones, etc. (See Figure 2).
• We develop two ontologies to support AI applications in a co-op environment. The first ontology is named as member farm ontology that describes interactions that happen in the farm and the second is a co-op agriculture ontology created based on the co-op ecosystem that details interactions like how co-op resources are shared between individual member farms.
• We utilize the co-op agriculture ontology to describe various operations of the co-op with the help of use-cases in selected scenarios, like the entire process of leasing an equipment that includes sharing of required member farm data based on agreements about the borrowed equipment, actions involved in returning the borrowed equipment, etc.
• We discuss various AI applications that can be developed for the co-op ecosystem that benefits member farmers, broadly addressed in four categories such as (i) Marketing and Distribution, (ii) Resources and Equipment, (iii) Labor, (iv) Service and Supply.
The rest of the paper is organized as follows -Section II discusses related work on various aspects such as cooperative farming, cooperative agreements and compliance, precision agriculture technologies along with the use of AI and ontologies in smart farming. Section III explains the architecture of our system, its entities and their interactions and co-op agreements including compliance which controls the flow of information. Section IV details our individual member farm ontology and co-op agriculture ontology. Section V demonstrates the operation of co-op ecosystem with the help of use cases. Later, Section VI describes various real time AI applications that support co-op members. Finally, we conclude the paper in Section VII.

II. RELATED WORK
In order to better define the technical and fundamental needs of a co-op ecosystem we discuss some of the important related work relevant to cooperative farming, cooperative agreements and compliance, precision agriculture technologies along with the use of AI and ontologies in smart farming and other cyber physical systems. We also highlight some gaps and limitations in existing approaches by comparing them with the state of the art technologies and research.

A. COOPERATIVES AND CO-OP FARMING
Cooperatives are formal enterprise which are financed, controlled, and owned by members for mutual benefit [20]- [23]. These co-ops work on membership agreements illustrating operational rules together with conditions and use of shared resources. Such cooperatives operate in different sectors such as grocery suppliers, water supplies, credit unions, utilities, farm suppliers, transportation and childcare. In particular, the United States Department of Agriculture (USDA) acknowledges the importance of co-ops in especially in the rural communities [24] of the country. Cooperatives provide education and training for members, elected representatives, managers and employees so they can contribute effectively to the development of their cooperative. While focusing on member needs, cooperatives work for the sustainable development of communities through policies and programs accepted by the members.
According to California Center for Cooperative Development [25], agricultural co-ops provide various benefits to its members as they come together to market and process their farm products, purchase and borrow agriculture equipment, supplies and exchange workers. Cameron et al. [26] discussed the role of agriculture cooperatives in Canada and Cuba which led to the strengthening of local food system. Statistics show that for every sector in the United States economy they are 29,000 cooperatives [27]. Further, many farmers are a member of existing 3,000 agricultural co-ops generating employment for 191,000 people in the year 2014.
There are various types of agricultural cooperative societies such as producer cooperatives, consumer cooperatives, worker cooperatives and purchasing cooperatives where each of them offer different services and benefits to its members. An example of a successful agricultural cooperative is Florida's Natural Growers [28] where members of this co-op deal with the quality and production of citrus fruits. Their collaboration extends from the initial plantation stage and continues till the harvest season. Another example is the Sunkist Growers and Cabot Creamery Cooperative which works together with smaller co-ops like Our Family Farms [29] and Deep Root Organic Cooperative [30] to market and distribute their produce. In North Carolina, small individual farmers have come together and established a cooperative society to share agriculture equipment and resources by developing a sustainable agriculture tool lending library [31].
At present, cooperatives function by utilizing traditional database management system like relational databases, data warehouses for collecting, storing, and aggregating the data generated. Resource allocation and borrow schedules are decided with the help of Enterprise Resource Planning (ERP) systems. The latter has limited scope for handling large amounts of data, generating insights by analyzing collected data, etc. Due to these drawbacks, the cooperative ecosystem has not yet integrated AI-driven techniques. We address many of these limitation by discussing various technical foundations and exploring potential AI applications that can augment the ecosystem (see Section VI).

B. AI SOLUTIONS IN SMART FARMING
Smart Farming has revolutionized the agricultural domain which has also assisted in increasing the quantity and quality of food and raw products. Sundmaeker et al. [32] discussed the impact of smart farming on real-time monitoring, remote management, etc. Specific crop related information such as soil nutrient deficiencies, plant stress, soil moisture etc. content can be identified by the use of hyper-spectral data to prevent crop damage [33]. Kamilaris et al. [34] described an Agri-IoT framework where an online platform was setup to provide services like, identification of trending events on social media, farm council alerts, automatic reasoning over real-time data. This system helped farmers in decision making during critical weather conditions which are common and very critical in agriculture domains. In order to analyze and classify different types of weed on a farm, Lottes et al. [35] proposed a system that detects vegetation cover from aerial images provided by a agricultural drone. Sai et al. [36] have also investigated requirements of a single smart farm based on a three layered architecture with physical devices, corresponding digital twins (virtual counterparts) and a knowledge graph representing interactions among different entities in a single farm. This work further proposed a smart farm ontology incorporating different users, sensors, and systems in a farm. Utilizing this ontology, the authors specified smart farming access control policies based on the widely used Attribute Based Access Control (ABAC) models [37], [38], and on Semantic Web Rule Language (SWRL) [39] and the Playts ontology [40] for sensor context. Irrigation control based climatic conditions is another important aspect of smart farming. Project named SCRI-MINDS [41] has been developed to increase efficiency in plant production while controlling excessive use of irrigation water and nutrients.
Well established AI techniques when applied on the data collected from farm sensors can help in developing an efficient and data driven smart farming ecosystem. Ghosal et al. [42] proposed a deep machine vision framework which determined different levels of plants stress in soybean crop. They used explainable neural networks to describe the severity of plant stress based on visual images. An AI based sowing application was developed by Microsoft [43]. This system provides recommendations like, optimal period for sowing seeds, preparing land for cultivation, etc. Lee et al. [44] designed a tool which helped in determining pest risk in fruit trees. Equipment such as AutoTrac [45] uses AI techniques to plant crops in a uniform manner with the aim of reducing overlap and excessive gap between plants. BlueRiver Technology [46] has applied computer vision techniques to identify individual plants and find abnormalities. Sa et al. [47] detailed an approach for dense weed classification from the aerial images by using encoder-decoder cascaded Convolutional Neural Network (CNN). Another application of AI that has shown promising results [48] is the use of Support Vector Machines (SVM) for sorting and using fuzzy logic for grading agricultural produce automatically without human interference.
Several stakeholders are interested in innovation and utilization of AI in the agriculture sector. Microsoft's Farm-Beat project [49], [50] is an example, where they focus on increasing the farm productivity by connecting AI tools and sensors deployed in the farm based on a data-driven approach. Montano's subsidary corporation named The Climate Corporation [51] has started research projects in order to provide farmers with various digital solutions. They focus on disease diagnosis, fertility scripting, seed scripting and their selection. Also, Precision King has partnered with AT&T to help farmers monitor their farms and assist them with insights in order to achieve irrigation efficiency [52].

C. ONTOLOGY BASED SYSTEM FOR CPS
Ontology based systems have been used to model various CPS ecosystems including smart homes [53], smart farms [36], power grids [54], etc. Ontologies have been used for knowledge representation in diverese technologies including security, AI, and rule based systems. A report written by Obrst et al. [55] has detailed the process of developing an ontology in the security domain. There are several ontologies that have been developed in this domain over last few years. For example, an ontology named CRATELO was designed by Oltramari et al. [56]. The proposed framework combined different domain ontologies and structure them as three layers to identify security threats in the network domain. Another ontology that deals with security of mobile applications was developed by Beji et al. [57]. Additionally, this framework provides countermeasures to the user based on the availability of resources. Petrenko et al. [58] developed an ontology to overcome negative impacts and restore the functioning of a smart grid when faced with security vulnerabilities. In order to maintain web application security, Razzaq et al. [59] described how their ontology could detect and control cyber attacks. Finin et al. [60] exploited the flexibility of decision making in access control models by creating and utilizing an ontology. Ontologies and knowledge graphs have also been used in creating and analyzing digital twin models [61]. These models are cyber clones of physical assets usable for in-depth analysis. Banerjee et al. [62] introduced a simple way of formalizing digital twin models for sensors in industrial production lines.
Several ontologies are widely being created and adopted for different domains such as healthcare [63], finance [64], cybersecurity [65]- [67], manufacturing [68], etc. to address variety of situations. For example, Gene Ontology (GO) [69] helps speed up analysis on gene sets due to its structured organization, where gene products and their functionalities are well defined. Information about various diseases and medical vocabularies are represented in Disease Ontology [70] that has been used by the biomedical community for classification, healthcare reporting, etc. Legal Ontology [71]- [73] helps in semantic indexing and search, keeping track of recent changes in laws, etc. The cyber insurance ontology [74] represents various insurance policies which would provide the insurance seekers with necessary details such as policy coverage, coverage limits, expected rate, etc.
In this paper, we create a member farm ontology to represent various interactions that happen between the sensors deployed in the farm. Later, we develop a cooperative agriculture ontology that represents co-op owned sensors as entities and describe the relationships between them.

D. COOPERATIVE AGREEMENTS
Setting up a legal entity and agreements in the initial stages of creating a co-op is imperative for a cooperative to be successful, since improper use of cooperative services and shared resources by its members may not solve its goal and eventually leads to dissolution. Having a legally binding document also provides stability, liability and greater access to financial resources [75]. A cooperative agreement is a legal document that has several important parts such as dividing profits, ownership, usage conditions, and management etc. For example, misuse of data captured from the farms may lead to unparalleled insights to a competitive market. Management entity provides information and guidelines regarding federal, state and local regulations to support crop production and sale. Therefore, ownership entity deals about providing access to real time information. Andrews et al. [76] discussed positive effects of incorporating cooperative agreement by surveying existing cooperatives across Europe. The cooperatives laid emphasis on economic efficiency and environment effectiveness to avoid water conflicts in the agriculture sector. Many researchers have previously worked on creating various AI systems for legal text [72]- [74], [77], [78]. These enable consumers to efficiently manage, monitor, and validate legal contracts, such as Service Level Agreements (SLAs) and privacy policies, that are available as text documents. They propose a cognitive assistant that can be used to manage legal documents by automatically extracting knowledge including terms, rules, constraints and reasoning over them to validate a service. The researchers have also created a Question and Answering (Q&A) system that can be used to analyze and obtain information from these documents. Similar systems are also needed for managing AI assisted secure co-op ecosystems to enable automated enforcement of compliance of agreements and policies. In the following section, we describe a proposed smart cooperative ecosystem detailing it's multi-layered architecture, interactions that are further used to create two ecosystem ontologies (Section IV). We also later discuss various AI applications that can be built for this ecosystem (Section VI).

III. COOPERATIVE ECOSYSTEM
A connected cooperative ecosystem entails technologies and underlying architecture integrating edge and cloud services, offering capabilities to analyze data collected from deployed smart sensors on the member farms. These capabilities also enable data driven AI applications which can be harnessed to increase crop yield, ensure efficient use of resources at the same time lowering the cost of operations. In addition we will also discuss ecosystem elements, co-op agreements and compliance needs together with different interactions among smart farming components to define the data and information flow in the ecosystem.

A. ARCHITECTURE
The architecture of cooperative farming ecosystem consists of physical layers, edge layer, and cloud services layer together with networking technologies knitted across all the layers to support communication. The physical layer will hold the real sensors and actuators deployed at the farm collecting information including weather condition, soil moisture levels, humidity, electrical conductivity, lighting, pH meter, etc. These devices are responsible for data sensing and based on the information gathered, help in actuating other devices to realise various smart farming use cases. Examples of these sensors include B&C Electronics SZ 1093 (pH), E+E Elektronik EE160 (Temperature/Humidity) etc. These sensors interact using underlying communication technologies including on-farm WiFi and cellular networks or high speed 5G.
The edge layer is deployed to connect devices in the farm at the same time offer local and real time gateway connectivity and computations. These devices eliminate need for data transfer to central cloud and limits the network bandwidth. Edge computing layer can have several edge nodes which offer services such as: data capturing, security monitoring and detection, prediction and real-time decision support. These edge computing plane may include NFV-powered control modules and use IoT communication protocols such as Message Queue Telemetry Transport (MQTT 6 ) or Constrained Application Protocol (CoAP 7 ). In case of MQTT, the MQTT agent acts as broker to support publish/subscribe scheme to enable communication among physical devices using topics. The use of context broker enables edge computing tasks without need to contact cloud layer. AWS Greengrass 8 is widely used edge service which can be used as a gateway for each member farm, to allow local communication but also enable cross member farm interaction and with a central co-op cloud hub.
The cloud computing layer maintains state of the sensors along with data records of the crops which includes filtered or processed values sent via the edge layer. In general, Platform as a Service (PaaS) architecture model is followed at the cloud layer which supports running applications and data services to support AI driven support to the farmers. This layer can also enable virtualized representation of physical components in the farm together with Big data services to provide analytics and processing. Thee services are enabled using distributed file system that ensure resilience and safety of data. AWS, Google Cloud, and Microsoft Azure are some of the widely used PaaS platforms which can be used by the cooperative hub to support secure data and information sharing among registered members. Several farm equipment manufacturers like, John Deere, 9 Farmers Business Network, 10 etc. have created cloud based products that help users monitor various sensors and vehicles used on a farm.

B. ECOSYSTEM ELEMENTS
In order to better define the ecosystem, we elaborate on various elements both at the member farm level and at the co-op level. These elements belong to either the physical, edge, or cloud computing layers defined above. Various inter-actions between these elements have been discussed in subsequent sections. Figure 2, illustrates various elements present in the co-op ecosystem.

1) MEMBER FARM ELEMENTS
These include various physical layer sensors and actuators deployed on the member farm. We have abstracted different type of member farm elements on the basis of functionality and mobility, into the following representations - The FBU represents various physical entities on an individual farm that consists of immovable sensors like humidity sensor, temperature sensor, automated sprinklers, etc. The data captured from these sensors are stored in member farm unit of the co-op cloud.
• On-Board Units (OBU): The OBU represents movable equipment like agricultural drones, harvesters, reapers, etc. which are also owned by the member farm. These OBUs while under operation interact with FBUs, WBUs and other OBUs. Interactions that happen between these sensors are also stored in member farm unit of the co-op cloud.
• Worker Based Units (WBU): Workers employed in the member farm are represented as WBU. They interact with FBUs and operate the OBUs to perform multiple tasks assigned by the individual member farm owners. The member farm unit of the co-op cloud records all the interactions that happen with the WBU.
• Home Based Unit (HBU): The HBU represents a hub that is setup by the owner of the member farm to interconnect all the deployed sensors in the farm. The HBU allows the owner to monitor actions of the sensors present in the farm and also grants access permissions to WBU on resources deployed in the member farm. The HBU is connected to the cloud service of the co-op.

2) CO-OP ELEMENTS
The co-op owns various resources like physical sensors and leases them to member farms or employ workers that work on various member farms. Co-op infrastructure includes physical entity, digital twin and co-op cloud for capturing, monitoring, analyzing and visualizing all the operations that happen between physical entities. We describe below the representations of the co-op owned elements and their functionality.

3) DIGITAL TWIN
The physical sensors deployed in the member farm are virtually represented as digital twins. They can be considered to be virtual replicas of physical elements of the ecosystem [79], [80]. They are utilized to visualize and analyze the data for improving efficiency of the co-op ecosystem.
With the data collected from deployed sensors, they help monitor all the interactions on the co-op farm ecosystem. Moreover, digital twins play an important role in maintaining the privacy of the individual member farm owners while sharing the collected data of the borrowed resources to the CBU. For example, MemberFarm_1 employs a worker (CWBU_1) from CBU. The digital twin will let CBU access only certain content of data that was collected by the CWBU_1 based on co-op agreement. Furthermore, digital twins have been used to provide insights about quality of crop, fertilizer usage, etc. by utilizing AI applications that analyzes the data captured in order to improve operational efficiency of the co-op ecosystem (See Section VI).

4) REPRESENTATION GRAPH
The knowledge graph represents the top layer in the co-op smart farming architecture. This structure represents the interactions among various cyber physical entities in the system spanning across multiple farm which are part of a VOLUME 8, 2020 cooperative. The nodes are physical devices and infrastructures in the system which are connected for information exchange and communication as shown by the edges in the graph. This interaction among the nodes is collected in the representation graph and stored in central cloud repositories, which in cooperative ecosystem will be the cloud services use by the cooperative hub. For example, the cloud will have the interactions among CBU-HBU, OBU-OBU, CWBU-OBU etc. A mobile OBU can interact with the farm owner's HBU or an OBU can share usage data with its worker's WBU. These physical-physical or physical-cyber-cyber-physical communications have short lifespans and are represented as data edges in the graph. Every time a new farm device encounters other devices either static or mobile, they exchange messages and store them in the representation graph. This content is accessible only to member farms or cooperative administrators for monitoring, compliance, and visualization purposes. The representation graph is optimized in the cooperative cloud to remove redundant interactions and store relevant data in addition to detecting anomalous events in the ecosystem. As an example, in case the devices are shared/borrowed among cooperative members, the access and interaction among the devices must only be limited among devices co-located at the farm. In case a borrowed autonomous tractor interacts with the farm sensors even after it is not used at the farm, such anomalous events must automatically be stored in the graph with timestamp. This will enable farmer and cooperative administrator to enable authorized interactions and block not allowed communications. Various modern access control schemes and encryption techniques can be used to secure and monitor access to the representation graph.

C. CO-OP AGREEMENTS & COMPLIANCE
At the core of an agriculture cooperative we have various agreements that lay down its foundations. These agreements explicitly state a co-op's bylaws, operating agreements, partnership and/or membership details, governance strategies, decision-making processes, shared equipment ownership, financial agreements specifically profit and loss allocation [81]. A sample co-op agreement can be found at [82]. A typical co-op agreement contains about 16 to 20 pages of legal text. Each piece is critical to the smart farming co-op ecosystem. Any AI assisted, secure CPS system built for this ecosystem needs to codify and include the complexities and details of these cooperative agreements. Including these agreements will enable the ecosystem to understand data sharing, compliance and privacy aspects of a co-op. It will enable individual member smart farms to exchange pre-negotiated data with the co-op and enforce multiparty compliance, ensuring privacy. The co-op on the other hand will also verify negotiated machine use and check if members are complying with the co-op agreement. Currently this is done through manual inspection and by using other adhoc technologies. Any AI services part of the ecosystem, needs to function in accordance with these agreements. We discussed some of these AI agents in section VI. Our ontology described in the next subsection can also be extended to incorporate these agreements and compliance rules. Next we also discuss some important issues focusing on compliance and various AI systems, in purview of a co-op ecosystem:

1) DATA SECURITY & PRIVACY
Securing the system that stores large volumes of data generated by the sensors deployed in members farms, is one of the most significant implications faced by the cooperative ecosystem. Sharing or misusing data with an unauthorized entity or another member farm owner without permission will result in various legal challenges. As data from various farms is being used by the co-op to provide insights, maintaining privacy is an important concern. Especially, considering the potential legal challenges that can arise if a user's privacy is breached. Proper anonymization techniques need to be utilized and explicitly mentioned in the co-op agreement. Specific research and technologies are already in place [83], [84]. European Union's General Data Protection Regulation (GDPR) includes multiple technical recommendations that can be leveraged to keep co-op and individual farm data secure and private [85].

2) DATA OWNERSHIP & PROVENANCE
Protecting the agriculture data from theft or infringement from unauthorized commercial use is important to avoid misuse and remain compliant with co-op agreements. Specific technologies need to be built to track ownership of the data collected. Some modern day systems have utilized blockchain [86]- [88] technologies and knowledge graphs to track ownership and data provenance. Here, co-op agreement clauses are converted to chaincode policies and smart contracts that can be executed on the blockchain.

3) COMPLIANCE WITH FEDERAL REGULATIONS
Agriculture is one of the most well regulated industries all over the globe. Various countries across the globe have many laws, regulations, and supervisory authorities [89]-[91]. These touch upon specific compliance requirements for producing and selling of agricultural products. One such set of regulations are the United State's Code of Federal Regulations (CFRs) -title 7 and title 9 that deal with federal agriculture rules and regulations. 11 The smart co-op ecosystem will need to ensure these regulations are followed and implemented in various AI systems that are created and utilized. Not doing so may invite legal and compliance issues. Some of these systems have been discussed in Section VI.

D. INTERACTIONS
When it comes to interaction among different entities, the co-op ecosystem can be broken into two abstract parts: (i) an individual member farm; and (ii) the co-op hub, including the shared resources and workers. To model various interactions in this ecosystem we next discuss interactions in both of these parts in detail. Using these interactions we also create the ontology discussed in Section IV.

1) INTERACTIONS ON AN INDIVIDUAL MEMBER FARM
In our previous work [36], we have discussed in detail several types of interactions among various entities present on an individual smart farm. OBUs are movable equipment like, autonomous tractors, drones, etc. that can interact with the other physical OBUs when present in the same geographical region. The OBUs store the interactions that happened between the physical OBUs or FBUs in the representation graph.

c: OBU-FBU
When OBUs want to perform actions such as crop harvestation, sowing seeds, dispersing fertilizer, etc. they interact with various FBUs to gather data. The representation graph contains all the interactions that occurred between the FBUs which can be accessed by the OBUs.

d: FBU-WBU
FBUs present in farm are usually operated by WBUs to perform specific actions. A WBU can interact with FBUs only when granted security permission. A WBU requesting an operation on FBU is stored as an interaction in the representation graph to increase reliability of the system. FBUs status is sent to the WBU whenever there is any interaction to keep the workers updated.

e: OBU-WBU
Workers operate the OBUs in order to perform various functions in the farm as needed. The exchange of information between the OBUs and WBU can be accessed by the owner of the farm. WBUs can acquire only the present information related to the OBUs from the time they are given access.

f: FBU-HBU
The WBUs present in the farm can interact with the FBUs only when permission is granted by the HBU. The HBU has permanent access to the all the FBUs in the farm. HBU stores the representation graph and all the information exchanged with the FBUs. This helps the HBU to access the historical information of the FBUs to help them analyze and take decisions based on the different scenarios.

g: OBU-HBU
When HBU receives the OBU-OBU interaction it stores it in the representation graph to keep a track of the OBUs operating on the farm. It also keeps track of the OBU data, this includes, current status, performance tracking, task updates, etc.

h: WBU-HBU
HBU plays an important role in the network for building the smart farm ecosystem. The HBU can decide to give temporary or permanent access permissions for OBUs and FBUs, to WBUs. If the WBUs are given temporary permission, they can access only the data stored from the units for the time period specified, or based on their labor contract agreement. Figure 4, maps all interactions that exist between an individual member farm and the co-op. In these type of interactions the individual smart farm's HBU transmits data across the farm's boundary. A HBU plays a critical role in this scenario, as it transmits data collected from individual FBUs, OBUs to the co-op. These interactions are regulated and comply with the co-op agreements discussed previously.

a: CBU-HBU
The cooperative hub (CBU) is the centralized unit which has access to some of the the individual member farms data in accordance with the co-op agreement. When an individual HBU establishes a connection with the CBU it can participate in co-op benefits such as leasing of resources like, CFBUs, COBUs, CWBUs, get security alerts when an abnormal event happens, cost accounting, etc. (See Section VI). Certain interactions that happen between the CBU and leased resources are represented in the form of a representation graph and stored in the cloud for future decisions (See Figure 2).

b: CBU-HBU-CWBU
The cooperative hub (CBU) employs a group of workers (CWBU) that can work on the member farms, whenever members need to borrow workers. When a member farm (HBU) requests a worker for a particular time period from the CBU; the co-op hub will transfer CWBU permissions based on availability during specified time periods to the member farm. The representation graph will store various interactions that happen between the temporary worker (CWBU) and other units in the member farm. CWBU's access to member farm data from sensors such as FBU and OBU (these belong to the member farm), will be revoked once the employed time period for the CWBU expires for that member farm.

c: CBU-HBU-COBU
Some heavy movable machinery like tractors, threshing machines, etc. and expensive devices like agricultural drones (COBUs) can be leased by the cooperative hub (CBU) to reduce the burden on the individual member farms owners (HBU). The temporary ownership of the COBU is granted to the requested member farm HBU based on the scheduled time slot. During this time the temporary COBU can share only certain data with CBU and give status updates only after complying with the co-op agreement. The entire data collected from these interactions are stored in the cloud of that particular member farm (HBU). The cooperative hub (CBU) always resets the status of COBU whenever being allocated to a different member farm (HBU) to avoid information leakage.
For example, the interactions that happened in the previous member farm 1 are deleted from the COBU before being allocated to member farm 2.

d: CBU-HBU-CFBU
Various farm based units like, salinity mapper, grain analyzer, high-tech produce tracker, etc. can be quite expensive and are not used daily by the member farm owners. Therefore, the member farm owners (HBU) can request the CBU for these sensors (CFBUs). The CBU allocates the CFBUs based on their availability for a fixed shorter time period to the member farm owners (HBU). The HBU takes the temporary ownership of the CFBU, perform tasks for that time period and returns it to the CFBU before the expiry of the time interval. The representation graph of the HBU stores interactions that happen between the CFBU and the other units of the member farm during that interval and automatic reset is done by the CBU after the scheduled time interval to avoid data leakage. For example, a yield monitoring system (CFBU) is borrowed from the CBU by a member farm 1 owner (HBU) from 9 AM to 11 AM. The member farm owner 1 can use the CFBU only till 11 AM after which the access permission resets and cannot be operated until further instruction are received from the CBU.

e: FBU/OBU/WBU-CFBU/COBU/CWBU
Temporary devices such as CFBUs, COBUs and CWBUs can be borrowed by a member farm owner (HBU) from the CBU so as to perform certain farm operations. These devices when present in a farm interact with various permanent sensors like, FBUs, OBUs and WBUs that are already deployed in farm by the member farm owner (HBU). Any interaction or access to the permanent sensors is denied automatically, when the leasing period of the temporary sensors expires. For example, a temporary worker (CWBU) needs to gather information that could be obtained by analyzing the data collected from deployed FBUs, CFBUs regarding crop quality in order to plan a harvest.

IV. ECOSYSTEM ONTOLOGIES
Ontologies describe various domain specific concepts through classes and properties. These properties include relationships between various classes and their attributes. These classes generally have multiple sub-classes, and a few parent classes. Parent class relations are generally inherited by its children. Instances are individual elements that are a type of a class. These instances have different data properties and can be associated with other instances via object properties. For example, the instance 'orange' can be associated with the color or the fruit. The instance of orange can have various attributes and relations to other concepts. An entity 'orange' can have an attribute 'type' with a value 'color' or 'fruit'. These attributes are vital so as to differentiate between two completely different concepts Using the architecture and various interaction discussed above in Section III-A & III-D, we have created two descriptive ontologies. The first one focuses on an individual member farm and can serve as the base ontology for multiple usecases. We call this our 'member farm ontology'. The second ontology describes various interactions and domain specific knowledge about the farming co-op ecosystem. We name this ontology 'cooperatives agriculture ontology'. Next we describe both of these ontologies in detail. Section V, showcase various scenarios and how these ontologies help the co-op ecosystem. These ontologies can help build various AI agents listed in Section VI.

A. MEMBER FARM ONTOLOGY
Here, we describe our individual member farm ontology that has been developed by considering various elements and interactions mentioned above in Section III-B and III-D. Figure 5 illustrates the ontology. The ontology contains MemberFarm class which has detailed knowledge about the overall functionality in our ecosystem. Below we describe the major classes and important properties of our smart farm ontology:   We have developed a semantically rich co-op agriculture ontology to capture data from various interactions discussed in section III-D. Figure 6, depicts the cooperatives agriculture ontology that contains four main classes namely, CBU class represents the cooperative provider, Unit class represents the resources present in co-op, MemberFarm class represents individual member farm owners that are part of co-op, and Agreement class represents legal components of co-op. The classes and properties of our ontology are further described below: 1) CBU class: This is an important class in our ontology which connects to other classes through its properties. It represents organization structure of co-op which monitors all permitted interactions and supports multiple member farms that agree to the terms and conditions of the co-op. In this section, we use the ontology to showcase various agricultural co-op use-cases. Our ontology is descriptive enough to model and showcase complex co-op interactions here, we showcase three use-cases that illustrate complex situations that arise when a member farm borrows equipment from the co-op. We also discuss a data sharing use-case between borrowed equipment and other deployed member farm units. Similar use-cases can be created for borrowed sensors and workers. Some of these interactions are represented and stored in the co-op cloud representation graph.

A. MEMBER FARM BORROWS EQUIPMENT
In this scenario a member farm 'Member_Farm_1' wishes to borrow an agriculture drone, 'ag_drone_1' from the co-op. 'Member_Farm_1' is an instance of the class MemberFarm, 'ag_drone_1' is an instance of class COBU. The borrow request with details about the time schedule reaches the co-op hub, 'co-op_1' and it evaluates the request (See Step 1 in Figure 7). If the co-op is able to honor the request, it computes a response and communicates it to 'Member_Farm_1' including the details about 'ag_drone_1'. The member farm initializes the resources for the incoming equipment. It creates a local instance, 'ag_drone_1_local' for the incoming 'ag_drone_1' and sets various properties required, especially the time schedule (See Step 2 in Figure 7). The local instance is used to ensure data security and privacy in the next use-case showcasing data sharing.

B. DATA SHARING BETWEEN MEMBER FARM UNITS AND BORROWED EQUIPMENT
The 'ag_drone_1_local' instance created previously, communicates with existing deployed FBUs, OBUs and other WBUs according to various policies and rules dictated by the farm owner. The data generated by the 'ag_drone_1_local' is stored in the representation graph of the individual member farm unit (See Figure 8). For the borrowed agricultural drone, the data can include farm images and its interaction with other deployed sensors; along with various internal drone performance data points and metrics. These interactions continue till the expiry of the borrowed time. Keeping in compliance with the co-op agreement, at the end of the borrowed time decisions regarding data privacy and access control need to be made. Only specific contents of data generated by FBUs, WBUs and OBUs is shared with the borrowed 'ag_drone_1_local' during these interactions. Well defined co-op agreements helps in evaluating the contents of shared data to maintain privacy of individual member farm.

C. MEMBER FARM RETURNS EQUIPMENT
Once the borrowing time expires, the 'Member_Farm_1', disassociates the local instance 'ag_drone_1_local', with the borrowed 'ag_drone_1'. During this process 'Mem-ber_Farm_1', stores a record of all the data collected in it's representational graph with 'ag_drone_1_local' (See Step 1 in Figure 9). According to the co-op agreement, 'Member_Farm_1' encrypts various farm specific private data. However, it allows 'co-op_1' access to the pre-negotiated data, which can include internal drone performance data points and metrics, that can be used by 'co-op_1' to maintain 'ag_drone_1'.
At the end of the process 'ag_drone_1' returns to 'co-op_1', where it can be borrowed by a member farm (See Step 2 in Figure 9).

VI. AI ASSISTED SMART CO-OP APPLICATIONS
Deploying integrated AI with CPS technologies at the co-op level will help create various applications that will benefit  individual member farmers. Some of these proposed applications in different areas with major societal implications are depicted in Figure 10.
As we build these AI applications [92], ontologies will play a central role in the process. Ontologies have been used in expert systems to assert data and domain knowledge. Ontologies described in Section IV can play a central role in creation of these systems when coupled with other domain describing ontologies. Some of the ontology assisted AI applications in other domains have been discussed in Section II.
Next we discuss various AI applications that can be developed for the co-op ecosystem that benefits member farmers, broadly addressed in four categories such as (i) Marketing and Distribution, (ii) Resources and Equipment, (iii) Labor, (iv) Service and Supply.

A. MARKETING & DISTRIBUTION 1) MONITORING, MARKETING & DISTRIBUTION OF PRODUCE
In a co-op, member farms produce different quality of crops/produce. The co-op can monitor the quality of the crops produced by member farmers by analyzing the historic sensor values for a particular crop, and use AI to compare it with other member farms. This 'relative' crop analysis can help a co-op recommend suitable marketing locations and price to member farms.
The co-op hub, with help of AI tools, can track the grain or produce in the market that offer the best price/purchase value to the co-op member farms. The tracked information is communicated to the member farms regarding prices offered by direct consumers and near-by markets. A co-op can also monitor various market conditions and recommend member farms to grow produce ideally suited for their farm conditions.
Another advantage of having a smart co-op environment is in the co-op packing and processing tasks [93]. A co-op can use deployed sensors and AI systems to group and standardized quality of crops/produce. This is specially important when a co-op sells produce to large-volume venues like schools and hospitals as they need products in standardized quality and packs. A smart co-op can help ensure such crops standardization in sufficient quantity and quality.

2) USE OF SENSOR DATA TO AID IN CROP CERTIFICATION
Food production and farming are a highly regulated industry with different countries having multiple national agencies monitoring food production. In the United States, Environment Protection Agency [89] and the Department of Agriculture [90] enforce various regulations and industry standards. In the European Union, Department of Agriculture and Rural Development [91] undertakes this responsibility with similar authorities in other countries. These federal authorities issue compliance directives to ensure quality food production. With the advent of smart farming technology these agencies are relying more and more on data produced by farm based sensors.
A co-op growing produce can use the sensors deployed on various member farms to provide data that can be used for crop certification. This can include data from soil sensors, fertilizer sprinklers, soil organic matter sensors, seed and stock usage data, water and irrigation sensors, etc. An example certification process that can benefit from a smart co-op setup is the USDA organic crop certification. 12

B. RESOURCES & EQUIPMENT 1) PROCUREMENT DECISION SUPPORT SYSTEMS
In order to aid in resource or machinery procurement, the co-op can create/utilize various decision support systems [94]. Shared data, acquired from the deployed sensors of member farms, helps the co-op to analyze resource requirements like quantity of fertilizers and type of advanced machinery needed (e.g., automatic in-row weeders 13 or smart turf harvesters 14 ) to increase productivity. For example, the co-op can make yearly decisions about the new machinery that can be purchased to increase quality and maximize the crop value of member farms. This can be done by analyzing the shared data from previous years.
Additionally, with the help of edge computing applications, a member farm owner can utilize co-op benefits in making purchase decisions. For example, based on edge analytics, the HBU of the member farms can request and reserve slots (from the co-op) for additional machinery/resources like soil nutrition guards, trucks, and harvesting tools. This can help in making early decisions which in turn, help in avoiding effects of late harvesting such as decreased crop yield, damage of the crop due to sudden change in weather conditions, and pests that decreases the quality of the yield.

2) SCHEDULING DEMAND FOR MACHINERY
An AI based self learning application can be designed to schedule the usage of resources by keeping track on the availability of machinery owned by the co-op. Information such as extreme weather conditions and early maturity/status of the yield can be predicted by analyzing data from various sensors. Consequently, a co-op can efficiently schedule the usage of machinery with member farm owners. In particular, during critical weather conditions and harvesting seasons, the demand for machinery increases significantly [95]. At this time, scheduling machinery usage in advance based on the data collected using various smart sensors across the co-op member farms becomes vital. Accordingly, an AI based application that provides scheduling recommendations by considering data from OBUs, WBUs, and FBUs of member farms can help in planning, reducing shortage of resources, and avoiding conflicts of utilization.

3) PREDICTIVE MAINTENANCE OF MACHINERY
A co-op (CBU) can leverage a proactive prediction strategy [96] to improve the efficiency of resources and machinery equipment by identifying patterns in the data collected from the smart sensors (COBU). In the proposed application, abnormal behavior of the COBU can be tracked to optimize maintenance costs and reduce breakdowns. This is done by notifying the CBU about an abnormal behavior that does not conform to the expected normal conditions and performance of the equipment occurred in the past. For example, the CBU received a minor repair alert about a COBU which is outside of its actual maintenance scheduled date. The minor repair of the COBU that has been identified can be fixed at an early stage to reduce downtime service.
We can also compare this to preventive maintenance of cyber physical infrastructure and assets utilizing the digital twin concept [62].

C. LABOR 1) SCHEDULING LABOR FOR PROPER UTILIZATION
One way of effectively using labor during peak season is to make use of various AI models [97], [98]. Considering the sensor data from member farms, the CBU can create an efficient schedule for the CWBUs based on individual requirements, expertise and availability. This is particularly important to avoid problems such as inefficient labor utilization or shortage of labor during peak season. Another AI system [99] that can further aid the co-op members can be built to identify and prioritizing member farms that are ready to be harvested based on the time series analysis of their crop data.
Co-ops using a data intensive system can also use such a system to comply with labor regulation as mandated by various state and fedral departments of labor. This system can also be used to consult with insurance advisors about need for insurance and workers compensation.

D. SERVICE & SUPPLY 1) A CO-OP EARLY WARNING SYSTEM
An early warning system [100] deployed at the co-op level will aid the member farms by alerting them to events like, crop diseases, pest management, weather, changing labor costs, price fluctuations, etc. Information such as negotiated interactions and data samples provided by the sensors that are deployed in a member farm are first communicated to the farm's HBU and then passed to the co-op. The co-op can utilize the shared data to create an early warning system by using various AI tools to predict a crop disease or a pest problem. For example, if a member farm has a higher use of fertilizer than peers then the co-op can alert the HBU.
Similarly, member farms (HBU) can be alerted about drought conditions and labor costs that could be predicted with the help of the forecast model, and also be provided guidance to mitigate the impact [101], [102]. For example, CBU can detect a parasitic fungi [103] in the area and alert the specific HBU. In this way the member farm can take necessary actions such as using fungicides, disinfecting the equipment to reduce the effect on the crop yield. The co-op can also generate alerts for other member farms in the area, or specific farms that have shared equipment or labor with affected farm/farms.

2) ANALYSIS FOR MEMBER EXPENDITURE
Member farms are frequently faced with decisions to make. Some decisions are critical to the farm budgetary. For example, purchasing new equipment, renting or potentially sharing the costs with other co-op members, financing, and labor are all business decisions that can have substantial financial impacts. According to a USDA report on farm production expenditures [104], labor is among the top five expenditures by farms with an average of 9.6% in 2018. Some decisions can result in immediate visible effects while others are less visible long-term and need more time to be recognized. For example, major changes in production practices require detailed analysis to estimate the benefits and costs of this decision. Evaluating all potential effects of these long-term decisions is critical for member farms. A CBU can provide AI member expenditure analysis service to help member farm owners keep track of short and long term costs and provide valuable insights. Decisions suggestions can be provided based on shared information from other member farms. For example, CBU can suggest a change of production practices to help lowering the expenditures by analyzing other member farms information.

VII. CONCLUSION
The growing demand for food production concerns the agriculture sector. In order to meet the food requirements of the escalating population, individual farmers have started utilizing precision agriculture technologies. However, despite various technological advancements, co-op ecosystems at present have not fully exploited the applications of AI and Internet connected devices. Therefore, in this paper we have created ontologies and proposed AI applications that add value to the smart farming co-op ecosystem. This paper first details the cooperative ecosystem by describing various components in the architecture, its elements, their interactions and the agreements involved to ensure proper functioning of a cooperative. Then we have developed ontologies for a cooperative and individual member farms. Additionally, prototype agriculture co-op use case scenarios are included that illustrate how situations like sharing of resources are handled by the co-op ecosystem. The paper also presents various AI applications in different domains which would integrally benefit individual member farm owners that are part of a co-op.
ANUPAM JOSHI (Fellow, IEEE) received the B.Tech. degree from IIT Delhi, in 1989, and the master's and Ph.D. degrees from Purdue University, in 1991 and 1993, respectively. He is currently the Oros Family Professor and the Chair of the Computer Science and Electrical Engineering Department, University of Maryland, Baltimore County (UMBC). He is the Director of the UMBC's Center for Cybersecurity, and one of the USM leads for the National Cybersecurity FFRDC. His research interests are in the broad area of networked computing and intelligent systems. His primary focus has been on data management and security/privacy in mobile/pervasive computing environments, and policy driven approaches to security and privacy. He has published over 250 technical papers, filed and been granted several patents, and has obtained research support from National Science Foundation ( KARUNA JOSHI received the B.Eng. degree (computers) from the University of Mumbai, and the M.S. and Ph.D. degrees in computer science from UMBC, where she was twice awarded the IBM Ph.D. Fellowship. She is currently an Associate Professor with the Department of Information Systems, UMBC. She is the UMBC Site Director of the Center of Accelerated Real Time Analytics (CARTA). She also Directs the Knowledge, Analytics, Cognitive and Cloud Lab. Her primary research area is data science, legal text analytics, cloud computing and healthcare IT. She has published over 60 scholarly articles. She has been awarded research grants by NSF, ONR, DoD, Cisco, and GE Research. She was also awarded the NSF I-Corps award and TEDCO MII grant to explore commercial opportunities for her research and created a start-up on data science and cloud technologies. She has also worked for over 15 years in the Industry primarily as an IT Project Manager. She worked as a Senior Information Management Officer at the International Monetary Fund for nearly a decade.