23 Leveraging Fog Analytics for Context-Aware Sensing in Cooperative Wireless Sensor Networks KRITI BHARGAVA and STEPAN IVANOV, Telecommunications Software & Systems Group, Waterford Institute of Technology, Ireland DIARMUID MCSWEENEY and WILLIAM DONNELLY, Waterford Institute of Technology, Ireland In this article, we present a fog computing technique for real-time activity recognition and localization on- board wearable Internet of Things(IoT) devices. Our technique makes joint use of two light-weight analytic methods—Iterative Edge Mining(IEM) and Cooperative Activity Sequence-based Map Matching(CASMM). IEM is a decision-tree classifier that uses acceleration data to estimate the activity state. The sequence of activ- ities generated by IEM is analyzed by the CASMM method for identifying the location. The CASMM method uses cooperation between devices to improve accuracy of classification and then performs map matching to identify the location. We evaluate the performance of our approach for activity recognition and localization of animals. The evaluation is performed using real-world acceleration data of cows collected during a pilot study at a Dairygold-sponsored farm in Kilworth, Ireland. The analysis shows that our approach can achieve a localization accuracy of up to 99%. In addition, we exploit the location-awareness of devices and present an event-driven communication approach to transmit data from the IoT devices to the cloud. The delay-tolerant communication facilitates context-aware sensing and significantly improves energy profile of the devices. Furthermore, an array-based implementation of IEM is discussed, and resource assessment is performed to verify its suitability for device-based implementation. CCS Concepts: • Networks In-network processing; Location based services;• Computer systems or- ganization Sensor networks; Embedded systems;• Information systems Location based services; Additional Key Words and Phrases: Fog computing, edge mining, cooperative wireless sensor network, local- ization, precision farming, testbeds This work has received support in part from the Science Foundation Ireland (SFI) and the Agriculture and Food Devel- opment Authority, Ireland (TEAGASC) under the SFI-TEAGASC Future Agri-Food Partnership, in a project (13/IA/1977) titled “Using precision technologies, technology platforms and computational biology to increase the economic and envi- ronmental sustainability of pasture based production systems.” In addition, this publication has emanated from research supported by a research grant from SFI and the Department of Agriculture, Food and Marine on behalf of the Government of Ireland under grant number [16/RC/3835]. Authors’ addresses: K. Bhargava (corresponding author) and S. Ivanov, Telecommunications Software & Systems Group, Waterford Institute of Technology, WIT West Campus, Carriganore, Waterford, Waterford, X91P20H, Ireland; emails: {kbhargava, sivanov}@tssg.org; D. McSweeney and W. Donnelly, Waterford Institute of Technology, Waterford, Ireland; emails: diarmuid.mcsweeney@teagasc.ie, wdonnelly@wit.ie. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org. © 2019 Association for Computing Machinery. 1550-4859/2019/03-ART23 $15.00 https://doi.org/10.1145/3306147 ACM Transactions on Sensor Networks, Vol. 15, No. 2, Article 23. Publication date: March 2019.