Keywords: Internet des Objets (IoT), Agriculture durable, Intelligence Artificielle (IA) embarquée, Réseaux de Embedded-AI-enabled semantic IoT platform for Agroecology Internet of Things (IoT), Sustainable Agriculture, Embedded Artificial Intelligence (AI), Wireless Sensors Networks, Low Power Wide Area Networks (LPWAN), Knowledge Engineering

Titre: Plateforme IoT sémantique compatible avec l'IA embarquée pour l'agroécologie.

notamment dans le cadre de l'IoT. Premièrement, les plateformes doivent être capables de percevoir des données dans l'environnement, de les interpréter et de prendre des décisions pour aider à la gestion des fermes. Le volume, la variété et la vélocité de ces données, conjuguées à la grande diversité d'objets ainsi qu'à l'avènement de l'IA embarquée dans les capteurs, rendent difficile les communications sur les réseaux agricoles sans fils. Deuxièmement, les recherches tendent à se focaliser sur des projets répondant aux problématiques de l'agriculture conventionnelle non durable et les projets concernant les petites exploitations axées sur l'agroécologie sont rares. Dans ce contexte, cette thèse explore la création d'une plateforme IoT composée d'un réseau de capteurs intelligents sémantiques, visant à guider les agriculteurs dans la transition et la gestion de leur ferme en agriculture durable tout en minimisant l'intervention humaine.

Information sur les organismes d'accueil

Organisme 1: LISV -Laboratoire d'Ingénierie des Systèmes de Versailles Addresse: 10 Av. de l'Europe, 78140 Vélizy-Villacoublay URL: www.lisv.uvsq.fr

Présentation:

Le LISV développe ses activités de recherche multi-disciplinaires, tant théoriques qu'expérimentales, principalement autour de la conception mécanique, l'automatique, la compréhension de phénomènes tels que la locomotion, la manipulation, l'ontologie et l'automatique pour l'équipe Robotique Interactive, et autour de la caractérisation, tant amont qu'aval, du comportement des systèmes ce qui part de la modélisation des comportements des composants afin d'appréhender le rôle des paramètres environnementaux, puis l'instrumentation et la métrologie du composant ou du système afin de valider ses performances. Les domaines d'applications principaux sont la robotique, la cobotique, la mécatronique, l'assistance aux personnes et à la mobilité, les systèmes embarqués, le véhicule autonome, les capteurs et la transmission d'information. LE LISV a également de nombreuses activités de valorisation (prototypes, brevets, logiciels, 3 startup ayant émergé dans les dernières années). L'ECE est une école d'ingénierie française spécialisée dans le numérique, située à Paris. Elle a été fondée en 1919 sous le nom d'École centrale de la TSF dans le but de former les tout premiers opérateurs radio, puis s'est spécialisée dans les nouvelles technologies de l'information et de la communication pendant la deuxième moitié du XX e siècle.

Le centre de recherche de l'ECE existe depuis 2004. Il compte aujourd'hui une vingtaine de permanents et une dizaine de doctorants. Il déploie une stratégie innovante qui enrichit la pédagogie et apporte aux élèves un éclairage sur les enjeux scientifiques, sociétaux et environnementaux. Les thèmes de recherche du centre couvrent un large spectre de domaines scientifiques, incluant à la fois des aspects fondamentaux et des aspects appliqués. Les travaux se développent en trois axes à la confluence des Systèmes Intelligents Communicants, des Méthodes Mathématiques pour l'Ingénierie Scientifique et Financière, et des Nanosciences et Nanotechnologies.

Depuis 2018, les étudiants de l'école ont mis en place un potager urbain sur le toit de leur campus afin de sensibiliser aux problématiques agricoles actuelles et également d'expérimenter leurs projets. Ce jardin est mis à contribution dans cette thèse, sur laquelle a été déployé un réseau de capteurs.

I would like to take a moment to express my deepest gratitude to the teachers, friends, and family who have supported and guided me throughout my PhD. Your unwavering care, patience, and encouragement has been a constant source of inspiration and motivation for me.

To my advisors, Amar and Naila, thank you for sharing your knowledge and wisdom with me. Your belief in my abilities despite some troublesome periods allowed me to hold on and pursue this quest for knowledge which is the PhD adventure. I also want to thanks all the members of the lab at ECE especially its director, Assia Soukane, who was also full of support and understanding throughout those years.

To my friends, thank you for being a constant source of laughter, comfort, and support. Your companionship has helped me through the toughest of times and has made the best moments even more memorable. Your loyalty and kindness have touched my heart and I am forever grateful for your friendship. I have a particular thought for my co-PhD students at ECE Paris especially the other doctoral students, Quentin, Abderaouf, Cécile, Maxime, Alexandre, Rémi, Melchior and Cécile with whom I had the chance to fight countless battle.

To my family, thank you for being my rock and my safe haven. Your love and support have sustained me through the ups and downs of life. Your guidance and encouragement have given me the strength to overcome challenges and pursue my passions despite the mountains of doubts that were in the way. I am blessed to have such a wonderful family and I love you all dearly.

To Siobhan, with all my love, thank you. You were a late addition to the war but I could not have won it without you as your presence gave me the strength and motivation to finish the last miles.

In conclusion, to all of you, I offer my sincerest gratitude for the impact you have had on my life. Your presence has made a difference and I am grateful for all that you have done for me. Thank you for being a part of my journey and for helping me become the person I am today. Throughout my life, I will never forget what you did for me and you will always accompany me in my future adventures.

List of Tables

1. [START_REF] Federico | Feeding the world: an economic history of agriculture, 1800-2000[END_REF] Types of environmental degradation,causes and impacts on agricultural processes . .

List of Abbreviations

• AI : Artificial Intelligence

-General Introduction

The introductory chapter of this report provides a comprehensive overview in four distinct sections, namely context and motivation, problem statement, methodology and contribution, and report outline. The context and motivation section highlights the reasons behind the chosen topic, while the problem statement section elaborates on the specific problem identified within the broader context. The methodology and contribution section discusses the process of research involved and explains the relevance of the study. Lastly, the report outline presents all the chapters in detail.

. Context and motivation

Agriculture is the foundation of human civilization as its invention mark the end of the hunter and gathering period and the creation of cities as our ancestors went from a nomadic life style to a sedentary one. Throughout our history, agriculture was a labour-intensive system with low productivity and a high sensitivity to climatic event. It was able to feed the population but required a vast number of small farms and at least a third of the population to be active in the primary agricultural production process. During the industrialisation period at the end of XIX th and the beginning of the XX th century, agriculture was reinvented. This new modern agriculture, also called agriculture 2.0 or the green Revolution, is characterized by the massive usage of heavy machinery, chemicals fertilizers and chemical protection (insecticide and pesticide). Nowadays, it is the main agricultural paradigm in the world as it allows farmer to grow important quantity of food for minimal human effort and strong adaptability to climate-induced constraints. Therefore, modern agriculture has been a major contributor to the world's food supply and has played a crucial role in supporting the growing global population [START_REF] Federico | Feeding the world: an economic history of agriculture, 1800-2000[END_REF]. However, the practice of modern agriculture has also given rise to a host of challenges that pose serious risks to the environment, health, and economic sustainability of the industry threatening humankind food security [START_REF] Foley | Solutions for a cultivated planet[END_REF]. Food security is the state where all individuals in a population have physical, social, and economic access to sufficient, safe, and nutritious food to meet their dietary needs and food preferences for an active and healthy life. It involves not only the availability of food but also the accessibility, affordability, and quality of food [START_REF] Charles | Food security: the challenge of feeding 9 billion people[END_REF].

One of the primary issues of modern agriculture is its impact on the environment . Large-scale farming practices have led to soil degradation, water pollution, and deforestation [START_REF] Tilman | Global food demand and the sustainable intensification of agriculture[END_REF]. Modern agriculture is heavily dependent on synthetic fertilizers, pesticides, and herbicides, which have a negative impact on the environment. The widespread use of these chemicals has led to soil and water contamination, and has also resulted in the development of pesticide-resistant insects and weeds [START_REF] Zhang | The impact of agricultural chemical inputs on environment: global evidence from informetrics analysis and visualization[END_REF]. Moreover, chemicals usage in the food chain might be the causes on numerous human diseases and hormonal disorders [START_REF] Nicolopoulou-Stamati | Chemical pesticides and human health: the urgent need for a new concept in agriculture[END_REF] . In the meantime , the extended cultivated area surfaces require the usage of heavy machinery that not only uses polluting fossil fuel powered motors but also tends to increase soil compaction due to their weight [START_REF] Hamza | Soil compaction in cropping systems: A review of the nature, causes and possible solutions[END_REF]. Another environmental issue of modern agriculture is the mono-cropping or monoculture. This method, where farmer use only one variety of crops per field to facilitate the harvest and the cultivation process, induce a decline in soil fertility as the same plants will need the same nutrients season after season, thus requiring more fertilizer usage and depleting the soil fertility. Moreover monoculture also increase the risk of diseases and pest development therefore inducing more pesticide usage [START_REF] Gebru | A review on the comparative advantages of intercropping to mono-cropping system[END_REF]. A comprehensive list of environmental consequences caused by traditional modern Agricultural practices is proposed in Table 1.1.

Cause

Type

Cause Degradation process Impact Physical Deforestation [START_REF] Lawrence | Effects of tropical deforestation on climate and agriculture[END_REF] Breakdown of natural soil structure, aggregation and porosity Reduction in infiltration capacity.

Changes in soil water-retention characteristics. Diminish earth capacity to absorb carbon based gases and produce dioxygen. Excessive human, livestock and machine traffic [START_REF] Hamza | Soil compaction in cropping systems: A review of the nature, causes and possible solutions[END_REF] Soil compaction, breakdown of natural soil structure Decreases infiltration capacity.

Changes in soil water-retention characteristics Block aeration for soil biota.

Limit roots spreading capacities. Excessive tillage [START_REF] Lal | Tillage and agricultural sustainability[END_REF] Compaction of surface and subsoil, reduction in proportion and strength/stability of aggregates Accelerated erosion by water and wind. Increase in bulk density leading to reduction in porosity Water logging and anaerobiosis Excessive water usage [START_REF] Turral | Climate change, water and food security. 36. Food and agriculture organization of the United nations (FAO)[END_REF] Soil Erosion and diminution of ground water level Loss of soil structure. Dilution of organic matter and diminution of soil fertility. Depletion of natural ground water stock impacts the natural water cycle inducing drought and flood and reducing water availability for future crops. Intensive urbanisation [START_REF] Beckers | The impact of urbanization on agricultural dynamics: A case study in Belgium[END_REF] Destruction of natural soil Loss of soil fertility. Usage of other natural zone for waste disposal. Loss of soil infiltration capacities due to concrete coating.

Chemical

Little to no use of fertilizers [START_REF] Mishra | Role of bio-fertilizer in organic agriculture: a review[END_REF] Nutrient depletion Decreased levels of macronutrients on exchange sites, soil organic matter, and in soil solution Excessive usage of fertilizers [START_REF] Mishra | Role of bio-fertilizer in organic agriculture: a review[END_REF] Acidification, eutrophication and population exposure Leaching and runoff of nutrients to water sources polluting them in the long term.

Usage

of pesticide [START_REF] Zhang | The impact of agricultural chemical inputs on environment: global evidence from informetrics analysis and visualization[END_REF] Soil and plants contamination Exposure to chemical potentially harmful to human , either directly (during spraying of the field) or indirectly (inclusion of chemicals in the food produces). Creating stnewer diseases and pest strains with stronger resistance to the pesticides Usage of insecticide [START_REF] Zhang | The impact of agricultural chemical inputs on environment: global evidence from informetrics analysis and visualization[END_REF] Depletion of insects population, exposure to population Disturbance of the natural food chain inducing disappearance of some species (e.g birds for who insects are the main food source) and over representation of other (e.g diminution of spider induce a an increase number of mosquitoes); Exposure to chemical potentially harmful to human , either directly (during spraying of the field) or indirectly (inclusion of chemicals in the food produces) Usage of poor quality water and inadequate drainage [START_REF] Turral | Climate change, water and food security. 36. Food and agriculture organization of the United nations (FAO)[END_REF] Salinization, alkalinizaton Loss in soil fertility. Industrial and urban wastes [START_REF] Rg Mclaren | Issues in the disposal of industrial and urban wastes[END_REF] Toxification, contamination with heavy metals, pollution Excessive build up of some elements (e.g., Al, Mn, Fe) and heavy metals (e.g., lead and mercury); increase in soilborne pathogens Biological Removal of residues (leftover from crops after harvest) [START_REF] Smith | Crop residue removal effects on soil carbon: Measured and inter-model comparisons[END_REF] Nutrient depletion and soil structure degradation Reduction of soil fertility, soil aggregation, and related properties Little to no use of organic input [START_REF] Mishra | Role of bio-fertilizer in organic agriculture: a review[END_REF] Introduction of not adapted species in the biota [START_REF] Dean R Paini | Global threat to agriculture from invasive species[END_REF] Unfair natural competition leading to some species beeing surepresented and other underrepresented compare to the natural biota of the ecosystem Crops beeing more sensitive to some pest and disease. Crops become more used as food source by some species.

Table 1.1: Types of environmental degradation,causes and impacts on agricultural processes

Besides its harmful method to the environment, modern agriculture is also not suited to face climate change. There is a subsequent number of research on the effect of Climate change that shows that the earth is getting warmer since the middle of the XIX century due to human activity and its greenhouse gasses production [START_REF] John | Climate change: causes, effects, and solutions[END_REF]. This rise in temperature, even if contained to a few degrees °C, will disrupt the rainfall pattern as well as increase the frequency and hardship of extreme weather condition across the world such has flooding , heatwave and fire or monsoon . This will induce an important and unequal shift in climate pattern across the world. As we can see in Figure 1.1 some region will be subject to a drastic reduction in their food production capability reducing the food security of their population especially in developing countries where smallholder farmers are more affected by the weather conditions [START_REF] Wheeler | Climate change impacts on global food security[END_REF]. Another issue related to modern agriculture is the impact of population growth and its impact on food consumption. The world's population is projected to reach 9.7 billion by 2050 [START_REF] Kc Samir | The human core of the shared socioeconomic pathways: Population scenarios by age, sex and level of education for all countries to 2100[END_REF], and this will put an enormous strain on the global food supply [START_REF] Ranganathan | How to sustainably feed 10 billion people by 2050, in 21 charts[END_REF]. As the population continues to grow, the demand for food will increase, and farmers will need to produce more food to meet the needs of the population. Moreover, the standard of living of humankind is, for the better, rising, inducing more food consumption and an increased demand for higher grade food product (e.g. animal products) from developing countries population as shown in figure 1.2 [START_REF] Plackett | Changing diets at scale[END_REF]. Figure 1.2: Dietary changes in developing countries, 1964-66 to 2030 [START_REF] Harrison | World agriculture: towards 2015/2030[END_REF] The Food and Agriculture Organization (FAO) of the united state nation therefore estimate that by 2050, food production must increase by around 60% if we want to insure global food security to provide for everyone needs in term of quantity and quality and availability [START_REF] Shaw | World food summit[END_REF]. With the current agricultural methods this would mean increasing the agricultural land of more than 593 million-hectare that to say twice the size of India [START_REF] Ranganathan | How to sustainably feed 10 billion people by 2050, in 21 charts[END_REF]. Regrettably, as illustrated in Figure 1.3, Earth can no longer accommodate an expansion in farming areas. Over 50% of habitable land is currently allocated to agriculture, and any further expansion would jeopardize our planet's ecosystems. It's also imperative for readers to recognize from this figure that while technology and Smart Farming (SF) offer significant benefits (as it will be later showcased in the thesis), achieving sustainable agriculture also requires a reduction in livestock-derived products consumption. Indeed, livestock farming occupies a staggering 80% of all farmland while only accounting for approximately less than 1/3 of our global calorie and protein supply that could be easily replaced by plant-based produces [START_REF] Meybeck | Sustainable diets within sustainable food systems[END_REF].

Figure 1.3: Global land use for food production [START_REF] Ritchie | Land Use[END_REF] In addition of the environmental and population issues, agriculture is facing also social problems in the form of a shortage of skilled labor. The average age of farmers in many countries is over 60, and there are fewer young people entering the industry as wages are low and work conditions are harsh [START_REF] Guo | The impact of aging agricultural labor population on farmland output: from the perspective of farmer preferences[END_REF]. This shortage of skilled labor is making it difficult for farmers to make a change and adopt new sustainable agricultural practices. Moreover aging farmers are more reluctant to adopt the usage of new technologies, which are essential for increasing efficiency and productivity [START_REF] Giua | Smart farming technologies adoption: Which factors play a role in the digital transition?[END_REF]. In a more global way, older farmers usually own their farmland and sell them when going into retirement. Currently it is mainly big company with financial interest that tends to buy those land to create huge farm exploitation with no or low care to the environment [START_REF] Deininger | Challenges posed by the new wave of farmland investment[END_REF].

Finally the last issue is food distribution and availability and waste. The problem with food process, distribution and storage is that it is often difficult to ensure that food reaches those who need it in a timely and efficient manner. This problems causes a major food waste issue as it is considered that 30 % of food produces are wasted every year [START_REF] Ishangulyyev | Understanding food loss and waste-why are we losing and wasting food?[END_REF]. This can be caused by technical issues : Food may spoil or be wasted due to inadequate storage facilities, transportation difficulties, or other logistical challenges [START_REF] Wakeland | Food transportation issues and reducing carbon footprint[END_REF]. But this also can be due to social issues : There can be disparities in access to food, with some countries, communities or individuals facing food deserts or limited access to fresh, nutritious food. These issues can lead to food insecurity and malnutrition, particularly for vulnerable populations such as low-income households, children, and seniors and the overall population in developing country. This inequality in food distribution leads to today absurd situation where 800 million people are undernourished while 800 million are considered in a state of pathological obesity [START_REF]The state of food security and nutrition in the world 2019: safeguarding against economic slowdowns and downturns[END_REF].

All of those issues will require the adoption of more efficient farming practices that can produce more food with fewer resources. Thanks fully the digital revolution brought numerous tool to help make agriculture more sustainable. The domain of science and engineering that aim to bring new technologies to farmers is called Smart Farming or Precision agriculture. It is define as the usage of advanced technology to optimize agricultural production, increase yields and reduce waste and overall resources usage (mechanical and chemical) and finally make the overall process of food production more reliable. [START_REF] Walter | Smart farming is key to developing sustainable agriculture[END_REF]. Smart Farming has already started to be implemented widely and it is consider that its usage will be even more important in the future. This lead to a new type of agriculture called 3.0 for the agriculture that already uses digital tools for automation and monitoring, and now even 4.0 with the introduction of advanced Information and Communication Technology (ICT) tools such as Artificial Intelligence (AI) or Internet of Things (IoT). Figure 1.4 resume the parallel between the level of agriculture and the level of traditional industry. revolutions [START_REF] Liu | From Industry 4.0 to Agriculture 4.0: Current status, enabling technologies, and research challenges[END_REF] .

Concretely, smart farming involves integrating various technologies such as sensing technologies, data analytic, artificial intelligence and robotics. A general view of the smart farming processes is proposed in Figure 1.5. All of these technology are generally grouped into Internet of Things (IoT) platforms to assist the farming process. The concept of the Internet of Things (IoT) refers to physical objects or collections of objects that are equipped with sensors, actuators, processing capabilities, software, and other technologies that communicate with other devices and systems over the internet. Usually IoT devices are grouped in IoT Platforms for specific usage. An IoT platform is software managing the connection and control of connected objects to collect, store, correlate, analyze and exploit their data and take the best decision to implement answers for various problem [START_REF] Gubbi | Internet of Things (IoT): A vision, architectural elements, and future directions[END_REF]. It is divided in three parts:

• Perception: Collection of data from various sources. Local sensors device, database, survey and human interaction systems.

• Decision: Analyse of such Data thanks to statics, analytics tools and AI

• Action: Sending command to actuators or proposing solution to human agent.

In the smart Farming context, a simple example of an IoT platform would be an irrigation system piloted by soil humidity sensors and is depicted in figure 1. [START_REF] Nicolopoulou-Stamati | Chemical pesticides and human health: the urgent need for a new concept in agriculture[END_REF]. The soil humidity sensors communicates wirelessly in what we call a Wireless Sensor Network (WSN). The IoT platform will collect the level of humidity in the soil, make analysis in comparison of future weather prediction (obtained through existing database on the internet), take a decision on the level of water to give to the crops and then finally send a precise activation command to a connected irrigation valve to apply only the minimum required amount of water, hence being precise and saving precious water resources.

Despite promising result and opportunity, the SF domain unfortunately encounters some limitations: • Technological : The technologies used in SF are complex and need to be improved as explained by the authors of the survey in [START_REF] Idoje | Survey for smart farming technologies: Challenges and issues[END_REF]. On the particular case of IoT platforms, which is the main topic of research of this thesis, the recent advancement in Embedded AI sensors offer promising application especially in SF. [START_REF] Sanchez | Tinyml-enabled frugal smart objects: Challenges and opportunities[END_REF]. Figure 1.7 shows the rising number of publication concerning Edge computing technologies. Embedded AI is a new field of AI where Machine Learning algorithms are optimize in order to run on constrained hardware with low computational power and memory such as Microcontroller Unit (MCU) or embedded Central Processing Unit (CPU). The idea is to analyze the data directly where they are collected in order to reduce latency and increase privacy but also to reduce energy consumption as offloading data, especially heavy ones such a image and audio files, is a powerhungry procedure. Embedded AI is also refer to as Edge Computing in opposition of Cloud Computing. A simple comparison between cloud computing and edge computing is proposed in Figure 1.8 with an exam-ple application where a camera sensor observe a field of strawberry. In the first case, cloud computing, the camera sensors take a picture of a plot of strawberry, sends the pictures through the network in a remote cloud server. The cloud server then apply a ML algorithm to this picture to infer the state of the plant. After this step, the cloud server can send the output to whoever needs to know (farmer, actuators (e.g. robot or irrigation). In the second case, the ML algorithm is running directly on the sensors and it sends only the output in a form of a small and light text message through the network to whoever needs to know. Those sensors offers a plethora of application for SF such as static camera sensors observing crops to monitor their growth and detect issues (e.g. disease, pest infestation, under development, water stress) or sound sensor to listen to livestock behavior and detect unhealthy individual for treatment (e.g. breath sensors for cows that detect stress). Unfortunately, they also brought new needs for agricultural Wireless Sensors Networks in term of Quality of Service (QoS) and mainly energy consumption [START_REF] Shubhangi | Energy autonomy in IoT technologies[END_REF][40] especially as their firmware need to be remotely updated and because they have to offload punctually some heavy data file (e.g. image or sound). As it will be later showcased, agricultural WSN mostly use Low Power Wide Area Network (LPWAN) technology to communicate [START_REF] Mekki | A comparative study of LPWAN technologies for large-scale IoT deployment[END_REF]. Amongst those LPWAN, LoRa protocol is the main used and promising communication technology used in agricultural IoT platform for its long range performances and its capacity to create ad-hoc network with unlicensed industrial frequencies [START_REF] Mahmood | Energy-efficient wireless sensor networks for precision agriculture: A review[END_REF]. Therefore the issue brought by Embedded AI sensors will be studied in the context of LoRa network. The intricate nature of IoT platforms is further complicated by these sensors due to their sophisticated management processes. It become more difficult for the system to represent the wide array of phenomena and variables the various sensors (smart or not) track, and ultimately, the diversity of devices (such as sensors, actuators, and routers) and agents (including plants and farmers) found on a farm. Numerous elements, ranging from sun exposure and water availability to natural competition and soil conditions, influence plant growth. In parallel, sensors have a plethora of parameters to consider, like their energy status, ambient temperature, and for those embedded with AI, their mean accuracy. For optimal decision-making, it's imperative to efficiently process the data collected and vigilantly monitor the health and status of each sensor. This necessitates the incorporation of AI methodologies such as knowledge engineering and expert systems to accurately represent our knowledge of both the sensors and the plants they oversee, allowing for well-informed decisions based on this comprehensive data. [START_REF] Wim | A critical review of Knowledge-Based Engineering: An identification of research challenges[END_REF][START_REF] Perera | Context aware computing for the internet of things: A survey[END_REF].Numerous methods already exist to do this such as ontology [START_REF] Otero-Cerdeira | Ontology matching: A literature review[END_REF], but they have rarely been applied to agriculture and, to our knowledge, never to an agricultural IoT platform with embedded AI sensors [START_REF] Jm Mckinion | Expert systems for agriculture[END_REF][START_REF] Meijer | The role of knowledge, attitudes and perceptions in the uptake of agricultural and agroforestry innovations among smallholder farmers in sub-Saharan Africa[END_REF][START_REF] Jha | A comprehensive review on automation in agriculture using artificial intelligence[END_REF]. Hence the strong focus of this thesis on this topic. Other technological issues will be briefly describe in the state of the art chapter of this report but the work conducted in this thesis was mainly oriented toward the issue related to the rise of Embedded AI in IoT platform using LoRa networking technology and the knowledge .

• Social [START_REF] Klerkx | A review of social science on digital agriculture, smart farming and agriculture 4.0: New contributions and a future research agenda[END_REF]: SF research literature is mainly focused on technical implementations. However SF needs to also answer various social issues in order to encourage farmers to take the steps in changing their practices. Especially regarding data management and privacy as discussed by the authors in [START_REF] Jakku | If they don't tell us what they do with it, why would we trust them?" Trust, transparency and benefit-sharing in Smart Farming[END_REF], or knowledge sharing with farmers as they will not use technology they don't understand and, therefore, won't be able to maintain as discussed in [START_REF] Pivoto | Scientific development of smart farming technologies and their application in Brazil[END_REF]. For example, one of the most significant reluctance of farmers is having to rely on technicians to maintain their trucks and equipment where they used to be able to do it on their own. Nowadays, the closed-source ecosystem of manufacturers forces farmers to hack their own tools and tractor to be able to repair them without paying fees to the manufacturer [START_REF] Wiens | New High-Tech Farm Equipment Is a Nightmare for Farmers[END_REF]. Therefore, the independence factor of farmers needs to be particularly addressed when developing smart farming solutions.

• Economical [START_REF] Eastwood | Managing socio-ethical challenges in the development of smart farming: from a fragmented to a comprehensive approach for responsible research and innovation[END_REF]: The gross margin in the farming industry are small. This is a key factor that SF tools need to take in account and it is closely linked to the social factor. Researcher must consider the economical cost of implementing them but also mainly maintaining them as it needs a specialised workforce to use them. For example an issue with the smart tractor proposed by one of the market leader manufacturer, John Deer's, has recently strike controversy as farmers can't repair their own truck due to proprietary software. When a malfunction occurs, tractor owners are often obligated to pay substantial repair costs to the respective company, a burden not easily offset by the farm's revenue [START_REF] Waldman | Farmers Fight John Deere Over Who Gets to Fix an $800,000 Tractor[END_REF]. Similarly, while agricultural robotics like automatic weeders and fruit pickers have shown potential (particularly in terms of sustainable development criteria), they face challenges in satisfying market demands due to their elevated costs and diminished return on investment compared to conventional human labor. Currently, only high-value agricultural products methods, such as viticulture, see a tangible benefit from these technological solutions [START_REF] Fountas | Agricultural robotics for field operations[END_REF]. In summary, smart agriculture must also be accompanied by favorable economic laws allowing its adoption, such as the prohibition of using cheaper but polluting methods or by imposing minimum wages for all agro-industry workers [START_REF] Klerkx | A review of social science on digital agriculture, smart farming and agriculture 4.0: New contributions and a future research agenda[END_REF].

• Scale [START_REF] Toma | Small-scale farming and food security-policy perspectives from central and eastern europe[END_REF]: SF technologies are mostly applied to large scale farm that can have access to investment money to make the transition. In the opposite, Small Scale Farmer (SSF) are left out on the SF revolution as little to no research is conducted to offer them the tools to be more sustainable [START_REF]Ending hunger: science must stop neglecting smallholder farmers[END_REF]. Small-scale agriculture consists of cultivating crops on a small surface of arable land, usually less than 2 ha according to most of the literature on the topic, and, often, yielding lower economic returns. This size number is subject to debate as a SSF in Latin America is not the same as one in Australia for example but also that surface itself is not enough of an indicator, as we should also consider the productivity, the income or the quantity of livestock of a farm [START_REF] Jouzi | Organic farming and small-scale farmers: Main opportunities and challenges[END_REF]. The study proposed by the authors in [START_REF]Ending hunger: science must stop neglecting smallholder farmers[END_REF], shows that research is not on the right track as 95 % of the 100 000 articles published on the ways to end hunger were of no help for small-scale farmer. However, small scale farming represents the vast majority of the farm in the world, over 80 %, as shown in Figure 1.9 :

Due to its poor yield, its sensitivity to the climate and the intense work labour, most of the farmer around the world operating in SSF are from the poorer countries of the planet [START_REF] Wiggins | The future of small farms[END_REF]. Nowadays, SSF are the subject of huge interest as their development could help the population of country under development to be more self sufficient and resilient to hunger, and to offer economical revenue to population [START_REF] Bosc | Investing in smallholder agriculture for food security[END_REF]. But an-Figure 1.9: Share of farms worldwide, by land size class. [START_REF] Lowder | The number, size, and distribution of farms, smallholder farms, and family farms worldwide[END_REF] other huge interest for those SSF is about their capability to be more sustainable and resilient than large-scale one [START_REF] Gerard | Small farms and sustainable development: is small more sustainable?[END_REF][START_REF] Jouzi | Organic farming and small-scale farmers: Main opportunities and challenges[END_REF]. For those reason, research are funded even in Europe to find new ways to allow people to go back to small scale farming [START_REF]Ruralization project[END_REF]. The problem of small scale farm is mostly the cost of the workforce. To reduce it two solutions can be used. First making the economical revenue more profitable by applying dedicated policies. Second reducing the needed workforce by using technology. This is on this second point that I pursued my research, even if the social and economical dimension of the problem should still be remembered during technical research in order to offer a useful solution to tackle with the issues of farmer.

• Application domain: The last limitation is the type of agriculture SF is applied to [START_REF] Siti | Smart farming: towards a sustainable agri-food system[END_REF]. As for now most of the project are used on conventional agriculture methods such as mono-cropping with fertilizer usage for example. Despite offering gain in productivity, those methods are not sustainable in the long term as explain before in this report. Hoppefuly, true sustainable methods exist such as agroecology [START_REF] Wezel | Agroecology as a science, a movement and a practice. A review[END_REF].

Agroecology is a scientific discipline that focuses on the study of ecological processes that operate in agricultural systems, with the aim of developing sustainable and resilient food systems. It emphasizes the interdependence of the social, economic, and ecological dimensions of agriculture, and seeks to promote the use of ecological principles and practices in agriculture. Agroecology emphasizes the importance of the local ecosystem, biodiversity, soil health, and the use of renewable resources, and aims to reduce the dependence on external inputs such as chemical fertilizers and pesticides. It also seeks to promote social justice and equity in the distribution of resources and benefits within the food system [START_REF] Altieri | Agroecology: the science of sustainable agriculture[END_REF]. The philosophy of agroecology is simple : Work with nature and not against. This mean adapting the crops to grow to local climate by artificial selection, using other biological agent to counter undesired effect (e.g. introducing predatory species to a know unwanted insect) or simply performing multi-cropping in a same field to have beneficial interaction amongst plants. The best example of agroecology is a method called three sisters that was, and is still use by the indigenous people of south and north america [START_REF] Terry | Sustainable Agriculture: Nutrition of Indigenous American 3 Sisters Garden Compared to Monoculture Corn Production and a Cool Old Squash[END_REF]. It uses a combination of squash plant, maize (corn), and climbing beans in a technique known as companion planting [START_REF] Parker | Companion planting and insect pest control[END_REF]. The maize and beans are often planted together in mounds formed by hilling soil around the base of the plants each year; squash is typically planted between the mounds. The cornstalk serves as a trellis for climbing beans, the beans fix nitrogen in their root nodules and stabilize the maize in high winds, and the wide leaves of the squash plant shade the ground, keeping the soil moist and helping prevent the establishment of weeds. A representation of this process can be found inf Figure 1.10. Association like this between plants exist in a wide variety and have various objectives. The multiplicity of such association make knowledge engineering an interesting tools to represent them in regard of their independent biological characteristics. In light of the agricultural context and the opportunities and limitations of smart farming, this thesis research has been directed towards implementing an IoT platform for small-scale agroecology. There is a significant emphasis on networking challenges associated with wireless embedded-AI sensor networks and the knowledge engineering required by the decision-making processes related to sensor management and agroecological principles

. Problem statement

Small-scale agroecology can be a viable model for sustainable food production in the future. Unfortunately smart-farming tools that address the specific issues encountered by those type of farm are scarce and under-developed compared to other type of agriculture (conventional agriculture or indoor farming). Hence the main problematic of this thesis :

"How can we improve farmer's ability to use smart-farming tools to implement sustainable agroecological practices?."

As stated above, IoT platform are powerful tools to gather data and interpret them in order to take the best decision regarding certain rules. This capacity to perceive information in a farm through sensors is even more efficient with the rise of new smart sensors performing AI directly at the Edge on the sensors hardware. This thesis will therefore focus on the implementation of an IoT platform with an heterogeneous WSN (A network composed of Smart sensors and classic sensors), to help the farmers follow agroecological principle that rely fundamentally on the observation and interpretation of the biotope and biocenose behavior of the farm. To do so we ask the question :

How can IoT platform be an answer to manage agroecological farms ?

To do so, we ask the question of the maintenance of the wireless sensors network as it should be minimal to avoid farmer's intervention. The main maintenance task that farmers have to perform with sensors is Battery management. Agricultural WSNs mainly use Low Power Wide Area Network (LPWAN) technologies, especially LoRa telecommunication protocol to communicates in order to save energy and doing so, extending sensor's battery lifetime drastically. Unfortunately those network have a really low data-rate. Therefore the rise of the usage of new smart sensor needs to be addressed in regard of LoRa limitations and advantages. The two main need for smart sensor, beside the communication of the results, is the ability to be remote updated and the ability to offload punctually an heavy file (e.g. image or file) for re-training the model in the cloud.

How can smart sensors be used in LoRa agroecological WSN ?

Finally, we need to represent the knowledge of agroecology and the knowledge on sensors network behavior (with a strong focus on Embedded AI sensors) in a novel Knowledge base to propose the best decision to the farmer regarding sensor placement, sensors maintenance (energy saving procedure & Firmware update management), crops layout, action determination (irrigation, harvest, treatment). For that we will be using Knowledge-engineering tools such as Ontology. In this context, we finally ask the question :

"How can we merge the information gathered by the sensors and take the best decision based on their data to implement agroecology and manage the sensors network maintenance?

To conclude, the proposed IoT platform should be able to merge data from the variety of implemented sensors in order to take the best decision regarding farm management but also WSN management with the help of a knowledge base. The augmented IoT platform compare to the one in figure 1.6 is shown in figure 1.11. It should be able to help sensors management to allow farmer with limited knowledge of IoT platform to implement easily such tools. Despite a strong focus of this thesis on the locally deployed WSN, it is important to note that the platform also need other source of information to output more precise decision. Those external sources are remote sensing techniques (satellite imagery) and farmer's observation on the field. Therefore those data source should also be taken into account in the process of decision making.

. Methodology and Contribution

The goal of this work is to design an efficient IoT platform for small-scale agroecology. To do so, as stated above, we need to consider the specificities of the introduction of smart sensor in wireless sensor network using LoRa technology and in the meantime treat the perceived data through a knowledge base regarding plant biology and sensors characteristics. The different parts of this work can be represented as a methodology in Figure 1.12. This methodology outlines the different phases of this work, their corresponding chapters, and the peer-reviewed contribution published during the thesis. 2. The second, third and fourth step are about the specific needs of Embedded AI and smart sensors in LoRa and are grouped in one chapter. The second step contribution is a proof of energy-efficiency for system using Embedded AI and LoRa compared to cloud computing.

3. The third step is about developing a Firmware Update Over the Air protocol in LoRa for Embedded AI devices performing TinyML.

4. The fourth step is about developing an heavy data-offload protocol for LoRa for remote model training.

5. The fifth, sixth and seventh step are about the setup of the knowledgebase that will act as a way to store the perceived element and process them through a set of logical rules for a decision-making purpose The fifth step is about representing the knowledge about plants and agroecology principles.

6. The sixth step is about representing the knowledge about sensors (especially smart sensors and their maintenance procedure) and WSN principles with a strong focus of storing the measured data.

7. The seventh step is about experimenting the created Knowledge-Base on use cases to get results. This is done in a simulated environment and by exploring different scenarios.

8. The eigth and last step is about a synthesis in which results are discussed and future works are presented.

Overall, this thesis propose approaches for the implementation of an IoT platform for agroecology in the form of a cloud platform where the farmers can enter his information about his farm location and types of plants he wish to grow and obtain a crops and sensors layout from the machine. Once he implemented this crops and sensors layout in the farm, the platform manage the sensors maintenance (meaning the battery usage, the FUOTA and data offload procedure for the Smart sensors) and the crops development with a knowledge base ontology. This IoT platform is presented in figure 1.13.

. Report Outline

In this report, Chapter 2 examines the state of the art in relation to IoT platforms in agriculture. In this context, the study focuses on two specific aspects of the IoT platform. Firstly, it addresses the utilization of embedded-AI sensors and their communication requirements within wireless sensor networks, emphasizing LPWAN and LoRa technology. Secondly, it delves into the storage, federation, and interpretation of sensor data for Agroecology. This chapter thus provides a review of WSN, Smart Sensors, and knowledge-based systems. Their current limitations and potentials are highlighted in the context of Smart Farming (SF). The chapter concludes with a summary of the state of the art and an overview of the proposed system. It's worth mentioning for the reader that this chapter is quite extensive. The objective was to offer a thorough overview and highlight the research efforts necessary to create a comprehensive knowledge base. Some of the concepts explained are aimed at individuals without prior experience or knowledge in the various domain and may thus be bypassed by well-versed readers.

Chapter 3 covers the topic of LoRa-based agricultural WSN with Embedded-AI sensors. It introduces a particular use-case scenario that highlights the potential application of such sensors. In the process, it thoroughly examines the limitations inherent to these sensors within the realm of Low Power Wide Area Network (LPWAN) communication, with a specific focus on the LoRa protocol. These limitations include energy consumption, Firmware Update Over the Air FUOTA), and the challenge of handling substantial data offloading. Afterward, we outline the software and hardware architecture of the embedded-AI algorithms we developed using Tiny Machine Learning techniques (TinyML) for our experimentation. We then present two novel protocols for Smart Sensors: one for FUOTA and another for efficient heavy data offload. Finally, we simulate our sensor system's behavior in various scenarios to explore its capabilities.

Chapter 4 focuses on the Knowledge-Engineering approach within the thesis. Firstly, it will define the concept of knowledge engineering and its realization through ontology development. Subsequently, it will showcase the knowledge-base constructed for our IoT platform. The latter will introduce the ontology's constituent classes, objects, and properties regarding plants and IoT devices. Moreover, it will outline a set of rules employed by the reasoner tools for the inference process. Beyond mere data storage, the system must also effectively handle diverse actions related to perceived data and implemented knowledge. Ultimately, we obtained an ontology tailored to the management of a small-scale agroecological IoT platform and delve into its architectural aspects. Chapter 4 also introduces various use-case scenarios to validate the behavior of the IoT platform's knowledge-base. The model underwent testing within a simulated environment to verify the suitability of the approach for both sensor and plant management.

Finally Chapter 5 will gather the various conclusion of the conducted research and propose future paths to explore in order to improve our system. This chapter will also showcase the various achievements attained during my PhD journey and highlight prospects for future career opportunities.

-State of the art

. Introduction

Smart farming is a scientific domain aiming to incorporate digital tools into the agriculture industry to enhance productivity, reduce labor, and improve food quality.SF is also called Precision Agriculture (PA) and can also be defined as the use of technology to improve the ratio between agricultural output (usually food) and agricultural input (land, energy, water, fertilisers, pesticides, etc.). As outlined in the introduction of this thesis, Smart Farming, could significantly contribute to shifting agriculture towards more sustainable practices while ensuring global food security [START_REF] Walter | Smart farming is key to developing sustainable agriculture[END_REF]. SF technology spans various computer science fields, including Artificial Intelligence, Data Science, and Robotics. Through cloud-base AI analysis, farmers can better comprehend climate patterns and changes, facilitating informed decisions about crop selection and resource allocation (e.g., water, chemicals). In the meantime, actuators such as Robots can effectively replace humans in challenging tasks like fruit harvesting and weed removal or simply in automation task like valves for irrigation management. The different components of Smart Farming are illustrated in Figure 2 However, as mentioned in the introductory chapter of this thesis, SF faces limitations in social, economic, application domain, scale, and technological aspects. This thesis concentrates on the challenges associated with utilizing Internet of Things (IoT) platforms within the SF context. Previous studies have explored IoT platform deployment in farming environments, offering substantial potential to enhance agricultural sustainability. IoT platforms must ensure communication among diverse networked devices, often wirelessly. This can be complex, given the diverse requirements of these devices, particularly due to the growing integration of embedded AI. Also Upon gathering data, IoT platforms must also make optimal decisions using acquired knowledge [START_REF] Gubbi | Internet of Things (IoT): A vision, architectural elements, and future directions[END_REF].

Due to its multidisciplinary nature, this problem entails the convergence of multiple subjects, necessitating a comprehensive scientific review of seemingly disparate areas. This chapter compiles information on the current state of the art and direction of Smart Farming technology, particularly in relation to Internet of Things applications. The focus is on wireless communication, embedded Artificial Intelligence, and knowledge-based decision-making processes. This section seeks to provide readers with a comprehensive overview of these technologies, their common applications in agricultural scenarios, their limitations, and potential areas for improvement. Other detailed technical reviews will be provided in Chapters 3 and 4, focusing on the specific applications implemented in our IoT platform.

. IoT platform

. Definition

An Internet of Things (IoT) platform refers to an integrated technological infrastructure designed to facilitate the seamless connectivity, data exchange, management, and control of a diverse array of physical objects or "things" through the Internet. These "things" encompass a wide spectrum of devices, sensors, actuators, and equipment that can collect, transmit, and receive data. IoT platforms serve as foundational frameworks that enable the interoperability and communication among these interconnected devices, allowing for the aggregation, analysis, and utilization of data for various applications. In other terms, it is a computer system capable of making autonomous action in the world based on its perception of it [START_REF] Gubbi | Internet of Things (IoT): A vision, architectural elements, and future directions[END_REF].

The concetp of "Internet of Things" was initially coined by Kevin Ashton in 1999 [START_REF] Ashton | That 'internet of things' thing[END_REF]. In a presentation he made, Ashton highlighted the potential advantages of employing RFID technology for managing products. By outfitting items with specific devices, these products could "communicate" pertinent details (such as their condition, traceability, etc.). This would enable products It is composed of three main components: Perception, Decision, and Action [START_REF] Khan | Future internet: the internet of things architecture, possible applications and key challenges[END_REF]. The perception module is responsible for retrieving data, either from a cloud database or through human interaction, and directly from the physical world using sensors. The decision module is software tasked with interpreting the collected data through data analytics or AI. Finally, the action module concerns the implementation of the decisions made. This can take the form of other physical devices known as actuators or robots, or in the form of reports communicated to humans to help them make a decision or to give them guidelines. Each component of an IoT platform communicates via specific transmission protocols regarding the specifics of the device [START_REF] Balaji | IoT technology, applications and challenges: a contemporary survey[END_REF]. Communication can be wired or wireless. The general model of an IoT platform is depicted in Figure 2.2.

For a deeper level of understanding, we present an illustrative example of an IoT platform in the context of Agriculture in Figure 2.3. The primary goal of this platform is to monitor stress levels in livestock, enabling the adjustment of the type and quantity of food they receive. This adjustment is crucial as food significantly influences stress levels [START_REF] Yousef | Stress physiology in livestock[END_REF]. Prior to IoT implementation, farmers had to manually observe signs of stress in individual animals. This task was challenging, especially for a large cattle herd, relying solely on visual cues of animals behavior. When an individual exhibited signs of stress, the farmer had to make approximate adjustments to their food regimen. However, with IoT technology, a sensor can be directly attached to each animal, allowing for the precise monitoring of stress levels using physiological sensors such as heart rate and breath sensors. Additionally, strategically placed cameras in the fields can analyze cow behavior through AI algorithms. Cameras and sensors need to communicate over the network to share their data with the cloud-based platform. Communication can either be wired, as seen with the cameras, or wireless, as is the case with the sensors attached to cows. Based on the collected data, the system can then precisely fine-tune the quantity and type of food provided to each individual. Furthermore, this data-driven system generates analytical insights for farmers. It can even automate the process of ordering animal food based on the actual needs of the cattle herd. Thanks to this system, one farmer can now monitor the stress level in a cattle herd of thousands of beasts easily and implement basic solution to diminish it. The previous example is straightforward, but an IoT platform can become significantly more intricate due to the diverse array of data sources available for the process of decision-making and the technology chosen for it. These platforms might even identify novel stress patterns in livestock that elude human observation. In the broader scope, IoT platforms can also facilitate predictive maintenance in industrial settings [START_REF] Civerchia | Industrial Internet of Things monitoring solution for advanced predictive maintenance applications[END_REF]. In our example, this involves averting stress in livestock by detecting early signs of abnormal behavior. This can be achieved notably through the utilization of a concept known as the "digital twin." The concept of a digital twin in IoT involves creating a virtual representation of a physical object or system. This virtual counterpart mirrors the real-world object, collecting and utilizing data from sensors and other sources to simulate its behavior, performance, and condition. This enables real-time monitoring, analysis, and optimization, helping to enhance decision-making, predictive maintenance, and overall efficiency [START_REF] Minerva | Digital twin in the IoT context: A survey on technical features, scenarios, and architectural models[END_REF].

When considering the technical architecture of an IoT system, arriving at a universally applicable design is a complex endeavor. The primary complexity arises from the inherent divergence among potential applications, each contingent upon a diverse array of variables and distinct design specifications [START_REF] Lombardi | Internet of things: A general overview between architectures, protocols and applications[END_REF]. In order to be efficient, an IoT platform should be:

• Scalable: Ensuring that as the number of devices and services grows, their performance remains unaffected.

• Interoperable: Enabling devices from various manufacturers to work together towards shared objectives;

• Distributive: Facilitating the establishment of a distributed framework where data, collected from multiple sources, is processed in a decentralized manner by different entities

• Secure: Preventing any unauthorized access

• Ressource constrained: Most objects typically possess limited computing capabilities

The most common architecture found in the literature, as explained by the authors in [START_REF] Al-Fuqaha | Internet of things: A survey on enabling technologies, protocols, and applications[END_REF], is the Three Layer Architecture. This architecture is presented in Figure2.4 and others common architecture are described by the authors in [START_REF] Pratim | A survey on Internet of Things architectures[END_REF]. It is composed of the following layers:

1. Perception/Action: It symbolizes the physical layer of objects that engage with the surrounding environment by gathering data and/or performing tasks. This layer encompasses objects equipped with computing and communication features, enabling them to interact with the external world. Those "Things" are usually equipped wit the following essentials properties:

• Communication: Objects can communicates with others and with different resources over the network

• Identification: Objects are uniquely identified • Actuating: Objects can interact with their environment.

• Computing: Objects can process information.

• Localization: Objects can be maped.

• User Interface: Objects can be interact with by human being.

Various technologies can be used to implement those properties [START_REF] Čolaković | Internet of Things (IoT): A review of enabling technologies, challenges, and open research issues[END_REF]. In table 2.1, we present example technologies for the different properties except the communication that will be explore more in depth on the network part.

Network:

The network layer's responsibility involves conveying the data collected at the perception level to the application layer or transmitting data from the application layer to the actuators or target services. This encompasses all the technologies and protocols essential for establishing this connection. It's important not to mistake this network layer with the one in the ISO/OSI model, which solely directs data through the network along the optimal route [START_REF] Riyadh Abdmeziem | Architecting the internet of things: state of the art[END_REF]. A wide variety of protocols are available for utilization in IoT. [START_REF]Global iot market to grow to 24.1 billion devices in 2030[END_REF][START_REF] William | Internet of Things: Business Economics and Applications[END_REF].

In terms of revenue, the collective IoT market was valued at USD 465 billion in 2019, a value that is expected to escalate to USD 1.5 trillion by 2030. The majority of expenditure, around 66%, will be allocated to services such as connectivity, while the remaining portion will be attributed to hardware, encompassing dedicated IoT devices, modules, and gateways.

The Agricultural IIoT sector is projected to encompass 4% of this market, equating to over USD 60 billion by 2030. Those statistics about the IoT market can be found in Figure 2.5.

. Agricultural Application

The realm of IoT applications spans across a multitude of industries, encompassing manufacturing, healthcare, transportation, energy, retail, smart cities, logistics, and home automation. In this context, our attention will be directed towards its specific application in agriculture. The research on farming industry is well-funded and in the middle of its most important transition toward sustainability. As a result, a multitude of IoT initiatives have emerged within this sphere, driven by research groups, companies, and individuals alike. Our aim is not to conduct an exhaustive examination of all IoT applications within the agricultural domain, as comprehensive surveys on this subject have already been conducted by the author in [START_REF] Rehman | A revisit of internet of things technologies for monitoring and control strategies in smart agriculture[END_REF][START_REF] Elijah | An overview of Internet of Things (IoT) and data analytics in agriculture: Benefits and challenges[END_REF][START_REF] Tzounis | Internet of Things in agriculture, recent advances and future challenges[END_REF][START_REF] Shoaib | A Survey on the Role of IoT in Agriculture for the Implementation of Smart Farming[END_REF]. Rather, our objective is to provide the reader with a concise overview of existing projects, facilitating a better understanding of the extensive array of potential applications within the realm of smart farming while outlining common limitations. We listed and compared some project in different application domains:

1. Irrigation management: The most prevalent application in agriculture is the control of irrigation. Reducing water supply to crops results in slower growth and diminished calcium absorption. Frequent irrigation leads to root decay and water wastage. As outlined by the UN Convention to Combat Desertification (UNCCD), around 168 countries are projected to confront desertification by 2030, with nearly 50% of the global population residing in regions experiencing significant water scarcity [START_REF] Bauer | The role of science in the global governance of desertification[END_REF]. Consequently, it becomes crucial to reduce agriculture's dependency on water resources through enhanced precision in its utilization.

To do so, farmers install drip irrigation systems to easily deliver water to each crop [START_REF] Van Der Kooij | The efficiency of drip irrigation unpacked[END_REF]. Those drip irigation system are now often managed through IoT, thefrore multiple research project have been conducted and the authors in [START_REF] Rajaram | IoT based crop-field monitoring and precise irrigation system using crop water requirement[END_REF][START_REF] Kansara | Sensor based automated irrigation system with IOT: A technical review[END_REF][START_REF] Jain | A survey of the automated irrigation systems and the proposal to make the irrigation system intelligent[END_REF][START_REF] Munoth | Sensor based irrigation system: A review[END_REF][START_REF] Garcıa | IoT-based smart irrigation systems: An overview on the recent trends on sensors and IoT systems for irrigation in precision agriculture[END_REF][START_REF] Kumar Rai | Planning and evaluation of irrigation projects: methods and implementation[END_REF] proposed good surveys of those projects. Based on sensors (local, like electronical soil moisture sensor, and remote like satellite imagery ), those platform can determine and send exact amount of water to each type of crops. One of the most basic example of such project have been implemented by the author in [START_REF] Kamaruddin | IoT-based intelligent irrigation management and monitoring system using arduino[END_REF], where they use arduino microcontroller, a capacitive soil moisture sensor and a cloud-based decision platform to manipulate an irrigation valve. More advanced application, like the one proposed by the author in , use AI and fuzzy logic algorithm to determine the water-need [START_REF] Santhana Krishnan | Fuzzy logic based smart irrigation system using internet of things[END_REF]. From our literature review we determined the following parameters to take in account for plant irrigation: Soil Moisture, Soil temperature, Soil type and structure, Air Temperature, Air humidity, Wind, Rain, Solar exposition, Satellite imagery, Weather forecast, type of plants, calendar, localization.

2. Soil management: Crops' growth heavily depends on soil fertility. Soil fertility is determined by the quantity and availability of specific nutrients in the soil [START_REF] John L Havlin | Soil: Fertility and nutrient management[END_REF], as well as its structure [START_REF] Lal | Soil structure and sustainability[END_REF]. Nutrients are minerals present in the soil that are essential for crop growth. A multitude of nutrients exist in various types (e.g., macro and micro), with Nitrogen (N), Phosphorus (P), and Potassium (K) being the most critical ones [START_REF] Epstein | Mineral nutrition of plants: principles and perspectives[END_REF].

Quantifying nutrient quantities in soil involves complex chemical analyses often requiring advanced lab equipment, such as spectrometers [START_REF] Bungau | Expatiating the impact of anthropogenic aspects and climatic factors on long-term soil monitoring and management[END_REF].

Soil structure involves arranging soil particles (e.g., sand, silt, clay, organic matter) into porous compounds, known as aggregates. These aggregates' arrangement, separation by pores and cracks, and composition influence soil structure. Soil structure also dictates its pH [START_REF] Kumar Rai | Planning and evaluation of irrigation projects: methods and implementation[END_REF]. Just as determining these characteristics often demands advanced laboratory tools, their monitoring is vital for informed decisions regarding fertilizer application, crop selection, and irrigation methods. Hence, research has explored IoT platforms for real-time soil condition monitoring.

Regarding nutrients, [START_REF] Sn Shylaja | Real-time monitoring of soil nutrient analysis using WSN[END_REF] and [START_REF] Sai | Proficient smart soil based IoT system for crop prediction[END_REF] proposed a Wireless-Sensor Network utilizing an electrochemical sensor to monitor N, P, and K levels. This system, after nutrient level determination, referes itself to databases of soil nutrient requirements for different crops at different growth stages, in order to suggest fertilizers application to attain ideal nutrient values. Authors in [START_REF] Madhumathi | Soil NPK and moisture analysis using wireless sensor networks[END_REF] employed a more precise colorimetry sensor for similar outcomes. Other researchers have introduced an X-Ray fluorescence approach based on a camera, enhancing nutrient assessment accuracy. This project uses AI to identify significant characteristics in camera images. AI also determines fertilizer levels and suggests efficient crop rotations, aiding soil fertility recovery between different cultures [START_REF] Swaminathan | IoT-driven artificial intelligence technique for fertilizer recommendation model[END_REF][START_REF] Blesslin | Machine Learning Algorithm for Soil Analysis and Classification of Micronutrients in IoT-Enabled Automated Farms[END_REF].

For pH measurement, real-time monitoring is also important. Researchers have developed IoT-based monitoring schemes, as seen in the works of [START_REF] Khatri | An IoT-based innovative real-time pH monitoring and control of municipal wastewater for agriculture and gardening[END_REF] and [START_REF] Archbold | pH measurement IoT system for precision agriculture applications[END_REF]. In contrast, soil structure monitoring in real time is less essential, as it generally remains constant over time [START_REF] Lal | Soil structure and sustainability[END_REF]. However, soil compaction, a significant issue linked to agriculture, affects soil structure. Highly compacted soil reduces fertility, hindering root development and nutrient/water uptake [START_REF] Lal | Tillage and agricultural sustainability[END_REF]. To detect and prevent soil compaction, various sensors, including mechanical ones, and IoT systems have been proposed [START_REF] Hemmat | Sensor systems for measuring soil compaction: Review and analysis[END_REF].

In conclusion, IoT proves to be an effective tool in preventing soil degradation, encompassing erosion, alkalization, acidification, salinization, and pollution [START_REF] Dhanaraju | Smart farming: Internet of Things (IoT)-based sustainable agriculture[END_REF].

Crop Diseases and Pest Control:

Usually, crop disease and pest detection are carried out by human operators since the primary information collected is visual. Farmers roam their fields, observe pests or diseases, and then implement corresponding countermeasures. These countermeasures can be categorized as organic, chemical, or mechanical. Organic approaches involve the use of sustainable substances to protect plants from threats. Conversely, chemical methods use products that may be more effective but are not sustainable. Mechanical countermeasures typically involve removing affected plants and surrounding vegetation to stop the spread of disease and pests [START_REF] Donatelli | Modelling the impacts of pests and diseases on agricultural systems[END_REF].

Regrettably, the agricultural workforce has significantly diminished over the past century. As a result, manual monitoring of all crops by farmers is no longer feasible [START_REF] Dimitri | The 20th century transformation of US agriculture and farm policy[END_REF]. Hence, current methods often involve preemptively applying chemical countermeasures before pests or diseases have a chance to develop, with the aim of preventing their emergence altogether. However, this strategy is unsustainable due to its reliance on fossil fuels, heavy machinery, and a large volume of environmentally harmful chemicals that are also limited in quantity on Earth. These tools also come with a significant economic cost. Moreover, there are growing concerns about the health and well-being of farmers and rural communities, as exposure to these chemicals can lead to diseases like cancer and developmental issues in children [START_REF] Nicolopoulou-Stamati | Chemical pesticides and human health: the urgent need for a new concept in agriculture[END_REF].

IoT can be a valuable tool for detecting and preventing the development of pests and diseases, and many projects have been developed in this domain. Comprehensive review papers on the topic have been authored by [START_REF] Liu | Plant diseases and pests detection based on deep learning: a review[END_REF][START_REF] Domingues | Machine learning for detection and prediction of crop diseases and pests: A comprehensive survey[END_REF][START_REF] Zhang | Monitoring plant diseases and pests through remote sensing technology: A review[END_REF]. There are different methods to detect diseases or pests, which can be direct or indirect. Indirect methods predict the risk of disease or pest development based on environmental parameters. For instance, models to detect conditions conducive to disease development in grapes based on temperature, humidity, and leaf wetness levels have been proposed by [START_REF] Suyash | Early detection of grapes diseases using machine learning and IoT[END_REF] and [START_REF] Trilles | Development of an open sensorized platform in a smart agriculture context: A vineyard support system for monitoring mildew disease[END_REF]. Similar approaches have been developed for strawberries [START_REF] Kim | IoT-based strawberry disease prediction system for smart farming[END_REF], general models for leaves [START_REF] Thorat | An IoT based smart solution for leaf disease detection[END_REF], cereal crops [START_REF] Zhang | Research on the monitoring system of wheat diseases, pests and weeds based on IOT[END_REF], and orchard monitoring [START_REF] Lee | Disease and pest prediction IoT system in orchard: A preliminary study[END_REF]. These methods often employ AI, machine learning, and knowledge engineering to identify patterns in environmental changes that lead to pest or weed development [START_REF] Kundu | IoT and interpretable machine learning based framework for disease prediction in pearl millet[END_REF][START_REF] Khattab | An IoT-based cognitive monitoring system for early plant disease forecast[END_REF]. Once a risk is identified, farmers are alerted but may still need to visit the field to confirm the presence of pests or diseases.

To mitigate this, drones, especially Unmanned Aerial Vehicles (UAVs), can be utilized [START_REF] Gao | A framework for agricultural pest and disease monitoring based on internet-of-things and unmanned aerial vehicles[END_REF]. Drones can independently survey fields, capturing images of crops to process with AI computer vision algorithms. Drones can either routinely monitor all crops [START_REF] Lottes | UAV-based crop and weed classification for smart farming[END_REF] or focus on areas deemed at risk by indirect methods [START_REF] Kitpo | Early rice disease detection and position mapping system using drone and IoT architecture[END_REF]. UAVs can also be programmed to apply localized countermeasures, such as spraying chemicals on affected crops and their immediate surroundings [START_REF] Achilles | Internet of things (IoT) and agricultural unmanned aerial vehicles (UAVs) in smart farming: A comprehensive review[END_REF]. Precision application methods have proven highly effective, allowing some farms to reduce chemical usage by up to 90% [START_REF] Khadatkar | Application of robotics in changing the future of agriculture[END_REF]. Finally, direct measurements can also be taken using static sensors, such as cameras placed around fields to capture images of crops and detect diseases, like in tomato fields [START_REF] Wang | Early real-time detection algorithm of tomato diseases and pests in the natural environment[END_REF], or microphone sensors designed to count insects [START_REF] Potamitis | Automated remote insect surveillance at a global scale and the internet of things[END_REF].

Crops Monitoring, Yield Forecasting and Harvesting time estimation:

Local sensors and remote observation enable farmers to monitor the growth process of their crops. By doing so, they can estimate future yield and determine the optimal harvesting time. Comprehensive studies on such applications have been conducted by the authors in [START_REF] Chamara | Ag-IoT for crop and environment monitoring: Past, present, and future[END_REF][START_REF] Sreekantha | Agricultural crop monitoring using IOT-a study[END_REF][START_REF] Cambra | An IoT service-oriented system for agriculture monitoring[END_REF].

In crop monitoring, the objective is to use available data to estimate the growth stage and health status of the plants. This not only allows farmers to predict yield and decide on the best harvesting time but also helps in managing resources like fertilizers and water. For instance, the authors in [START_REF] Tian | Apple detection during different growth stages in orchards using the improved YOLO-V3 model[END_REF] introduced an IoT platform utilizing a camera system and the machine learning computer vision algorithm YOLO [START_REF] Jiang | A Review of Yolo algorithm developments[END_REF] to oversee apple growth. If apples are deemed undersized for their growth period, the platform recommends fertilizer application. Once the apples are ready for harvest, an estimate of the available quantity is relayed to the farmer. The primary technology for sensing growth stages is camerabased. Cameras can be static sensor nodes or mounted on drones, typically UAVs [START_REF] Lottes | UAV-based crop and weed classification for smart farming[END_REF]. However, for observing extensive areas like wheat fields, remote sensing is often preferred. This is typically conducted by planes or satellites. With advanced imaging techniques, they can gauge the quantity and characteristics of plants in a field, such as type, growth stage, health, and harvesting time. Commonly, they utilize the NDVI index [START_REF] Toby | On the relation between NDVI, fractional vegetation cover, and leaf area index[END_REF]. The Normalized Difference Vegetation Index is a straightforward indicator used to determine if the observed area contains live green vegetation. Several other indices can be applied to crops, and an in-depth review on remote sensing technologies was presented by the authors in [START_REF] Wójtowicz | Application of remote sensing methods in agriculture[END_REF].

Regarding crop yield prediction, IoT platforms merge local and remote data to estimate the approximate quantity of produce available at har-vest. For example, the authors in [START_REF] Vannoppen | Estimating farm wheat yields from NDVI and meteorological data[END_REF] developed a system based on NDVI and meteorological data to predict wheat production in Europe, showing promising outcomes. Yield forecasts enable farmers to make informed decisions about the types of crops they should cultivate in specific environments. They can also assess the economic worth of a land parcel. Moreover, such forecasts assist agro-industry stakeholders in predicting required logistics and potential results [START_REF] Av Rozhkova | Artificial intelligence technologies in the agro-industrial complex: opportunities and threats[END_REF]. A detailed overview of methods for yield forecasting was provided by the authors in [START_REF] Van Klompenburg | Crop yield prediction using machine learning: A systematic literature review[END_REF], they mainly uses Machine learning algorithms to determine insightful paterns. Crops monitoring is the one of the application that is the most implemented industry-wise. Microsoft even propose its own platform FarmBeats for monitoring [START_REF] Vasisht | {FarmBeats}: an {IoT} platform for {Data-Driven} agriculture[END_REF] just as Amazon and its AWS platform.

Indoor farming and controlled environment agriculture

Indoor farming and controlled environment agriculture (CEA) refer to the cultivation of plants and crops in locations where environmental conditions-such as temperature, humidity, light, and CO2 concentration-are closely monitored and regulated, often independent of external weather conditions [START_REF] Benke | Future food-production systems: vertical farming and controlled-environment agriculture[END_REF]. This stands in stark contrast to traditional agriculture, which is heavily dependent on external climate conditions and seasonal changes [START_REF] Van Ginkel | Energy, water and nutrient impacts of California-grown vegetables compared to controlled environmental agriculture systems in Atlanta, GA[END_REF]. Indoor farming is often carried out in greenhouses, where sunlight is the primary light source. One of the principal advantages of indoor farming is its capacity for year-round production. Traditional outdoor farming is frequently at the mercy of unpredictable weather patterns and seasonal changes. By transitioning agriculture indoors, farmers can bypass these challenges, ensuring a consistent crop yield regardless of the time of year. Additionally, because indoor farming systems can be established virtually anywhere, including in urban settings [START_REF] Despommier | Farming up the city: The rise of urban vertical farms[END_REF], they can significantly reduce the need for transporting food over long distances, leading to fresher produce and decreased carbon emissions. For example, the city of Singapore is investing a considerable amount of money into this method [START_REF] Despommier | Vertical farms, building a viable indoor farming model for cities[END_REF]. Moreover, controlled environment agriculture could pave the way for opportunities in space travel and colonization [START_REF] Gerard | The colonization of space[END_REF].

Indoor farming uses substantially less water than its outdoor counterpart, especially when integrated with systems like hydroponics. Pesticides and herbicides, which are often concerns in traditional agriculture due to their environmental impact, can be minimized or even eliminated in a controlled environment because of the reduced risk of pests and diseases. Controlled environment agriculture is optimally managed by IoT devices, making it one of the most fitting use cases for this tech-nology. Temperature sensors, paired with air conditioning units, can ensure the correct temperature is maintained [START_REF] Ahmad | An intelligent IoTbased system design for controlling and monitoring greenhouse temperature[END_REF]. Ultra-Violet sensors can gauge the level of available light and control LED panels to provide the right amount of luminosity for the plants [START_REF] Marc W Van Iersel | Optimizing LED lighting in controlled environment agriculture[END_REF]. Comprehensive surveys on IoT projects concerning indoor farming have been proposed by various authors in [START_REF] Mccartney | Protected agriculture in extreme environments: a review of controlled environment agriculture in tropical, arid, polar, and urban locations[END_REF][START_REF] Redmond R Shamshiri | Advances in greenhouse automation and controlled environment agriculture: A transition to plant factories and urban agriculture[END_REF][START_REF] Shoaib | Internet of Things in Greenhouse Agriculture: A Survey on Enabling Technologies, Applications, and Protocols[END_REF].

However, the main limitations of indoor farming include its demand for vast amounts of energy and the need for complex infrastructure, which can make large-scale implementation challenging [START_REF] Despoina | How energy innovation in indoor vertical farming can improve food security, sustainability, and food safety?[END_REF]. Additionally, not all crops are suited for indoor growth. This is especially true for grain agriculture [START_REF] Benke | Future food-production systems: vertical farming and controlled-environment agriculture[END_REF].

Livestock management:

Livestock management is also improving through smart farming. Although animal product consumption should be reduced, as mentioned in the introduction chapter of this thesis, IoT offers various tools to assist farmers in managing cattle. Comprehensive surveys on IoT applications for livestock have been proposed by authors in [START_REF] Ijesunor | IoT technologies for livestock management: a review of present status, opportunities, and future trends[END_REF][START_REF] Shoaib | A survey on the role of iot in agriculture for the implementation of smart livestock environment[END_REF][START_REF] Iwasaki | IoT sensors for smart livestock management[END_REF]. The primary application is health monitoring of animals [START_REF] Gs Karthick | Internet of things in animal healthcare (IoTAH): review of recent advancements in architecture, sensing technologies and real-time monitoring[END_REF]. Using smart wearable tag sensors placed on cows, IoT platforms can monitor vital signs, such as body temperature or heartbeat, and alert the farmer if any anomalies, like fever, are detected [START_REF] Gokul | Implementation of smart infrastructure and non-invasive wearable for real time tracking and early identification of diseases in cattle farming using IoT[END_REF]. One of the earliest use-cases of IoT systems for smart farming applications was the use of GPS tracking collars for livestock. This allowed farmers to track the movement of their cattle herd and create virtual fences [START_REF] Butler | Virtual fences for controlling cows[END_REF]. The collar detects the GPS position of the animal and if it is in a prohibited area, sends a mild electric shock to guide the animal back to allowed zones. This approach not only allows farmers to manage their cattle without constructing extensive fence infrastructure but also enables them to dynamically modify the areas where they want their cattle to graze, potentially restricting certain zones to allow for grass regeneration. GPS collars can also be used to detect behaviors indicative of diseases, such as mastitis [START_REF] Feng | SocialCattle: IoT-based mastitis detection and control through social cattle behavior sensing in smart farms[END_REF] or even detect cattle theft in certain cases [START_REF] Dieng | A study on IoT solutions for preventing cattle rustling in african context[END_REF]. Another interesting application is the detection of estrus in female animals using machine learning [START_REF] Lee | IoT livestock estrus monitoring system based on machine learning[END_REF]. A valuable application is animal identification through facial recognition as proposed in [START_REF] Kumar | Cattle recognition: A new frontier in visual animal biometrics research[END_REF].

Overall, IoT can assist farmers in enhancing the well-being of their livestock, thereby producing higher-quality animal products. Regrettably, this facet of smart farming also encompasses darker applications such as Animal Factory management. An industrial livestock factory, often termed a factory farm or Concentrated Animal Feeding Operation (CAFO), is a massive industrial agriculture facility where numerous livestock are primarily raised for food production. These operations prioritize production output and efficiency, frequently at the expense of conventional farming practices or rigorous animal welfare considerations. Similarly to Controlled Environment Agriculture, IoT can be beneficial in such domains. For instance, to mitigate animal stress resulting from lifelong confinement in cramped indoor spaces, often devoid of natural light, authors in [START_REF] Ronaghi | Investigating the impact of economic, political, and social factors on augmented reality technology acceptance in agriculture (livestock farming) sector in a developing country[END_REF] have suggested virtual reality applications for cows and pigs to alleviate stress.

A noteworthy application of IoT related to animals is the monitoring and defense against wildlife. Outdoor fields frequently face threats from wild animals such as wild boars, deer, and foxes. IoT projects using computer vision have been developed to deter wild pigs when detected in the vicinity, employing alarms, as discussed by authors in [START_REF] Ojo | Network performance evaluation of a LoRa-based IoT system for crop protection against ungulates[END_REF]. Moreover, IoT can be utilized to monitor endangered species like birds, which can also serve as significant environmental indicators for agriculture, as elaborated upon in [START_REF] Santangeli | Integrating drone-borne thermal imaging with artificial intelligence to locate bird nests on agricultural land[END_REF].

Transport, storage and distribution:

The logistics of agricultural products after harvest fall outside the scope of this thesis, which exclusively addresses the farming processes within the agriculture industry. However, given that over a third of food produced is wasted [START_REF] Papargyropoulou | The food waste hierarchy as a framework for the management of food surplus and food waste[END_REF], enhancing the logistics of food distribution remains of paramount importance. IoT can also be employed to monitor storage, such as wheat silos [START_REF] Rathore | Blockchain-based smart wheat supply chain model in Indian context[END_REF], ensure the traceability of products through RFID [START_REF] Wasson | Integration of RFID and sensor in agriculture using IOT[END_REF], or even automate the purchasing process by restocking fridges when they are empty or lack certain types of food [START_REF] Edward | Smart fridge design using NodeMCU and home server based on Raspberry Pi 3[END_REF]. Comprehensive surveys on supply chain management of food products facilitated by IoT are provided by the authors in [START_REF] Yan | Information sharing in supply chain of agricultural products based on the Internet of Things[END_REF][START_REF] Yadav | Analysing challenges for internet of things adoption in agriculture supply chain management[END_REF].

Agroecology:

Agroecology integrates the science of ecology with agriculture to create resilient, sustainable farming systems. It emphasizes the relationship between plants, animals, humans, and the environment within agricultural landscapes, aiming to enhance biodiversity, improve soil health, and promote a balance between food production and ecosystem preservation. In other words, the principle of agroecology emphasizes the interactions among various stakeholders of a farm to ensure its long-term sustainability. This entails avoiding dependence on unsustainable methods such as the use of chemical inputs, heavily mechanized oil-powered machinery, and standardized crop strains commonly associated with monocropping techniques as mentioned in 1.1. However, adopting agroecological practices presents certain challenges. These include heightened sensitivity to environmental factors (for instance, crops may become more susceptible to drought if irrigation systems are avoided to prevent groundwater depletion and the resultant ecological concerns) and also a significant requirement for mechanical labor labor that is usually performed by human as oil-powered machine are not only unsustainable but also not effective for fields using monocropping for example) [START_REF] Altieri | Agroecology: the science of sustainable agriculture[END_REF]. Despite the two aforementioned drawbacks, agroecology, in certain scenarios, can be not only sustainable but also more productive per unit of land [START_REF] Fukuoka | The natural way of farming[END_REF]. Fundamentally, agroecology mirrors pre-industrial revolution agricultural practices, wherein farmers primarily relied on their local environment for food production [START_REF] Singh | Traditional agriculture: a climatesmart approach for sustainable food production[END_REF]. This paradigm has spurred significant research into smart farming, with the goal of producing efficient tools that facilitate the implementation of agroecology [START_REF] Walter | Smart farming is key to developing sustainable agriculture[END_REF]. The underlying rationale is straightforward: rather than employing smart farming tools to render unsustainable practices marginally more sustainable, it is preferable to use these tools to enhance the productivity of inherently sustainable agriculture. Several comprehensive surveys on smart farming tools tailored for agroecology have been conducted [START_REF] Bach | Sustainable agriculture and smart farming[END_REF][START_REF] Siti | Smart farming: towards a sustainable agri-food system[END_REF][START_REF] Agarwal | Sustainable Smart-farming framework: smart farming[END_REF]. Addressing the environmental sensitivity of agroecology, IoT platforms are ideally positioned, given their capacity to effectively interpret and forecast climatic scenarios using data harvested both locally and remotely. For instance, the authors in [START_REF] Schoenke | Gaia-AgStream: An Explainable AI Platform for Mining Complex Data Streams in Agriculture[END_REF] introduced AI algorithms designed to decipher intricate data streams from diverse agricultural sensors, leading to improved local farm climate predictions. These predictions can subsequently guide farming strategies and crop scheduling. Taking a more pragmatic stance, the authors in [START_REF] Zărnescu | Putting Internet-of-things at the service of sustainable agriculture[END_REF] developed and trialed an IoT platform named SysAgria on a farm. This system offers exhaustive, real-time environmental updates and development conditions across various phenological phases of crops, fruit trees, vines, and vegetables. These insights can shape sustainable proactive treatments, fertilization planning, and the scheduling of sowing and harvesting activities. Agroecology can also be realized within greenhouses to prolong the production season. Here again, IoT proves instrumental. As demonstrated by the work in [START_REF] Pradyumna | MyGreen: An IoT-enabled smart greenhouse for sustainable agriculture[END_REF], IoT can meticulously regulate greenhouse irrigation (sourced exclusively from rainwater collection on the greenhouse itself) while also managing airflow, temperature, and sunlight to preempt conditions conducive to disease propagation. Regarding the mechanical labor issue, better climate prediction can help manage human ressources to reduce it but the field of robotics is also a very well developped research domain within smart farming. Robotics is outside of the scope of this thesis but a good survey of robotic applications of smart farming have been conducted by the authors in [START_REF] Redmond R Shamshiri | Research and development in agricultural robotics: A perspective of digital farming[END_REF].

9. Small-Scale: As highlighted in 1.1, small-scale farms (SSFs), typically encompassing an area of less than 2 ha and characterized by limited incomes, constitute 80% of global farms, as illustrated in Figure 1.9. Despite this, much of the research in Smart Farming does not take these factors into account, with a majority of projects targeting larger agricultural operations [START_REF]Ending hunger: science must stop neglecting smallholder farmers[END_REF]. Notably, small-scale farms are often considered more sustainable than their larger counterparts [START_REF] Jouzi | Organic farming and small-scale farmers: Main opportunities and challenges[END_REF]. Analogous to agroecology, SSFs depend heavily on manual labor and are acutely vulnerable to climate change. In response, several IoT projects tailored to the needs of SSFs have been initiated. Comprehensive surveys on this subject have been conducted by the authors in [START_REF] Paul | A review of practice and implementation of the internet of things (IoT) for smallholder agriculture[END_REF]180,[START_REF] Mizik | Climate-smart agriculture on small-scale farms: A systematic literature review[END_REF]. Predominantly, we observed that projects designed for SSFs mirror those proposed for larger farms but with an emphasized commitment to technological accessibility. This entails cost-effective development, opensource publication, and user-friendly solutions catering to farmers less adept with technology. For instance, researchers at Dedan Kimathi University of Technology introduced a budget-friendly IoT platform to automate greenhouse operations for vegetable cultivation in Kenya [START_REF] Paul | Seeds of Silicon: Internet of Things for Smallholder Agriculture[END_REF]. On a broader scale, certain projects aim to shield farmers from climatic adversities such as floods. In Tanzania, the rainy season can trigger rapid river level rises and devastating floods. The devised IoT solution comprises solar-battery powered SONAR level sensors stationed at various river locations, linked via LoRa to several grid-connected gateways with cellular connectivity. If the sensors detect swift river level increments, an SMS-alert mechanism activates, prompting downstream farmers to extract river water to accommodate the impending upstream surge. A pivotal factor underpinning the success of this system is the fervent commitment of volunteers who coordinate activities, sustain the IoT framework, and facilitate workshops to engage local communities. This not only minimizes costs but also augments awareness regarding Smart Farming applications for SSFs [START_REF] Uwayisenga | IoT-based system for automated floodwater detection and early warning in the East Africa Region: a case study of Arusha and Dar es salaam, Tanzania[END_REF].

. Limitations

Despite its huge potential, IoT technology faces certain limitations regarding its technical implementation and its application to agriculture. Authors in [START_REF] Gubbi | Internet of Things (IoT): A vision, architectural elements, and future directions[END_REF] described the main issues in depth in their survey for more details. The main limitations of IoT are the following:

• Network and communication: IoT devices require a reliable communication medium to transmit and receive data. While wired connections offer the highest reliability in data transmission, the necessary infrastructure is often incompatible with many applications. Consequently, most IoT devices utilize wireless networks. However, wireless commu-nication presents challenges. Firstly, devices must be within an area with network coverage, necessitating a specific gateway infrastructure. Secondly, IoT devices are typically deployed in large numbers within confined areas. This high density can lead to Quality of Service (QoS) issues, which undermine the reliability of a platform, especially when latency is a critical criterion. Various protocols at various layers of the communication stack are tailored to different applications, and a concise survey of these has been presented by the authors in [START_REF] Al-Sarawi | Internet of Things (IoT) communication protocols[END_REF]..

• Processing power: The logical component responsible for processing on the devices is typically a microcontroller with limited computational power. While this reduces both cost and energy consumption, such processing units are not capable of implementing complex algorithms. As a result, there is a heightened reliance on the cloud computing capabilities of IoT platforms, which in turn increases communication requirements, as highlighted by the authors in [START_REF] Firouzi | The convergence and interplay of edge, fog, and cloud in the AIdriven Internet of Things (IoT)[END_REF].

• Energy consumption: Devices are typically battery-powered since a wired connection can lead to excessive infrastructure costs. This necessitates the devices to be optimized to run for multiple years without the need for battery replacement. As a result, energy consumption becomes a pivotal criterion for IoT devices. Factors that influence energy consumption include computation time, type of communication, and its duration. Wireless transmission is often the primary energy-consuming activity, depending on the protocol used [START_REF] Georgiou | The IoT energy challenge: A software perspective[END_REF]. It's also worth noting the emergence of organically powered batteries like BeFC, which utilize glucose to generate electricity [187]. These batteries are fully biodegradable and sustainable, but they offer only limited energy, making them suitable only for energy-efficient systems. Conversely, efforts have been made to equip IoT devices with energy harvesting components that tap into the energy available in their environment, such as vibrations [START_REF] Sanislav | Energy harvesting techniques for internet of things (IoT)[END_REF].

• Data Storage: IoT platforms produce vast amounts of data. This necessitates dedicated storage infrastructure and efficient management [START_REF] Shruti | Study of IoT: understanding IoT architecture, applications, issues and challenges[END_REF].

• Data interpretation: Depending on the application domain, interpreting vast amounts of diverse data can be challenging. The decision-making component of an IoT platform must be efficient enough to deliver impactful results for its intended domain. While decision algorithms can be as basic as conditional statements like "if/else," it is more beneficial for the platform to incorporate domain-specific knowledge to make more insightful decisions [START_REF] Wang | Knowledge representation in the internet of things: semantic modelling and its applications[END_REF].

• Security and Privacy: Many IoT devices lack adequate security protocols, often due to limited computational power, rendering them vulnerable to breaches, particularly to "man-in-the-middle" attacks during firmware updates. As the number of devices multiplies, the potential attack surface expands exponentially. Beyond security issues, privacy remains a significant concern. Continuous data collection by devices raises alarms about surveillance, personal privacy, and the broader societal implications of such an interconnected world. Consequently, safeguarding this data's privacy is crucial. If the data isn't encrypted or securely stored, it becomes an enticing target for hackers [START_REF] Yang | A survey on security and privacy issues in Internet-of-Things[END_REF].

• Interoperability: Many IoT devices are manufactured by different companies using various standards. This can lead to devices being incompatible with one another. Same issue with communication protocols as their multiplicity can be difficult to manage. Without a unified standard, integrating different devices to work seamlessly in an ecosystem can be challenging [START_REF]IoT architecture challenges and issues: Lack of standardization[END_REF].

• Cost: The cost for setting up the necessary infrastructure for IoT, such as sensors, networks, storage, and processing units, can be expensive.

It is important that IoT systems offers a economically viable implementation for companies. In addition to the setup expenses, there are maintenance costs to consider. Over time, devices might require updates, repairs, or replacements, all of which contribute to the cumulative expenses [START_REF] Nicolescu | Mapping the values of IoT[END_REF]. Furthermore, the environmental cost should not be overlooked. As the number of devices grows, so does electronic waste.

Proper disposal becomes a concern [START_REF] Arshad | Green IoT: An investigation on energy saving practices for 2020 and beyond[END_REF].

• Regulation: Different countries have different regulations concerning data privacy, device standards, wireless communication bandwidth etc. Ensuring compliance across regions can be complex. In addition there is liability issues. If an IoT device fails and causes harm or damage, determining liability can be complex [START_REF] Spyros | Ethics and law in the internet of things world[END_REF].

In the context of agriculture, IoT faces unique challenges as exposed by the authors in [START_REF] Abbasi | Internet of Things in agriculture: A survey[END_REF][START_REF] Ahmed | Internet of Things (IoT) for smart precision agriculture and farming in rural areas[END_REF].

On the hardware side, the often remote and open nature of farming environments can result in connectivity issues, particularly in vast rural fields where network access may be inconsistent. Devices might be situated in locations that are difficult to access, especially during the growing season (consider a sensor placed in the midst of a cornfield). Consequently, it's vital to ensure their reliable operation over extended periods, which predominantly hinges on efficient energy management. Furthermore, basic environmental sensors (like those for temperature, wind speed, and rainfall) may not provide sufficiently insightful data. Computer vision algorithms, while effective for various applications, demand increased computational power, which augments the reliance on cloud computing and communication -this, in turn, can drain batteries more rapidly. Lastly, agricultural IoT devices are subject to the rigors of the elements, necessitating durable, weather-resistant designs.

On the software side, decision-making algorithms must process and interpret a broad spectrum of environmental data. Making sense of this data with rudimentary algorithms can be challenging. For instance, the irrigation system described in part 1.1 and illustrated in figure 1.6 operates the water valve based solely on readings from a soil moisture sensor. This approach is suboptimal since irrigation procedures should also account for current and forecasted weather, soil type, crop variety, calendar, sun exposure, sensor type, manufacturer, firmware version, and more. This diverse range of factors complicates the decision-making process.

Additionally, the upfront costs and specialized expertise needed to deploy IoT systems can be prohibitive for farmers with limited resources. Tackling these agriculture-specific challenges is crucial to fully harness the potential of IoT in smart farming.

Moreover, the initial investment and technical know-how required for implementing IoT systems can be a barrier for resource-constrained farmers. Addressing these agricultural-specific limitations is essential to fully unlock the benefits of IoT in Smart farming.

. Amelioration axes

All the mentioned limitations have a range of proposed solutions that are described in the associated cited papers. In this thesis, the focus is directed towards optimizing the energy efficiency of sensors and deploying a knowledgebased decision system. This system is designed to make the sensors last as long as possible and to take the best judgments, considering both the data from sensors and the principles of agroecology farm management. Initially, energy efficiency is tackled in a conventional manner by adopting dedicated wireless communication protocols. The objective then shifts to bypassing the cloud for executing complex algorithms, such as computer vision, in order to reduce the substantial energy costs associated with data transfer. To achieve this, a new AI domain termed "Embedded AI" [START_REF] Zhang | A Review of Artificial Intelligence in Embedded Systems[END_REF] seeks to bring computational processes directly to the end devices, thus eliminating data transfer and enhancing privacy concurrently. Finally the aim is to employ knowledge engineering to assist the system in making the most informed decisions, especially regarding Agroecology which is a complex field with a vast amount of parameters to take in account. Consequently, these three areas-energyefficient wireless sensor communication, Embedded AI, and knowledge engi-neering-are the focal points of the subsequent sections in this state-of-theart review.

. Energy efficient Wireless Sensor Network

. Definition

A Wireless Sensor Network (WSN) is a collection of spatially distributed sensors that cooperate to monitor physical or environmental conditions, such as temperature, sound, images, pressure, humidity, etc. These sensors can autonomously communicate the information through wireless protocols to a main location (typically a gateway or base station) which then processes the data towards an application server, either locally or in the cloud, for the data to be exploited. Even though we focus on the sensors in WSNs, from the IoT point of view, actuators are also to take in account as wireless nodes on the networks as their communications will also weight on the network behavior. Good reviews and architectural descriptions have been proposed by the authors in: [START_REF] Kocakulak | An overview of Wireless Sensor Networks towards internet of things[END_REF][START_REF] Bouchemal | A survey: WSN heterogeneous architecture platform for IoT[END_REF][START_REF] Sr | Applications of wireless sensor networks-A survey[END_REF]. A typical layout of multiple wireless sensor network is depicted in figure 2. [START_REF] Nicolopoulou-Stamati | Chemical pesticides and human health: the urgent need for a new concept in agriculture[END_REF] where we can see the different components: typically equipped with a radio transceiver, a microcontroller, an interfacing circuit, and an energy source, usually a battery. In addition there is a sensory part that captures the data from the environment (such as camera, temperature probe, etc.) and/or an actuators such as a light or a motor.

• Base Station/Gateway: This is the component that gathers data from the sensor nodes, processes it, and might forward the data to other networks (like the internet). The base station is typically more powerful in terms of computational capabilities and energy than the individual sensor nodes. It can also be called sink.

• Application server: The Application server (or servers) is the end point of the data where they are processed and analysed to produce interesting output. It can be located on the local network of the WSN or in the cloud.

A WSN has also various core characteristics :

• Wireless Communication type: Nodes communicate with each other or with a base station through wireless protocols. There is a variety of protocols available with different pros and cons regarding the network characteristics. One one or more wireless protocols can be used depending on the nodes, thus creating heterogeenous WSN. We will be describing those protocols more in details in part ??.

• Quality of Service (QoS) [START_REF] Asif | Quality of service of routing protocols in wireless sensor networks: A review[END_REF]: It refers to the set of techniques and mechanisms used to manage network resources, ensure the performance, reliability, and priority of specific data flows, and meet the requirements of different types of network traffic. It also measures key network performance metrics. The main components of QoS are:

-Bandwidth: Refers to the maximum rate of data transfer across a network path. QoS can allocate specific bandwidth amounts to different types of traffic to ensure smooth flow.

-Latency: The time it takes for a packet to travel from source to destination.

-Packet Loss percentage: Refers to the number of packets that are sent but never arrive at their destination. This can happen due to network congestion, faulty hardware, or other issues.

-Signal to Noise Ratio (SNR): In communication, SNR is a measure used to describe the level of a desired signal to the level of background noise. It represents how much the intended signal stands out from unwanted background noise. A higher SNR indicates a clearer and better-quality signal, while a lower SNR suggests that the signal is harder to distinguish from the noise.

-Jitter: Variation in the delay of received packets. Real-time voice and video communication can be seriously affected by high jitter values, as it results in choppy or disrupted streams but this is less important for nodes in a WSN.

-Congestion and traffic management: These mechanisms control the rate of traffic flow. Policing drops or marks packets that exceed a specified rate, while shaping buffers and delays excess packets to fit within a defined rate. During peak times, a network might experience congestion. QoS mechanisms help in managing this congestion, ensuring that priority traffic gets through while lowerpriority traffic might be queued or even dropped.

• Topology [START_REF] Soparia | A survey on comparative study of wireless sensor network topologies[END_REF]: Depending on the application and network design, WSNs can take on different topologies. The most common ones for WSNs are star, tree, or mesh topologies and are depicted in figure 2.7. -Tree topology: A tree topology is a hierarchical structure that organizes nodes in a parent-child relationship, resembling the structure of a tree. At the top, there's typically a single node, often referred to as the coordinator, root or base station. Each node, except the root, has one (and only one) parent node and zero or more child nodes and the nodes that have child nodes are referred to as interior nodes, while nodes without any children are called leaf nodes or leaves. The processing power and energy consumption is highest at the root node and keeps on decreasing as we go down the hierarchical order. Tree topologies are especially suitable for applications where data is collected in a hierarchical manner but are susceptible to failure as if an interior node fails, all of its child nodes can lose connectivity to the root.

-Mesh topology: In a mesh topology, every node not only transmits its own data but also functions as a relay for data from other connected nodes. There are two types of mesh topologies: Fully Connected Mesh and Partially Connected Mesh. In the fully connected mesh topology, every node is connected to every other node. Conversely, in the partially connected mesh topology, a node is connected only to one or more neighboring nodes. Mesh networks offer several advantages. First, they allow for network coverage expansion without the need for costly gateways, relying instead on nodes that can also function as relays. Secondly, if a relay node or gateway fails, the network can reconfigure its routes to continue transmitting messages. The issue is the increased energy consumption of certain nodes that will have to perform networking task even when not in use for their primary role (sensing or actuating).

• Scalability [START_REF] Swati | A review on scalability issue in wireless sensor networks[END_REF]: WSNs can range from a few to thousands of nodes. It's crucial for the network's design to handle this variability in size to insure the quality of service. Not every wireless protocols is fitted for every types of nodes density.

• Security [START_REF] Lee | Security and privacy in wireless sensor networks: Advances and challenges[END_REF]: WSNs are vulnerable to various security threats due to their inherent characteristics such as wireless communication, limited resources, and distributed deployment. Such threats must be addressed to insure the good behavior of the network.

• Addressing [START_REF] Vilas | A review on efficient routing techniques in wireless sensor networks[END_REF]: Addressing in WSN is a critical issue due to the limited resources of the nodes and the dynamic nature of the network. Each node in the network requires a unique identifier, called an address, to enable communication with other nodes in the network. One of the main challenges in addressing WSN is the limited address space. Due to the large number of nodes and the limited memory and processing power of the nodes, addressing schemes in WSN need to be designed to use as few bits as possible while still providing a unique address to each node. Another challenge is the dynamic nature of the network. Nodes in the network may move or fail, causing changes in the network topology. This can lead to problems with address assignment and resolution, which can result in communication failures or increased latency.

• Firmware update [START_REF] Kerliu | Secure over-the-air firmware updates for sensor networks[END_REF]: Firmware updates WSNs can be challenging due to the limited resources of the sensor nodes and the distributed nature of the network. Firmware updates are necessary to improve the functionality and security of the network and to address bugs and vulnerabilities. However, updating firmware in WSNs requires careful consideration of several issues. One of the main challenges is the limited storage and processing power of the sensor nodes. Firmware updates typically require significant amounts of memory and processing power, which can be a problem for resource-constrained nodes. Updating firmware on all nodes in the network can also consume a significant amount of network bandwidth and energy, leading to network congestion and reduced network lifetime. Another challenge is the distributed nature of WSNs. Sensor nodes are typically deployed in remote and hard-to-reach locations, making it difficult to update firmware on all nodes simultaneously. This can result in inconsistency in the firmware versions across the network, which can lead to compatibility issues and communication problems. To address these challenges, various approaches have been proposed for firmware updates in WSNs. These include incremental updates, where only the parts of the firmware that have changed are updated, and delta encoding, where only the differences between the current and new firmware versions are transmitted. These approaches can reduce the amount of memory and bandwidth required for firmware updates. Another approach is to use over-the-air programming (OTA), which allows firmware updates to be transmitted wirelessly to the sensor nodes. OTA updates can be more efficient than physically updating each node and can be done remotely, reducing the need for on-site maintenance.

• Cost [START_REF] Klerkx | A review of social science on digital agriculture, smart farming and agriculture 4.0: New contributions and a future research agenda[END_REF]: Cost is a significant issue in WSNs due to the large number of nodes that are typically deployed and the limited resources of the nodes. One of the main cost factors in WSNs is the cost of the sensor nodes themselves. Sensor nodes can vary in cost depending on the type of sensor used, the processing power, and the communication capabilities. Deploying a large number of nodes can quickly become expensive, making it challenging to deploy WSNs on a large scale. Another cost factor is the cost of maintaining the network. WSNs typically require ongoing maintenance, including battery replacements, firmware updates, and physical repairs. Maintaining a large number of nodes can be challenging and costly, especially in remote or hard-to-reach locations. Additionally, the cost of data storage and processing can be significant in WSNs. Sensor nodes generate a large amount of data, and processing this data in real-time can be computationally intensive. Storing and processing this data requires specialized hardware and software, which can be expensive.

Finally, we emphasize the energy consumption of such networks. WSNs must be energy-efficient as devices run on batteries and need to last extended periods of time. An energy-efficient WSN prioritizes the battery lifespan of the device, often at the expense of data rate, range, quality of service, etc. A good survey on energy management methods in WSNs have been proposed by the authors in [START_REF] Junaid Ahmed Khan | Energy management in wireless sensor networks: A survey[END_REF].

. WSN communication protocols

Wireless communication refers to the transfer of information or data between devices or systems without the use of physical connections, such as wires or cables. Instead, wireless communication utilizes electromagnetic waves, which include radio frequencies, infrared signals, microwaves, and other forms of electromagnetic radiation. In WSNs, when we talk about communication protocols we refer to the overall communication stacks as described in the OSI and TCP/IP model and not only the wireless physical transmission of data. The OSI (Open Systems Interconnection) model is a conceptual framework used to understand how different networking protocols interact across diverse networking infrastructures [210]. Developed by the International Organization for Standardization (ISO) in the late 1970s, the model defines a set of seven layers, where each layer represents a specific set of functions necessary for communication systems. These layers range from the physical hardware components used to transmit bits over a medium to high-level data formatting and presentation. The key idea behind the OSI model is that different networking tasks are compartmentalized into specific layers, allowing for modularity and making it easier to understand and troubleshoot network operations. The TCP/IP model, sometimes called the Internet protocol suite, is the foundation for modern internet communication [START_REF] Parziale | TCP/IP tutorial and technical overview[END_REF]. Developed also in the 1970s by the U.S. Department of Defense, it has become the dominant framework for networked communication. Instead of the seven layers in the OSI model, the TCP/IP model consists of only four layers. These layers are more broadly defined than the OSI layers, making the model less granular but more aligned with actual protocol design and implementation. While it's not entirely accurate to say the TCP/IP model was "derived" from the OSI model, there's a general understanding that the design of the OSI model influenced the articulation and documentation of the TCP/IP model. The latter was developed before the OSI was standardized but was formally documented afterward. The TCP/IP model can be mapped to the OSI model's layers, even though they don't align perfectly. This mapping is often used in teaching and discussing network protocols to show the equivalences and differences between the two model. Those aligments are described in figure 2 In the following section, we will describe the main protocols used in the domain of IoT for the different layers of the TCP/IP model. As mentioned previously, there is no standard for all IoT applications; thus, there is a vast array of protocols available that address various issues. Our goal here is not to provide a comprehensive survey for each layer, but we will mention reliable sources for in-depth surveys for each layer and describe the primary protocols.

• Application layer [START_REF] Kumar | Survey on recent advances in IoT application layer protocols and machine learning scope for research directions[END_REF]: It is the the topmost layer, and it provides the interface between the user's application and the network. It deals with end-user services and facilitates communication between software and lower layers of the TCP/IP model. The four main protocols in the IoT domain at this layer are:

-MQTT (Message Queuing Telemetry Transport) [START_REF] Hunkeler | MQTT-S-A publish/subscribe protocol for Wireless Sensor Networks[END_REF]: It was, introduced in 1999, stands as one of the pioneering M2M communication protocols. Andy Stanford-Clark from IBM and Arlen Nipper from Arcom Control Systems Ltd (now Eurotech) were the brains behind its development. This protocol operates on a publish/subscribe mechanism, tailored for efficient M2M communication in bandwidthlimited environments. Within this system, an MQTT client sends messages to an MQTT broker. Other clients can then subscribe to these messages or even store them for future access. Messages are directed to specific addresses called topics, and a client can subscribe to multiple topics, receiving all messages associated with each one. MQTT operates as a binary protocol, typically featuring a 2-byte fixed header, and can handle message payloads up to a maximum of 256 MB. It employs TCP for transport and fortifies security using TLS/SSL. Hence, the communication between the client and the broker remains connection-based. A standout feature of MQTT is its three-tiered Quality of Service (QoS) ensuring message delivery reliability. It's ideal for extensive networks with numerous small devices requiring back-end internet server monitoring or control. However, MQTT isn't designed for direct device-to-device transfers or broadcasting data to a multitude of receivers. Its design is fundamental, presenting only a limited set of control features.

-CoAP (Constrained Application Protocol) [START_REF] Shelby | The constrained application protocol (CoAP)[END_REF]: It originates from the IETF CoRE (Constrained RESTful Environments) Working Group and serves as a streamlined M2M protocol. It is designed to facilitate both request/response and resource/observe models, which is akin to a publish/subscribe system. CoAP's primary aim is to function alongside HTTP and the RESTful Web, enabled by straightforward proxies. In contrast to MQTT's topic-based approach, CoAP employs Universal Resource Identifiers (URIs). In this system, publishers dispatch data to URIs, while subscribers align themselves with specific resources defined by these URIs. When publishers push new data to a URI, every subscribed party receives a notification regarding the updated URI value. CoAP operates as a binary protocol, typically having a 4-byte fixed header. Its message payload sizes are contingent on the web server or the underlying programming framework. CoAP's foundation is built upon the UDP transport protocol and it adopts DTLS for its security measures. As a result, communication between clients and servers occurs through connectionless datagrams, which might compromise reliability. However, to address this, CoAP introduces two distinct QoS levels via "confirmable" and "non-confirmable" messages. Receivers must acknowledge "confirmable" messages with an ACK packet, whereas "non-confirmable" messages don't demand any acknowledgment. CoAP provides a richer feature set compared to MQTT. For instance, it incorporates content negoti-ation, enabling clients to specify how they'd prefer a resource to be represented. This flexibility ensures that both client and server can evolve separately, allowing for the introduction of new representations without causing mutual disruptions.

-AMQP (Advanced Message Queuing Protocol) [START_REF] Vinoski | Advanced message queuing protocol[END_REF]: AMQP is a lightweight M2M protocol formulated by John O'Hara at JPMorgan Chase in London, UK, back in 2003. Designed with a corporate mindset, its architecture prioritizes elements like reliability, security, provisioning, and interoperability. AMQP can cater to both request/response and publish/subscribe models, offering a plethora of messagingassociated features like reliable queuing, topic-based messaging, flexible routing, and transactions. Central to AMQP's communication mechanism is the concept of an "exchange." Either the publisher or the consumer has to establish this "exchange" by naming it and then circulating this name for discovery purposes. Following this, the consumer crafts a "queue" and immediately links it to the created exchange. For a message at the exchange to reach its intended destination, it undergoes a "binding" process to match with the right queue. There's versatility in how AMQP can distribute messages -directly, via fanout, based on topics, or leaning on headers. AMQP's structure is rooted in a binary protocol, typically showcasing an 8-byte fixed header. The message payload sizes, though, vary depending on the broker/server or the development framework in place. By default, AMQP relies on TCP for transportation, supplementing its security using TLS/SSL and SASL. Communication in this system is connection-driven, between the client and the broker. One of AMQP's cornerstone features is its reliability. To this end, it provides two foundational QoS levels for message delivery: the Unsettle Format, which isn't inherently reliable, and the Settle Format, which ensures reliability.

-HTTP (HyperText Transfer Protocol) [START_REF] Wukkadada | Comparison with HTTP and MQTT in Internet of Things (IoT)[END_REF]: HTTP, primarily known as a web messaging protocol, was an original creation of Tim Berners- The choice between one protocol and another is typically determined by various factors such as message size, resource requirements, power consumption, latency, bandwidth availability, and reliability. Authors in [START_REF] Naik | Choice of effective messaging protocols for IoT systems: MQTT, CoAP, AMQP and HTTP[END_REF] have proposed a method to decide based on these criteria.

• Transport Layer [START_REF] Shang | Challenges in IoT networking via TCP/IP architecture[END_REF]: The transport layer in the TCP/IP model serves as the mediator for end-to-end communication between devices on a network. It manages the transmission of data, ensuring that the information sent from a source device is accurately received by the destination device. By doing so, the transport layer facilitates seamless communication and data integrity across the network, irrespective of the underlying physical infrastructure or the geography between the communicating devices. Two of the most well-known transport layer protocols are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).

-TCP (Transmission Control Protocol): TCP is a connection-oriented protocol, which means that it establishes a dedicated communication path between two devices before data transfer begins. This protocol ensures the reliable delivery of data packets by sequencing them and requiring acknowledgments for received packets. If an acknowledgment isn't received within a certain timeframe, TCP assumes the packet was lost and resends it. The primary advantage of TCP is its reliability: TCP ensures that data packets are delivered to the receiver in the correct order and without errors. Lost packets are retransmitted. However, from an IoT perspective, a drawback is that establishing a TCP connection is more complex, leading to more data transmission and subsequently increased energy consumption.

-UDP (User Datagram Protocol): Unlike TCP, UDP is a connectionless protocol. It sends data without establishing a dedicated end-toend connection. There's no guarantee that the packets sent will reach their destination or that they will do so in the correct order. However, this means that UDP has lower overhead and can deliver data faster. UDP is suitable for situations where speed is a priority over reliability, like streaming audio or video where occasional packet loss might be acceptable. Despite UDP being faster and simpler, its unreliability makes its implementation complex in WSN scenario where nodes needs to be sure that their data is transmitted.

In conclusion, TCP might be preferred for applications where data reliability and integrity are crucial, such as firmware updates, critical sensor data transmission, or device management. UDP might be more suitable for scenarios demanding real-time data delivery with minimal overhead, such as periodic telemetry from sensors, real-time monitoring, or multimedia streaming in IoT contexts. • Network Interface/Wireless communication: The network interface layer in the TCP/IP model, also known as the link or physical layer in other models, is responsible for the direct transmission of data between two devices on the same network. It deals with the physical connection, ensuring that data packets are placed onto the network medium and are received from it, converting the data between the packet format and the format suitable for the transmission medium, be it wired or wireless. This layer also manages error detection and correction for data being transmitted and received. The network interface layer handles the specific requirements of different communication technologies used in IoT, such as low power consumption for battery-operated devices or the ability to function in challenging environments. The wireless communication process in WSNs is the most energy costly as explained in [START_REF] Feng | A survey of energy-efficient wireless communications[END_REF]. In terms of wireless communication we make the distinction between Personal Area Network (PAN), Local Area Netwok (LAN) or Wide Area Network (WAN).

A PAN is a network for personal devices, typically covering a short range, usually less than 100m, like within the proximity of an individual. Famous PAN used in Wireless IoT communications are:

-Bluetooth Low Energy (BLE) [START_REF] Nair | Optimizing power consumption in iot based wireless sensor networks using Bluetooth Low Energy[END_REF]: BLE, or Bluetooth Low Energy, is a wireless communication protocol designed for short-range communication between devices while consuming significantly less power than classic Bluetooth. It also using the 2.4 GhZ frequency band.

Originally introduced as part of the Bluetooth 4.0 standard, BLE is optimized for situations where battery life is crucial, making it an ideal choice for many IoT devices. Due to its low power consumption, devices using BLE can operate for long periods, sometimes even years, on tiny coin-cell batteries -RFID (Radio Frequency Identification) [START_REF] Finkenzeller | RFID handbook: fundamentals and applications in contactless smart cards, radio frequency identification and nearfield communication[END_REF]: RFID, or Radio-Frequency Identification, is a technology that uses electromagnetic fields to identify and track tags attached to objects. These tags contain electronically stored information. Unlike barcodes, which require direct line-of-sight for scanning, RFID tags can be read through various materials from a distance. There are two primary types of RFID tags: passive tags, which have no internal power source and draw power from the RFID reader's electromagnetic waves, and active tags, which have their own power source, usually a battery, enabling them to transmit data over longer distances and even initiate communication. The data capacity, read range, and frequency band (commonly low, high, or ultra-high frequency) of RFID tags can vary. This technology is widely used in numerous applications like supply chain management, asset tracking, and access control due to its ability to operate without direct contact, thereby offering efficient and streamlined tracking and identification.

-NFC [START_REF] Lazaro | A survey of NFC sensors based on energy harvesting for IoT applications[END_REF] -Cellular Networks [START_REF] Vaezi | Cellular, wide-area, and non-terrestrial IoT: A survey on 5G advances and the road toward 6G[END_REF]: Traditional cellular networks (like 3G, 4G, and the emerging 5G) are being used for IoT devices that require higher data rates and broad geographic coverage. The introduction of 5G, in particular, promises to enhance IoT with faster speeds and lower latencies. A significant limitation of cellular networks is their dependence on Internet Service Provider (ISP) companies, which are responsible for establishing network coverage through dedicated infrastructure. Additionally, they can have considerable energy demands and necessitate the use of licensed frequency bands, which implies extra costs for network access. The cost consideration becomes critic when managing an IoT fleet comprising thousands of devices. Paying for individual network plans for each device could become financially untenable.

-Satellite Communication [START_REF] Centenaro | A survey on technologies, standards and open challenges in satellite IoT[END_REF]: Satellite communication in the realm of IoT involves using satellites to enable and ensure connectivity for IoT devices, especially in locations where traditional networks might not reach such as deep-sea vessels, forested areas, or desert regions. Despite its vast coverage, satellite communication comes with its own set of challenges. First and foremost, the cost can be substantially higher than conventional connectivity methods. Setting up the necessary infrastructure, such as satel-lite and related equipment, can be expensive, therefore, the cost of access to such service might be high and in a similar way as cellular networks, can be prohibitive in case of large IoT Fleet. Additionally, the latency in satellite communication can be higher than terrestrial networks, meaning there can be a noticeable delay in transmitting and receiving data. This can be an issue for applications that demand real-time responses. The data rates might also be lower compared to more traditional communication methods, limiting the amount of data or the speed at which it can be transferred.

-WiMAX (Worldwide Interoperability for Microwave Access) [START_REF] Syed | WiMAX: applications[END_REF]: It is s a wireless broadband technology designed to provide high-speed internet access over long distances. Essentially, it's an alternative to cable and DSL internet services but operates over a wireless link. One of WiMAX's core technical characteristics is its ability to provide broadband connectivity over a wide area, potentially covering several kilometers, making it particularly suitable for remote or underserved regions. Operating in the microwave part of the radio spectrum, typically between 2 and 66 GHz, WiMAX can offer speeds comparable to traditional broadband services. It utilizes a technology called Orthogonal Frequency-Division Multiple Access (OFDMA) to efficiently use bandwidth and cater to multiple users. This ensures a steady and reliable connection, even when many users are accessing the network. It's also worth noting that WiMAX supports both point-to-point and point-to-multipoint access modes, which offers flexibility in how the network can be deployed and used. However, the use of WiMAX for IoT comes with certain drawbacks. Firstly, even though WiMAX can cover several kilometers, it doesn't match the widespread coverage of cellular networks, which are more prevalent. Additionally, setting up WiMAX infrastructure can be expensive, especially when considering the costs of base stations and other associated equipment. Being a line-of-sight technology, WiMAX can experience issues with interference from physical obstacles, especially in urban environments with tall buildings. This can affect signal quality and reliability. Finally WiMAX, in many parts of the world, hasn't seen the level of adoption that technologies like LTE or even 5G have. As a result, the ecosystem, in terms of devices, integration, and support, might not be as robust as those for more prevalent technologies.

-LPWAN (Low Power Wide Area Network) [START_REF] Raza | Low power wide area networks: An overview[END_REF]: These networks are designed for long-range communications and consume minimal power, at the expense of data rate. They are particularly well-suited for IoT applications, and therefore will be the focus of the next section. To conclude this section, based on our state-of-the-art study and as showned by the authors in [START_REF] Ml Liya | A survey of LPWAN technology in agricultural field[END_REF], we assert that LPWANs are the most effective wireless communication method for agricultural scenarios. Therefore, their technical specifics, applications, limitation and opportunities will be explained in greater depth in the following sections. However, we can already explain that the choice of LPWAN was made for the following reasons:

1. Vast coverage Area: Agricultural farms and fields are typically spread across vast areas, often in remote regions. Traditional wireless networks might not provide coverage in these areas. LPWANs, on the other hand, are designed to provide wide coverage, often spanning several kilometers. This means a single LPWAN base station can potentially cover an entire farm or even multiple farms.

Low Power Consumption:

Sensors in agricultural settings might be deployed in areas where it's challenging to frequently replace batteries or provide a consistent power source. LPWANs are designed for devices with limited power sources. Devices on these networks can operate for years on a small battery. This is ideal for agricultural sensors which can be placed in the field and left to operate for extended periods without the need for frequent maintenance.

3. Cost-Effective: Deploying and maintaining a wireless network over a large farm can be costly. LPWAN solutions are generally more cost-effective in terms of both infrastructure and operational costs compared to other wireless solutions, making them an attractive choice for farmers and agricultural businesses.

4. Optimal for Low Data Rate: Agricultural sensors, such as soil moisture sensors, temperature sensors, or weather stations, typically do not generate massive amounts of data. They send concise, periodic updates. LPWANs are optimized for such low data rate transmissions, making them ideal for this use case.

Easy Scalability:

As a farm grows or if a farmer decides to deploy more sensors, LPWANs can easily scale to accommodate the increased number of devices without the need for significant infrastructure changes.

. Low Power Wide Area Network

Low-Power Wide-Area Network (LPWAN) is a category of wireless communication technologies specifically designed to transmit small amounts of data over long distances while consuming minimal power. This makes them especially well-suited for Internet of Things (IoT) applications where devices, often battery-powered, need to send occasional or small data packets across wide areas, potentially spanning several kilometers, without the need for frequent battery replacements. To help readers understand, consider a comparison between types of networks and real-life package delivery services: WAN can be likened to UPS, FedEx, or DHL. These services can send large packages across the world quickly, but to do so, they rely on a heavy infrastructure and need a significant amount of energy (like oil) to power their trucks and planes. LAN is analogous to your local postal service: fast and efficient within your city, but it similarly relies on infrastructure and energy. PAN can be compared to a bicycle courier within your city. They can quickly deliver medium-sized packages in a neighborhood with minimal energy costs, but their range is limited. Finally, LPWAN can be imagined as traveling pigeons. They can traverse kilometers between cities without the need for infrastructure, relying merely on seeds for sustenance. However, they can only carry really small text messages.

The ability of LPWAN technologies to transmit messages over long distances with minimal energy cost is primarily attributed to a combination of radio frequency (RF) modulation techniques, network architecture, and protocol optimizations. • Protocol optimization: LPWAN technologies are optimized for transmitting small amounts of data, which means the transmission duration is short. Shorter transmissions consume less energy. In addition, Some LPWAN solutions adjust the data rate based on the quality of the radio link. When the device is closer to the gateway, it might transmit faster, and when it's further away, it might use a lower data rate to ensure reliable communication. Moreover, LPWAN technologies often employ forward error correction techniques. This allows the receiver to correct errors in received messages without the need for retransmission, thus saving energy. Finally LPWAN protocols are often simplified, with minimal overhead. This means that most of the transmitted bits are useful data, reducing the energy required for sending protocol-related overhead.

As IoT applications rises, more and more types of LPWAN are developed. Good surveys on existing LPWAN have been proposed by the authors in [START_REF] Bharat S Chaudhari | LP-WAN technologies: Emerging application characteristics, requirements, and design considerations[END_REF][START_REF] Mekki | A comparative study of LPWAN technologies for large-scale IoT deployment[END_REF][START_REF] Ismail | Lowpower wide-area networks: opportunities, challenges, and directions[END_REF][START_REF] Raza | Low power wide area networks: An overview[END_REF]. There is four main LPWAN technologies namely LoRa (and its associated protocol stack LoRaWAN), Sigfox, NB-IoT, LTE-M.

• Sigfox [START_REF] Lavric | Sigfox communication protocol: The new era of iot?[END_REF]: Sigfox operates as an LPWAN service provider, delivering comprehensive IoT connectivity through its unique patented methods. It sets up its own custom base stations with advanced cognitive software-defined radios and links them to backend servers using an IP network. Devices communicate with these stations using GFSK modulation in an extremely narrow band (100 Hz) within the sub-GHZ ISM frequency range. Sigfox utilizes open ISM frequencies. Thanks to its ultranarrow band approach, Sigfox benefits from efficient bandwidth use and notably low interference. This results in minimized power usage, elevated receiver precision, and economical antenna configurations, at a peak data rate of just 600 bps. Sigfox only allows a limited nuber of messages to send per day per node to avoid network congestion.

Heavy data transfer such as images is not possible. Downlink message (from the server to the node) is also limited making Sigfox unsuitable for firmware update over the air.

• LoRa [START_REF] Bor | LoRa for the Internet of Things[END_REF]: LoRa operates on a physical layer, modulating signals in the sub-GHZ ISM band using a distinct spread spectrum method. Similar to Sigfox, LoRa employs open ISM frequencies. Its communication is bidirectional, made possible by the chirp spread spectrum (CSS) modulation, which broadens a narrow-band signal across a wider bandwidth.

The signal produced exhibits low interference, granting it a high resilience against disruptions and making it challenging to detect or obstruct. LoRa employs a range of six spreading factors (from SF7 to SF12) to balance data rate and distance. A higher spreading factor yields a more extended range but at the cost of a reduced data rate, and the opposite holds true. Depending on the spreading factor and channel bandwidth, the data rate of LoRa varies from 300 bps to 50 kbps. Interestingly, LoRa base stations can simultaneously receive messages transmitted at diverse spreading factors. Each message has a maximum size limit of 243 bytes. The LoRa-Alliance standardized a communication protocol based on LoRa, named LoRaWAN, with its inaugural version released in 2015. In the LoRaWAN system, every message sent by a device is captured by all nearby base stations. This multiple reception mechanism enhances the probability of successful message retrieval in LoRaWAN. More detail on LoRa and LoRaWan will be provided in Chapter 3 of the thesis as LoRa was the selected LPWAN for our IoT platform. Finally LoRa is capable of Firmware Over The Air Update (FUOTA) and punctuall heavy file transfer.

• NB-IoT [START_REF] Ratasuk | NB-IoT system for M2M communication[END_REF] and LTE-M [238]: Those two protocols are based on the usage of a small portion of the available spectrum in the licensed LTE frequency bands. LTE, standing for Long-Term Evolution, is a 4G wireless communications standard developed to provide faster internet speeds compared to 3G technologies. Those two protocols are standardized by the 3GPP (3rd Generation Partnership Project) organism. The 3GPP ensures the maintenance and development of technical specifications for mobile telephony network standards. The core similarity between NB-IoT and LTE-M lies in their integration into the cellular framework. Both technologies are designed to operate within the LTE spectrum and can be deployed with minimal changes to the existing LTE infrastructure. This means that for network operators, rolling out either of these technologies often involves just a software upgrade to their existing base stations. However, the two technologies diverge significantly in their specific design and use-case optimizations. NB-IoT focuses on static or low-mobility devices and prioritizes extended coverage and deep penetration. It achieves this using a very narrow bandwidth (hence the "Narrowband" in its name), which allows it to provide connectivity in challenging environments, like deep indoors or underground. Its protocol is simplified and is particularly suited for devices that transmit small amounts of data sporadically. Due to its design, NB-IoT often achieves longer battery life and offers a cost advantage for the devices, but it sacrifices data rates and mobility support. On the other hand, LTE-M, also known as Cat-M1, offers broader application potential. While it also aims for power efficiency and extended coverage, it supports higher data rates compared to NB-IoT and can handle voice and mobility. This means devices using LTE-M can move between cell areas (like a vehicle tracking system) or even support voice functionalities. LTE-M uses a wider bandwidth than NB-IoT, leading to the higher data rates, but this also means its devices are typically more complex and might be slightly more expensive.

The technical characteristics of those network are summarized in table 2.3.

. Agricultural Application

LPWANs are the best choice to be used in agricultural applications, as previously mentioned. Comprehensive surveys on the applications of LPWANs for agriculture have been presented by the authors in [START_REF] Ml Liya | A survey of LPWAN technology in agricultural field[END_REF][START_REF] Dai | Low-cost sensor network for collecting real-time data for agriculture by combining energy harvesting and LPWA technology[END_REF][START_REF] Pejković | LPWAN for use in agriculture[END_REF]. In this section we will showcase some typical agricultural application of WSNs with various LPWAN technology to highlight the advantages and disadvantages of the different protocols.

• Sigfox: Sigfox has been used as a monitoring environment platform, as presented by the authors in [START_REF] Joris | An autonomous sigfox wireless sensor node for environmental monitoring[END_REF]. The industry widely implements Another interesting application was implemented for individual cattle position tracking in mountain pastures [START_REF] Llaria | Geolocation and monitoring platform for extensive farming in mountain pastures[END_REF]. Despite its effective implementation, limitations of the Sigfox network for agricultural applications mentioned in the literature are numerous. Firstly, the coverage of the Sigfox network solely depends on a national operator. If the Sigfox network is unavailable in a region, no Sigfox-based IoT platform can be deployed. Secondly, the usage of the ISM band limits the number of messages a device can send per day to 140. While this may be sufficient for some environmental applications, the authors in [START_REF] Llaria | Geolocation and monitoring platform for extensive farming in mountain pastures[END_REF] pointed out that it was insufficient for tracking applications or more complex data transfer such as images. Finally, while a Sigfox node can perform uplink (sending a message from a device to the gateway) efficiently, downlink is limited (sending a message from the gateway to the device). This means that it can be challenging to confirm if a message was successfully transmitted. This not only limits actuator commands, such as opening an irrigation valve, but also poses security issues, as firmware updates over the air are not possible. Due to its proprietary nature, the Sigfox protocol has seen limited adoption in the research field. Additionally, it's worth noting that the Sigfox company has faced significant financial challenges and was acquired in early 2023, casting uncertainty on the protocol's future [START_REF] Figarotech | Sigfox, fin de partie pour une ex-star de la French Tech[END_REF].

• NB-IoT: NB-IoT has been widely used in agriculture, primarily due to its compatibility with existing LTE networks that are readily available, even in rural areas. This means that farms with coverage can begin deploying sensors immediately. NB-IoT has been successfully implemented for irrigation and fertilization management projects as in [START_REF] Valecce | NB-IoT for smart agriculture: Experiments from the field[END_REF], greenhouse environment monitoring and automation [START_REF] Yang | Research and design of greenhouse environment monitoring system based on NB-IoT[END_REF][START_REF] Ye | A wireless network detection and control system for intelligent agricultural greenhouses based on NB-IOT technology[END_REF], irrigation management [START_REF] Cardoso | A Methodology for Sustainable Farming Irrigation using WSN, NB-IoT and Machine Learning[END_REF], and aquaculture monitoring and automation [START_REF] Huan | Design of water quality monitoring system for aquaculture ponds based on NB-IoT[END_REF].

Additionally, NB-IoT provides the capability to transmit larger data files, such as images. However, this usage should remain occasional to avoid excessively draining the battery [START_REF] Sikandar Zulqarnain Khan | An nb-iot-based edge-of-things framework for energy-efficient image transfer[END_REF]. Streaming, in any case, is not possible. The limitations of NB-IoT stem from its use of licensed bands. This incurs additional costs for farmers, as they must invest in dedicated data plans, and it also ties them to the Internet Service Provider (ISP) responsible for network coverage in the area. Furthermore, many farms worldwide, especially in developing countries, are too rural and remote to receive LTE coverage.

• LTE-M: LTE-M is viewed as the most suitable LPWAN technology for IoT applications requiring high data rates, low latency, and full mobility (i.e., where sensors are mobile). It also provides the highest density among LPWANs, supporting up to 1 million devices per km². In agriculture, there aren't many research implementations. The authors in [START_REF] Hu | Design of an embedded system with on-demand image capturing and transmission for remote agricultural monitoring[END_REF] proposed an image acquisition system for field monitoring. The specific features of LTE-M often make it seem overkill for agricultural applications. The trade-off between cost, data rates and energy consumption is less appealing from an application perspective, as discussed by the authors in [START_REF] Ml Liya | A survey of LPWAN technology in agricultural field[END_REF]. However, for specific high data rate applications, such as image transfer, it can be valuable. As a result, researchers have suggested a heterogeneous LPWAN network that uses LoRa for sensor monitoring and LTE-M for base station communication like in [START_REF] Jose | When one wireless technology is not enough: A network architecture for precision agriculture using LoRa, Wi-Fi, and LTE[END_REF]. LTE-M also has the same issue as Sigfox and NB-IoT which is the network coverage dependancy of a national operator.

• LoRa: LoRa has been widely adopted for agricultural projects and has been the focus of dedicated studies [START_REF] Davcev | IoT agriculture system based on LoRaWAN[END_REF][START_REF] Arshad | Implementation of a LoRaWAN based smart agriculture decision support system for optimum crop yield[END_REF]. Network experiments conducted by the authors in [START_REF] Miles | A study of LoRaWAN protocol performance for IoT applications in smart agriculture[END_REF] further underscore the protocol's suitability for agricultural applications. LoRaWAN WSNs are incorporated in every agricultural application cited in section 8, including greenhouse monitoring and automation [START_REF] Kumar | Leveraging LoRaWAN technology for precision agriculture in greenhouses[END_REF], crop yield monitoring [257], and irrigation management [START_REF] Sánchez | LoRaWAN applied to agriculture: A use case for automated irrigation systems[END_REF]. In certain conditions, LoRaWAN even supports image transmission, as successfully demonstrated by [START_REF] Ji | Lora-based visual monitoring scheme for agriculture iot[END_REF] in agricultural contexts. Lastly, LoRa proves effective for livestock monitoring [START_REF] Joshitha | Lorawan based cattle monitoring smart system[END_REF], given that LoRa nodes facilitate mobility [START_REF] Al | On the use of LoRaWAN for mobile Internet of Things: The impact of mobility[END_REF] and even offer basic localization through gateway triangulation [START_REF] Gu | Lora-based localization: Opportunities and challenges[END_REF].

From the literature, LoRaWAN emerges as the most suitable protocol for our application context, as indicated by the authors in [START_REF] Miles | A study of LoRaWAN protocol performance for IoT applications in smart agriculture[END_REF]. The rationale is threefold. Firstly, LoRaWAN fulfills the coverage and energy consumption requirements for farm deployments. Secondly, since LoRaWAN operates in an unlicensed spectrum with an open-source protocol stack, farmers can deploy a LoRa network on their farms both easily and cost-effectively. In contrast, Sigfox, NB-IoT, LTE-M, and other LPWANs necessitate infrastructure de-ployment by their respective operators. This is particularly crucial for smallscale farms in developing countries, which are predominantly situated in rural and remote locations with restricted access to existing network infrastructure.

Lastly, the open-source nature of the LoRaWAN protocol stack empowers developers and researchers to suggest improvements for various use cases and ensures maintenance support from the community.

. Limitations

LPWANs are designed for wireless communication with a focus on longrange and power efficiency, but this comes at the cost of low data rates. LP-WAN have multiple limitation as explained by the author in [START_REF] Ismail | Lowpower wide-area networks: opportunities, challenges, and directions[END_REF]. This low data rate not only makes them unsuitable for real-time or high-bandwidth applications, such as video streaming, but also hinders the transfer of large data files, such as images or sound, typically used by machine learning algorithms in the cloud. The latency in LPWANs can be high, in part because the data payloads for individual messages are limited but also due to the duty cycle imposed in certain region due to government regulation, making LPWAN unsuitable for applications that require real-time responses. This regulation often impose that a device is allowed to communicate a fraction of the time (usually 1% to 10%). The duty-cycle regulation are particularly constraining for LPWAN using unlicensed frequency band like ISM band. Moreover, LPWAN doesn't provide high-Quality of Service features, so there's no guarantee of consistent data delivery or message ordering. In environments with many devices, especially on unlicensed spectrums like LoRa, interference can become a concern. From a security standpoint, while LPWAN technologies incorporate safety features, the limited capabilities of LPWAN devices can constrain the robustness of security measures. Geographical and physical obstacles can sometimes challenge the advertised extensive coverage. Also, devices using LPWAN often lack powerful processing capabilities due to the focus on power efficiency and low cost. The LPWAN market has multiple competing technologies, which can lead to fragmentation and challenges in interoperability. Some LPWAN types, especially those based on cellular systems, also require existing network infrastructure to operate effectively. However, despite these limitations, LPWAN remains invaluable for many IoT scenarios that prioritize range and battery life over data speed.

. Amelioration axes

LPWANs are particularly suited for telemetry sensors in agriculture, such as temperature, humidity, wind speed, etc. However, more complex sensors, such as cameras or microphones, struggle to send their data over such limited networks. This becomes a significant issue as an increasing number of agricultural IoT applications rely on this kind of data, as shown in 8, especially with the assistance of machine learning algorithms performed in the cloud, as discussed in section 2.2.2. Thankfully, a new technological paradigm, called Embedded Artificial Intelligence, aims to shift the computation process directly to the end devices. This can also be called Edge Computing. This shift is becoming increasingly feasible due to the advancement of Embedded AI methods and the cost reduction of high-performance microcontrollers, like 32-bit microcontrollers. Using these methods, a sensor can analyze complex data directly on the device, sending only the inferred result to the application server in a concise message via LPWAN, thereby conserving energy. However, Embedded Artificial Intelligence requires the capability to occasionally offload its complex data and to be updated remotely. These needs, along with other characteristics of Embedded AI, will be explained in greater depth in the next section 2.4. For LPWANs and in particular LoRa as it is the best suited LPWAN for agricultural application, these requirements indicate the need to develop new protocols to ensure the proper operation of Embedded AI sensors. Addressing this need while being energy efficient will be the primary focus of this thesis regarding the network contribution.

. Embedded intelligence 2.4.1 . Definition

To grasp the concept of Embedded Intelligence more effectively, it's essential first to outline the computational architecture of an IoT network [START_REF] Pratim | A survey on Internet of Things architectures[END_REF]. The computational processes to exploit and interpret the perceived data within an IoT platform can occur at multiple locations across the network. Typically, these processes are executed at the Edge, within the Fog, or in the Cloud. We talk about edge computing to describe the processing of data at the source of data generation, often at the edge of the network [START_REF] Shi | Edge computing: Vision and challenges[END_REF]. This can be on devices like IoT sensors, gateways, or other equipment constituting a point of collection. The primary advantage of edge computing is that it reduces the need to send vast amounts of data across a network, leading to reduced latency, bandwidth usage, and potential points of failure. Fog computing is an architectural approach that extends the concept of edge computing. It decentralizes computing resources and operations, distributing them closer to the data sources but often at a layer above individual edge devices [START_REF] Bonomi | Fog computing and its role in the internet of things[END_REF]. Fog computing is similar as an intermediary layer between the edge and the cloud. It aims to improve efficiency, reduce data transfer loads, and provide quicker data processing and analysis closer to the source. It often involves aggregating data from multiple edge devices and then processing it in a local gateway or other local computing resource like a server on the local network. Fog computing can also refer to distributed computation approach where the computation process of data perceived by one edge device is distributed amongst other devices on the same network. Fog computing may vary in definition de-pending on research approach but we define it at processing data within the local network without accessing the internet. Finally, cloud computing refers to the delivery of various services over the internet, including storage, processing, and software solutions [START_REF] Marinescu | Cloud computing: theory and practice[END_REF]. These services are delivered from data centers that can be located anywhere globally, providing immense computing power and storage capacity. The relationship between edge, fog, and cloud computing can be visualized as a hierarchy or continuum of data processing layers depicted in figure 2.10 and is discussed more in depth by the authors in [START_REF] Laroui | Edge and fog computing for IoT: A survey on current research activities & future directions[END_REF]. The Edge Layer is at the bottom of this hierarchy. Individual devices (like sensors or smart cameras) process data on-site before deciding what data to send upwards. As we move up, fog nodes or gateways might collect data from several edge devices, performing preliminary processing, filtering, or analysis. At the top, the cloud receives data that might have been aggregated and pre-processed by the lower layers, conducting more extensive analysis, storage, or leveraging its vast computational resources for tasks that aren't time-sensitive or that require significant computational power like Artificial Intelligence. The overall idea of this layered architecture is to avoid any unnecessary data transmission which are energy costly, weight on the network bandwidth, prone to error and security failure and increase latency. Together, these layers provide a multi-tiered approach to data processing, allowing for efficient, scalable, and responsive IoT systems, ensuring data is processed in the most suitable location based on latency, bandwidth, energy, and computational requirements.

Usually, processing data at the edge is preferable and can lead to faster decision-making due to reduced latency, as data doesn't need to be transmitted and then received from a centralized system. Moreover, this approach can increase privacy and security since data remains on the device, reducing transmission-related security risks. Devices can also continue to function even when offline, ensuring operational continuity [START_REF] Shi | Edge computing: Vision and challenges[END_REF]. Finally, in the context of WSNs, the energy required for wireless transmission often represents the most significant energy expense for a device [START_REF] Feng | A survey of energy-efficient wireless communications[END_REF]. Therefore it is preferable to limit wireless communication to expend battery lifetime.

Unfortunately, complex algorithms, such as AI models, require considerable computational power to execute and most of IoT device posses limited computational capacities. However, AI-driven data analysis is becoming increasingly prevalent, especially for intricate data processing tasks involving images or audio. In the agricultural realm, camera sensors are of utmost importance. For instance, they can leverage computer vision AI algorithms to detect if a plant is manifesting a disease or to monitor livestock, as highlighted in section 8. Regrettably, we also deduced in section 2.3 that devices in agricultural WSNs use LPWAN technology to facilitate long-distance communication with minimal energy consumption, but this comes at the expense of data-rate. The entire procedure of transferring images for AI analysis from a large number of nodes to the cloud within agricultural WSNs is consequently time-consuming and can cause network congestion, significantly impacting battery life of node devices.

To address this issue, researchers have sought to shift the AI computational process directly to the end device developing techniques in a new field known as Embedded AI. Embedded AI integrates artificial intelligence capabilities directly into edge devices, allowing them to process and analyze data locally rather than relying on cloud-based systems for these computations.

To do so despite the limited computational power of typical IoT devices as explained in 2.2.2, and without increasing costs too drastically, two approaches are explored, the hardware one and the software one as discussed in [START_REF] Zhang | A Review of Artificial Intelligence in Embedded Systems[END_REF]:

• The hardware approach involves designing and developing specialized computer chips or logical component, that are optimized for running AI algorithms. such dedicated purpose integrated circuits are to opposed to generic purpose ones such as Microcontroller and Microprocessors . Dedicated hardware can provide substantial performance gains over traditional chips architecture, allowing for real-time processing, lower power consumption, and support for more complex models. Different type of hardware approach exists:

-Graphical Processing Units (GPU): GPUs are specialized electronic circuits designed to accelerate the processing of images and videos to be displayed on a computer's screen. Unlike microprocessors, which handle general-purpose tasks in a computer, GPUs are optimized for parallel processing, making them highly efficient for tasks that involve large-scale data computations, such as graphics rendering and deep learning applications. Over time, the high parallel processing capabilities of GPUs have led to their use not just in graphics-related tasks but also in various computational workloads, especially in the fields of artificial intelligence and scientific simulations, as explained by the authors in [START_REF] Baji | Evolution of the GPU Device widely used in AI and Massive Parallel Processing[END_REF]. In the realm of IoT devices, GPUs can either be used in combination with a microprocessor or a microcontroller. When combined with a microprocessor, we refer to the device as a System on Chip (SoC). A SoC is an integrated circuit that consolidates multiple components of a computer or other electronic system into a single chip, encompassing a CPU, memory, input/output ports, and often other specialized hardware. Well-known examples of SoCs include the Raspberry Pi and Nvidia Jetson Nano. The Jetson Nano is a particularly well-optimized SoC for embedded AI applications, as shown by the authors in [START_REF] Cass | Nvidia makes it easy to embed AI: The Jetson nano packs a lot of machine-learning power into DIY projects-[Hands on[END_REF]. SoCs can sometimes be too costly for certain applications, and in such cases, GPUs can be combined with microcontrollers. Authors in [START_REF] Jia Shyan | Real time road traffic sign detection and recognition systems using Convolution Neural Network on a GPU platform[END_REF] have successfully implemented a road traffic sign detection system using a combination of a microcontroller and GPU. However, GPUs typically require extended RAM capacity and higher energy consumption, making them less suitable for basic microcontrollers or battery-powered devices, as discussed in [START_REF] Lee | Efficient implementation of lightweight hash functions on gpu and quantum computers for iot applications[END_REF].

-Application-Specific Integrated Circuit (ASIC) An ASIC is a customdesigned chip optimized for a specific application or function, rather than for general-purpose use. In this context, GPUs can be considered ASICs for graphical processing. Although GPUs have been widely repurposed for AI applications, dedicated integrated circuits for AI have been engineered, as shown by the authors in [START_REF] Lei | Low power AI ASIC design for portable edge computing[END_REF]. For example, Google has developed an ASIC for running the famous TensorFlow algorithm, called Tensor Processing Units or TPUs [272]. Other intriguing approaches include Neural Processing Units (NPUs) dedicated to running neural networks and Visual Processing Units (VPUs) as mentioned in [START_REF] Kim | Hardware accelerator systems for artificial intelligence and machine learning[END_REF]. While most of these ASICs are geared towards server applications, there have been research to embed such components into IoT devices as explained in [START_REF] Tsai | Embedded Hardware for Processing AI at the Edge: GPU, VPU, FPGA, and ASIC Explained[END_REF].

-Field Programmable Gate Arrays (FPGA) ASICs, including GPUs, are not purely general-purpose hardware; they're designed to run specific types of algorithms within their domain of application. However, hardware can be tailored to meet the unique needs of particular algorithms through the use of programmable logical units, among which FPGAs are the most prevalent. FPGAs are integrated circuits that can be reconfigured post-manufacture to implement various digital circuits. Unlike ASICs, which are permanently designed to perform a specific function, FPGAs allow designers to program and adjust the hardware configuration to suit various tasks and applications, particularly AI acceleration, as described by the authors in [START_REF] Li | A survey of FPGA design for AI era[END_REF]. They are especially well-suited for embedded AI applications, as explained by the authors in [START_REF] Phooi | Embedded intelligence on FPGA: Survey, applications and challenges[END_REF], because they can be easily reprogrammed. However, their cost can be a significant drawback for large-scale device deployment.

• The software approach, on the other hand, primarily involves optimizing and adjusting existing AI algorithms and models so they can run efficiently on hardware-constrained devices such as microcontrollers.

There's a balance to strike: excessive simplification could result in a loss of model accuracy or performance. Moreover, even optimized models might not perform adequately on extremely resource-constrained devices. To optimize AI algorithms effectively, we must deepen our understanding of the domain. AI is a multidisciplinary field of computer science focused on creating systems capable of performing tasks that would ordinarily require human intelligence. These tasks encompass problem-solving, understanding natural language, recognizing patterns, making decisions, and interpreting complex data, among others. Due to the multidisciplinary nature of AI, there exists a vast variety of methods, approaches, and algorithms for different applications. The authors in [START_REF] Miruna | A survey of explainable AI terminology[END_REF] have provided an excellent survey on this topic. It appears that within the realm of AI, the most prevalent domain is Machine Learning, and among Machine Learning techniques, the most commonly used is Neural Networks (NN). Neural networks mimic the functioning of the human brain by utilizing an extensive web of interconnected processing units called neurons. Those neurons forms layers, and when there is more than one layer, NNs are often refers to as Deep learning methods. NNs excel at identifying patterns and play a crucial role in tasks such as audio pattern treatment, image analysis, and speech and language processing [START_REF] Zhang | A survey on neural network interpretability[END_REF]. For these reasons, neural networks appear to be at the heart of Embedded Machine Learning methods, as illustrated by the authors in [START_REF] Merenda | Edge machine learning for ai-enabled iot devices: A review[END_REF]. In the agricultural sector, we've demonstrated that sensor applications requiring AI processing at the edge typically involve image or audio file analysis 2.2.2. Therefore, NNs are also of utmost importance for embedded agricultural applications, as highlighted by the authors in [START_REF] Kujawa | Artificial neural networks in agriculture[END_REF]. The prevalence of Machine Learning and NN in the Embedded AI domain is so important that Embedded AI is often refered to as Tiny Machine Learning [START_REF] Dutta | Tinyml meets iot: A comprehensive survey[END_REF].

To grasp how to optimize NNs and embed them into IoT devices, we first need a brief understanding of how neural networks function: Neural networks operate by processing input data through layers of interconnected nodes or "neurons". Each connection has an associated weight, which is adjusted during training. When data is fed into the network, it undergoes a series of transformations within these neurons. Neurons compute a weighted sum of their inputs and apply an activation function to produce an output. As data flows from the input layer to the output layer, they go through a number of intermediate neurons forming hidden layers and the network makes predictions based on the current weights of those neurons. This process is pictured in figure 2.11.

Now that we know how NNs operates, we need to understand how to train them. The training of a neural network involves repeated forward and backward computations through each layer of the network until the desired accuracy of the model is reached. This training process can be divided in three parts and is depicted in Figure 2.12 1. Forward Propagation Forward propagation in neural networks involves passing the input data through the network to produce an output. Starting at the input layer, each neuron computes a weighted sum of its inputs and applies an activation function to generate an output. This output is then used as input for the next layer of neurons. This process continues through each layer of the network until the final output layer is reached, producing

Loss function:

The forward propagation produces a predicted value, which is compared to the real (ground-truth) value using a loss function. The loss function calculates a score, or error, based on the difference between these values. This score guides parameter updates during the backward propagation process. Ideally, the loss function approaches zero, indicating that predictions closely match the real values. There is a vast amount of available loss functions with different advantages and drawbacks and those are listed by the Keras API, a famous tool for NN building [282].

Backward propagation:

After forward propagation determines the prediction error using a loss function, backward propagation adjusts the network's weights and biases to reduce this error. It calculates the gradient of the loss function with respect to each weight by applying the chain rule, determining how much each weight contributed to the error. The gradients indicate the direction and magnitude of changes required. Once gradients are computed, weights and biases are updated using optimization techniques, often gradient descent (but many other optimizer algorithms are available [START_REF] Zhang | A survey on neural network interpretability[END_REF]), to make the network's predictions more accurate in subsequent forward passes.

It is important to note that running a NN differs from training one, with the latter being more resource-intensive. Hence, Embedded AI software strategies focus on adapting pre-trained NNs for constrained hardware, delegating the training to more powerful servers, usually in the cloud [START_REF] Dutta | Tinyml meets iot: A comprehensive survey[END_REF]. For example the famous YOLO (You Only Look Once) algorithms, widely use in object detection, has been the subject of many research to simplify it and port it into constrained devices [START_REF] Terven | A Comprehensive Review of YOLO: From YOLOv1 and Beyond[END_REF].

For deploying pre-trained neural networks on resource-limited devices, several strategies exist, as detailed in [START_REF] Deng | Model compression and hardware acceleration for neural networks: A comprehensive survey[END_REF]. Presently, the predominant and most effective approach is model compression techniques. Model compression offers a suite of tools designed to lighten the computational process of the neural network. A detailed exploration of each method's workings would necessitate an extensive discussion on neural network operations, which is beyond the scope of this thesis. However, the primary tools utilized include:

-Network structure redesign: It involves enhancing existing neural networks by crafting novel architectural configurations. For example MobilNet [START_REF] Andrew | Mobilenets: Efficient convolutional neural networks for mobile vision applications[END_REF] is an NN architecture designed specifically for mobile and embedded vision applications. It is optimized for performance on devices with limited computational and memory resources.

-Quantization: This refers to the compression of floating-point data bits in parameters to reduce the complexity and size of the model by simply reducing the number of bits. This methods comes at the cost of model accuracy but several methods offers interesting trade-off as shown in [START_REF] Sabih | Utilizing explainable AI for quantization and pruning of deep neural networks[END_REF].

-Pruning: It refers to the technique of reducing the size and computational complexity of a neural network by removing certain neurons or connections that contribute minimally to the network's performance. The primary motivation behind pruning is to produce a leaner and faster model that can operate efficiently on devices with limited computational resources, such as IoT devices or mobile phones, without significantly compromising accuracy. By eliminating these redundant or less important neurons and connections, the neural network becomes more lightweight, consumes less memory, and requires fewer computations, making it more suitable for deployment on embedded systems. Multiple pruning methods exists and are described in this survey [START_REF] Liang | Pruning and quantization for deep neural network acceleration: A survey[END_REF]. A simple visualize way to represent pruning is given in figure 2.13 While on-device training might not be as common as deploying pretrained models, it presents a compelling opportunity, as discussed by the authors in [START_REF] Zhu | On-device Training: A First Overview on Existing Systems[END_REF]. The primary benefit for devices include the capability to learn without an Internet connection. Additionally, there's no requirement to send data to the cloud or retrieve an updated model, which conserves bandwidth, minimizes latency, and saves energy. Looking at it from a data viewpoint, on-device training inherently safeguards privacy. Finally, with on device learning devices can become more intelligent, handling model drift issues and updating deployed pre-trained models to better suit the environment and even individual users. For instance, a medical instrument could gradually adapt to deliver tailored predictions or services, catering to a particular patient's unique circumstances. Despite these advantages, the hardware implementation of on-device learning still demands significant processing power, making it unsuitable for simpler microcontrollers, although there are promising results on SoCs [START_REF] Haoyu Ren | Tinyol: Tinyml with online-learning on microcontrollers[END_REF].

In essence, the software approach seeks to adapt the AI to the device, while the hardware approach adapts the device to the AI. In many modern embedded systems, a combination of both approaches is used to achieve the best performance, ensuring that AI algorithms are both optimized for efficiency and have the dedicated hardware support to execute them effectively. In both case the need for model update and adaption to the specific condition where the devices is being deployed is of upmost importance, whereas it comes from on device training or remote-server induced model update.

. Application

Due to its multidisciplinary nature, Embedded AI has been applied to a wide range of domains, and comprehensive surveys on common applications have been conducted by authors in [START_REF] Osman | Tinyml platforms benchmarking[END_REF][START_REF] Andrade | Overview of the state of the art in embedded machine learning[END_REF][START_REF] Dutta | Tinyml meets iot: A comprehensive survey[END_REF][START_REF] Abadade | A Comprehensive Survey on TinyML[END_REF]. Originally, it was considered that the realm of embedded AI saw its first significant contribution in applications related to voice assistants and wake words [START_REF] Han | TinyML: A systematic review and synthesis of existing research[END_REF]. Wake words are specific words or phrases used to activate voice-activated AI systems. Examples include "Hey Siri" for Apple, "OK Google" for Google Assistant, and "Alexa" for Amazon. These words allow hands-free interaction, with the device only sending audio to servers for further analysis after the wake word is detected. This addresses some privacy concerns and limits the energy consumption of battery-powered devices such as smartphones. The intent was for a low-power microcontroller to always be listening, while the main processor is in sleep mode, avoiding excessive energy consumption by analyzing everything it hears when it's not relevant. The sole goal was detecting those words to wake the processor.

Another critically important application is in healthcare, for instance, within the cardiac domain. Wearable devices can monitor a patient's cardiac rhythm and analyze it directly at the edge without relying on the cloud. This means cardiac anomalies can be detected in real time, with appropriate measures taken, as explained in [START_REF] Costa | From cloud AI to embedded AI in cardiac healthcare[END_REF]. Another intriguing application in healthcare involves a system designed to detect and manage unwanted episodes in patients with Parkinson's syndrome [START_REF] Gokul | Gait recovery system for parkinson's disease using machine learning on embedded platforms[END_REF].

A domain where embedded AI shows promising applications is predictive maintenance. Predictive maintenance involves detecting the conditions of machine failure and thereby averting it with easier maintenance operations compared to complex repair procedures. Authors in [START_REF] Vıtor | Edge AI System Using a Thermal Camera for Industrial Anomaly Detection[END_REF] proposed a system based on ESP 32 and a thermal camera to detect heat anomalies in machines in real time. Similarly, to detect failures in washing machines, a vibration sensor and Arduino Nano 33 BLE were employed by authors in [START_REF] Lord | Mechanical Anomaly Detection on an Embedded Microcontroller[END_REF], combined with the TensorFlow Lite ecosystem.

In the agricultural sector, TinyML also presents various opportunities. It's especially beneficial for small-scale farmers, providing a significant improvement in crop monitoring at minimal costs. An example is the PlanVillage project, aiming to assist African farmers in integrating IoT and Embedded AI into their farming [START_REF] Latifa | Accuracy of a smartphone-based object detection model, PlantVillage Nuru, in identifying the foliar symptoms of the viral diseases of cassava-CMD and CBSD[END_REF]. A prominent application of Embedded AI is crop monitoring. Authors in [START_REF] Trilles | Development of an open sensorized platform in a smart agriculture context: A vineyard support system for monitoring mildew disease[END_REF] proposed an edge computing system to oversee the progress of mildew diseases in vineyards based on environmental data. Other researchers have employed simple cameras to monitor water stress in crops [START_REF] Ramos-Giraldo | Low-cost smart camera system for water stress detection in crops[END_REF]. Similarly, cameras have been used for grape leaf disease detection [START_REF] Falaschetti | A low-cost, low-power and real-time image detector for grape leaf esca disease based on a compressed CNN[END_REF], coffee plant leaf disease detection [START_REF] De | Quantitative analysis of deep leaf: a plant disease detector on the smart edge[END_REF], and fruits and vegetables identification as in [START_REF] Gutti | Real Time Classification of Fruits and Vegetables Deployed on Low Power Embedded Devices Using Tiny ML[END_REF]. Additional interesting research has focused on irrigation management, like in [START_REF] Waseem | Smart Water Resource Management by Analyzing the Soil Structure and Moisture Using Deep Learning[END_REF], where a system for agro-environmental management using moisture sensors and real-time video analysis of soil photographs was proposed. Embedded AI can also upgrade older systems, as illustrated by a TinyML device that uses a camera to collect data from numerical water meters to monitor central pivot irrigation. Furthermore, Embedded AI has been employed in supervising atmospheric conditions in greenhouses. For instance, authors in [START_REF] Bruno | Embedded artificial intelligence approach for gas recognition in smart agriculture applications using low cost mox gas sensors[END_REF] developed a cost-effective gas monitoring system potentially used to detect disease development conditions and act on them. Livestock management can also benefit from advancements in embedded AI, like the study by authors in [START_REF] Arablouei | Animal behavior classification via deep learning on embedded systems[END_REF] who focused on a real-time animal behavior recognition system using inertial measurement sensors in collars. Embedded AI can also assist in wildlife observation and monitoring through audio analysis, as discussed in [START_REF] Hr Sabbella | An always-on tinyml acoustic classifier for ecological applications[END_REF].

These applications highlight the profound advancements embedded AI can offer to IoT platforms, especially in the realm of agricultural applications. However, during our research -and as noted by other authors in their surveys [START_REF] Abadade | A Comprehensive Survey on TinyML[END_REF] -it was observed that TinyML implementations in specific scenarios, especially in agriculture, often overlook their network specifics. To our understanding, applications that combine the practical use of LPWAN, the most prevalent type of network in agriculture, with embedded AI, remain an uncharted territory.

. Limitations

Embedded AI, though groundbreaking and influential, is not without its challenges. First and foremost, the resource constraints of the device can limit the accuracy of AI algorithm outputs. Consequently, embedded AI should not be employed for critical operations where utmost accuracy is essential. Latency can also be an issue: If a model requires an excessive amount of time to execute on a device, depending on the time constraint, it might be more efficient to run the algorithms on a powerful server. Energy consumption is another nuanced consideration. By refraining from transmitting data, a device can significantly conserve energy, which is paramount for battery-powered devices. However, if an algorithm's runtime is extended due to intricate data processing or an unoptimized embedded AI algorithm, the energy consumption could surpass that of just transmitting the data. For instance, if a device consumes 50 mW of power for transmission and 20 mW during operation, and the data to analyze is 1 kb in size with a communication speed of 1 kbps, any algorithm taking longer than 2.5 seconds to execute would make it more efficient to transmit the data directly to the server. Therefore, both network configuration and embedded AI algorithms must be meticulously assessed for each application to ensure energy efficiency.

Finally, the principal limitation of embedded AI is model drift. This concept refers to the change in the patterns of the data over time, which can affect the performance of a trained model. In other words, the statistical properties of the target variable, which the model is trying to predict, change over time in unforeseen ways. For those reasons, it's essential to continuously monitor model performance in deployed environments to detect signs of drift. Upon detecting drift, it's advisable to retrain the model using recent data. Various real-world elements can cause data patterns to shift: evolving consumer behaviors, differential equipment wear, fluctuating economic conditions, and other such elements. Drift can manifest in various forms:

• Sudden Drift: An abrupt alteration in data distribution.

• Incremental Drift: Gradual changes over a span of time.

• Gradual Drift: Alternation between previous and new data concepts.

• Cyclic Drift: Recurring shifts to former states or patterns.

In an agricultural context, a model might be trained to enumerate strawberries in a specific fields. However, fields vary significantly in terms of strawberry type, soil color, pre-existing vegetation, and sunlight exposure for example. Therefore, once a generic fruit detection model is deployed, it needs to "calibrate" itself against gradual drift and train with local observation to enhance accuracy. Overtime the strawberry size will change in size an color introducing incremental drift. Change in season patterns will also affect the image inducing cyclic drift. Finally a sudden drift can happen if a wild pig decides to stomps into our strawberry plot.

Such drift-related challenges necessitate periodic model re-training and updates. However, as highlighted in section 2.4.1, on-device training has its limits. Presently, the most common strategy, upon drift detection in an embedded device, involves offloading data to a central server responsible for leveraging the data to train a more accurate model, which is then redeployed to the affected devices. This procedure raises network concerns as it augments overall traffic and can be energy-intensive if executed using wireless communication protocols. Furthermore, as indicated in 2.3.6, Wireless Sensor Networks (WSN), especially in agricultural contexts, predominantly utilize LPWAN technologies. The inherent data rate constraints of LPWANs add complexity to the data offload and update process, particularly given the potential multitude of nodes.

. Amelioration axes

Embedded AI is still a new domain, and a wide range of solutions are currently being developed to facilitate its more widespread implementation. Solutions are available to enhance the performance of embedded AI algorithms through both software and hardware approaches. Methods have also been proposed to address the need for model training and adaptability in response to drift. One such method involves using a server to retrain model based on offloaded sensor data before uploading a new model to the devices. This method is energy-intensive and can be challenging for LPWAN networks, which are the most commonly used in agricultural scenarios. Regrettably, we couldn't find any practical implementations of embedded AI in LPWAN networks that take in account this critical need for update, even though surveys have alluded to the potential of such applications. Thus, we presume that this remains largely unexplored territory in research. Consequently, we chose to investigate the energy efficiency of embedded AI in LPWAN networks, particularly within an agricultural context, and prioritize the development of algorithmic tools for energy-efficient data offloading and model updates.

. Knowledge engineering

As explained in the introductory chapter of this thesis, an IoT platform must also proficiently interpret the data collected from various sensors. Agriculture presents a vast array of diverse data involved in the plant growing process, especially when adhering to the principles of agroecology. Therefore, to assist farmers in managing the data they have collected, efficient software tools must be provided. Such software can be very simple in certain use cases, for example, controlling an irrigation valve based solely on the soil humidity value from a sensor, with only a conditional if-else statement. However, such a simplistic decision-process architecture can quickly become inefficient when dealing with a vast number of cases, data, and scenarios. For instance, the number of if-else statements in the previous example could substantially increase if the irrigation process also took into account factors such as the type of soil, type of plants, the farm's region, future weather forecasts, time of day, etc. Therefore, it is advantageous to implement knowledge directly into a computer system, enabling it to autonomously make optimal decisions based on its understanding of a situation. To achieve this, we focused our research on a domain of Artificial Intelligence known as Knowledge Engineering.

. Definition

The definition of knowledge engineering in information systems is as follows: "Knowledge engineering is the process of developing knowledge-based systems in any field, whether it be in the public or private sector, in commerce or in industry" [START_REF] John K Debenham | Knowledge systems design[END_REF]. Knowledge is also defined as "The explicit functional associations between items of information and/or data" [START_REF] Studer | Knowledge engineering: Principles and methods[END_REF]. Data refer to individual reading values from sensors, while information pertains to a preliminary degree of data analysis. For instance, considering the location and time of temperature readings (e.g., specific points within the city) allows one to discern a trend, illustrating the ongoing temperature shifts and determining a state, such as cold or warm. Finally, knowledge entails being aware of information provided by data, as well as other factors, in order to make effective decisions. The relationship between data, information, and knowledge is presented in Figure 2.14. The example illustrates that when data indicates stormy weather (an information), a person, based on their knowledge of storm conditions, content of their wardrobe, and destination, can choose an appropriate coat to avoid getting sick when leaving its place. • Explicit: It is a form of knowledge that can be articulated and easily passed on to others. Examples include rules from a game, maintenance procedures, or, in our context, agricultural methods. It is often documented in various media forms such as books, tutorials, videos, or other kinds of media.

• Implicit: Implicit knowledge refers to a type of knowledge that is challenging to articulate or share. This encompasses personal experiences, intuition, motor skills, and so forth. It is particularly relevant in the context of pattern recognition. For example, while it is straightforward to recognize someone by their face, it becomes considerably more complex to enable another person to recognize them simply by describing their appearance.

Knowledge, being a fundamental trait of human intelligence, therefore, engineering it can be considered a field of Artificial Intelligence. Knowledge engineering refers to the conception of Knowledge-Based Systems (KBSs). There are multiple ways of implementing KBSs, as explained by the authors in [START_REF] Simon | An introduction to knowledge engineering[END_REF]. For example, Neural Networks in Machine Learning are effective tools to implement implicit knowledge as they train (or in other words "gain experience")over a certain amount of data to be able to recognize patterns, such as image interpretation.

In our specific case, we aim to construct a KBS capable of making decisions regarding agroecological farm procedures based on sensor data. Consequently, the most apt software architecture for our research is known as Expert Systems, which are often referred to simply as KBSs. Expert systems, theorized since the mid-80s by the authors in [START_REF] Jackson | Introduction to expert systems[END_REF], are software designed to generate decisions based on input and knowledge. They emulate the behavior of a human expert, meaning they can comprehend a situation (or a frame) by applying logic to it based on rules that apply to a domain of knowledge. For example, a medical system might take user input for a disease and patient characteristics, then propose an adapted posology for the treatment based on those data. Another example in smart farming would be a system capable of determining the correct amount of water for an area based on soil moisture, sun exposure, time of day or year, plant type, etc., much like a farmer would do through the knowledge acquired through education. For an expert system to function correctly, it must implement efficient tools to retrieve and model the expert's knowledge within the KB. The process of outputting a decision is termed an inference. The global architecture of an expert system is presented in Figure 2.15. It is clear that the knowledge base (KB) is at the core of such expert systems. KBs are software models designed to represent knowledge in a form that is accessible and interpretable by a computer. In order to be efficient, they need to have several core characteristics:

• Formal representation: It aims to provide a way to represent explicit knowledge. The definition given by the authors in [START_REF] Shah | Ontologies for formal representation of biological systems[END_REF] is: "A formal representation is a computer-interpretable standardized form that can serve as the basis for unambiguous descriptions of hypotheses and models in a domain of discourse." In other words, it is the structure within which the actual computer code expresses knowledge. There is a variety of tools to encode knowledge, with two of the most famous ones being RDF (Resource Description Framework) and Ontologies. They are used to describe resources and the relationships between them. Ontologies are more complex as they can allow for the representation of more intricate properties and relationships between resources. Overall, they are schematic structures representing graphs. In Chapter 4, we will explore in more depth how ontologies are implemented, as we identify them as the most suitable structure for our application. It is important to note that ontologies are so prevalent in the construction of knowledge bases that knowledge bases are often simply referred to as ontologies.

• Scalability: Scalability in the context of a knowledge base refers to its ability to efficiently handle a growing amount of information, users, and queries without experiencing significant degradation in performance.

A scalable knowledge base should be able to expand its capacity and capabilities to accommodate increasing data and user demands while maintaining responsiveness and usability. This typically involves optimizing data storage, retrieval mechanisms, and computational resources to ensure smooth operation as the knowledge base grows.

• Interoperability: This refers to the system's ability to seamlessly integrate and exchange information with other systems, databases, or knowledge bases. A knowledge base with good interoperability can communicate and share data effectively with various software applications and platforms, making it possible for different systems to work together and access the knowledge within the knowledge base. This is essential for achieving a holistic and interconnected information environment, enabling data sharing and facilitating efficient collaboration across diverse tools and technologies. The idea is also to reuse already existing resources when needing access to a certain type of knowledge. For example, if I build a knowledge base for a woodworking application, it could be useful to retrieve information about trees. We could implement knowledge about trees directly in the knowledge base, but 93 this could take time and require expertise beyond woodworking. Therefore, if a knowledge base has already been constructed about trees by more specialized experts in this domain, it would be better to reuse that one.

It is worth mentioning that knowledge bases are also a core instrument in today's internet infrastructure. The W3C (World Wide Web Consortium), the organization in charge of promoting the technological compatibility of the web, has pushed toward the implementation of what they call the Semantic Web, which they define as "The Semantic Web provides a model that allows data to be shared and reused among multiple applications, companies, and user groups" [313].The Semantic Web is an extension of the World Wide Web that aims to enable machines to understand the meaning of information on web pages and in digital content. It is based on the idea of adding semantic metadata to web resources, allowing computers to process and interpret the data in a more intelligent way. This metadata helps create a web of linked data with explicit relationships between concepts and entities.

In conclusion, knowledge bases are often dedicated to a specific domain and should maximize the reuse of semantic knowledge already available. In the following sections, we will highlight some specific applications of knowledge bases for IoT in agriculture and how they can help identify the missing resources for our agroecological scenario.

. Internet of things application

IoT has been an area where Knowledge Engineering can offer substantial benefits, particularly in ensuring interoperability. As mentioned in Section 2.2.2, one of the major limitations of IoT is the diversity of devices, protocols, and associated services. A knowledge base in this area could address this issue, and as a result, multiple efforts have been made towards the creation of such resources. In their well-crafted surveys, authors in [START_REF] Rhayem | Semantic web technologies for the internet of things: Systematic literature review[END_REF][START_REF] Szilagyi | Ontologies and Semantic Web for the Internet of Things-a survey[END_REF] have explored Semantic applications for the IoT domain comprehensively. They identify various types of knowledge bases to cater to different needs within IoT: those focusing on data management, those concentrating on hardware representation, those dedicated to services, and those emphasizing security. Hybrid approaches also exist.

The W3C has shown a keen interest in the semantic representation of IoT. Similar to the semantic web, the semantic representation of Things in the Internet of Things (IoT) could offer significant advantages to web infrastructure, especially considering the exponential deployment of IoT devices. Therefore, since 2012, they have developed the Semantic Sensor Network (SSN) with the same intention [316]. SSN takes the form of an ontology and serves the purpose of describing sensors, their observations, related procedures, studied features of interest, the samples used, observed properties, and even actu-ators. SSN employs a modularized architecture, both horizontally and vertically, and incorporates a self-contained core ontology named SOSA (Sensor, Observation, Sample, and Actuator) to represent its fundamental classes and properties. Due to their distinct scopes and levels of axiomatization, SSN and SOSA collectively enable support for a wide range of applications and use cases. The domain of the semantic Web applied to things is often refers to as Web of Things (WoT) [START_REF] Raggett | The web of things: Challenges and opportunities[END_REF].Nowadays, the SSN serves as the foundation for various IoT knowledge-based applications, such as wireless sensor networks [START_REF] Bendadouche | Extension of the semantic sensor network ontology for wireless sensor networks: The stimulus-WSNnode-communication pattern[END_REF] and cloud operations [START_REF] Müller | From RESTful to SPARQL: A Case Study on Generating Semantic Sensor Data[END_REF], among others.

. Agricultural Application

The creation of knowledge bases for agricultural purposes has been a focus of research in the Smart Farming Domain. Comprehensive surveys on available semantic resources and knowledge bases for agriculture have been conducted by authors in [START_REF] Drury | A survey of semantic web technology for agriculture[END_REF][START_REF] Bikram Pratim Bhuyan | A Systematic Review of Knowledge Representation Techniques in Smart Agriculture (Urban)[END_REF]. Since the mid-1980s, the Food and Agricultural Organization of the United Nations has developed and maintained AGROVOC [322], which is the largest and most comprehensive semantic resource for agricultural knowledge. AGROVOC comprises over 40,000 concepts available in more than 40 languages, encompassing knowledge about plants, farming methods, forestry, nutrition, and various other areas related to agriculture. However, AGROVOC functions more as a thesaurus than an ontology, which means that the relationships between entities are more hierarchical than ontological, resulting in less extractable knowledge [START_REF] Sánchez | Using an AGROVOCbased ontology for the description of learning resources on organic agriculture[END_REF].

Managing and exploiting one large repository for all agricultural knowledge can be challenging. Hence, it is often preferable to create smaller knowledge bases on various topics and link them together. There is a wide variety of ontologies covering every aspect of agricultural procedures, types of plants, and more, which are grouped into repositories. Some notable repositories for ontologies include AgroPortal [START_REF] Jonquet | AgroPortal: A vocabulary and ontology repository for agronomy[END_REF], The Crop Ontology [325], Planteome [START_REF] Cooper | The Planteome database: an integrated resource for reference ontologies, plant genomics and phenomics[END_REF], CIARD Ring Portal [START_REF] Pesce | The CIARD RING, an infrastructure for interoperability of agricultural research information services[END_REF], and GODAN (Global Open Data for Agriculture and Nutrition) [328].

What sets these repositories apart from their larger counterparts, such as AGROVOC, is their decentralized development approach. In these repositories, motivated individuals can contribute specific or specialized information that may be of interest to smaller user groups but might get overlooked by larger ontology developers. A prime example of this is CropPestO [START_REF] Ángel | CropPestO: An Ontology Model for Identifying and Managing Plant Pests and Diseases[END_REF], an ontology model for identifying and managing plant pests and diseases. This ontology not only covers different types of threats to various crops but also provides detailed information about their treatment, conditions for development, and numerous other meta-properties. It's likely that such fine-grained information might be absent from larger ontologies.

In the specific domain of knowledge bases dedicated to organic agricul-ture or agroecology, our research has led us to the conclusion that this is a relatively underexplored area. We have not come across any ontologies with the keywords "Agroecology" or "Organic Agriculture" in the previously mentioned repositories. Our literature review has revealed only a limited number of research works in this field: In 2009, the European Union launched Organic.Edunet [START_REF] Sánchez-Alonso | Engineering an ontology on organic agriculture and agroecology: the case of the Organic. Edunet project[END_REF]. The goal was to provide a tool based on ontology and semantic resources, including AGROVOC, to create a platform for educating younger generations about Agroecology and Organic Farming. In 2018, authors in [START_REF] Pakdeetrakulwong | An Ontology-based Knowledge Management for Organic Agriculture and Good Agricultural Practices: A Case Study of Nakhon Pathom Province, Thailand[END_REF] proposed an ontology dedicated to promoting Organic and Good Agricultural Practices in Thailand. However, the exact implementation details remain somewhat vague, and no link to the actual ontology has been provided. Since 2019, the French government has been funding a knowledge base for sharing agroecological transition knowledge. However, it's important to note that this knowledge base is primarily oriented towards providing general information to farmers rather than managing an IoT platform [START_REF] Soulignac | GECO, the French web-based application for knowledge management in agroecology[END_REF].

In 2021, researchers from INRAE (The French National Institute for Agriculture and Ecology Research) proposed a position paper from a biological perspective, emphasizing the need for ontological development in organic agriculture [START_REF] Pouteau | The plantness of the plant: how to address crop ontology in organic agriculture?[END_REF]. During the same year, researchers in the field of social sciences also highlighted the necessity of an ontological approach for Agroecology [START_REF] Domptail | Agroecology as an ontology to guide agricultural and food systems?[END_REF]. Finally, three recent research works have focused on the practical implementation of a general ontology for what they refer to as Climate Smart Agriculture [START_REF] Vincent | OntoCSA: A Climate-Smart Agriculture Ontology[END_REF][START_REF] Naidoo | Modelling Climate Smart Agriculture with Ontology[END_REF][START_REF] Adewumi | An ontology-based information extraction system for organic farming[END_REF]. While they offer interesting approaches to model agroecological principles, they may be insufficient for our application, particularly concerning IoT, as discussed in Chapter 4. Lastly, recent work conducted this year has utilized a knowledge base approach to implement a Deep Neural Network System Using Ontology to Recommend Organic Fertilizers for Sustainable Agriculture [START_REF] Vijaya | Deep Neural Network System Using Ontology to Recommend Organic Fertilizers for a Sustainable Agriculture[END_REF]. However, this work is dedicated to a specific use case only.

. IoT and agricultural Application

KBSs that focus on both agricultural applications and agriculture itself are still a relatively new area of research. The first comprehensive survey we found encompassing both domains was published in June 2023 by the authors in [START_REF] Shoaib Farooq | Web of Things and Trends in Agriculture: A Systematic Literature Review[END_REF], even though the authors in [START_REF] Bikram Pratim Bhuyan | A Systematic Review of Knowledge Representation Techniques in Smart Agriculture (Urban)[END_REF] briefly refer to IoT applications. From these works, we identified three major IoT and agricultural Knowledge Base architectures. The first one, called AgOnt, was proposed by authors in 2010 [START_REF] Hu | AgOnt: ontology for agriculture internet of things[END_REF]. The authors created the "AgOnt" ontology to capture relationships in the lifecycle of agricultural products, considering data such as humidity or temperature. These relationships involve product properties (e.g., location, timestamp, environmental parameters, device, processing status) and connections to source products (e.g., a plant's relationship to its seedlings from which it originates). However, it is merely an theoretical architecture for mapping food produce according to data. The second architecture was proposed in 2016 by the authors in [START_REF] Kamilaris | Agri-IoT: A semantic framework for Internet of Things-enabled smart farming applications[END_REF], and it focuses on linking device data and farm operations through knowledge base reasoning. They based their ontology on the Semantic Sensor Network previously mentioned in [316]. They proposed two use cases to demonstrate the efficiency of their system: one regarding cow fertility detection and management through heat sensors, and the other regarding soil fertility, considering soil composition and moisture levels. They conclude the need for a broader knowledge base for agricultural and IoT applications, as their work serves as a showcase of the potential of such applications. Finally, the authors in [START_REF] Ramanathan | Semantic Knowledge for Autonomous Smart Farming[END_REF] proposed an ontology based on the SSN and other agricultural repositories to create a system capable of managing various farming actions. They successfully tested their system with irrigation management based on plant characteristics. However, once again, it is a broad model that requires knowledge acquisition. Other knowledge-based systems have been implemented with IoT for specific agricultural application. For example, the authors in [START_REF] Khattab | An IoT-based cognitive monitoring system for early plant disease forecast[END_REF] proposed a KBS to monitor early plant diseases based on weather data from sensors.

Overall, our research concludes that implementations of knowledge bases in the domain of IoT and agriculture are still scarce. Therefore, various types of architectures should be proposed to outline the advantages and drawbacks of each, with the aim of providing a future standard akin to the SSN. Moreover, we found no applications regarding IoT device management and agroecology. Finally, many of the KBSs studied regarding IoT and agriculture did not implement different types of sensors regarding their capacity to provide embedded intelligence.

. Limitations

The limitations within this domain are manifold. Firstly, the process of gathering expertise-driven knowledge can be arduous and demanding. Crafting a comprehensive ontology or knowledge base for the agricultural sector is an intricate endeavor. Agricultural knowledge is extensive and in a state of constant evolution, rendering the task of encapsulating every facet of agriculture within a single ontology or knowledge base quite challenging. Based on this observation, we wish to highlight the absence of knowledge-based systems specifically tailored to Agroecology and Organic Farming. This research gap becomes even more pronounced in the context of agroecology and IoT, where, to the best of our knowledge, no KBS has been proposed to address inquiries within this specialized field. Lastly, we must also acknowledge the limitations of integration within the emerging Embedded AI paradigm, particularly in our specific case involving TinyML and LoRa. Nevertheless, it's important to note that despite these challenges, knowledge bases hold the poten-tial to significantly enhance the organization, retrieval, and decision-making processes in the field of agriculture.

. Amelioration axes

Within the field of knowledge base development, the creation of a specialized ontology designed for the management of Agroecological and IoT-based farming practices holds the promise of enhancing sustainability and aiding farmers in effectively managing their farms. Furthermore, exploring the incorporation of smart sensor characteristics and requirements within this domain could yield valuable insights that extend beyond our own, warranting careful examination.

. Conclusion and proposed contribution

This chapter aimed to provide an overview of Smart Farming research within the realm of IoT. Our exploration revealed several key limitations in various aspects of IoT platforms for agriculture. Firstly, on the networking front, the emergence of the Embedded Intelligence paradigm, particularly TinyML, offers essential capabilities to sensing devices, allowing them to operate independently of the cloud and be more energy-efficient. However, challenges related to model drift necessitate that TinyML devices can receive firmware updates and offload certain data for model retraining in the cloud. This requirement becomes particularly complex in Low-Power Wide-Area Network (LPWAN) settings, where devices communicate at low data rates and with low duty cycles, limiting the amount of transferable data per day and the size of data and firmware update transfers. Secondly, from a decision-making perspective, both IoT platforms in the agricultural domain and the IoT domain, in general, are inherently complex, involving a multitude of data sources. Efficient knowledge management techniques are required to navigate this complexity effectively. This need is particularly evident in the field of Agroecology, where environmental conditions and ecosystem behavior heavily influence the proposal of efficient farming methods based on collected data.

These limitations have directed our thesis towards two primary contributions. The first contribution aims to demonstrate the energy-saving efficiency of TinyML and LPWAN architecture compared to cloud-based models. We will utilize the LoRaWAN LPWAN network, identified as the most suitable for agricultural applications. Additionally, we will propose an efficient architecture that enables model retraining in the cloud through punctual image offloading via LoRa and Firmware Update Over the Air through LoRa. The second contribution focuses on the decision-making aspect. We propose the creation of an ontology to assist farmers in managing sensor networks in Agroecology farms. Our ontology will primarily address sensors management, especially smart sensors equipped with TinyML, and agroecological responses concerning plant and environmental characteristics.

-An energy-efficient wireless sensor network

for Embedded AI devices

. Introduction

Based on the review presented in Chapter 2 of this thesis, we identified that IoT platforms, especially within the agricultural sector, possess several technological limitations that need addressing. This chapter delves into the design and testing of an efficient Wireless Sensor architecture for Embedded AI devices for LPWAN agricultural network. As detailed in section 8, the application of Artificial Intelligence is central to Smart Farming. AI can predict weather and climate patterns, monitor crop growth, forecast yields, automate processes with robotic machinery, and offer actionable insights derived from vast data sets collected by various sensor devices. This leads to more sustainable and efficient farming practices. A particularly promising application of AI in agriculture is the processing of complex data such as images or sounds using computer vision or audio analysis algorithms.

Those AI algorithms usually tend to require higher computational processing power than typical IoT devices, such as microcontrollers or simple Systems On Chips, can provide. Therefore, as shown in section 2.4, power-constrained IoT devices often offload the computational processes of AI to other devices in the fog or a cloud server. This introduces multiple issues. Firstly, there are concerns about privacy and security since data being transferred are subject to security breaches or can be unethically used by the cloud service provider. Secondly, there's the matter of latency. The overall process of transmitting the data to another device can introduce significant delay, which might be detrimental, especially for time-critical applications. A third challenge arises when there is a loss of connectivity, rendering the devices useless. Lastly, and perhaps most significantly for battery-powered devices, is the issue of energy consumption. Wireless communication is the most energy-intensive operation for constrained devices and often accounts for the majority of battery usage. In the context of agricultural wireless sensor networks, this energy constraint becomes even more pronounced. Devices often need to communicate over long distances and are scattered over vast geographical areas, making battery management and recharging complex. To conserve energy during communication, a specific type of wireless network called LPWAN (Low Power Wide Area Network) is employed. These networks allow devices to communicate over long distances with minimal energy costs but come with the trade-off of reduced data rates. This lower data rate can hinder or even prevent cloud-based computer vision applications from being implemented effectively in farming environments.

Hopefully, as shown in section 2.4, recent technological advancements have brought AI algorithms to the edge with methods like Tiny Machine Learning. This allows simple microcontrollers to run complex neural networks directly on their computation-constrained hardware. This approach does come at the expense of some accuracy, but the trade-off is usually acceptable for non-critical applications, such as most farming operations. Despite promising results, this new AI trend has a high sensitivity to model drift. This means that even if a model is trained for a generic application, it will often require adjustments and improvements once deployed in the specific ecosystem where it operates. As a result, there's a need for model retraining using local data where it's deployed. Although the prospects for running AI models are promising, on-device learning for constrained hardware is still in an early stage for traditional microcontrollers. Model retraining is therefore often conducted in the cloud, necessitating the offloading of data that might have insufficient confidence score levels for the predictions made. Once the refined model is ready, it's then redeployed to the devices. This entire process amplifies wireless communication, leading to increased network congestion and power consumption, which can be challenging for LPWAN networks to support.

In conclusion, this context highlights different limitations regarding the uses of TinyML in agricultural LPWAN networks. The questions are multiple. Can the usage of TinyML with combination of LPWAN can be more energy efficient that cloud based system? And can LPWAN meet the requirements of TinyML regarding punctual heavy data offloading and Firmware update over the air while still being energy efficient? To answer those question this chapter will propose the development of dedicated algorithms and a series of experimentation to evaluate them in specified scenarios before drawing conclusion on the feasibility and the advantages over cloud based approach of the proposed TinyML/LPWAN WSN architecture. The focus for LPWAN will be directed towards LoRaWAN networks, as it was identified as the most suitable LPWAN technology for agricultural applications in section 2.3.6.

. Architecture proposal

. Scenario

To assess the feasibility and efficiency of our proposed TinyML and LPWAN architecture, we examined an agricultural use case focusing on strawberry monitoring with two functional modes: normal behavior and degraded condition mode. In the normal behavior mode, an intelligent, battery-powered camera sensor, equipped with a TinyML algorithm, is stationed in a field. Its primary task is to detect and count strawberry fruits. After determining the count, the sensor sends this data to an application server in the cloud, which hosts a decision platform, using a LoRaWAN network . Decisions are made based on the fruit count and other factors. These might include initiating fertilizer application if the fruit count is lower than expected, taking countermeasures against potential diseases or pests, detecting thefts by humans or wildlife, or sending a harvest notification if the fruits are ripe. This action directive is then passed on to the executor, which might be the farmer or an autonomous robot in order to optimize their intervention. For example, a human or robot operator will only move or relocate itself for harvest when fruit are ready. A visual representation of this use case can be found in Figure 3 In the normal behavior mode, the TinyML algorithm predicts the number of available fruits with a certain confidence score. If this score drops below a specific threshold, the system shifts to the "degraded condition mode." The threshold is determined by the application's criticality. In our case, we have arbitrarily set it at 90%. In this mode, the sensor device begins offloading picture data to the LoRaWAN network without disturbing its normal functioning. This means it adapts its transfer to avoid network congestion. After collecting a sufficient amount of new data, the model is retrained in the cloud on the application server. Once this is complete, the update is transmitted from the application server to the LoRaWAN server, which then manages the Firmware Update Over the Air (FUOTA) process for the designated devices. This mode is depicted in figure 3.2.

Our system architecture is therefore made of five main components:

1. Smart sensor: It uses a microcontroller running a TinyML algorithm to infer the number of fruits within its field of view. If the confidence score of its inferences falls too low, it requests a firmware update over the air and offloads its data to the cloud. 3. LoRaWAN Server: Responsible for receiving and dispatching messages between the device and the Application Server. It also oversees the FUOTA process in LoRa. The LoRaWAN server can often be located at the same location as the application server or directly on the gateway.

Application Server:

It hosts the Cloud decision platform responsible for interpreting the results from the smart sensor. It is also in charge of data storage and model retraining when the system enters degraded condition mode and sufficient new data has been acquired.

Performer:

The determined action is then relayed to the executor, whether it be a farmer or a robot.

From the state-of-the-art review we conducted throughout our research and through discussions with other researchers, it appears that the specific architecture of using a microcontroller to run a TinyML algorithm and communicate results through LoRa, while also being capable of updates via image transfer and Firmware Update Over The Air (FUOTA), is novel. Close works that aligns with ours are presented by the researchers in [START_REF] Altayeb | Classifying mosquito wingbeat sound using TinyML[END_REF], who also developed a platform with a TinyML model for the communication of results over a LoRa network, specifically for mosquito wingbeat classification to count different species. Another team of research proposed a retro fit system where they use a microcontroller ESP32-cam to read the mechanical display of a water meter and communicate the data over LoRa [START_REF] Nguyen | Research and Implement Embedded Artificial Intelligence in Low-Power Water Meter Reading Device[END_REF]. Authors in [START_REF] Teoh | An internet of things based smart waste management system using LoRa and tensorflow deep learning model[END_REF] also developed a bin management system using LoRa and edge AI. However, they ran the TinyML model on a System on Chip (SoC) Raspberry Pi instead of a microcontroller and did not tackle the issue of energy consumption. All the works previously mentioned, despite demonstrating the applications of such architectures even beyond the realm of agriculture, did not propose an update procedure to address model drift post-deployment.

. Environment development

To execute our proposal, we meticulously selected a range of software, hardware components, and the LPWAN communication protocol, LoRaWAN. This section will delve into each of these components in detail to elucidate their functionalities and role into our architecture.

LoRa & LoRaWAN

We will discuss the detailed workings of LoRa and LoRaWAN in this section, alongside research projects that align with our architectural objectives, specifically FUOTA and image transmission.

Among the myriad LPWAN technologies available, LoRa stands out as the most widely used and recommended for agricultural applications. This preference is attributed to its communication range, power efficiency, open-source nature, and the utilization of open frequency bands that don't necessitate expensive licenses. In practical terms, this means farmers can easily establish their own networks on their farms with the only major expense being the gateways and other hardware equipment such as server if he does not rely on the cloud for the application process. Historically speaking , LoRa is a recent technology and began in 2009 when two French engineers, Nicolas Sornin and Olivier Seller [START_REF] Bardyn | IoT: The era of LPWAN is starting now[END_REF], wanted to develop a long-range, low-power modulation technology. They created their own startup in 2010 called Cycleo that revolved around this goal. Convinced by the potential of this long-range and low-power technology, Semtech a major semiconductor company, acquired Cycleo in May 2012. Semtech pushed the creation of a MAC prototocol to help the standardisation of the technology by defining message format and the implementation of security features, this protocol will later be refered to as LoRaWAN and is distributed in open source. In february 2015 the LoRa alliance [347] was created to support and promote the global adoption of the LoRaWAN standard by ensuring the interoperability of all LoRaWAN products and technologies.

To achieve long distance and low power consumption, LoRa uses a Chirp Spread Spectrum (CSS) spread spectrum modulation technique, a technology commonly used for sonars in the maritime industry and radars in aviation [START_REF] Reynders | Chirp spread spectrum as a modulation technique for long range communication[END_REF]. This phenomenon is also found in nature among dolphins and bats to detect fish or insects. Indeed, Cycleo did not invent the CSS technology, but rather pioneered the use of this technology for data transmission. From a electronic wave modulation point of view CSS consists of changing the value of the frequency over time, increasing or decreasing the frequency over a defined time slot to encode data. The process of CSS is depicted in figure 3.3 with a LoRaWAN frame. Each frame starts with a preamble and a synchronisation process before adding the data. We can see that Chirp impulse can be either up or down and that multiple chirp can be performed per time slot. LoRaWAN network are therefore composed of the following part:

• End Devices: Sensors or actuators transmit messages wirelessly using LoRa modulation to the gateways and similarly receive messages wirelessly from the gateways.

• Gateways: Receive messages from end devices and forward them to the Network Server using a a different network type called backhaul, like cellular, wifi, ethernet etc.

• Network Server: It primarily routes messages from the devices to the application server, verifies addresses, and ensures network availability by sending adaptive data rate commands to the devices. It is also responsible for implementing security protocols and confirming the authenticity and origin of messages. Furthermore, it oversees the acknowledgment process by relaying receive statuses to devices. If a message is received multiple times, the software sorts and retains only the relevant one. In terms of message transmission verification, LoRaWAN can be likened to a simple ALOHA protocol. It also manage downlink by choosing the best gateway for a device and also by handling the firmware update over the air processes. • Join server: This server, that is often associated to the network server, is in charge of managing the activation of new devices in a network in a secure way.

End devices communicate with nearby gateways and each gateway is connected to the network server. LoRaWAN networks use an ALOHA based protocol, so end devices don't need to peer with specific gateways. Messages sent from end devices travel through all gateways within range. These messages are received by the Network Server. If the Network Server has received multiple copies of the same message, it keeps a single copy of the message and discards others. This is known as message deduplication.

As mention previously, LoRa frequencies falls into the category of ISM regulation. The regulation about those band variate between countries as no worldwide standard has been adopted. In Europa for example, those bands are centered around the 868 MHz frequency while in the US it is around the 915 MHz one. This ISM frenquency is divided into various channels. In Europe there is a total of 16 channel with a 125 kHz bandwith between 863 Mhz and 870 MHz. As those licenses are free to use there is still a strong regulation limitation called the duty cycle. In Europe, the duty cycle is 1%, meaning that a device can only send data during 864 second per day.

The data rate (DR) in LoRa is a crucial factor.

DR = BW × SF × CR 2 SF
Table 3.1 displays the recommended data rate configurations and their associated bit rates, correlated with various Spreading Factor and Bandwidth values. The coding rate isn't considered as it is an external parameter dependent on the specific application. More often, it is set to its common value of 4/5.

The maximum payload of each data packet is also defined by the regulation. In Europe it is dependent on the data rate and the different value are gathered in table 3 • Spreading Factor: The spreading factor controls the chirp rate, and thus controls the speed of data transmission. Lower spreading factors mean faster chirps and therefore a higher data transmission rate. • Bandwidth: In this context, the bandwidth refers to the channel frequency utilized by the device for communication. Doubling the bandwidth leads to a corresponding doubling of the bit rate, given a constant spreading factor and coding rate. The minimum bandwidth is 125kHz, but 250 kHz or even 500 kHz can also be used, as illustrated in table 3.3.

• Coding rate (CR): LoRa modulation also adds a forward error correction (FEC) in every data transmission. This implementation is done by encoding 4-bit data with redundancies into 5-bit, 6-bit, 7-bit, or even 8bit. Using this redundancy will allow the LoRa signal to endure short Spreading factor Bandwidth Bit rate (kbits/s 7 125 5.5 7 250 10.9 7 500 21.9

Table 3.3: Difference in bit rate according to bandwidth interferences. The Coding Rate (CR) value need to be adjusted according to conditions of the channel used for data transmission. If there are too many interference in the channel, then it's recommended to increase the value of CR. However, the rise in CR value will also increase the duration for the transmission

In conclusion regarding the Data Rate, it is adaptive. This means that depending on the quality of the link within a network, which is determined based on the Signal to Noise Ratio, both the gateway and node will adjust their data rate to ensure reliable transmission. Generally, lower data rates are less susceptible to noise. LoRa implements the simple ALOHA access protocol for channel access. Every time a device wants to use a channel, it sends its message without checking if the channel is busy. If it does not receive an acknowledgment from the reciever, it will retransmit its message after a random period of time [START_REF] Abramson | The ALOHA system: Another alternative for computer communications[END_REF].

The LoRaWAN specification defines three device types: Class A, Class B, and Class C. All LoRaWAN devices must implement Class A, whereas Class B and Class C are extensions to the specification of Class A devices. All device classes support bi-directional communication (uplink and downlink);

• Class A: Class A communication is always initiated by the end-device. A device can send an uplink message at any time. Once the uplink transmission is completed the device opens two short receive (downlink) windows. There is a delay between the end of the uplink transmission and the start of the receive windows (RX1 and RX2 respectively. If the network server does not respond during these two receive windows, the next downlink will be after the next uplink transmission. This shown in figure 3.6

• Class B: Class B devices open scheduled receive windows for receiving downlink messages from the network server. Using time-synchronized beacons transmitted by the gateway, the devices periodically open receive windows. The time between two beacons is known as the beacon period. The device opens downlink 'ping slots' at scheduled times for receiving downlink messages from the network server. Class B devices also open receive windows after sending an uplink, as you can see in Figure 3.7: Amongst the variety of application LoRaWAN can be employed in, two of them are of special interest for us and our architecture namely the heavy media file transfer and the firmware update over the air (FUOTA).

• Heavy data offload: The architecture we propose that support model update for local application is, to our knowledge, novel. Consequently, we found no literature addressing this specific use case of heavy data offloading for model re-training. However, studies exploring the transfer of substantial data, such as images or audio files, using the LoRa network are available. In this section, we'll examine them to better define our strategy for implementing this functionality in our system. Firstly, we'll conduct a theoretical calculation to understand the number of pictures that can be sent daily based on the picture size. Various data rate values exist, determined by network availability, which in turn determine the speed (S) of transmission in bits per second (Bps). A lower data rate increases the probability of message transmission at the expense of bit rate. Typical data rate values for LoRa are presented in table 3.1. We are also aware of the duty cycle (DC) -the time a device can transmit data daily as per regulations. Using this information, along with the size of a media (MS), we can determine the maximum number (N) of times a media can be transmitted in a day using the formula:

N = S × DC M S
After performing the calculations, the theoretical number of media items that each data rate can send, based on media size, is shown in Figure 3.9.

Typical AI applications in agriculture demand varied data processing frequencies based on the specific application. For instance, monitoring the progression of diseases on crop leaves may necessitate data collection only once an hour. In contrast, tasks such as identifying and counting individual cows in a herd passing through a gate could require thousands of executions daily [START_REF] Wolfert | Big data in smart farming-a review[END_REF]. Given the diverse range of applications, it's reasonable to assume that many will need at least a hundred executions a day.

The results underscores LoRa's inefficiency in handling large file transfers, rendering it ill-suited for AI cloud data processing. Transferring files of 10 kb remains manageable, with every spreading factor able to transmit more than ten images daily. In the most optimal data rate scenarios, over a thousand can be sent. However, the system encounters difficulties with files larger than 100kb. None of the data rates can satisfy the previously mentioned requirement for agricultural applications. This also underscores the need for efficient file compression to adhere to regulatory standards, particularly when sporadically offloading large data sets.

Figure 3.9: Theoretical maximum number of large media files transferable per day based on data rate and media size Despite these limitations, LoRa has been studied as a tool for image transmission in various scenarios. From our research, we identified noteworthy projects and compiled their characteristics and limitations -Authors in [START_REF] Akram | Overcoming limitations of LoRa physical layer in image transmission[END_REF] proposed a method for long-distance image transmission using LoRa for mangrove monitoring. They achieved distances of up to 6 km, which was suitable for their application. For transmission, the images were compressed using the JPEG format before being converted into a hexadecimal format. Subsequently, the files were split into small packets for transmission. Although they mentioned duty cycle limitations, they did not specify the number of images transmitted per day that adhered to these constraints. The exact size of the transmitted image wasn't explicitly stated; however, an approximation of 25 kB can be inferred from their experimental results. They tested their system using various data rates, and the transmission speeds ranged from 67 to 840 seconds. This implies that between 12 and 1 image was transferred per day.

-Authors in [START_REF] Wei | The Development of LoRa Image Transmission Based on Time Division Multiplexing[END_REF][START_REF] Wei | Image transmission using LoRa technology with various spreading factors[END_REF] tested image transmission for three simultaneous nodes using a broadcast timing algorithm. In this setup, the gateway synchronizes the transmissions of each node, allotting specific time slots for their individual image transfers. In their experiments, they transmitted images approximately 30kb in size.

They assessed the transmission of these images under various conditions and at different data rates. Under optimal network conditions (highest data rate with a clear line of sight), the transmission time was 51 seconds, while in degraded network conditions with obstructions such as buildings, it took 150 seconds. This means they could transmit between 17 and 5 images a day, depending on the conditions. The same author, Ching-Chuan Wei, also conducted an analysis of LoRa image transmission based on different encoding methods. He showed that WebP was more efficient than JPEG [START_REF] Wei | Comparison of the LoRa image transmission efficiency based on different encoding methods[END_REF].

-Authors in [START_REF] Guerra | A low-rate encoder for image transmission using LoRa communication modules[END_REF] proposed an experimentation for LoRa image transmission over varying distances. They successfully transmitted 64 kb images over distances of 2 km in 110 seconds, 5 km in 146 seconds, and 16 km in 210 seconds. While they did not address the duty cycle issue directly, based on their results, we can infer that the maximum number of images they could transmit per day is 7 at 2 km, 5 at 5 km, and 4 at 16 km. They utilized the JPEG2000 compression technique and emphasized how image encoding can significantly influence transmission time.

-Authors in [START_REF] Fort | Quasireal time remote video surveillance unit for lorawan-based image transmission[END_REF] attempted to implement a quasi-real-time video surveillance system that transfers LoRa frames upon detecting movement. They demonstrated that WebP is a viable compression format for images, as they were able to reduce pictures from 3.1 MB to 3.8 kB. However, during their testing, with unspecified parameters, it took up to 10 minutes to send just one picture, suggesting potential issues with their test setup.

- [START_REF] John | LoRaWAN-based Camera with (CIRA) Compression and Image Recovery Algorithm[END_REF] proposed a compression and image recovery algorithm based on JPEG, where they managed to compress images that were several MB in size to between 2.7 and 27 kB. Although they didn't provide detailed transmission parameters, they successfully achieved transmission times under 30 seconds to comply with the Thing Network LoRa provider's rules.

- [START_REF] Pham | Low-cost, low-power and long-range image sensor for visual surveillance[END_REF] is the first real implementation of LoRa image transmission that we encountered in the literature. The author implemented a simple model using JPEG image compression to send images of 8kB, but did not specify the actual transmission time. In subsequent work, [START_REF] Pham | Robust CSMA for long-range LoRa transmissions with image sensing devices[END_REF], the same authors highlighted the limitations of the simple ALOHA protocol that LoRa uses for communication.

They also proposed employing CSMA (Carrier Sense Multiple Access) [START_REF] Kleinrock | Packet Switching in Radio Channels: Part I -Carrier Sense Multiple-Access Modes and Their Throughput-Delay Characteristics[END_REF] methods to allow multiple nodes to communicate im-

The research projects we've encountered lead us to several conclusions regarding heavy file transfers in LoRa networks. Firstly, while such transfers are possible, they are limited in terms of the number of transmissions per day. This means they may not be suitable for applications requiring frequent heavy data offloads. Based on our analysis, we believe that an application requiring more than 50 transfers a day would be impractical, and it would be advisable to minimize such transfers, thereby tailoring the application precisely to its needs. Secondly, heavy files must be compressed to reduce the transmission size. Ideally, the size of compressed files should be kept under 100 kb. Among the identified compression methods for images, three stood out: JPEG, JPEG2000, and WebP, with WebP appearing to be the most efficient. This emphasis on compression underscores the potential value of tinyML, as cloud-based ML algorithms would primarily have access to compressed data, implying a loss of information.Lastly, we want to highlight the inefficiency of the ALOHA protocol for large data file transmissions, as it could lead to network congestion when many packets are transmitted simultaneously. To mitigate this issue, various methods have been proposed, including CSMA protocol implementation, time slot allocation per node, and grouped packet acknowledgments

• Firmware Update over the Air FUOTA is a critical requirement for IoT devices. The need for updates is inherent to any computer science project. This is due to multiple reasons: The upgrading of an application, the evolution of an application towards a different direction, calibrating a device in a specific environment, or implementing security updates to protect a device from newly discovered vulnerabilities. Specifically, in the case of IoT, these updates need to be performed over the air, i.e., wirelessly, as devices are often numerous and spread across vast geographical areas. This makes it challenging for operators to manually update each device by connecting to them through a wired connection. This is typically the case for LoRa agricultural networks. The authors in [START_REF] Arakadakis | Firmware Over-the-Air Programming Techniques for IoT Networks -A Survey[END_REF][START_REF] El | Secure firmware Over-The-Air updates for IoT: Survey, challenges, and discussions[END_REF] have provided comprehensive surveys on FUOTA for IoT. Additionally, the researchers in [START_REF] Bettayeb | Firmware update attacks and security for IoT devices: Survey[END_REF] have presented a survey detailing various security threats associated with firmware updates. There is usually two type of mode for FUOTA, push mode and pull mode. In "push mode," a centralized update server, whether on the cloud or locally, actively sends the latest firmware version to each device. This method's primary benefit is its immediacy, ensuring devices promptly receive updates when they're ready for them. However, a significant drawback is its high bandwidth consumption. As updates are sent individually to every device, this method is best suited for updating smaller groups of devices. On the other hand, "pull mode" involves devices independently checking for available updates at regular intervals. If an update is found, the device will download it. This method is more bandwidth-efficient compared to push mode. Yet, it has its downsides. If the device checks infrequently, crucial updates could be delayed. Furthermore, if a device isn't in the right state to initiate an update, it might experience prolonged delays. Another consideration is that devices in pull mode don't necessarily register for these updates. While this might seem beneficial in terms of development simplicity, it's not ideal from device management and security standpoints. Both of these update methods can be implemented simultaneously within a single application, creating a hybrid approach.

In the specific case of LoRa and LoRaWAN, the FUOTA procedure has recently been standardized by the LoRa Alliance, a working group at Semtech, the company that owns the patented radio technology of LoRa. The detailed standard is available at [START_REF] Alliance | Fuota process summary technical recommendation[END_REF][START_REF] Sornin | LoRaWAN Firmware Updates OTA[END_REF] and is illustrated in figure 3.10. It is recommended as a push-based method but could be adapted into a hybrid or pull method. The FUOTA process is managed by the Firmware Update Server, which collaborates closely with the Application Server that implements a firmware management layer. The File Distribution Server oversees the key parameters of LoRa FUOTA, which include multicast addressing, fragmentation, and clock synchronization. On the device side, the firmware must incorporate a bootloader to oversee transitions between firmware versions. The various steps of the FUOTA process are as follows:

1. Multicast addressing: Typically, multiple devices need updates simultaneously. For efficiency, these devices can be grouped under a single address. Each device in a LoRaWAN network has a unique identity, comprised of a 32-bit device address and a set of AES128 keys for unique identification and authentication. A device can also be part of up to four multicast groups. During multicast addressing, the application server identifies the devices to be updated, assigns them a specific address, and provides them with an application key for payload encryption and a session key for computing the message integrity check (MIC).

of large data blocks to individual or multiple devices. The application server sends information to the device about each transmission session, including the total number of packets it should receive, as well as the error recovery and fragmentation algorithms being used.

3. Clock synchronisation: Many LoRa devices operate in Class A mode to conserve energy. To simultaneously update multiple devices, the network server assigns a time slot to each device to be awake to start the transmission of the update file. Since device clocks can drift over time, the clock synchronization process ensures all devices maintain consistent timing by updating in tandem with the server. Upon reaching their designated time slot, devices switch to Class C mode to receive the update file.

Transmission:

During transmission, the gateway sends a large number of packets to the device, which doesn't acknowledge receipt to prevent network congestion.

5. Update Upon receiving the firmware update, the bootloader checks its integrity before beginning the update process. If the received file has irreparable flaws, the update is discarded. After the update, the device reboots and usually returns to its default mode, typically Class A. Authors in [START_REF] Abdelfadeel | How to make firmware updates over lorawan possible[END_REF] have studied the specificities of the standard in different network scenario and has conclude for the efficiency of the method for firmware update smaller than 100kb but only when transmitting with the best data rate available. Authors in [START_REF] Heeger | Secure LoRa firmware update with adaptive data rate techniques[END_REF] have shown that uploading a 128 kb firmware size took between 16 mi and 8.36 hours depending on the data rate, this is acceptable timing in the best data rate scenario but it is way to long to respect duty cycle regulation. Authors in [START_REF] Hess | Ultra-low-power overthe-air-update in secure lorawan networks[END_REF] have proposed an efficient implementation of a FUOTA LoRa server with the open source LoRa server from the Chirp Stack. To the best of our understanding, no research has been done on updating TinyML models via LoRa. Nonetheless, we presume that the firmware update process for such applications mirrors that of more conventional ones.

Hardware

Hardware evaluations were carried out across multiple platforms. For devices running the TinyML algorithm, we selected several microcontrollers based on specific criteria:

• Arduino's Portenta H7 [370] paired with the Portenta Vision Shield -LoRa [371]: Arduino environment needs little introduction for those familiar with microcontrollers. Recently, Arduino shifted from its iconic 8bit architecture to the more potent 32-bit system, facilitating advanced computations. The Portenta H7 represent this evolution with its Arm cortex microcontroller. It's complemented by a shield featuring the Himax HM-01B0 monochrome 320x320-pixel camera module and LoRa capabilities, powered by Semtech's SX1276 chip. The rationale behind using an Arduino is to make replicating our research easier, as the Arduino development environment is widely recognized and user-friendly for embedded system engineers. The sensor node utilizes the STM32 NUCLEO-L073RZ equiped with an SX1276 LoRa transceiver. Meanwhile, the gateway is built around the NUCLEO-F746ZG and incorporates the SX1301 gateway chip. In the realm of embedded devices, STM32 is regarded as a professional choice, and the STMCube ecosystem holds a prominent position in the industry. Furthermore, its 32-bit architecture enables the execution of complex algorithms. This made it compelling for us to evaluate its performance within our architecture. However, the kit did not include a cam-era, so we integrated an OV2640 [373], a 2-megapixel RGB low-power camera

Software

Multiple software and tools were used during our research to develop our system and test it. Some of them in particular worth mentioning are:

• STM32 Cube environment[376]: This software was use for the programming of microcontroller. The STM32Cube development environment is a software platform offered by the company STMicroelectronics for their STM32 microcontroller series. It makes it easier for developers to create applications for STM32 microcontrollers.

• VS code & PlatformIO[377]: VS code is a famous IDE which has a rich ecosystem of extensions such as platformIO, a cross-platform, crossarchitecture, multiple framework, tool for embedded systems development. It was used the programming and interfacing of the LoRa network server and for the programming of ESP32 and Arduino Portenta H7 microcontroller.

. Phases

In this section, we describe the end-to-end phases implemented in our proposed architecture. Initially, we discuss the use-case scenario in normal mode to demonstrate its feasibility and energy efficiency. Subsequently, the same methodology is applied for the process of model re-training under degraded conditions that render the confidence score of the device node inefficient. The overall process is illustrated in Figure 3.15, with the steps for the normal behavior mode highlighted in blue and the degraded conditions mode highlighted in red.

Normal behavior mode

In normal behavior, the phases are as followed:

1. Data collection: In order to train the initial iteration of our model, we first need to collect data. Data can be obtained from a dataset; for example, in our application scenario, we started by utilizing the excellent fruit dataset from Kaggle [START_REF] Gorgolewski | Fruit recognition[END_REF]. However, the recommended approach in embedded machine learning is to collect data directly from the devices, since embedded camera modules often exhibit lower quality. Thus, in our scenario, the first dataset was collected through the camera device. We utilized the Edge Impulse tool to directly gather pictures from the Arduino Portenta and the ESP32 cam (which has the same camera module as the STM32). Once the data have been collected, they need to be labeled. In Figure 3.16, you can see image data labeled and collected by both the Arduino Portenta and the ESP32 cam, featuring various numbers of fruits. We trained our model to count the number of fruits in a picture using the FOMO (Faster Object, More Object) algorithm developed by Edge Impulse [START_REF] Moreau | FOMO: Object detection for constrained devices[END_REF]. FOMO is a novel machinelearning algorithm that enables object detection on highly constrained devices. It allows devices to count objects, identify the location of objects in an image, and track multiple objects in real time, utilizing up to 30 times less processing power and memory than other similar dedicated algorithms, such as MobileNet SSD or YOLOv5 [START_REF] Aadithya | Comparative Study Between MobilNet Face-Mask Detector and YOLOv3 Face-Mask Detector[END_REF], which are two algorithms also available for constrained devices. The principle of FOMO is based on heatmap determination, wherein a picture is split into multiple smaller ones, and on each is performed a binary classification to determine the presence or absence of the object we seek to count. The splitting factor of the original picture influences the processing time and power needed but allows better resolution for detecting objects that may be small or situated close to each other. Once the model is trained, it is tested over multiple data sets to determine its accuracy. In machine learning, accuracy refers to the fraction of predictions that a model gets right. It is calculated by dividing the number of correct predictions by the total number of predictions on a specified dataset. In our application, which is not critical, we set the minimum accuracy to 90%.

Model uploading:

After the initial model is trained, it is uploaded to the device via a wired connection. The overall process of data collection, model training and deploying according to Edge Impulse is depicted in figure 3.17.

Figure 3.17: TinyML model creation process with edge impulse 4. On-device inferring: As soon as it is deployed, the device will begin making predictions. For our application, which involves counting strawberry fruits, we set the number of inferences performed to one per day, although the frequency can be adjusted according to the application's needs.

Result transmission:

Once the result is obtained, it is transferred to the application server via the LoRaWAN network. The message consists of a single packet, with only the number of fruits included in the payload as an integer. After transmission, the device waits for an acknowledgment of reception from the gateway. If it does not receive it, it retries sending the message.

Result interpretation:

The application server can interpret the data. Even if it only received a number, extra information such as the localization, the number of recent passages or the historical data values of the sensors can be retrieved from the knowledge implemented with the system described in chapter 4.

7.

Sleep procedure: Once the device finished transmission it goes back in sleep mode. Sleep mode in microcontrollers refers to a low-power state that conserves energy when the device is inactive or when full power is not necessary. In sleep mode, certain functions or sections of the microcontroller are turned off or operated in a reduced-power state to minimize energy consumption, thereby extending the battery life of battery-operated devices. The exit from sleep mode can occur due to a scheduled procedure that is induced at the end of a timer, or due to an external signal. In our case, it is triggered by a timer.

Degraded condition mode

In degraded condition mode the phases are as follow:

1. On-device inferring: Every time the device runs the tinyML algorithms, it assigns a confidence score to the prediction. In machine learning, and specifically in the context of convolutional neural networks (CNNs) used for classification tasks, a confidence score is a value that represents the model's certainty regarding its prediction. After processing input data, the model generates a prediction; in our case, the estimated number of fruits. The confidence score (Cs), usually a value between 0 and 1, indicates how certain the model is that its prediction is correct, with a score closer to 1 indicating higher confidence. For example, in our specific case, the prediction might output a number of 3 strawberries with a confidence score of 0.95, meaning that the device is highly certain. However, if it counts 4 strawberries with a confidence score of 0.45, this indicates that this result should not be taken into account. In the case of successive inference processes that have low confidence scores, this might indicate that the model is not adapted to the local environment where the device is deployed and needs a new, better-adapted model.

In situations where multiple predictions in a row (number to be determined by the application, in our case we set it to 4) have low confidence scores, the system enters degraded condition mode. The procedure begins by compressing the image to the WebP format, which is identified as more efficient than JPEG or JPEG2000 in existing literature [START_REF] Wei | Comparison of the LoRa image transmission efficiency based on different encoding methods[END_REF]. The file is then prepared for transfer by converting it to a hexadecimal string. Once the data rate is selected, we determine the maximum payload size per packet and subsequently split our file accordingly. We group the packets in sets of ten to minimize network congestion, as each packet typically receives an acknowledgement in LoRa. To prevent any loss of information during this grouping, we add an extra Cyclic Redundancy Code to each group, allowing the application server to verify the successful receipt of each one. The transmission process then commences, and each group of packets is acknowledged by the server. If a group is not received, it is resent. Once all the groups have been retrieved, the server conducts a final verification of the overall received file and acknowledges the device. cation, we obtained a model with sufficient accuracy using 100 images. Depending on the specific task a smart sensor must perform, this number may be lower or higher. Images can be collected from one device or multiple devices monitoring the same phenomenon under the same conditions. Linking devices with similar characteristics can be challenging due to variations in hardware, applications, and the environments in which they are deployed, among other factors. Chapter 4 of this thesis will focus on semantic methods to link sensors together. The model retraining is quite straightforward and occurs in the same manner as in the normal behavior mode. It's important to note that in our experimentation, image data are labeled manually, requiring significant work, which could be a limitation of this solution. However, we could presume that more generic and precise AI models running on more powerful servers could automatically label the data collected by smaller devices with lower computational power. This machine-learning-oriented subject should be a topic for further research, posing the question: "How can we automatically label data collected at the edge for TinyML model re-training?" 4. Firmware Update Over the Air: After obtaining the new model, the final step in the process is to update the concerned devices. Once more, the server performs device grouping through semantic capabilities. When the server is prepared to update, it initiates the FUOTA procedure, as elucidated in 3.2.2. This procedure involves multicast addressing, file fragmentation, and clock synchronization preceding the transmission, followed by a reboot and update after an integrity check has occurred. This process is illustrated in figure 3.18, where the mode change from class A to class C during transmission, and back to class A at the conclusion. It is important to note that to avoid network congestion, there is no acknowledgment for individual packets during transmission. If the total packets received -and their integrity -do not pass the implemented error mechanism procedure, the device discards the FUOTA process and informs the server that a new update will be needed.

Image data transmission:

. Experimentation and results

. Embedded AI model

Model training

For our experiment, we trained our model in accordance with the previously described phases to identify strawberries, utilizing a collection of 100 pictures, each containing 0 to 10 instances of the fruit. We trained two distinct models: one using images from the Arduino Portenta Shield and its HM-01B0 monochrome Both libraries can be accessed from our GitHub [START_REF] Chollet | Portenta Fragola software[END_REF], and implementation on platforms can be effortlessly tested using the example library provided by Edge Impulse [START_REF] Moreau | FOMO: Object detection for constrained devices[END_REF].

Hardware deployment results

After training both TinyML models, they are ported to the various devices and tested multiple times to verify the system's robust behavior and obtain key metrics. We constructed a small wooden structure to hold the sensors and tested our architecture with varying numbers of strawberries. This test bench is shown in Figure 3 During a testing period consisting of 20 cycles for each device, we obtained a variety of results:

• Arduino Portenta: The results indicate that the estimated peak RAM usage is 243.9 kb and the firmware size is 77.5 kb, constituting 24.39% and 3.88% of Arduino's capacity, respectively, and leaving room for potential improvements. Over 20 inferences, the system's average inference time is 148 ms, and it predicted correctly for 19 measurements, signifying that the model's accuracy level is upheld.

• ESP32-Cam: The results show that the estimated peak RAM usage is 455 kB and the firmware size is 82.5 kB, which are 88.87% and 18.42% of the ESP's capacity, respectively. RAM usage is the limiting factor here, as a more complex model could exceed the RAM capacity for such a device. Over 20 inferences, the system's average inference time is 312 ms, and it predicted correctly for 17 measurements (85%), signifying that the training accuracy level of the model is maintained.

• STM32: For the STM32, the hardware characteristics are more constrained to achieve a trade-off with energy consumption. The firmware size, once compiled, is 93.2 kB, while the peak RAM usage is at 100 kB, representing respectively 9.32% and 100% of the STM32's capacity. This constrained RAM usage seems to influence the inference time, as over our test of 20 predictions, the average time for an inference was 676 ms. With 18 out of 20 predictions being correct, the accuracy is again upheld, as field testing yields a 90% accuracy level.

We can observe from this hardware deployment testing that the models are performing as expected, confirming the efficiency of TinyML in agricultural scenarios. However, we also showcase the importance of hardware selection when developing an embedded AI application. In this specific scenario, some hardware, like the Portenta, appears somewhat oversized as most of its resources are unused, while, conversely, the STM32 is underperforming due to RAM capacity. On the other hand, the ESP32 seems to be the appropriate size. We have gathered the results in Table 3

Transmission

As soon as the TinyML model finished running, the number of fruits inferred is transmitted to the server through LoRaWAN with an integer encoded on one byte, meaning the payload size of the packet is also 1 byte. This also signifies that the message will be transferred in the form of a single packet. In our experimental setup, the Gateway and the node are located in the same room, approximately 10m apart, with a clear line of sight. The coding rate value is set at 1. We collected the average time of the transmission process over 10 transmissions for the typical data rates (DR0 to DR6) and devices. Additionally, we calculated the maximum number of transmissions per day according to the duty cycle. The results are presented in We have observed that the transmission time appears to be more dependent on the data rate than on the device. This can be explained by the use of the same transmission chip hardware, the SX1276, in each microcontroller. Finally, we also conclude that, overall, the transmission duration is quite short, minimizing power consumption and adhering to duty cycle regulations (a maximum of 864s a day for transmission). This allows devices to communicate their results between 947 and 65954 times a day.

Energy Consumption: Experimental Results and Simulations

The average energy consumption of each device in various operational states is provided in the manufacturers' datasheets and is presented in Table 3.9. We chose to use the theoretical values for energy consumption, as experimental readings yielded similar average results. We can calculate the daily average energy consumption for each device by multiplying the time spent in each mode (specifically, 'run' during the inference process, 'transmission' during the transmission process, and 'sleep' during the sleep process) by the respective energy consumption of that mode and adding them together. The formula is as follows: Our experimental results are somewhat limited since our test bench does not fully mirror the real-world usage of sensors deployed on a farm. To provide a more comprehensive overview of battery life, we input the previously collected values into the FloRa [384] simulator, which is based on Omnet++ [383]. This simulator models data collection over a one-hectare surface with 100 devices, all maintaining a clear line of sight. The input parameters provided to the simulator are compiled in Table 3.10. We evaluated the energy consumption of each device across various data rates over a year.

Mode

E daily = E run × T run + E transmission × T transmission + E sleep × T sleep
The results collected from the simulator provide deeper insight into the energy consumption of each device in a Wireless Sensor Network (WSN) deployed on a farm. The results are displayed in Figure 3.21. The simulation yields data regarding the overall energy consumption of each device for each data rate over a year of operation. The total amount of energy per device per data rate is presented in Table 3.11.

From the simulation results, we observed that for the Arduino and STM32, with data rates between DR2 and DR6, a battery of 10,000 mA would enable a device to easily last a year on a battery. The ESP32 would require more optimization to be able to run on a small IoT battery, but these results emphasize once again the need for precise hardware selection for every application. From theoretical and simulation results, we conclude that our architecture is suitable for our scenario. We understand that by enhancing the battery size and performing energy optimization, each device could easily operate for an entire year or even longer. This proves the suitability of using TinyML and LoRa architecture for machine learning applications in agriculture, as farmers not only have access to AI at the edge but also only need to change the battery of their sensors infrequently. Furthermore, our experimentation could be further optimized in the future for different specific applications, making it even more energy-efficient. We also observe that energy consumption is largely dependent on the device, emphasizing once again the necessity for correct hardware selection when deploying an embedded AI model.

We also conducted additional analyses to showcase the advantages of our TinyML and LoRa architecture compared to the use of WiFi and cloud-based AI, utilizing only the Arduino Portenta for this purpose. Three scenarios were considered in our experiments, maintaining the same parameters as the previous experimentation-meaning one inference per day and a 2000 mA bat- The battery lifetime expectation results are compiled in Figure 3.23. These results validate our hypothesis that a system using LPWAN and TinyML is more energy-efficient than a system based on a more power-hungry communication method like WiFi or a cloud-based AI system. [START_REF] Chollet | Portenta Fragola software[END_REF], where they received encouraging feedback.

. Data offloading

Algorithm efficiency

After validating the suitability of our architecture in normal behavior mode, we addressed the degraded condition mode. In this section, we will focus on the image transmission process. We implemented the algorithm described in Section 3.2.3 into only the Arduino Portenta and ESP32 microcontrollers. We are concentrating on these two microcontrollers this time because the main complexity of our algorithm arises from the transmission side and the size of the image taken; whereas the ESP32 and STM32 utilize the same transmission chip and camera in their hardware configuration. The images taken from the Portenta and ESP32 can vary in size with each measurement. The average size of images taken by the Arduino Portenta and compressed with WebP over 10 images is 4.7 kb. For the ESP32, the average size of images, which are in color this time, is higher and reaches an average of 9.8 kb. The average transmission time for each image at different data rates is presented in Table 3.12. We maintained the same setup as previously, with only one node at a time, separated by 10m from the gateway, and with a clear line of sight.

From these results, we showcase the efficiency of our algorithm for sending images of different sizes, as it outperformed the other available methods presented in 3.2.2. We also obtained a result similar to the theoretical one regarding the duty cycle limitation.

Knowing that we only needed 100 pictures to train our TinyML model, we observe that the Arduino Portenta can retrain a new model in one day when communicating at data rates between DR3 and DR6. For the ESP32, retraining is possible at data rates between DR5 and DR6. However, devices, especially in agricultural scenarios such as ours, are usually not deployed in isolation, and multiple others are observing the same phenomenon. Therefore, data could be collected from multiple nodes, making it possible to transfer a sufficient amount of images for model retraining, even at the lowest data rate. For example, 10 devices equipped with the Arduino Portenta could each transfer 10 images at the lowest data rate, allowing a model to be retrained even in degraded network situations. Separating the data offload could also be beneficial for battery lifetime. Instead of having one device transfer 100 images, it would be more optimized to share this task among ten devices in order to maintain a balance in the battery level, avoiding one device running out of power more quickly than the others.

Energy consumption: Experimental result and simulation

We initially calculated the energy consumption of our system, basing our evaluations on our experimental results and the methodology previously proposed, during normal behavior mode. We determined the amount of energy needed to transfer 10, 50, or 100 images per device. These results are presented in Figure 3.24 for the ESP32 and in Figure 3.25 for the Arduino Portenta. Subsequently, we calculated the number of times the process of sending such quantities of images could be executed on a 2000 mA battery, and presented the results in Table 3.13. The results conclusively affirm the energetic feasibility of our system. However, it is once again vital to note that, depending on the specific application, model drift may require more or less data offloading. Therefore, the system's sizing must account for this need.

On the other hand, simulation results were inconclusive. When inputting the same parameters as previously enunciated into the FloRa simulator, we noticed that the packet delivery ratio was only an average of 12.2%. This is attributable to the fact that our architecture did not implement any scheduling methodology amongst the different nodes, meaning that every node tries to transmit their data simultaneously, leading to network congestion. Future work should, therefore, be conducted on scheduling. Despite the fact that efficient scheduling could help ensure network reliability during image data offloading, we discussed the role 6G could play in such scenarios in a paper published and presented at the 6GNet conference in October 2023 [START_REF] Amar Ramdane-Cherif | Embedded AI and Computation Offloading for 6G Green Communication[END_REF]. Indeed, a device equipped with a multi-radio access system, such as LoRa for result communication and cellular for data offloading (and later firmware updates), could resolve the architecture issues identified. However, for this to transpire, 6G networks need to address the challenges of cellular technology for IoT devices, namely data plan pricing, low-power communication, and network coverage.

FUOTA efficiency

In our final experimentation, we focused on the Firmware Update Over the Air Procedure (FUOTA). We implemented the protocol described in Section 3.2. From these initial results, we conclude that updating the TinyML model is feasible with LoRaWAN. As the FUOTA process is punctual, we can also assert that the duty cycle is respected, especially since it is the gateway that utilizes its duty cycle for transmission, the node device only sending acknowledgment messages. Therefore it is also of utmost importance for the gateway to correctly group the devices that need to receive the same update, as done in the multicast addressing procedure of the FUOTA recommendation. If multiple devices need different updates, the system should carefully schedule those FUOTA processes to avoid overflowing its duty cycle, especially with lower Data Rates.

Energy consumption evaluation

To demonstrate energy consumption, we considered two scenarios, both employing a DR6 data rate. In each scenario, the device spends the majority of the time in standby mode and only wakes up once a day to perform a single TinyML inference and transmit a small telemetry message to the server. Additionally, the device wakes up once a week to be updated with new firmware of 100kb size. In the first scenario, all communications are performed with LoRa, while in scenario 2, WiFi is used as a point of comparison. The overall conclusion regarding the FUOTA process is that it is suitable for a TinyML model and energy-efficient. Once again, the frequency of the FUOTA process might differ depending on the application. Therefore, careful sizing of the battery should be undertaken to ensure good device behavior. This work on FUOTA has been presented at the International Telecommunication and Network Application Conference (ITNAC) in 2022 and has received encouraging feedback [START_REF] Nicolas | Energy efficient Firmware Over The Air Update for TinyML models in LoRaWAN agricultural networks[END_REF].

. Conclusion

Promising results have emerged from this chapter, which focuses on energyefficient embedded AI deployment in an agricultural context. Initially, TinyML is identified as a compatible technology for agricultural applications. Especially when paired with a Low Power Wide Area Network (LPWAN)-in this instance, LoRa-it can furnish significant energy savings. Such devices, by processing data at the edge, circumvent dependence on the cloud, thereby enhancing privacy and reducing latency. Furthermore, they avoid transmitting heavy data files like images or sounds, a process that is not only energyintensive but also demands more robust networks, such as cellular or WiFi. These networks, however, bring their own challenges in coverage, range, energy consumption, and cost.

Utilizing LoRa and LoRaWAN enables devices to operate longer on battery power-a critical aspect for agricultural sensor networks-by transmit-Figure 3.29: Battery lifetime of the system in days for various size of firmware ting small messages over vast distances with minimal energy expenditure. LoRa, with its open-source nature, low cost, and the capability for private deployment on unlicensed bands, is particularly appealing for farmers. This is especially true in rural areas, where farms may lack adequate coverage from networks provided by professional carriers.

Nevertheless, TinyML implementation comes with its limitation, notably its sensitivity to drift. Once deployed in a specific environment, the embedded generic model will necessitate updates with local data. However, on-device learning for IoT devices is not feasible due to the computational limitations of the hardware. To address this issue, we introduce an architecture in this thesis that encompasses sporadic data offloading, server model retraining, and a Firmware Update Over The Air (FUOTA) process for TinyML devices. We have demonstrated that retrieving heavy files punctually, such as images via the LoRa network, is not only feasible but also energy-efficient, as is the FUOTA procedure.

Future work should explore various aspects of our proposal. Firstly, a scheduling process should be implemented for image offloading to prevent network congestion when too many devices attempt to offload simultaneously. This issue also pertains to the FUOTA process, where the gateway must efficiently schedule offloading and group devices. On a wider scale, we ponder the efficacy of a multi-radio access technology for such applications. While transmitting inference results via LoRa is recommended for energysaving purposes, utilizing alternative wireless networks for data offloading and FUOTA could safeguard optimal network performance, particularly when nodes are densely populated in an area. Unfortunately, we've demonstrated that other current wireless networks are also inadequate for our application type. Thus, we suggest that future work on 6th generation telecommunications should consider these specific IoT needs. Finally, it is noteworthy to men-tion ongoing efforts by various companies, like Starlink, and states to deploy satellite constellations that provide internet access even in remote areas, presenting a potentially valuable opportunity for IoT in agriculture.

-A knowledge-based approach for IoT platform management in agroecological farm

. Introduction

In the previous chapter, we presented an energy-efficient architecture for implementing smart sensors in an agricultural wireless sensor network, focusing on the perception aspect of our IoT platform. Now, we shift our focus towards the decision-making part of the platform, enabling our system to make informed decisions based on the sensor network. These decisions may pertain to farm management actions or sensor network maintenance operations. As we demonstrated in Chapter two, an effective tool for managing a wide range of data and agents, as is the case in agricultural IoT, is the creation of an expert system capable of making decisions with the assistance of a knowledge base.

A knowledge base allows for a formal representation of a context by providing a systematic classification of elements, their properties, and the relationships that exist between them. By employing an additional tool known as a reasoner, it becomes possible to imbue the objects in the knowledge base with a layer of intelligence through logical rules. This set of rules can address various situations, such as identifying the current state of a sensor or determining the appropriate course of action in the event of sensor malfunction. This approach enables the system to possess the capacity to perceive and interpret the environment, which are critical requirements for applying Agroecology knowledge. As we discussed in the introductory chapter of this thesis, Agroecology is a form of agriculture heavily reliant on the local environment, the distinct biological characteristics of the individuals within it, the crops being cultivated, and other factors.

In this chapter, we will introduce our work related to the development of a knowledge base for Agroecological farm procedures and the management of Wireless Sensor Networks in the context of smart sensors. We will introduce the concept of ontologies and explain how to construct them. Subsequently, we will describe the various resources that constitute our own ontology, along with the rules implemented to manage them. Finally, we will demonstrate how the ontology is employed by a reasoning algorithm to facilitate informed decision-making within our system.

. Definition

. Ontology

An ontology is a formal, explicit representation of knowledge that defines the concepts, relationships, and properties within a specific domain [START_REF] Staab | Handbook on ontologies[END_REF]. It serves as a structured model or framework for organizing and capturing knowledge about a particular subject area. An ontology delineates both the concepts existing within a particular domain and the connections that exist among these concepts. Various ontology languages offer distinct capabilities. The latest advancement in standardized ontology languages is exemplified by OWL (Ontology Web Langage), developed by the World Wide Web Consortium (W3C) [394]. OWL ontologies are an implementation of Description Logic (DL) [START_REF] Baader | Description logics[END_REF] which is a decidable subset of First Order Logic. OWL exists in various forms with increasing levels of expressiveness, namely OWL Lite, OWL DL, and finally OWL Full. The ascending levels of expressiveness enable the representation of more extensive knowledge, but they also entail higher computational requirements. In this thesis, we opted for OWL Full since computational efficiency was not a primary concern. An OWL ontology consists of Classes, Properties, and Individuals:

• Classes: A class denotes a fundamental concept employed for the categorization and representation of entities or objects possessing shared characteristics, properties, or attributes within a particular domain or knowledge domain. For instance, the "plant" class encompasses all individuals that fall under the category of plants. Classes are organized hierarchically, with superclasses representing more general categories and specialized sub-classes representing more specific ones. In the context of OWL, class hierarchies are not limited to tree-like structures; they allow for the use of multiple inheritance. As an example, the "tomatoes" class can inherit from both the "plant" and "fruit" classes, signifying that all tomatoes are considered both plants and fruits, and consequently, they possess the corresponding attributes. Classes can be defined using various logical expressions, including enumeration of possible instances for the class, forming unions with other classes, creating intersections between two classes, expressing negation (indicating a class's opposition to another), defining disjunction (stating that a class cannot belong to two classes simultaneously), and other methods outlined in [START_REF] Staab | Handbook on ontologies[END_REF].

• Properties: Properties serve as binary relations that establish connections between individuals of specific classes, facilitating relationships between them or linking an individual to a literal value. For example, the "hasLocation" property can be employed to connect an individual crop with an individual field, denoting the spatial association between them. In the same context, a field of the same type could possess a property called "hasGPScoordinate," pointing to a literal value. Properties can be defined in various ways, including symmetric properties, which imply that if a relation exists between class A and class B, it also holds between class B and class A. Similarly, inverses for concurrent relations indicate that if one individual is the child of class A, then class A is the parent of that child. Various types of properties are available in the OWL documentation to cater to different modeling needs.

• Individuals: also known as instances or objects, refer to specific, concrete entities or members of a class within a domain. Unlike classes, which represent general categories or types of entities, individuals represent actual, distinct objects or data points that exist within the real world or a modeled domain. Individuals can be thought of as the tangible instances or examples that belong to a class in the ontology. As an illustration, the "cow" class may encompass various specific individuals, such as Marguerite, Anatole, and Luciole. Additionally, these individuals can also be considered instances of other classes; for instance, Marguerite could be an instance of both "Dairy" and cow; "Anatole" could also belong to the "Bull" class, each representing distinct categorizations.

Ontologies can also be represented as a Knowledge Graph (KG). An example of an KG for an ontology related to Points of Interest (POI) is depicted in Figure 4.1. In this illustration, various classes, instances, and properties are employed to model knowledge pertaining to a POI. Notably, the illustration demonstrates that individuals representing the same entity in different classes can be connected as equivalents, as demonstrated with the "Wine region."

. Ontology development with OWL and Protégé

Designing an ontology entails several important considerations. Firstly, it's crucial to recognize that there are often multiple valid approaches to modeling a domain, with the most suitable choice depending on the specific application and potential future extensions. Additionally, ontology development is an iterative process, requiring refinement and adaptation as one's understanding of the domain deepens or new requirements arise. Finally, when crafting an ontology, it's essential to ensure that the concepts within it closely reflect the objects and relationships found in the domain of interest, typically corresponding to nouns (representing objects) or verbs (representing relationships) as they appear in domain-related sentences. This alignment enhances the ontology's ability to effectively capture and represent real-world knowledge. In details, the steps to build an ontology are as followed [START_REF] Debellis | A practical guide to building OWL ontologies using Protégé 5.5 and plugins[END_REF]:

1. Define the Scope and Purpose: One should start by clearly outlining the ontology's scope and objectives. This involves specifying the domain it covers and the goals it aims to achieve. This initial step aids in identifying the concepts and relationships to be included.

Identifying Concepts and Classes:

Next, identify and compile the essential concepts, entities, or classes pertinent to the domain. These serve as the foundational elements of the ontology. For example, in a medical ontology, concepts might encompass "disease," "symptom," "treatment," and "patient."

3. Defining Properties and Relationships: Determine the properties and relationships that connect these concepts within the ontology. Properties describe attributes or characteristics, while relationships specify how concepts relate to each other. For example, in a social network ontology, you might establish a "friend_of" relationship between individuals.

Creating a Taxonomy or Hierarchy:

Organize the concepts into a hierarchical structure, often referred to as a taxonomy or class hierarchy. This hierarchy illustrates the subsumption relationships between classes. For instance, in a biological ontology, "Mammal" may be a subclass of "Animal."

5. Specifying Constraints and Rules: Define constraints, rules, and axioms to express the logical relationships and limitations within the ontology. This ensures semantic consistency and coherence. For instance, you might stipulate that an individual can belong to only one "species" class.

6.

Populating the Ontology: Populate the ontology with instances or individuals that represent real-world objects or data within the domain. For instance, in a geographical ontology, you may create instances for specific countries, cities, and landmarks.

To build our ontology we will be using the Protégé software proposed by Stanford University [START_REF] Mark A Musen | The protégé project: a look back and a look forward[END_REF]. Protégé is a widely used and highly regarded opensource software tool for ontology development and knowledge modeling. It has been a staple in the field of ontology engineering for many years. Protégé provides a user-friendly environment for creating, editing, and managing ontologies, allowing users, including ontology engineers and domain experts, to define concepts, relationships, and constraints within a domain. It supports various formal ontology languages, including OWL (Web Ontology Language), making it versatile for different ontology projects. Protégé also offers a range of plugins and extensions, enabling customization and integration with other tools and services, making it a valuable resource in the development of knowledge-based systems and the Semantic Web.

. Reasoning

In ontology engineering, a reasoner is a software tool or component that plays a crucial role in semantic reasoning and inference. It is designed to analyze and draw logical conclusions from the information and relationships encoded within an ontology. Reasoners use the axioms, rules, and constraints specified in the ontology to perform tasks such as:

• Consistency Checking: Reasoners can determine if an ontology is logically consistent, which means there are no contradictory statements or errors within the ontology.

• Classification: They can classify individuals (instances) into appropriate classes based on the ontology's hierarchy and defined relationships.

• Inference: Reasoners can infer new information or relationships that are implied by the existing ontology. For example, they can deduce that if an individual belongs to a certain class and certain conditions are met, then it also belongs to another class or has specific attributes.

• Query Answering: Reasoners can answer complex queries about the ontology, helping users retrieve relevant information and make logical deductions.

• Validation: Reasoners can validate whether an ontology adheres to specified modeling patterns, constraints, and best practices.

One of the most well-known and widely used reasoners in the field of ontology engineering is the "Pellet" reasoner [START_REF] Sirin | Pellet: A practical owl-dl reasoner[END_REF]. Pellet is an open-source reasoner that supports the OWL (Web Ontology Language) standard and is integrated with the Protégé ontology development environment. It provides ro-bust reasoning capabilities for tasks such as consistency checking, classification, inference, and query answering. Pellet is recognized for its performance and scalability, making it a popular choice for ontological reasoning tasks in various applications. Therefore it will be the reasoner used in our work.

In more complex scenarios, a reasoner can be equipped with logical rules. A rule, in essence, is a philosophical concept wherein, assuming the truth or falsehood of a set of propositions, we can deduce the truth of another independent proposition. Rules consist of two distinct components: an antecedent set of conditions and a consequent set of actions. In computer systems, they are frequently depicted as statements in the format: "If <condi-tions> Then <actions>." There is multiple way to implement rules in knowledge base. In this work we will be using SWRL.

SWRL, which stands for Semantic Web Rule Language, is an ontology language extension designed to enable the representation of rules within ontologies in the Semantic Web context. SWRL allows ontology developers to express rules that define conditions and actions based on the ontology's classes and properties. A simple example use of SWRL rules would be to assert that the combination of the hasParent and hasBrother properties implies the ha-sUncle property. It could be written in SWRL this way: hasP arent(?x1, ?x2) ∧ hasBrother(?x2, ?x3) ⇒ hasU ncle(?x1, ?x3) Utilizing this expression, the reasoner can make the deduction that when X1 is identified as the offspring of X2, it logically follows that X3, who serves as the sibling of X2, concurrently assumes the role of X1's uncle.

. Proposed model

For the knowledge base of our IoT platform related to agroecology, we have chosen to propose three main classes: WSN (Wireless Sensor Network), Crops, and Farm. The overall model is presented in Figure 4.2. Our approach involves implementing elements from the Semantic Sensor Network [316] for describing the WSN and drawing inspiration from the Plant Ontology available on Planteome [START_REF] Cooper | The Planteome database: an integrated resource for reference ontologies, plant genomics and phenomics[END_REF] for describing plants. Additionally, we have taken cues from the work of authors in [START_REF] Ángel | CropPestO: An Ontology Model for Identifying and Managing Plant Pests and Diseases[END_REF] to model pest and disease interactions. Furthermore, we will incorporate a rule layer to describe the interactions between these classes and generate valuable insights on how to manage farms and sensor networks.

As mentioned previously, we utilized the Protegé software to construct our ontology. We tested our ontology with O'FAIRe [START_REF] Agroportal | Agroportal/fairness: This project is a fairness assessment tool for ontologies, vocabularies and semantic resources[END_REF], an Ontology FAIRness evaluator, and obtained a fair score based on various criteria. The results are presented in Figure 4.3. The assessment of fairness for the ontology is based on various rules outlined by the authors [START_REF] Amdouni | FAIR or FAIRer? An integrated quantitative FAIRness assessment grid for semantic resources and ontologies[END_REF]. The overall architec-

. Crops: Plant and Agroecology knowledge base

The crops class of our ontology is divided into two subclasses, namely 'plant' and 'threats.' The 'plant' class in our ontology is intended to represent the characteristics of each plant, while the 'threats' class groups together pests, diseases, and their corresponding countermeasures. The detailed graph of classes and properties is presented in Figure 4.6.

The details for each class are as follows:

• Plant: The 'Plant' class includes all the different types of crops that can be cultivated on a farm, such as wheat, tomatoes, salad, and more. While more complex information and knowledge are accessible for each plant through the linkage with the Plant Ontology (PO), we have defined some useful properties related to our application requirements:

-isEquivalentTo is an object property that links individual plants to equivalent classes in the Plant Ontology.

-hasClimate an object property that indicates the preferred types of climate for the plant.

-hasLocation is an object property that specifies the field or the greenhouse of the farm where the plant is situated.

-hasMinSeedingTemperature is a data property that indicates the minimum temperature required for the plant to commence development.

-hasWaterRequirement is a data property indicating the level of moisture required in the soil.

-hasFavoriteTypeofSoil is a object property indicating the preferred types of soils for the plant.

-isSensitiveTo is linking tdifferent threats to each plant. It is a symmetric object property with the property 'isMenaceTo' of the 'Threat' class, pointing to a disease or a pest.

On top of those basic elements, the novelty of our Knowledge base resides in the representation of what a plant needs from its ecosystem that could be provided by other plants and, conversely, the things it requires. The 'Agroecology_Bonus_Malus' class element is a subclass of the plant and models the things a plant can offer and could need from the ecosystem with the properties canProvide and canRequire. A quick example of the process is depicted in Figure 4.5, with the use case explained in the introductory chapter of this thesis being the Three Sisters companion planting (peas, corn, and squash), as depicted in Figure 1.10. We represent semantically the provided and required elements by each plant in its environment. By adding a rule in SWRL, the system is able to determine another property between two plants called isGoodAssociation, which is a symmetric property. This rule between two plants, p1 and p2, on an agroecological element, a1, is in the form of: canP rovide(?p1, ?x3)∧canRequire(?p2, ?x3) ⇒ isGoodAssociation(?p1, ?p2)

• Threats The threat class is composed of three subclasses, namely the pest, disease, and countermeasure. The pest class encompasses the various types of biological attacks that can threaten crops. Similarly, Countermeasure. This is a symmetric property with the property pro-tectAgainst, which links every countermeasure to the pest or disease it aims to cure. Each threat and measure also has an isMenaceTo property, symmetric to each plant that it is a menace to.

. WSN: Sensors and actuators knowledge base

The goal of the WSN class is to represent the basic element of our sensor network, namely the normal Sensor, the Smart sensors and the Actuators. To represent the sensor characteristics, we inspired ourselves from the Semantic Sensor Network recommendation by the W3C [316]. The different elements are presented in figure 4.7 and are described as follows:

• Sensor: The sensor class represents classic telemetry sensors and groups various types of sensors. For the purpose of experimentation, we represented only a fraction of available agricultural sensors. These sensors are for measuring Air Humidity, Temperature, Soil Moisture, Sun exposition, wind speed, and rain level. Each sensor has different properties:

-hasValue is a data property that represents the numerical value of the measurement. -hasBatteryLevel is a data property representing the battery level of each sensor.

• Smart Sensor: The smart sensor class is a bit more complex. First of all, they are linked to a firmware version through the property hasFirmware.

The firmware class itself has a boolean data property of isUpToDate representing the state of the sensor. Another pertinent property, denoted as performFUOTA, serves to establish a connection between a smart sensor and the up-to-date Firmware version with whom to perform a FUOTA procedure. The smart sensors also have different types of applications. For the purpose of experimentation, we represented only three types of smart sensor applications, namely detecting pests, detecting diseases, and counting fruit. For the pest and disease subclasses, they are linked to the pests and diseases represented in the plant class by the object property isDetecting. Finally, all subclasses have the following properties as well: could be implemented on the farm, but we focus on the farmer, the greenhouse, and the field. Additionally, we created a specific class for farmers regarding the procedures they have to implement. The farm itself has two properties, which are:

• hasGpsCoordinate is a data value representing the position of the farm in the world. This will allow our system to extract weather and climate data according to the farm's position.

• hasCurrentWeather is an object property pointing to a weather object that represents conditions such as Storm, Rain, Sun, Cloudy. Here, we could implement a Weather Ontology proposed by other research.

The different elements of the farm are the following:

• Farmer: This class represents the humans in charge of fields and greenhouses. This relation is represented with the property isInChargeOf, which links a farmer to one or multiple instances of the field and greenhouse class. This property is symmetric, with a managedBy property linking a field or a greenhouse to a farmer. The linkage between the farmer and each procedure is established through a property denoted as isPerformingX, where 'X' represents the particular type of procedure.

• Field: The field (similar to the greenhouse class) represents the spatial area where crops, sensors, and actuators are deployed. It is linked to the class Soil by the property hasSoilType.

• Greenhouse: The greenhouse class is similar to the field class but for greenhouses.

• Procedure: The procedure class represents the actions implementable by farmers. Here, too, the potential procedures are not exhaustive, and we focus on seeding procedures, harvesting, and applying countermeasures and sensor battery management. Once Again the linkage between the farmer and each procedure is established through a property denoted as isPerformingX, where 'X' represents the particular type of procedure (For example isPerformingBattChange for the procedure regarding changing the battery).

. Rule Based System

As previously discussed, we have incorporated rules into our ontology to enhance its level of expressiveness. These rules have been specifically tailored for diverse applications, and their details are presented in the following Table 4.1. Each entry in the table comprises a description of the contextual situation in which the respective rule is intended to be applied, the corresponding literal expression formulated in Semantic Web Rule Language (SWRL), and an accompanying explanation of the rule's rationale and functionality.

. Experimentation

In this section, we will populate our knowledge base with diverse instances representing different classes. Subsequently, we will conduct queries to demonstrate the system's capacity for interpreting a range of scenarios.

. Crops layout

The first scenario is to validate the identification of good associations between plants. We populated our ontology with the following plants along with their advantages and drawbacks according to Agroecology (Provide and Require):

• Tomatoes: Require protection against small insects, provide soil structure

• Corn: Provide vine support, provide shade to the ground • Squash: Require nitrogen, require shade to the ground • Peas: Require vine support, provide nitrogen

• Basil: Require soil structure, provide protection against small insects We queried our ontology to select the best associations for tomatoes and Corn, and we obtained the following results:

• Tomatoes: Basil • Corn: Squash, Peas This showcases the effective architecture around the Provide and Require classes. This example is simple but illustrates the potential of such a method to model Agroecological knowledge.

. Sensors management

In our ontology, we have populated it with five sensors: s1, s2, s3, s4, and s5. Sensors s1, s2, and s3 are situated in Field1, managed by Farmer1, while sensors s4 and s5 are located in Field2, managed by Farmer2. Specifically, sensors s1 and s4 exhibit a battery level of 10%, while the remaining sensors maintain a battery level of 50%. We have the capability to query the system to retrieve information about sensors and farmers connected through the 'isIm-plementingBattChange' relationship. The query output yields s1 with Farmer1 and s4 with Farmer2, thereby demonstrating the successful establishment of associations between sensors and farmers within the knowledge base.

. Irrigation routine

For the irrigation management aspect, we have populated our knowledge base with various instances. Initially, we have introduced three types of crops: Potatoes with a water requirement of 20, tomatoes with a water requirement of 30, and watermelons with a requirement of 40. Subsequently, we have created two farm entities, namely, farm1 and farm2, each containing two fields (designated as f1, f2, f3, and f4). Within each field, we have positioned a humidity sensor (h1, h2, h3, h4) and an irrigation valve (v1, v2, v3, v4). We have configured the current weather conditions such that farm1 experiences sunny weather, while farm2 faces stormy weather. Furthermore, we have allocated the fields as follows: potatoes in fields f1 and f3, watermelons in f2, and tomatoes in f4. To complete the setup, we have set the soil moisture sensor values to 25. When querying for irrigation valves with an 'isActive' status set to True, the system outputs only valve v2, which corresponds to the watermelon field, in line with expectations. However, when the sensor values are adjusted to 15, the system outputs valves v1 and v2. Lastly, if we configure all the current weather conditions as 'Sunny,' the system identifies the need for irrigation for all crops, resulting in the activation of all irrigation valves

. Pest and disease detection and management

In this scenario, we enrich our ontology with the inclusion of smart sensors deployed in Field1 and Field2, each tasked with detecting slug pest invasions. Field1 is under the stewardship of Farmer1, while Field2 is managed by Farmer2. We introduce instances of tomato and salad plants. A relationship denoted as 'isSensitiveTo' is established between the salad plants and slug pests. Tomatoes are cultivated in Field1, while salad plants are grown in Field2. Upon setting the values of the smart sensors in both fields to 'true,' indicating the detection of slug pests, querying the system for fields with slug infestations yields Field1 and Field2 as results. Subsequently, querying for plants sensitive to slug pests in either Field1 or Field2 yields salad plants as the result. Finally, we inquire about the associated countermeasure for slug invasion, which is the application of lavender.

. Optimal seeding and harvest detection

We can also leverage the knowledge base to extract literal values and perform operations solely on them. For instance, we can inquire about the minimum temperature requirement for seeding a tomato plant and the geographical location of the farm. Utilizing these two pieces of information, we can develop a simple algorithm to compute the average daily temperature based on weather data at the farm's location. Subsequently, we can compare these temperature values with the minimum seeding temperature requirement (set at 15 degrees) to determine the optimal date for tomato planting. For this exercise, we accessed weather data from the Meteo France website for two regions: Haut-de-France (Northern Region) and Occitanie (Southern Region). The computed average temperatures for both regions suggest that tomatoes can be planted as early as the beginning of April in Occitanie, whereas in Hautde-France, one would need to wait until the end of May to meet the temperature requirements for tomato planting.

. Conclusion

This work on ontology development has been peer-reviewed and will be presented at the International conference KEOD (Knowledge Engineering and Ontology Development) that is taking place in Rome, Italy between the 15th and 18th of November 2023.

Our knowledge base proposes interesting results regarding our application. First of all, we have showcased that knowledge-based systems could offer compelling outputs regarding sensor management. By utilizing knowledge, a system can determine which smart sensors requires update. Additionally, the system is capable of detecting low battery levels in sensors and requesting that a farmer replace the battery by identifying which farmer is responsible for the sensors based on their location in the field. The system can also interpret data and propose effective actions regarding farm procedures such as seeding or implementing countermeasures to address threats. Finally, we have proposed an architecture for plant interaction based on providing and requiring classes. Each type of crop can provide certain advantages to the environment and require specific resources from it. By modeling these characteristics for each type of crop, the system can find suitable associations between crops following Agroecology principles.

Despite these promising results, we acknowledge that for our basic architecture to be truly effective, it should be enriched with more concepts provided by expert agroecological farmers, which would require more applied research. Moreover, we have demonstrated that existing knowledge can be reused for our application; therefore, efforts should be made to integrate more knowledge into it. Finally, the critical limitation identified is the need for the correct tools for experts to provide their knowledge to the system for later reuse, as well as the development of suitable interfacing tools for users to access this knowledge. Current manual methods, as we have used, are inefficient for retrieving vast amounts of knowledge, such as that in agriculture. Hopefully, new technologies such as Large Language Models offer new capabilities for human-machine interaction. These tools mimic human speech patterns; however, their responses are not solely based on knowledge but also on speech patterns. By combining knowledge-base systems with LLM query engines, we could develop systems that efficiently manage both explicit and implicit knowledge.

-General Conclusion

. General conclusion

Smart farming will play a significant part in the sustainable transformation of agriculture. With the advent of precision agriculture, thanks to IoT platforms, ensuring reliable communication among the myriad sensors and devices on farms becomes crucial. The development of intelligent sensors that embed AI algorithms for advanced calculations at the edge further amplifies this issue. Additionally, once data are collected, farmers often find it challenging to utilize them, especially in line with agroecology principles. In this context, this thesis introduces an energy-efficient protocol tailored for embedded AI sensors over the LoRa network and a knowledge-based system to aid farmers in decision-making based on sensor data and agroecology principles.

In Chapter One, we delve into the motivation and challenges of this work, addressing the issues of data communication and interpretation. Furthermore, this chapter explains the research methodology employed. Chapter 2 reviewed the current state-of-the-art IoT platforms for agricultural purposes, Embedded AI, and knowledge engineering for Agriculture. In Chapter 3, we proposed a model to meet Embedded AI sensors requirement in LoRa network by building our own smart devices and simulating their behavior regarding energy consumption. Chapter 4 elaborates into the notion of knowledgebased systems in the context of Agroecology and Smart Sensor management. It provides a comprehensive exploration of the ontology crafted for this study, its integral components, the logical rules that form the foundation of the intelligence layer, and the sequential steps involved in the inference process. Additionally, Chapter 4 presents a range of experiments designed to validate the efficacy of our systems.

Throughout the research process, multiple novel contributions have been made. Firstly, we proved the energy efficiency of Embedded AI systems for exploiting heavy data such as images or sound. Then we proposed a protocol to allow intelligent sensors to be remotely updated on LoRa low power wide area network, despite the heavy size of such firmware over the air update. Moreover, we proposed a novel energy-efficient approach to offload heavy sensor data, such as pictures or sounds, when the confidence score of a sensor drops below an acceptable threshold. This allows AI algorithms to be re-trained in the cloud with local data before being remotely updated. With the gathered data, we proposed a knowledge base created through ontology to model the different IoT devices and their interactions with plants. We also model agroecology principles in our knowledge base, making it an ontology for the agroecological management of IoT platforms.

Overall our results showcase the future applications of Embedded AI in the agricultural domain and offer solutions to answer its networking issues with LoRa LPWAN network. Concurrently, it proved the efficiency of knowledgebase systems for complex application domains such as agroecology and sensors management.

. Future works

Despite the encouraging outcomes, we have identified certain limitations that should be the object of further research.

Firstly, on the networking side, even though we've addressed the challenges of transmitting large data files (such as firmware updates or images), LoRa technology-and broadly, all LPWAN protocols-are unsuitable for this type of application. We demonstrated that such transfers can occur sporadically in networks that aren't too dense, with a limited number of devices transmitting simultaneously. However, as the number of intelligent devices is anticipated to grow significantly, these wireless sensor networks are expected to become denser. This will challenge the ability of smart devices to communicate over LPWAN. To address these issues, several solutions can be explored. A straightforward remedy is to develop multi-Radio Access Technologies (multi-RAT), where each device is equipped with multiple network interfaces for different purposes. For instance, a sensor could have both a LoRa radio and a WiFi radio. The device would transmit its measurements and AI-inferred results via LoRa to conserve energy, while using WiFi for larger data transfers. This approach, however, complicates both the devices and the network infrastructure, as more specialized gateways are required. Another comprehensive solution involves harnessing the potential of future 6G networks. While the complete specifications and goals of 6G (the sixth generation of mobile networks) have not yet been fully defined or standardized, one primary objective will be to cater to the requirements of AI integration and denser IoT WSN networks. Consequently, we recommend that 6G provide devices the flexibility to interchangeably use either a specific low-power data channel for transmitting minimal data at a reduced energy cost or a higher data-rate channel for larger energy-costly data transfers. REWRITE:It is important to note also that future network systems based on satellite communication are becomming more proeminent and might take a mor.

Secondly, regarding the knowledge representation and reasoning component, a major limitation exists in the acquisition of knowledge. Currently, our system represents the knowledge necessary for managing an IoT platform for Agroecology using a simple use-case ontology. We constructed different parts of this ontology incrementally, drawing solely on theoretical knowledge and referencing existing ontologies, without striving for comprehensiveness. This method isn't well-suited to represent expansive domains such as agriculture, plant biology, and the broader food industry. One main challenge is the necessity of involving a vast panel of experts to integrate their knowledge into our ontology. Addressing this limitation requires research into improving the process of transferring knowledge from experts to machines. Emerging technologies like Large Language Models (LLMs) could provide valuable assistance. An LLM is an artificial intelligence model trained to understand and generate human-like text by processing vast amounts of diverse textual data. Such extensive training enables LLMs to identify a wide variety of linguistic patterns, equipping them for tasks like text generation, question answering, translation, and summarization. While models like OpenAI's GPT series showcase the potential of Large Language Models (LLMs), it's essential to acknowledge that their outputs are pattern-driven, rooted in training data, and devoid of genuine understanding or consciousness. Nevertheless, we assume that LLMs could play a pivotal role in the development of tools designed to assist experts in transferring their knowledge to a knowledge base through messaging apps and chatbot-based assistants.

. Peer-reviewed publication

The Doctoral school actively promotes its students to produce and share their contributions through scientific publications. In order to attain a PhD, students are required to generate a minimum of one peer-reviewed publication, although it is highly recommended to go beyond this requirement.

To date, I've had the honor of presenting two publications at international conferences. Presently, I have two additional papers that have been accepted and are scheduled for presentation in conferences -one in October and the other in November. Once the thesis writing process concludes, a Journal paper will encapsulate the comprehensive results achieved. Therefore As of now, there are a total of four produced peer-reviewed publications, with one more anticipated. Those are the following: In conclusion, the Doctoral School require a total of 180 points to obtain the PhD and I obtained 189. The thesis and research work account for 158 points. The total of additional training and activities (mandatory and optional) is 31 points (14 mandatory and 17 optional).

. Future opportunities

As I approach the end of my student journey, a decade after obtaining my high school diploma, I look back with nostalgia. I truly cherished those years dedicated to acquiring knowledge. However, I'm equally enthusiastic about the future, and I'm already exploring opportunities for the next phase of my career. I aspire to remain in the research field, either in academia or on a more industry-oriented trajectory. Throughout my studies, I had the opportunity to connect with many professionals in the smart farming domain, and I'm currently in discussions for a position in a research and development project at the Agrotechnopôle of INRAE (Institut National de Recherche Agronomique et Environnementale), the French research center for agriculture.

In conclusion, I want to thank again all the people who made this thesis possible. I also want to thank the reader for taking the time to explore my research.

-Annexe : Résumé de thèse en Français

L'agriculture moderne nécessite une profonde transformation pour répondre aux défis du développement durable tout en nourrissant qualitativement et quantitativement la population mondiale croissante. En effet, celle-ci repose sur l'utilisation d'éléments chimiques polluant les sols et présents en quantités limitées sur terre. L'usage de machinerie lourde nécessitant des combustibles fossiles et tassant le sol limite sa fertilité à long terme. Enfin, ces deux méthodes sont le pilier de la monoculture standardisée qui consiste à cultiver un seul type de plantes sur de vastes territoires aux écosystèmes et conditions climatiques différents, facilitant le développement de maladies et la déplétion en nutriments des sols. Pour répondre à ces problématiques, les agriculteurs adoptent le "Smart Farming" ou agriculture intelligente. C'est une méthode agricole qui utilise les nouvelles technologies de l'information et de la communication pour améliorer l'efficacité, la productivité et la durabilité de la production agricole. Elle englobe l'usage de capteurs, l'internet des objets (IoT : Internet of Things), l'intelligence artificielle (IA), l'analyse de données, la robotique et divers autres outils numériques optimisant des aspects tels que la gestion des sols, l'irrigation, la lutte antiparasitaire ou encore la gestion de l'élevage. L'objectif est d'augmenter la production tout en réduisant la consommation de ressources, minimisant les déchets et améliorant la qualité des produits. Toutefois, malgré ses avantages et son déploiement réussi dans divers projets, l'agriculture intelligente rencontre des limites : Tout d'abord, les solutions de SFs doivent être adaptées économiquement au domaine agricole où les marges sont faibles. Ensuite, les fermiers doivent être accompagnés pour l'implémentation et l'utilisation de ces nouvelles méthodes. Enfin, le SF est trop souvent employé pour rendre des méthodes d'agriculture polluante plus durables au lieu de proposer des solutions pour rendre l'agriculture durable plus productive. Une des méthodes durables les plus connues est l'agroécologie qui se base sur l'observation et l'interprétation de l'écosystème local pour adapter les pratiques agricoles à celui-ci. Dans ce contexte, cette thèse s'est intéressée à la création d'une plateforme IoT pour les fermiers afin de faciliter leur transition écologique. Une plateforme IoT est un système informatique capable de percevoir des données dans l'environnement (notamment à l'aide de capteurs), de les interpréter et de proposer des actions à réaliser en fonction des données récoltées. Un exemple serait un capteur d'humidité du sol qui détermine la quantité d'eau disponible pour les plantes proches et déciderait d'ouvrir ou non une vanne d'irrigation pour fournir la quantité précise en eau tout en évitant de gaspiller la ressource. Dans la réalité, l'irrigation dépend de bien plus de phénomènes comme le type de sol et de plantes, la température, les prévisions météos, la date, etc. Cette thèse s'est intéressée à deux problématiques de telles plateformes IoT : la perception de phénomènes complexes grâce à l'IA embarquée ainsi que la prise de décision à l'aide de méthodes d'ingénierie des connaissances. L'IA embarquée, également appelée "Embedded AI" en anglais, désigne l'intégration de technologies et d'algorithmes d'intelligence artificielle dans des dispositifs ou des systèmes informatiques avec des puissances de calcul restreintes tels que des capteurs. L'avantage de ces capteurs est leur indépendance vis-à-vis du cloud pour interpréter des données complexes comme les images. Cette indépendance permet d'obtenir des gains en termes de données, de confidentialité et surtout en termes d'énergie, car le transfert de données est généralement le processus le plus coûteux énergétiquement, ce qui pose problème pour des capteurs opérant sur batterie. Grâce à l'IA embarquée, une flotte de capteurs peut détecter des phénomènes complexes en agroécologie comme le développement de maladies sur les feuilles, le nombre de fruits prêts à la récolte, etc. Le problème de cette méthode est que le modèle d'IA embarqué doit être mis à jour fréquemment, ce qui nécessite de collecter des données dans l'environnement où le capteur est déployé afin de ré-entraîner des modèles dans le Cloud pour les redéployer à distance par la suite. Or les capteurs agricoles utilisent des réseaux de communication de type LPWAN (Low Power Wide Area Network -Réseau étendu à faible consommation d'énergie) qui permettent aux capteurs de communiquer sur de longues distances avec une très faible consommation d'énergie, mais au détriment du débit de données. Cette thèse a donc proposé des protocoles algorithmiques de mise à jour à distance et de collecte ponctuelle de données pour des modèles d'intelligence artificielle fonctionnant sur des réseaux LoRa. L'efficacité énergétique de ces systèmes a été prouvée ainsi que leur faisabilité, cependant il a été déterminé que la mise à l'échelle de telles solutions est complexe, ainsi les futurs réseaux de type 6G devront adresser cette problématique. Cette partie a fait l'objet de 3 publications dans des conférences internationales. La deuxième contribution de cette thèse concerne la prise de décisions à partir de ces données perçues. Pour ce faire, nous avons modélisé les connaissances agroécologiques ainsi que les caractéristiques des différents capteurs afin de proposer un système capable de proposer des plans pour des fermes en multicultures ainsi que la gestion de l'irrigation et des menaces (maladies et parasites). Nous avons utilisé des méthodes sémantiques basées sur les ontologies pour réaliser cela. Cette partie a fait l'objet d'une publication dans une conférence internationale. Dans l'ensemble, nos résultats mettent en avant les futures applications de l'IA Embarquée dans le domaine agricole et proposent des solutions pour répondre à ses problèmes de mise en réseau avec le réseau LoRa LPWAN. Parallèlement, a été démontré l'efficacité des systèmes de base de connaissances pour des domaines d'application complexes tels que l'agroécologie et la gestion des capteurs.

Organisme 2 :

 2 ECE -École Centrale d'Électronique Addresse: 10 Rue Sextius Michel, 75015 Paris XV URL: www.ece.fr Présentation:

3. 8

 8 Class C receive windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Theoretical maximum number of large media files transferable per day based on data rate and media size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10 FUOTA architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 Arduino Portenta H7 and its LoRa Vision Shield . . . . . . . . . . . . . . . . . . . . . . . 3.12 STM32 Nucleo pack LoRa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13 ESP32 Cam and theattached Hope RFM95W module for LoRa connectivity . . . . . . . . 3.14 Laird Sentrius RG168 Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.15 Overall process flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.16 Image data acquired through the Arduino Portenta are on the right, and through the ESP32 cam are on the left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.17 TinyML model creation process with edge impulse . . . . . . . . . . . . . . . . . . . . . 3.18 FUOTA Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.19 Test Bench Featuring the ESP32-Cam on the left, the Arduino Portenta in the middle, and the STM32 on the right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.20 Battery Lifetime (in Days) for Various Data Rates, Based on Experimental Results and Theoretical Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.21 Simulation Outcomes for a One-Year Operational Period . . . . . . . . . . . . . . . . . .3.22 Evolution of Battery level over time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.23 Battery Lifetime of the system in days . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.24 Energy consumption of the system for transferring various numbers of images using the ESP32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.25 Energy consumption of the system for transferring various numbers of images using the Arduino Portenta. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.26 Evolution of Battery level over time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.27 Battery lifetime of the system in days . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.28 Evolution of Battery level over time for various size of firmware . . . . . . . . . . . . . . 3.29 Battery lifetime of the system in days for various size of firmware . . . . . . . . . . . . . 4.1 Ontology and instanced data comparison . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 General Knowledge-Base model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Ontology Fairnness Evaluator Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Ontology Structure in Protégé . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Relationship between different indivuduals of the Plant class and the inferrred association based on the provided and required properties . . . . . . . . . . . . . . . . . . . . 4.6 Ontological representation of the Crops class . . . . . . . . . . . . . . . . . . . . . . . . 4.7 Ontological representation of the WSN class . . . . . . . . . . . . . . . . . . . . . . . . . 4.8 Ontological representation of the Farm class . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 ICFUN presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 ITNAC presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 6gnet presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Eceborg group photo when I was president . . . . . . . . . . . . . . . . . . . . . . . . .

2. 1

 1 Usual technologies used in the IoT domain . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Main network protocols acording to OSI/ISO Model used in the IoT field . . . . . . . . . 2.3 Main LPWANs technical specificities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 Bit rate for each data rate (DR0 -DR6) configured with the spreading factor and the bandwidth. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Packet sizes (N) in bytes for each Data Rate of European regulation . . . . . . . . . . . . 3.3 Difference in bit rate according to bandwidth . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Image transfer via LoRa literature survey . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Hardware and Software Components for System Evaluation . . . . . . . . . . . . . . . . 3.6 Hardware Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7 Hardware deployment results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 Transmission Time in Milliseconds of Inference Result for Various Data Rates and maximal number of inference a day according to Duty Cycle . . . . . . . . . . . . . . . . . . 3.9 Power Consumption for Each Device Across Various States . . . . . . . . . . . . . . . . 3.10 Simulation Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 Total Energy Requirement in mA for One Year of Device Operation . . . . . . . . . . . . 3.12 Average Image Transmission Time (s) and Maximum Daily Transfers at Various Data Rates, According to Duty Cycle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13 Number of Image Offload Operations Possible with a 2000 mA Battery, According to Data Rate and Quantity of Images Sent in a Single Operation. . . . . . . . . . . . . . . . 3.14 FUOTA process duration in seconds (s) . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.1 SWRL rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 Mandatory additional training of the Doctoral School of Paris-Saclay . . . . . . . . . . . 5.2 Optional activities and trainings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

•

  FUOTA: Firmware Update Over The Air • ICT : Information and Communication Technology • IoT : Internet of Things • IIoT : Industrial Internet of Things • LPWAN : Low Power Wide Area Network • ML : Machine Learning • PA : Precision Agriculture • QoS : Quality of Service • SF : Smart Farming • SSF : Small-Scale Farm (and Farmer) • TinyML : Tiny Machine Learning • WSN : Wireless Sensor Network

Figure 1 . 1 :

 11 Figure 1.1: Projected change in future global crop yields between 2010 and 2050 [19]

Figure 1 . 4 :

 14 Figure 1.4: Development road-map of industrial revolutions and agriculturalrevolutions[START_REF] Liu | From Industry 4.0 to Agriculture 4.0: Current status, enabling technologies, and research challenges[END_REF]

Figure 1 . 5 :

 15 Figure 1.5: Smart Farming domains

Figure 1 . 6 :

 16 Figure 1.6: Iot platform example

Figure 1 . 7 :

 17 Figure 1.7: Edge computing interest (Google trends 2013-2020)[START_REF] Merenda | Edge machine learning for ai-enabled iot devices: A review[END_REF]

Figure 1 . 8 :

 18 Figure 1.8: Cloud computing (top) vs Edge computing (bottom)

Figure 1 . 10 :

 110 Figure 1.10: Three sisters method representation

Figure 1 . 11 :

 111 Figure 1.11: Overall view of the IoT platform

Figure 1 . 12 :

 112 Figure 1.12: Methodology and contribution overall view

Figure 1 . 13 :

 113 Figure 1.13: IoT platform specific view

  .1.

Figure 2 . 1 :

 21 Figure 2.1: The cyber-physical management cycle of Smart Farming enhanced by cloud-based event and data management [69]

Figure 2 . 2 :

 22 Figure 2.2: IoT platform model

Figure 2 . 3 :

 23 Figure 2.3: IoT platform for livetock stress management

Figure 2 . 4 :

 24 Figure 2.4: 3 layers architecture

Figure 2 . 5 :

 25 Figure 2.5: The internet of Things Market 2019-2030 (number of devices in billions and USD value in millions

Figure 2 . 6 :

 26 Figure 2.6: Typical Wireless sensor networks architecture

Figure 2 . 7 :

 27 Figure 2.7: WSNs topologies [204]

. 8 .

 8 The Application Layer in TCP/IP encompasses the functions of the Application, Presentation, and Session layers of the OSI model. The Transport Layer in TCP/IP corresponds directly to the Transport Layer in the OSI model. The Internet Layer in TCP/IP aligns with the Network Layer in the OSI model. Finally, the Network Access Layer in TCP/IP combines the functions of the Data Link and Physical layers of the OSI model.

Figure 2 . 8 :

 28 Figure 2.8: OSI and TCP/IP

Figure 2 .

 2 Figure 2.9 expose the relation between distance and data rate for each protocol.

Figure 2 . 9 :

 29 Figure 2.9: Range vs speed and energy consumption in different types of Network

Figure 2 .

 2 Figure 2.10: Cloud, Fog, Edge data processing architecture

Figure 2 . 11 :

 211 Figure 2.11: Neural Network architecture

Figure 2 . 12 :

 212 Figure 2.12: Neural Network training process[START_REF] Pramoditha | Overview of a neural network's learning process[END_REF]

Figure 2 . 13 :

 213 Figure 2.13: Neurons pruning process

Figure 2 .

 2 Figure 2.14: Knowledge Pyramid

Figure 2 . 15 :

 215 Figure 2.15: Expert System Basic Architecture

  .1.

Figure 3 . 1 :

 31 Figure 3.1: System in normal behavior mode

Figure 3 . 2 :

 32 Figure 3.2: System in degraded condition mode : Data offload and FUOTA process

Figure 3 . 3 :

 33 Figure 3.3: Chirp Spread Spectrum modulation of a LoRaWAN frame

Figure 3 . 4 :

 34 Figure 3.4: A typical LoRaWAN network architecture

5 Figure 3 . 5 :

 535 Figure 3.5: Comparison of LoRa Spreading Factors: SF7 to SF12

Figure 3 . 6 :Figure 3 . 7 :

 3637 Figure 3.6: Class A receive windows

Figure 3 . 8 :

 38 Figure 3.8: Class C receive windows

Figure 3 .

 3 Figure 3.10: FUOTA architecture

Figure 3 . 11 :

 311 Figure 3.11: Arduino Portenta H7 and its LoRa Vision Shield

Figure 3 .

 3 Figure 3.12: STM32 Nucleo pack LoRa

Figure 3 . 13 :

 313 Figure 3.13: ESP32 Cam and theattached Hope RFM95W module for LoRa connectivity

Figure 3 . 14 :

 314 Figure 3.14: Laird Sentrius RG168 Gateway

Figure 3 . 15 :

 315 Figure 3.15: Overall process flowchart

Figure 3 . 16 :

 316 Figure 3.16: Image data acquired through the Arduino Portenta are on the right, and through the ESP32 cam are on the left

Figure 3 .

 3 Figure 3.18: FUOTA Session

  .19.

Figure 3 . 19 :

 319 Figure 3.19: Test Bench Featuring the ESP32-Cam on the left, the Arduino Portenta in the middle, and the STM32 on the right

131

  Using this daily energy consumption data, we can calculate the average battery life of a device utilizing a 2000 mA battery, a standard battery size for IoT devices. These results are presented in Figure3.20.

Figure 3 . 20 :

 320 Figure 3.20: Battery Lifetime (in Days) for Various Data Rates, Based on Experimental Results and Theoretical Values

Figure 3 . 21 :

 321 Figure 3.21: Simulation Outcomes for a One-Year Operational Period

  tery. In the first scenario, the TinyML algorithm operates directly on the microcontroller, and the inference result is communicated via LoRaWAN. The second scenario also involves the TinyML algorithm running directly on the microcontroller, but in this case, the result is communicated via WiFi. In the final scenario, only the captured picture is sent via WiFi to offload 10 kB of data, representing the transfer of an image and validating the impact of TinyML on energy consumption. After retrieving the average transmission time of a packet through WiFi and a 10 kB image through WiFi, we can calculate the energy consumption of scenarios 1, 2 and 3 by using the previously enounced formula. The results are presented in Figure3.22.

Figure 3 . 22 :

 322 Figure 3.22: Evolution of Battery level over time

Figure 3 . 23 :

 323 Figure 3.23: Battery Lifetime of the system in days

Figure 3 . 24 :

 324 Figure 3.24: Energy consumption of the system for transferring various numbers of images using the ESP32.

Figure 3 . 25 :

 325 Figure 3.25: Energy consumption of the system for transferring various numbers of images using the Arduino Portenta.

  For our experiment, we utilized the simple energy evaluation model from the INET framework of Omnet++ [383]. The simulator evaluates the lifetime expectancy of the battery and runs until both scenarios exhaust a 2000 mA battery. Results are presented in Figures 3.26 and 3.27. It appears that using LoRa in such an application could represent significant energy savings compared to WiFi usage.

Figure 3 . 26 :

 326 Figure 3.26: Evolution of Battery level over time

Figure 3 . 27 :Figure 3 . 28 :

 327328 Figure 3.27: Battery lifetime of the system in days

Figure 4 . 1 :

 41 Figure 4.1: Ontology and instanced data comparison

Figure 4 . 2 :

 42 Figure 4.2: General Knowledge-Base model

Figure 4 . 3 :

 43 Figure 4.3: Ontology Fairnness Evaluator Results

Figure 4 . 4 :

 44 Figure 4.4: Ontology Structure in Protégé

Figure 4 . 5 :

 45 Figure 4.5: Relationship between different indivuduals of the Plant class and the inferrred association based on the provided and required properties

Figure 4 . 6 :

 46 Figure 4.6: Ontological representation of the Crops class

Figure 4 . 8 :

 48 Figure 4.8: Ontological representation of the Farm class

1 .Figure 5 . 1 : ICFUN presentation 2 .

 1512 Figure 5.1: ICFUN presentation

Figure 5 .

 5 Figure 5.2: ITNAC presentation

Figure 5 . 3 : 6gnet presentation 4 . 2 :-

 5342 Figure 5.3: 6gnet presentation

Figure 5 . 4 :

 54 Figure 5.4: Eceborg group photo when I was president

Figure 5 . 5 :

 55 Figure 5.5: Vegetable garden of the school

Figure 5 . 6 :

 56 Figure 5.6: Class teaching

Table 2

 2

	.2 illustrates several of the fre-

ISO/OSI Model layer Network communication protocol

		CoAP, MQTT, AMQP, XMPP, DSS;
	Application	Service Discovery: mDMS, DNS-SD, SSDP;
		Security: TLS, DTLS
	Transport	TCP/UDP
	Network	Adressing: IPv4/IPv6 Routing: RPL, CORPL, CARP, etc
	Adaption	6LoWPAN, 6TiSCH, 6Lo, etc.
		IEEE 802.15.4 (Zigbee, etc.), IEEE 802.15.1
	Data Link	(Bluetooth), LPWAN (LoRaWAN, etc.), RDFID, NFC, IEEE 802.11 (Wifi), IEEE 802.3
		(Ethernet), IEEE 1901 (PLC), I2C, SPI etc.
	Table 2.2: Main network protocols acording to OSI/ISO Model used in
		the IoT field
	number of IoT devices will surge from 7.6 billion in 2019 to 24.1 billion by 2030,
	showcasing a compound annual growth rate (CAGR) of 11%, as indicated by
	recent research

  Physical layer Service Data Unit) of 127 bytes. When considering the 25 bytes from the MAC sub-layer (without security), this results in 102 bytes at the link level. Adding data link layer security, only 81 bytes remain available at the IP level. It's also important to account for the overhead from IPv6 headers (40 bytes), any potential extension headers, UDP (8 bytes), or TCP (20 bytes). In the end, the actual data payload is quite limited (33 bytes for UDP and 21 bytes for TCP), which does not meet the IPv6 specifications that require a minimum transmission unit of 1,280 bytes. This is why some WSN protocols require an adaptation layer located between the network layer and the link layer of the OSI model. For 802.15.4, this protocol is called 6LoWPAN[START_REF] Shelby | 6LoWPAN: The wireless embedded Internet[END_REF]. It receives IPv6 packets of 1,280 bytes from the network layer and transmits them to its counterpart on the remote device in 802.15.4 frames. Since these frames only have 81 bytes available, the adaptation layer must fragment the IPv6 packets before sending them and reassemble them upon receipt.

• Network layer

[START_REF] Bello | Network layer inter-operation of Device-to-Device communication technologies in Internet of Things (IoT)[END_REF]

: It is responsible for determining the best path to route data across a network of interconnected devices and networks. It handles the process of transmitting data packets from the source to the destination, potentially across multiple and diverse networks. The main objective of the network layer is to provide a means for data packets to traverse networks, taking into consideration factors like network congestion, topology, and outages. The core functionality of the network layer revolves around logical addressing with the help of IP (Internet Protocol). IP allows for the logical addressing of hosts and directs packets based on these addresses. IPv4 is the fourth version of IP, and for a long time, it was the dominant protocol. It uses 32-bit addresses, which limits the number of devices that can be addressed. As the successor to IPv4, IPv6 was introduced to tackle the address exhaustion issue associated with IPv4. It uses 128-bit addresses, providing a vastly larger address space. The introduction of IPv6 is an important progess towards the unique identification of each nodes which is fundamental for the deployment of efficient IoT architecture, but poses problems for data transmission on the physical layer due to its length. For example the 802.15.4 wireless communication protocol have a maximum size of the PSDU (

•

  Radio frequency modulation: Many LPWAN technologies use spreadspectrum techniques, which spread a narrowband signal across a wider frequency band. This helps in achieving long-range communication as the signal becomes more resistant to interference and noise. In addition, LPWAN receivers are often designed to have very high sensitivity. This means they can pick up very weak signals, allowing for longer transmission ranges. Moreover, most LPWAN technologies operate in sub-GHz bands (like 868 MHz in Europe and 915 MHz in the US), which have better propagation characteristics and can penetrate obstacles more effectively than higher frequencies. Those frequency band are usually available to use for free according to regulation as they fell under the Industrial, Scientific and Medical bands frequency bands. This allows for longer range and better indoor penetration but also cost reduction.

Finally, lowering the data rate in radio transmission typically translate to longer range in RF communication because the signal can be more readily detected and decoded over noise, even at very weak signal strengths.

• Network architecture: Many LPWAN technologies use a star network topology, where end devices communicate directly with a central gateway. This simplifies the communication process and reduces the need for energy-intensive tasks like routing. Moreover, LPWAN nodes mostly operate in "sleep" stae, only waking up to transmit or receive data. By being active only a tiny fraction of the time, they dramatically reduce their energy consumption.

Table 2 .

 2 3: Main LPWANs technical specificitiesSigfox, as seen with companies like Sencrop [242], which builds agricultural sensors, including weather stations, connected through Sigfox.

	Feature	LoRa	Sigfox	NB-IoT	LTE-M
	Bandwith (Europe)	868 MHz	868 MHz	180 KHz 3GPP Licensed 14 MHz 3GPP Licensed
	Battery life time	8-10 years	7-8 years	7-8 years	5 years
	Modulation	SS Chirp	GFSK/DBPSK UNB/GFSK/BPSK	QPSK/16
	Data rate	250bps-50 kbps 100-600 bps	66 kbps -159 kbps	1 Mbps -7 Mbps
	Range	2-50 km	3-10 km	1-5 km	10 km
	Private network support Yes	No	No	No

Table 3 .

 3 It represents the number of 1: Bit rate for each data rate (DR0 -DR6) configured with the spreading factor and the bandwidth.

	Data Rate Configuration (SF + BW) Bit rate (bit/s)
	0	LoRa: SF12 / 125 kHz	250
	1	LoRa: SF11 / 125 kHz	440
	2	LoRa: SF10 / 125 kHz	980
	3	LoRa: SF9 / 125 kHz	1760
	4	LoRa: SF8 / 125 kHz	3125
	5	LoRa: SF7 / 125 kHz	5470
	6	LoRa: SF7 / 250 kHz	11000

bits transmitted per unit of time. In LoRa modulation, the data rate is influenced by several factors, including the spreading factor (SF), bandwidth (BW), and coding rate (CR). It is expressed by the following formula:

Table 3 .

 3 .2. 2: Packet sizes (N) in bytes for each Data Rate of European regulation

	Data Rate N
	0,1,2	51
	3	115
	4,5,6,7	222
	Data rate core characteristics are :

• The thing network[378]:

  The thing network is an open source initiative developing a LoRaWAN server and sharing it freely worldwide. It was use during testing of the nodes behavior. It is an other open source LoRaWAN server software. It was use to handle the FUOTA process and the image offloading process.It is an open-source operating system for IoT devices. Designed for Arm Cortex-M microcontrollers, it simplifies the creation and deployment of code for nodes. It was used on the STM32 and Arduino Portenta. Creating TinyML algorithms is a complex task involving multiple software such as TensorFlow Lite. To help with the rapid implementation of Embedded AI devices, Google offers a freeto-use platform for research called Edge Impulse. This cloud platform for Machine Learning operations (MLOps) [empty citation] performs training operations and data collection seamlessly through a graphical user interface. We used it to develop our TinyML model for counting strawberries. Many network simulators exist for LoRa, as indicated by the author in[START_REF] Idris | Survey and comparative study of LoRa-enabled simulators for internet of things and wireless sensor networks[END_REF], but their conclusion is that their are equivalent and depend on the studied application. We chose OMNeT++ because it is an open-source, well-established C++ simulation framework primarily designed for creating network simulators. Various model frameworks, developed as individual projects, offer specialized functionalities, such as tools for sensor networks, wireless adhoc configurations, Internet protocols, performance evaluations, and more. In our case, one such independent framework is FLoRa [384], a LoRa simulator. FLoRa enables the establishment of LoRa networks with modules for LoRa nodes, gateways, and a network server. Application logic can be introduced as separate modules that connect with the network server. Both the network server and nodes support the dynamic adjustment of configuration parameters through Adaptive Data Rate (ADR). Moreover, energy consumption statistics are recorded for each node.A recapitulatif table of Software and hardware solution is presented in table3.5

	• ArmMBDED OS [381]: Network Communication	Embedded AI
	Hardware	Laird RG168 gateway, Hope RFM95, STM32	Arduino Portenta H7, STM32,ESP32 CAM
		The thing network, The
	• FreeRTOS [380]: FreeRTOS is an open-source real-time operating sys-Software ChirpStack, Omnet++ Edge Impulse
	tem (RTOS) for embedded devices. It offers multitasking support, allow-and FloRa
	ing for the simultaneous execution of multiple tasks, and is optimized
	for low memory usage and strong performance. It was employed on
	the ESP32 nodes to facilitate firmware updates.

• The ChirpStack[379]: • Edge Impulse [382]: • Omnet++ and FloRa [383, 384]:

Table 3 .

 3 5: Hardware and Software Components for System Evaluation

  To address the issue of local drift, the system needs to train another model; therefore, the application server requires new data. As explained in Section 3.2.2, transmitting images over LoRa is a complex process. In our case, we propose the following algorithm:

	Algorithm 1 Image transmission algorithm
	if Cs ≤ 0.9 then
	Compress image to Webp format
	Convert image in Webp format to hexadecimal string
	Determine data rate for transmission
	Split the file into a number of packet N according to data rate
	Group packet together by a number of 10
	Add an application specific CRC code for each group.
	Establish connection with gateway
	while P acketSent ≤ N do
	Send packet by group
	Server check the integrity of the received data
	if CRC does not match then
	Server asks for group Re-transmission
	Device re-transmit the group
	else
	Servers sends acknowledgment of reception
	end if
	end while
	Final error verification check
	Server acknowledge the reception
	end if

Table 3 .

 3 6.

		ESP32 Arduino Portenta STM32
	RAM	512 kb	1 Mb	100 kb
	Operating frequency 8 MHz	48 MHz	32 MHz
	Flash memory	448 Kb	2 Mb	1 Mb
	Table 3.6: Hardware Characteristics

  .7.

		ESP32 Arduino Portenta STM32
	Firmware memory usage 18.42%	3.88%	9.32%
	RAM usage	88.87%	24.39%	100%
	Inference time	312 ms	148 ms	676 ms
	Accuracy respected?	Yes	Yes	Yes
	Table 3.7: Hardware deployment results

Table 3

 3

	.8.

Table 3 .

 3 8: Transmission Time in Milliseconds of Inference Result for Various Data Rates and maximal number of inference a day according to Duty Cycle

Table 3 .

 3 9: Power Consumption for Each Device Across Various States

		ESP32	Arduino Portenta STM32
	Sleep	10 µA	2.95 µA	0.29 µA
	Run	190 mA	121 mA	105 mA
	Transmission LoRa 211.5 mA	142.5 mA	126.5 mA

Table 3 .

 3 10: Simulation Parameters

	100 (1 for 10 m 2 )

Table 3 .

 3 11: Total Energy Requirement in mA for One Year of Device Operation

		DR0	DR1	DR2	DR3	DR4	DR5	DR6
	ESP32	41203 29512 23941 20740 19299 18465 18115
	Arduino 20098 12584 9134	7286	6225 5786 5507
	STM32 22605 15901 12828 10836 9833 9402 9172

Table 3 .

 3 12: Average Image Transmission Time (s) and Maximum Daily Transfers at Various Data Rates, According to Duty Cycle.

	Device	DR0	DR1	DR2	DR3 DR4 DR5 DR6
	ESP32	117.60 66.82 30.00 16.70 9.41 5.37 2.67
	Max image
	transfer per	7	13	29	52	92	161	323
	day
	Arduino Portenta	56.40 32.05 14.39 8.01 4.51 2.58 1.28
	Max image
	transfer per	15	27	60	108	191	335 674
	day

Table 3 .

 3 13: Number of Image Offload Operations Possible with a 2000 mA Battery, According to Data Rate and Quantity of Images Sent in a Single Operation.

		Image
	Device	Quan-	DR0 DR1 DR2 DR3 DR4 DR5 DR6
		tity
		10	29	51	113	204 362 633 1274
	ESP32	50	6	10	23	41	72	127	255
		100	3	5	11	20	36	63	127
		10	90	158	351	631 1120 1960 3942
	Arduino	50	18	32	70	126	224 392	788
		100	9	16	35	63	112	196	394

3.

3.3 . Firmware update over the air

Table 3 .

 3 3 using the open-source LoRaWAN server, ChirpStack[379]. We adapted the FUOTA server proposed by the authors in[391] to run on our Laird Gateway. The Arduino Portenta H7 operates Arm Mbed OS in charge of the reception of the update. First, we trained a new example model with new data and compiled it. The size of the updated model is 83.6 kb. The FUOTA process is long as the firmware size is substantial. We compiled the average time measured for 10 FUOTA process for a node device (reception and update) with the same firmware according to different Data Rates (DR) in Table3.14. 14: FUOTA process duration in seconds (s)

		DR0 DR1 DR2 DR3 DR4 DR5 DR6
	Arduino Portenta	552 475 412	302 245 176	153
	Duty Cycle limitation	1	1	2	2	3	4	5

Table 4 .

 4

	1: SWRL rules

Application: The application layer encompasses all the software required to deliver a particular service. At this level, data from the pre-

Fragmentation: Firmware images are typically large, often spanning several hundred kBytes, and cannot fit into a single downlink packet; thus, multiple packets are necessary. Given that LoRaWAN links can sometimes be unreliable, packet losses are common. This makes it difficult to identify which packets have been lost during multicast transmissions. To mitigate this, the fragmentation specification provides commands to ensure the reliable transfer

Server model re-training: Once a certain amount of new image data has been collected, the server can re-train a new model. In our appli-

Acknowledgements

ages while avoiding network congestion..

- [START_REF] Chen | Efficient image transmission using lora technology in agricultural monitoring iot systems[END_REF] proposed an image transmission system for agricultural scenarios using LoRa. They compressed images using the JPEG method and introduced a Multiple Packet LoRa (MPLR) protocol, which is between 22 and 45% faster than the traditional ALOHA method.

For images ranging from 9 kb to 28 kb, transmission times varied: from 5 to 15 seconds with the best data rate, and between 49 to 164 seconds with the lowest data rate.

-Finally, authors in [START_REF] Ji | Lora-based visual monitoring scheme for agriculture iot[END_REF] demonstrated the use of image transmission with LoRa for agricultural applications. They proposed a system that transmits images using the JPEG 2000 compression method.

While they did not specify the transmission time, they conducted tests to prove the efficiency of the transmission in terms of image integrity. Their results showed that images transferred with LoRa retained 85% of their original information during transmission.

We compiled the different papers and their characteristics in table 3 -hasValue is a data property that represents the numerical value of the measurement. In case the smart sensor is counting fruit, it will have the value of the number counted; in case it is a sensor detecting a phenomenon, it will take the value 1 when the phenomenon is detected.

-hasLocation is an object property that specifies the field or the greenhouse of the farm where the sensor is situated.

-hasBatteryLevel is a data property representing the battery level of each sensor.

• Actuator: The actuator class represents the different machine-actionable systems in the farms. Again, a vast variety of them exists. In our system, we only represent the irrigation valve and the greenhouse fan system. We use the following properties to manage them:

-isActive is a data property that represents the state of the actuator. Is it active or not.

-hasLocation is an object property that specifies the field or the greenhouse of the farm where the actuator is situated.

. Additional training

The doctoral school of Paris-Saclay asks its PhD student to complete a certain number of mandatory additional training. This training are presented in table 5.1.

Activity type

Point to obtain

Note Status

Ethic and scientific integrity course