## 2 Prototype
### Architecture  
Figure 4 shows the architecture of the prototype system for detecting and counting different users of cycling and hiking trails and routes. This architecture responds to the scenario presented in Figure 3 described above. The architecture is centered on two main elements: the sensor node and the bridge node. The sensor nodes are IoT devices that will be responsible for detecting and counting different types of users (people, bicycles, motorcycles). It is assumed that these nodes will be strategically positioned along the trails, in places where there is no conventional Internet connection, for example via a mobile network. They have a camera and storage and support Bluetooth communication. Following our previous work [8], it was decided that a YOLOv3-Tiny CNN [9] would be trained and run on these nodes using a dataset developed in the context of this study. This decision was made based on its prediction speed, processing requirements and accuracy. These nodes will store the count information of different types of users in non-volatile memory for extended periods of time until an opportunity arises to propagate it. This concept of opportunistic communication that supports long communication delays is defined by DTNs [17; 18], which are networks that aim to provide connectivity in scenarios where TCP/IP protocols simply do not work. These networks seek to take advantage of mobile devices that support wireless technologies to interconnect network partitions over time. It is assumed that the sensor nodes support Bluetooth, which is a short-range wireless communication technology [19] that uses radio frequency (RF) operating between  
Figure 4: Prototype architecture. 2.4 GHz and 2.5 GHz to transmit data. When Bluetooth-enabled devices are in close proximity, they can detect each other and negotiate terms for pairing, and then exchange data. Generally, the closer they are, the better the connection [20]. While the Bluetooth 4.0 version supports indoor ranges of 10 m and outdoor ranges of 50 m, Bluetooth 5.0 allows for low-power transmission and can support indoor ranges of 40 m and outdoor ranges of up to 200 m. In terms of transmission speed, Bluetooth 5.0 is twice as fast as Bluetooth 4.0. While Bluetooth 4.0 reaches theoretical maximum speeds of up to 1 Mbps, Bluetooth 5.0 can reach up to 2 Mbps [21]. Bluetooth was chosen over Wi-Fi because it has much lower energy consumption [22; 23], which is important in this scenario that assumes battery-operated devices. The bridge nodes are intermediaries and play a fundamental role in propagating the data collected from the sensor nodes to the server on the Internet. It is assumed that the bridge nodes are the smartphones of some of the trail users, so they have non-volatile storage memory and Bluetooth. When a user with the mobile application (i.e., bridge node) approaches a sensor node, the opportunity arises for a contact to send count data. The process of detecting, negotiating and establishing a Bluetooth connection between the sensor node and the bridge node is automatic. The same goes for sending the data stored in the sensor node to the bridge node, which cooperate in the task of accepting and storing it [12]. No human intervention is required in these processes. This approach aims to exploit the fact that users will later use a mobile network or Wi-Fi to access the Internet. At that point, the data with the user counts are sent to a remote server, where they will be stored on a database server. This process may be subject to errors, for example in the user's application, which could compromise the delivery of the data with the user counts to a remote server. Therefore, we opted for a strategy of replicating the information with the count data across several users, according to an approach known as Spray and Wait [24], which is appropriate for this scenario [25]. The data collected over time, according to this process, will be accessible via a web application which will generate statistical reports.