# Community Detection Framework Using Deep Learning in Social Media Analysis
## 3 Proposed Community Detection Framework
### Performance Evaluation  
The performance evaluation of community detection models aims to assess the accuracy, robustness, and scalability of the algorithm. The model performance evaluation in community detection aims to quantify the quality of the communities detected by a given algorithm. There are several metrics commonly used to evaluate the performance of community detection algorithms, including modularity, normalized mutual information (NMI), and F1-score.  
Modularity [30] is a measure used to evaluate the quality of community structure and measure the degree to which the number of edges within communities exceeds the  
Figure 2: ClusterNet architecture in [8].  
number of edges between communities. It takes into account the density of edges within communities compared to those between communities. This means that communities with a higher density of edges within them and a lower density of edges between them will have a higher modularity score. Modularity is a normalized measure, which means that it takes into account the expected number of edges within and between communities if edges were distributed randomly. This helps to avoid the problem of trivial solutions where the network is divided into communities with arbitrary edges.  
As community detection in an unlabeled social network is an unsupervised task, traditional classification performance metrics like accuracy, precision, and recall are not applicable. Traditional classification metrics rely on predefined labels to measure performance. In community detection, the absence of labels means there is no direct way to assess how well the detected communities align with ground-truth categories. Evaluation metrics like NMI (Normalized Mutual Information) or F1-score are more suitable for comparing clustering results against ground truth labels, focusing on the overlap between detected and actual communities. Therefore, alternative metrics, such as modularity, were chosen to evaluate the quality of the discovered structures without needing labeled data. Modularity offers a more intrinsic evaluation of community structures without relying on external labels, making it particularly useful in exploratory analyses where true community assignments may not be known. This allows for a deeper understanding of the community dynamics captured by the model, which is crucial in applications like cybercrime investigations. If the modularity is smaller, the corresponding community division is more ambiguous. The modularity formula is as Equation (2):  
\[Q=\frac{1}{2m}\sum_{i\
eq j}{(A_{ij}-\frac{k_{i}k_{j}}{2m})\delta(C_{i},C_{j})}, \tag{2}\]  
where \(m\) is the total number of edges in the network, \(k_{i}\) is the degree of node \(i\), and \(A_{ij}\) is the element in the adjacency matrix. If \(i\) and \(j\) are connected, \(A_{ij}=1\); otherwise, \(A_{ij}=0\). \(C_{i}\) is the community where node \(i\) is located. \(\delta\) is the Kronecker function. When \(C_{i}=C_{j}\), \(\delta(C_{i},C_{j})=1\); otherwise, it is 0. If all nodes belong to the same community, \(Q=0\). Therefore, the larger the value of \(Q\), the clearer the structure of the community.