Edge AI in Smart Farming IoT: CNNs at the Edge and Fog Computing with LoRa

The agricultural and farming industries have been widely influenced by the disruption of the Internet of Things. The impact of the IoT is more limited in countries with less penetration of mobile internet such as sub-Saharan countries, where agriculture commonly accounts for 10 to 50% of their GPD. The boom of low-power wide-area networks (LPWAN) in the last decade, with technologies such as LoRa or NB-IoT, has mitigated this providing a relatively cheap infrastructure that enables low-power and long-range transmissions. Nonetheless, the benefits that LPWAN technologies enable have the disadvantage of low-bandwidth transmissions. Therefore, the integration of Edge and Fog computing, moving data analytics and compression near end devices, is key in order to extend functionality. By integrating artificial intelligence at the local network layer, or Edge AI, we present a system architecture and implementation that expands the possibilities of smart agriculture and farming applications with Edge and Fog computing and LPWAN technology for large area coverage. We propose and implement a system consisting on a sensor node, an Edge gateway, LoRa repeaters, Fog gateway, cloud servers and end-user terminal application. At the Edge layer, we propose the implementation of a CNN-based image compression method in order to send in a single message information about hundreds or thousands of sensor nodes within the gateway's range. We use advanced compression techniques to reduce the size of data up to 67% with a decompression error below 5%, within a novel scheme for IoT data.