## 4 The Structure Fidelity Data Collection Framework
### Cluster Head Selection  
Prior to the cluster head selection, we need to build a data transmission model between member nodes and cluster head. Normally, all nodes including the CH in the cluster sense the environment, and then member nodes report their readings to the CH via a hop distance.  
Let \(X_{M\times N}\) as described in Equation (7) represents the dataset received by the CH, where \(M\) and \(N\) denote the discrete time domain and the number of sensor nodes in the cluster respectively. Consider a node scheduling method, only \(n\leq N\) sensor nodes are in a working state. In the case, the CH only receives \(M\times n\) readings from the working node. In order to measure the SSIM index between the original dataset \(X\) and the later dataset \(Y\), we need to find a way to fill the \(M\times(N-n)\) remainder readings in \(Y\). A polished model is designed for that, where all missing readings are replaced by the readings from CH without any increase in traffic. To reduce the error generated by this replacement, the mean squared deviations (MSD) on the readings between the CH and other nodes must be minimized. Based on the principle, the node with the minimal mean squared deviation (\(Min\_MSD\)) will be selected as the CH.  
Due to member nodes in the cluster can receive and send the readings with each other, each node makes an independent decision based on the mean squared deviation value as to whether to be the CH.  
A \(Min_{-}MSD\) based distributed cluster head selection algorithm named \(Min_{-}MSD\) approach is described in Algorithm 1.  
```
0: a node set \(G\)
0: a set of clusters covering the set \(G\) and the cluster head for each cluster
1: Set all nodes in \(G\) as uncovered
2:while\(G\) is not null do
3: Randomly pick up the node \(\upsilon\) from \(G\)
4: Pick up all the nodes distance from less than the threshold \(max_{-}dis\) and put them into a list of \(S\)
5:for every node \(i\) in the list \(S\)do
6:\(MSD(i)=\frac{1}{M}\sum\limits_{j=1}^{M}\sum\limits_{k\in S,k\
eq i}(x_{ji}-x_ {jk})^{2}\)
7:endfor
8: Cluster head \(CH=\{i|\min(MSD(i))\}\)
9: Calculate the Pearson's distance of each node in \(S\) and \(CH\)
10: Sort the nodes in \(S\) according to the increasing order of the Pearson's distance value
11: Create a new cluster \(C\) including only \(CH\)
12:while\(S\) is not null do
13: Pick up the next node \(s\) from \(S\) in turn
14:if\(s\) is within the communication radius \(R_{CH}\) of the \(CH\)then
15: Put \(s\) into the cluster \(C\)
16:endif
17:endwhile
18: Output the cluster \(C\) and cluster head \(CH\)
19: Remove all nodes in \(C\) from \(G\)
20:endwhile
```  
**Algorithm 1** Cluster formation and cluster head selection  
Algorithm 1 works by combining two main operations: cluster formation and cluster head selection. Two metrics (Euclidean and Pearson's distance) are used to group together nodes with high spatial correlation to form a cluster, and cluster head selection aims to minimize the structure distortion generated by our data transmission model between member nodes and cluster head. First, the geographically close nodes are roughly divided into a list of nodes \(S\), where the node with the minimal mean squared deviation is elected as the cluster head. Second, the nodes in list \(S\) are sorted according to the increasing order of the Pearson's distance between them and the elected cluster head. Finally, the nodes both with low Pearson's distance value and within the communication radius of the cluster head have a better chance of joining the new cluster. It is important to emphasize that a greedy strategy is adopted in Algorithm 1 to ensure that all nodes are covered.