\chapter{Conclusion and Future Work}
This chapter presents the key findings of this thesis. It also presents some limitations of this work and potential areas for future research that could extend and refine the work presented in this thesis.

\section{Conclusion}
Loneliness is becoming a significant worldwide issue with physical, emotional, social, and economic consequences. Multiple aspects, such as age, gender, socioeconomic level, and significant life events, could impact this complex condition. Early detection of loneliness is important to avoid its harmful long-term physical and mental health effects. Various factors present challenges to the early detection of loneliness, including its subjective nature, the stigma associated with loneliness, less self-awareness, etc. The younger population is more vulnerable to loneliness due to certain factors associated with this specific population. The challenges of early detection and potential mental health stigma further complicate early detection in this population group. Fortunately, the younger population is more comfortable and literate in using technology. This makes using smartphones and wearable devices for early loneliness detection in this population specifically.

Chapter 2 of this thesis presents a comprehensive scoping review to analyse the existing research on loneliness and social isolation detection using passive sensing. This literature review is the first to look at this specific area of loneliness detection with passive sensing. The main aim of the review was to synthesize the existing body of research, identify trends and limitations, and propose potential directions for future research. This review provided an important overview of the strengths and limitations of passive sensing techniques used in loneliness and social isolation detection. The analysis found the increasing use of smartphones and wearable sensors for loneliness detection across various studies and demographics. The review also highlighted several gaps in existing studies on loneliness detection, specifically privacy aspects of such systems, reliance on generic machine learning models, lack of dynamic analysis, energy consumption-related issues, and clinical validation issues of these systems.

Chapter 3 presents the methodology of our research. It provided a comprehensive introduction to the datasets used, including specific sensor details. The chapter elaborated on the extraction process of behavioural features, followed by a thorough explanation of data-cleaning steps. Additionally, it described the machine learning models used.

%Building upon the critical privacy issues identified in the scoping review (Chapter 2), we then focused on developing a privacy-preserving approach to loneliness detection using passive sensing data (Chapter 4). This work addresses a critical gap in existing research by using federated learning for loneliness detection. The study shows that while centralized machine learning models still outperform federated learning models, this approach holds significant potential for privacy-sensitive loneliness detection. Tree-based algorithms emerged as the most effective for both centralized and federated approaches. 

Building upon the gaps identified in Chapter 2, Chapter 4 presented the personalisation-based approach for loneliness detection using student grouping based on behavioural similarities. Since loneliness is a very subjective experience which can manifest in people very differently, existing methods in literature often overlook the crucial individual differences among people. This makes it difficult for generic models to accurately predict its presence and severity. A more effective approach could be identifying subgroups with similar behavioural characteristics, which would lead to a more personalized and accurate detection of loneliness and the behavioural patterns within each subgroup. Based on this idea, we used clustering techniques on the StudentLife dataset to identify distinct behavioural subgroups to develop personalized loneliness detection models. We also monitored the evolution of these groups throughout the study period and applied binary classification algorithms to each group to detect loneliness. Our results show that this categorization of students based on behavioural patterns increases the performance of loneliness detection models over a generic approach. This work presents a novel perspective on loneliness detection in two ways. First, it addresses the limitations of generic models by recognizing the diversity of how loneliness manifests in individual behaviours. By identifying subgroups based on similar behavioural patterns, the models can be customized for better performance. Secondly, this study presents the idea of tracking behavioural changes over time for loneliness detection. This approach gives useful information into how loneliness may emerge or intensify in individuals which could potentially be early warning signs. 

Building upon the personalized approach introduced in Chapter 4, we recognized the need for a dynamic approach that could adapt to the changing behavioural patterns of students and can detect loneliness on an early basis. In Chapter 5, we presented a novel dynamic approach that identifies diverse behavioural subgroups, tracks their dynamic evolution, analyzes their relationship with loneliness and detects loneliness in a dynamic way. For this, we used the larger GLOBEM dataset. This approach updates and refines the behavioural groups based on new data on a weekly basis and in parallel also updates the classification models for loneliness detection. This dynamic approach ensures that our models keep up with the changing nature of student life, which may lead to more accurate and timely loneliness detection. To address the ever-changing nature of student behaviours, we used incremental clustering to update behavioural subgroups as new data arrives. We then developed both a broad generic classification model and specialized models for each subgroup. This approach recognizes that loneliness manifests differently across individuals. Our results show that student behaviour changes over time. We saw how groups of students with similar behaviours shifted, and how this was linked to feelings of loneliness. This highlights the need for detection systems that include the ability to evolve and adjust to reflect the dynamic nature of students' lives.

This thesis extends beyond detecting loneliness as a single concept. Researchers have identified two facets of loneliness that can manifest in individuals: social and emotional loneliness. In Chapter 6, we investigated the manifestation of social and emotional loneliness in behaviours using student data collected with passive sensing techniques, an area that has not been explored in existing literature. There were three main goals in this study. The first was to find the potential of behavioural features extracted from passive sensing data to distinguish between social and emotional loneliness among college students. The second aim was to determine whether these behavioural features can accurately predict and classify these loneliness types. The final aim was to identify the most important behavioural features that predictive models use to differentiate between two loneliness types. We used the two-sided Mann–Whitney U test to compare the distributions of the behavioural features between socially and emotionally lonely groups. The goal of this test was to determine if there were statistically significant differences in the behaviours of socially lonely and emotionally lonely groups. Then, we used machine learning classification models to identify the predictive power of identified behavioural features. Finally, we applied the importance analysis of SHAP features to find the most important features that were used by machine learning models for classification.

The results showed significant differences between the behavioural profiles of socially and emotionally lonely groups. Socially lonely individuals show less location variance, fewer location transitions, shorter phone usage duration, and lower Bluetooth scans than emotionally lonely individuals. Additionally, the socially lonely group had reduced physical activity and shorter awake time and longer sleep duration. Our predictive modelling found that the identified digital behavioural markers can effectively classify loneliness categories. Machine learning models with different algorithms significantly outperformed baseline approaches. XGBoost emerged as the top performer with an accuracy of 78.48\%. SVM and Random Forest also demonstrated strong classification capabilities. Our SHAP analysis found that phone usage and location-based features were the most influential predictors of loneliness categories. For both XGBoost and Random Forest models, features like maximum phone usage duration, location variance, and location entropy were particularly important. The phone unlock patterns, and the number of significant places also played an important role. 

Research shows that loneliness and depression often co-occur and can have a complex relationship with each other. Based on this, in Chapter 7, we worked on understanding the relationship between these two conditions using passive sensing data, which is a relatively unexplored approach in this context. This chapter aimed to answer several key questions regarding the behavioural aspects of loneliness and depression in college students. We looked into the different behavioural patterns linked to each condition, how they might be related and how they might act as mediators, and how well behavioural features combined with standard self-report scales could accurately detect loneliness and depression. We used two methods to understand how loneliness and depression show up in behaviours. First was logistic regression, which helped us identify specific behavioural differences between lonely/depressed students and others. Association rule mining (ARM) revealed complex patterns of behaviours linked to these conditions. This combination of methods provides a richer picture of how loneliness and depression manifest behaviourally in college students. Then, we used mediation analysis to examine the interplay between loneliness and depression. This analysis helped us identify specific behavioural features that mediate the relationship between these conditions which provided us findings into the underlying mechanisms of their connection. And finally, we trained multiple machine learning models with logistic regression, k-nearest neighbours, support vector machine (SVM), random forest, gradient boosting, and extreme gradient boosting to assess the power of combining behavioural features with traditional self-report scales to classify lonely and depressed students separately. 

Our analysis found important behavioural differences between lonely and depressed students. Loneliness was associated with increased phone use (especially in the evening), more locations visited and reduced incoming calls. On the other hand, depressed people show fewer locations visited, less physical activity, shorter sleep duration, fewer conversations, and fewer Bluetooth scans. Association rule mining further highlighted complex combinations of these behaviours as predictive of loneliness and depression. Our mediation analysis also found significant links between loneliness and depression. ML models show the potential to classify lonely vs not lonely and depressed vs not depressed accurately. Across both conditions, the XGBoost model consistently outperformed other classifiers.

This thesis has presented a series of feasibility studies that explored various aspects of loneliness detection using the two pre-collected passive sensing datasets. Collectively, these studies show the significant potential of passive sensing-based methods combined with machine learning for understanding and detecting loneliness from both technical and theoretical perspectives. This thesis work is a stepping stone towards clinical evaluation and the real-world deployment of these methods. 

\section{Limitations and Future Work}
Our work can be improved and extended in many ways. Throughout this thesis, we have addressed specific limitations and future directions within each relevant chapter. Here, we synthesize and expand upon these points to provide a comprehensive overview of potential improvements, discussions and extensions to our work. Some key points are given below, which build upon the chapter-specific discussions and consider the broader implications of our research.

\subsection{Generalisability}
AI-driven approaches to mental health detection using passive sensing data have a limitation of generalizability across diverse populations. Similar to findings in recent research on depression risk prediction, these models often have an algorithmic bias that leads to performing less accurately in varied demographic and socioeconomic subgroups \cite{adler2024measuring}. This limitation is equally applicable to our work on loneliness detection. 

Our models, which are trained on student populations, do not account for how loneliness manifests across different demographic and socioeconomic subgroups. Behavioural patterns that indicate loneliness in one subgroup may have different implications in another. For instance, increased mobility might indicate loneliness in one demographic group but not in another. Our approach of using clustering to identify behavioural subgroups and develop group-specific loneliness detection models (Chapter 4 and Chapter 5) presents a step towards addressing this heterogeneity in loneliness manifestation across different populations. However, it is important to note that it still has some limitations. Even within identified behavioural subgroups, meaningful variations may still exist that our models do not capture. Our grouping is based primarily on behavioural data. It does not account for other relevant factors that could influence loneliness manifestation. As we discussed in Chapter 7 as well, individuals in lower socioeconomic groups showed a positive association between mobility and depression risk, while higher socioeconomic groups showed the opposite \cite{adler2024measuring}. This contradicts prior research, which found that mobility generally decreases depression risk \cite{saeb2015mobile}. Although this finding is about depression, the nature of this limitation is equally applicable to loneliness as well. Similarly, phone usage patterns associated with depression risk also differ significantly between age groups. Research shows that higher daytime phone use in younger individuals (18-25) is linked to lower depression risk, maybe due to its role in social connection and entertainment. However, this relationship is the opposite in older adults (65-74), where higher daytime phone use is associated with increased depression risk \cite{adler2024measuring}. Again, the nature of such limitations is equally applicable to loneliness. As we have shown, the groups evolve over time, and behavioural subgroups can change. This dynamic nature presents ongoing challenges for long-term model accuracy. While our approach improves reliability within student samples, its effectiveness for significantly different populations (e.g., non-students or students from different cultural backgrounds) remains uncertain. Although our subgroup approach reduces some biases, it may inadvertently introduce others if certain demographic groups are overrepresented in particular behavioural clusters. This also raises important points about the fairness of these models. 

We performed some experiments related to this issue by using the StudentLife dataset and our own collected UCC dataset with the younger population for a pilot study. The findings from these experiments further highlight these generalizability challenges. Despite both the StudentLife and UCC datasets being collected from younger populations, we observed significant performance drops when applying models trained on one dataset to the other. Specifically, the loneliness detection model trained on the StudentLife dataset performed poorly when tested on the UCC dataset and vice versa. However, performance improved when we trained and tested a model using only the UCC dataset and the StudentLife dataset.

While these experiments highlight significant challenges in generalizing loneliness detection models, our research also shows the potential benefits of personalization (Chapter 4 and Chapter 5). This raises important questions about the trade-off between generalization vs. personalization. On the one hand, generalizable models can be used for broader, diverse populations. However, as our findings show, these models may perform poorly when applied to populations different from their training data and when increasing population size. On the other hand, personalized models showed improved reliability within their target populations. However, the development of such personalized models for every possible subgroup could be resource-intensive and reduce the scalability of loneliness detection systems. This trade-off between generalization vs. personalization opens up an important question for future research: To what extent can we develop models that are both generalizable across populations and sensitive to individual or group-specific variations in loneliness manifestation? 

These findings show both the limitations and potential of passive sensing-based models for loneliness detection. While these models show promise when personalized, they are not yet robust enough for diverse populations. Future work needs to include a broader range of data, including detailed demographic information, socioeconomic indicators, and other relevant contextual factors. This would help for more nuanced and comprehensive understanding that could potentially lead to more robust and accurate loneliness detection models.

\subsection{Longitudinal Studies}
Another limitation of this thesis is the short duration of the datasets used. The datasets we used were collected over a 10-week period, which is insufficient for capturing the gradual and nuanced behavioural changes associated with loneliness. Loneliness is typically a gradual evolving experience rather than an abrupt change in emotional state. So, the behavioural manifestations of loneliness may take considerable time to become apparent or may fluctuate subtly over longer periods. The 10-week timeframe may miss these nuanced, long-term patterns of change. 

Future studies should aim to collect long-term data. This would help researchers to observe and analyze the subtle, progressive changes in behaviour that may indicate the onset or intensification of loneliness. These long-term periods could find cyclical patterns in loneliness and associated behaviours, which might be linked to academic cycles, seasons, or life stages. Moreover, adding time series analysis in future studies could capture moments of change and provide a deeper understanding of the temporal dynamics of loneliness and behavioural changes. This approach would help detect critical periods where interventions might be most effective and could lead to more precise and timely loneliness detection and intervention strategies.

\subsection{Limitations of Binary Classification}
We have mainly used binary classification for loneliness throughout this thesis. While this approach simplified our analysis, it does not fully capture loneliness's complex, continuous nature. The reason for using binary classification was due to small datasets with only a 10-week period. As we have discussed above, loneliness typically changes slowly, so trying to categorize it into multiple levels or treat it as a continuous variable would have been tricky with such limited data. This could have led to reduced statistical power, increased risk of overfitting, and potential reliability issues in distinguishing between fine-grained loneliness levels over such a short period. By using binary classification, we could more clearly see the behavioural patterns linked to lonely versus not lonely. Moreover, binary outcomes tend to give more stable and easy-to-interpret results in ML, especially with smaller datasets. However, we recognize this approach might have missed some of the subtle variations in how loneliness can intensify or change over time.

Another important limitation associated with this binary classification approach is the selection of a threshold score from the UCLA scale to divide participants into lonely/not lonely categories. This choice of threshold directly affects the distribution of students across the lonely and not lonely categories. A higher or lower threshold could lead to different categorizations that can potentially classify more or fewer participants as lonely. For example, some students who are close to the cutoff score may experience loneliness but are not classified as such due to the arbitrary selection of this threshold. This has important implications for the model's performance, as small variations in the threshold can change the balance between the two classes (lonely/not lonely), thus affecting the overall classification accuracy, sensitivity, and precision. The binary classification using this threshold may oversimplify loneliness. Students near the cutoff, called borderline cases, might show behaviours that are more complex than the "lonely" or "not lonely" binary classification. This means the model could miss subtle changes in their loneliness, especially for those whose scores fluctuate around the threshold. As a result, important behaviours from students just below the threshold may be ignored or misclassified. While we did not conduct a sensitivity analysis in this thesis, future work could include this approach to better understand how the model handles borderline participants. Exploring techniques such as fuzzy classification or applying threshold tuning based on behavioural patterns over time could reduce misclassification. Moreover, as we discussed above, future studies with longitudinal data collection could play a key role here as well. This could provide a more detailed analysis of how these borderline cases fluctuate that can help to develop more robust models that can accommodate the nuanced changes in loneliness levels.

\subsection{Limitations of Cross-Validation Approaches}
Throughout the thesis, we have used different cross-validation approaches to evaluate model performances. In Chapters 4 and 5, we used stratified 10-fold cross-validation which is a widely used technique that divides the data into 10 balanced folds to ensure each fold has a relatively even distribution of lonely and non-lonely cases. This method provided stable and balanced performance metrics. However, an inherent limitation of 10-fold cross-validation in our context is the potential for data leakage. Since each student’s data could appear in both the training and test folds across multiple iterations, there is a risk of the model indirectly learning individual behavioural patterns through repeated exposure in training. This could lead to inflated performance metrics, as the model might benefit from familiarity with each student’s behaviour across folds. In Chapters 6 and 7, we used LOSO cross-validation to mitigate this risk by fully isolating each student's data during testing, which provides a stricter evaluation but also potentially results in lower metrics due to this isolation.

Future work should consider conducting LOSO-based analyses in Chapters 4 and 5 to achieve a consistent and fair evaluation across all chapters. This would help to ensure that performance improvements we observed in group-specific or generalized models are not influenced by unintentional data leakage and that the models can generalize reliably to new students.

\subsection{Algorithmic Improvements}
Throughout this thesis, we have consistently used traditional ML algorithms for loneliness detection. Our primary focus was to explore and understand the behavioural manifestations of loneliness, which are very easy to do with traditional ML models as they are easy to interpret. The relatively small datasets that are common in mental health research are better suited to these methods and are less prone to overfitting than deep learning models. Another reason is that these algorithms have been widely used in mental health research which provides a solid foundation for comparison and validation of our findings within the existing literature. 

While these approaches served our research goals effectively, future work should explore the potential of deep learning in loneliness detection. However, the deployment of deep learning models requires substantially larger datasets to train effectively without overfitting, and usually deep learning-based models are harder to interpret than traditional ML models. As we discussed above, larger datasets over longer periods would address the limitations in capturing gradual behavioural changes and provide the volume of data necessary to train and validate deep learning models effectively. Another option could be to investigate the use of domain adaptation and transfer learning techniques. This would involve using models pre-trained on larger, more diverse datasets (e.g., datasets related to mental health, well-being, or even general behaviour) and then fine-tuning them specifically for the task of loneliness detection.

\subsection{Self-Reported Bias}
Another limitation in our methodology is the reliance on self-reported loneliness surveys to label passive sensing data. The subjective nature of such reporting may lead to discrepancies between reported feelings and actual emotional states due to factors like response bias, mood variation, limited self-awareness, and differing interpretations of survey questions. Cultural factors and temporal mismatches between survey completion and data collection periods can further complicate this issue. These factors potentially affect the quality of labels used to train our machine-learning models which could impact their accuracy and reliability. Future research should address these limitations by incorporating multiple assessment methods, increasing the frequency of surveys, developing more objective measures and conducting validation studies. 

\subsection{Establishing Causality}
It is important to emphasize that while our research has identified significant associations between various behavioural features and loneliness, these findings do not imply causality. The relationships we have found between digital behavioural markers and loneliness are correlational in nature, and we must be cautious in interpreting these results. We cannot conclude that these behaviours directly cause loneliness or vice versa. The relationship between behaviours and loneliness is complex and bidirectional and could be influenced by multiple factors that our current methodology may not fully capture. We only have a partial view of a person's life through sensor data. There is a lot more going on in a person's life that could play a significant role in relation to loneliness. For instance, passive sensing might detect low activity levels or disrupted sleep patterns, which are often associated with loneliness. However, these same patterns could be indicative of various other conditions or circumstances. For example, if an individual shows reduced physical activity and irregular sleep patterns, although these behaviours align with potential loneliness indicators, they could also be symptoms of physical illness, work-related stress, or even a period of intense focus on a project. Without additional contextual information, these models risk misinterpreting these patterns and potentially misclassifying an individual's mental state.

Similarly for causality, while we found that increased phone usage correlates with higher levels of loneliness, we cannot determine whether excessive phone use leads to loneliness, if lonely individuals tend to use their phones more, or if other underlying factors influence both. Broader spectrum data would be needed to get a broader picture that could lead to more robust and accurate detection models and to establish causality. Additionally, these behavioural patterns should be monitored over extended periods along with contextual data to distinguish between temporary fluctuations in behavioural indicators and persistent trends that could truly indicate loneliness.


\subsection{Interdisciplinary Approaches}
Future work also needs to incorporate interdisciplinary approaches for the validation of these passive sensing based systems within clinical settings. This collaboration with clinical psychologists can give us a more comprehensive understanding of loneliness as a multifaceted phenomenon and its various behavioural indicators. This would also help in validation and reliability of using such passive sensing based systems in real world scenarios. By integrating information from different disciplines, researchers can develop more accurate and reliable models that align closely with clinical definitions of loneliness and its associated behaviours. This collaboration would help in ethical considerations in a more granular way that would improve the overall impact and acceptability of such systems in wider populations.

\subsection{Timely Interventions}
The ultimate goal is to detect loneliness early, which would result in timely interventions before loneliness leads to more severe mental and physical health issues. Future research should focus on designing and testing intervention systems that can be automatically triggered by signals detected from the sensing systems. Interventions could be of several types, like app messages offering a bit of encouragement or reminding someone to reach out to a friend. For more serious cases, alerts could even go to a therapist. The key is linking those interventions directly to what the detection systems are picking up on, which would create a support system that doesn't just monitor but actually helps. 

\section{Final Comment}
Building upon the foundational work of previous researchers in the field, this thesis further pushes the boundaries of understanding and detecting loneliness through passive sensing techniques. Future directions, including expanded datasets with different populations, longitudinal studies, investigating generalisation vs. personalisation and cross-disciplinary collaboration and validation, can help to refine these methods and unlock their full potential. I am optimistic that continued research and collaboration will result in more robust, nuanced tools for detecting both loneliness and other related mental health conditions. These advancements have the power to improve our understanding of these conditions, early detection and more importantly to facilitate timely, targeted interventions that could transform the lives of people worldwide. While much work remains, the findings and potential presented here give me hope that we can create a future where loneliness is detected at early stages, leading to timely intervention, and this way, its harmful effects could be minimized. Researchers, clinicians, and technologists can work together to translate these findings into real, tangible detection and support systems, which would be a significant step toward combating this pervasive challenge of our time.
