## 3 The Envisioned Fog Computing Architecture Supporting the CDNN Execution
### On the Hierarchical Organization of the FC Technological Platform  
As stated in Section 1, the FC platform is suitable to execute CDNNs with early exits. The resulting FC technological platform is typically composed of a set of \((M-1)\) clusters of medium-size virtualized data centers (i.e., Fog Nodes (FNs)), which are hierarchically-organized into tiers and exploit (typically wireless) transport links for enabling inter-tier communication. Doing so, a communication path is implemented from the lowermost IoT realm at _tier_\(\#0\) to the uppermost Cloud Node (CN) at _tier_\(\#M\). At each intermediate _tier_\(\#m\), with \(1\leq m\leq M-1\), an intra-tier local network allows an AGregator (AG) node to provide an early exit by suitably merging the outputs of the corresponding FNs into a local output (see the per-tier side branches in Figure 1b). Doing so, it is expected that only a small fraction of the volume \(v_{0}(t)\) of data generated by the IoT devices at time \(t\) needs to be transported up to the remote CN for analytics, while a (hopefully) large part of \(v_{0}(t)\) early exits through the available intermediate per-tier local outputs. Figure 3 shows a sketch of the envisioned multi-tier networked technological platform for the distributed execution of the inference phase of an (already designed and trained) CDNN with early exits. Basically, the Fog platform of Figure 3 is composed of the hierarchically organized cascade of three main segments, namely:  
1. the _lowermost_ segment (i.e., _tier_\(\#0\)), where a set of spatially distributed resource-poor IoT sensors operate. Since current IoT devices (for example, smartphone, tablets and personal assistants, just to name a few) are natively equipped with built-in sensors, IoT devices at _tier_\(\#0\) are assumed to be co-located with Fog nodes at _tier_\(\#1\) (see the dark blue triangles at the bottom of Figure 3);
2. the _middle_ segment, where a number of spatially distributed and networked Fog nodes operates. According to Figure 3, this segment is hierarchically organized into \((M-1)\) stacked tiers numbered from _tier_\(\#1\) to _tier_\(\#(M-1)\). At _tier_\(\#m\), with \(1\leq m\leq M-1\), a cluster: \(\{\text{Fog}(j,m),\ 1\leq j\leq m_{m}\}\), with \(m_{m}\geq 1\), of Fog nodes operates by exchanging data with a local aggregator \(AG(m)\) over an intra-tier LAN. From time to time, the local _Detector_\(\#m\) generates a local decision \(\hat{c}_{m}\) (i.e., a class label) on the current input data generated by the sensors at _tier_\(\#0\) when the confidence level of the per-tier aggregated data \(\widehat{\mathcal{Y}}_{m}\) delivered by \(AG(m)\) is high enough (see the dotted red lines in Figure 3). In the opposite case (i.e., when the confidence level of \(\widehat{\mathcal{Y}}_{m}\) is estimated to not be high enough), the local output is the empty set: \(\emptyset\), that is, no data is generated by the \(m\)-th local output;
3. the _uppermost_ segment (i.e., _tier_\(\#M\)), where a (single) remote Cloud node (labeled as \(\text{Fog}(1,M)\) in Figure 3) operates. Its task is to perform complex analytics on the most hard-to-classify input instances, so as to provide a final decision \(\hat{c}_{M}\) on the class label of the currently sensed input data, regardless of its actual confidence level. From time to time, the sensors at the bottom of the technological platform of Figure 3 sense the local surrounding environment and then pass the sensed data in upstream for its tier-by-tier hierarchical mining. At each intermediate _tier_\(\#m\), with \(1\leq m\leq(M-1)\), an (average) fraction \(\rho_{m}\) of the input data is passed to the next _tier_\(\#(m+1)\) for furtherprocessing, while the remaining fraction \((1-\rho_{m})\) undergoes local exit, in order to produce the corresponding decision \(\hat{c}_{m}\).