Application of machine learning models to predict the relationship between air pollution, ecosystem degradation, and health disparities and lung cancer in Vietnam
Ngoc Hong Tran, Lan Kim Vien, Ngoc-Thao Thi Le
1 Computer Science University, Vietnamese-German University, Binh Duong, Vietnam
2 Department of Information Technology, Ho Chi Minh City University of Technology,
Ho Chi Minh City, Vietnam
Corresponding author, Email: ngoc.th@vgu.edu.vn
ABSTRACT
Lung cancer is one of the major causes of death worldwide, and Vietnam is not an exception. This disease is the second most common type of cancer globally and the second most common cause of death in Vietnam, just after liver cancer, with 23,797 fatal cases and 26,262 new cases, or 14.4% of the disease in 2020. Recently, with rising disease rates in Vietnam causing a huge public health burden, lung cancer continues to hold the top position in attention and care. Especially together with climate change, under a variety of types of pollution, deforestation, and modern lifestyles, lung cancer risks are on red alert, particularly in Vietnam. To understand more about the severe disease sources in Vietnam from a diversity of key factors, including environmental features and the current health state, with a particular emphasis on Vietnam's distinct socioeconomic and ecological context, we utilize large datasets such as patient health records and environmental indicators containing necessary information, such as deforestation rate, green cover rate, air pollution, and lung cancer risks, that is collected from well-known governmental sharing websites. Then, we process and connect them and apply analytical methods (heatmap, information gain, p-value, spearman correlation) to determine causal correlations influencing lung cancer risks. Moreover, we deploy machine learning (ML) models (Decision Tree, Random Forest, Support Vector Machine, K-mean clustering) to discover cancer risk patterns. Our experimental results, leveraged by the aforementioned ML models to identify the disease patterns, are promising, particularly, the models as Random Forest, SVM, and PCA are working well on the datasets and give high accuracy, however, the K means clustering has very low accuracy and does not fit the datasets. Keywords: Air pollution, data analytics, ecosystem, lung cancer, machine learning.
1. INTRODUCTION
Lung cancer is a leading global health challenge, ranking as the second most common cancer and the foremost cause of cancer-related mortality worldwide. Vietnam, in particular, faces a growing burden of lung cancer, with significant morbidity and mortality rates exacerbated by socioeconomic and environmental factors. In 2020, Vietnam reported over 26,262 new cases and nearly 23,797 deaths due to lung cancer, highlighting the urgent need for effective prevention and intervention strategies. According to 2022 data from the Global Cancer Observatory, lung cancer accounted for 13.5% of all cancer cases in Vietnam, with an age-standardized mortality rate of 132.6 per 100,000 people. In the meanwhile, the World Health Organization (WHO) reports that air pollution accounts for 29% of global lung cancer cases, underscoring its role as a major health hazard. Deforestation, while indirectly linked, exacerbates respiratory diseases through the loss of carbon sinks and increased particulate matter in the atmosphere. Moreover, rapid urbanization and industrialization have intensified environmental degradation in Vietnam. The country’s reliance on coal for electricity, accounting for 64.6% of generation as of 2024, has significantly increased CO 2 emissions. Environmental factors such as air pollution, deforestation, and industrial emissions have been identified as significant contributors to lung cancer. While cigarette smoking remains the primary contributor to lung cancer, accounting for approximately 80% of global cases. Beyond smoking, environmental variables such as poor air quality, linked to rising coal consumption and increasing coal use and emissions, are emerging as critical contributors to lung cancer. Despite advancements in diagnostic tools and treatments, there remains alack of comprehensive studies that integrate behavioral and environmental factors, particularly in contexts like Vietnam, where rapid urbanization and industrial growth intersect with public health challenges.
Data Integration and Preparation
To ensure robust analysis, datasets were cleaned, standardized, and integrated for compatibility across diverse sources. Key preprocessing steps included:
- Categorical Encoding. Variables such as cancer severity levels were encoded numerically to facilitate machine learning model compatibility. - Data Cleaning. To enhance data quality, missing values were imputed, and irrelevant columns were removed. For instance, numerical fields with formatting inconsistencies (e.g., commas) were corrected for computational analysis. - Standardization. All features were scaled to ensure uniformity, using z-scores to standardize values. This step was critical for distance-based algorithms like K-Nearest Neighbors (KNN). - Importance of Data Integration. Integrating micro-level (patient-specific) and macro-level (environmental) data offers a holistic view of lung cancer risk factors. Patient datasets reveal behavioral and genetic influences, while forest and emissions data provide context for ecological degradation. This multi-scale approach enables a nuanced understanding of how environmental and individual factors interact to drive lung cancer prevalence in Vietnam's unique context. 3. DATA ANALYTICS AND INSIGHT FINDINGS
In this section, the analytical results are visualized using a heatmap and information gain ranking to identify and analyze the most significant features influencing lung cancer
risk. 3.1. Heatmap
Through the heatmap released from the combined dataset, we infer top most impacting features with more than 70% influence ratio connecting the health status and behavior to the lung cancer risks. Particularly, the ‘ Obesity ’ feature affecting 83% is considered as a strong positive correlation, suggesting that higher obesity levels are associated with more severe lung cancer conditions. Secondly, the ‘ Coughing of Blood ’ feature occupying 78% proves that smoking exhibited a significant positive correlation, underscoring its role as a critical factor in lung disease severity. The third-ranked dominant feature is ‘ Alcohol Use ’ with a significance of 72%, indicating a strong correlation with advanced stages of lung cancer. The less dominant features, that are, ‘ Balanced Diet ’ and ‘ Dust Allergy ’ with a 71% influence ratio, highlighting its prevalence in severe cases of lung cancer. ‘ Balanced Diet ’ refers to the situation when the patient lacks some important nutrients while consuming a high amount of food with unnecessary nutrients for their body. Finally, the ‘ Passive Smoker ’ and ‘ Genetic Risk ’ are more impactful than active smoking, passive smoking significantly contributes to disease progression and it reaches a significance of 70% . Impressively, it becomes evident that even non-smokers have a high probability of developing lung cancer if they are frequently exposed to secondhand cigarette smoke. Ultimately, we must acknowledge that genetics play a significant role in the hereditary transmission of lung cancer. While this realization may be concerning, it also encourages us to prioritize and take better care of our health. Other variables, air pollution, chest pain, and chronic lung diseases demonstrated moderate correlations. These insights emphasize the multifactorial nature of lung cancer risk. Figure 1 . Heat map of cancer patient data sets.csv Figure 2. Bar chart of information gain of cancer patient data sets.csv
3.2. Information gain
To support the analytical result from the heatmap above, we use information gain measurement to conclude the dominant features that affect mainly to determine the lung cancer risks at the patients. These findings demonstrate the significance of behavioral and respiratory factors, providing a hierarchy of importance for lung cancer prediction models
The information gain which are achieved in Figure 2 proves that the top predictors include ‘ Passive Smoker ’, ‘ Coughing of Blood ’, ‘ Obesity ’. The secondly ranked factors are ‘ Alcohol Use ’, ‘ Wheezing ’, ‘ Chest Pain ’. Then, ‘ Chest Pain ’ and ‘ Balanced Diet ’ significantly connect to the lung cancer risks. These ratios and rankings have a high similarity to the results we found in the above heatmap. Additionally, we also find that the least predictive features are ‘ Gender ’, ‘ Snoring ’, and ‘ Swallowing Difficulty ’ contributed minimally to classification performance. Therefore, we can see that if a patient has these symptoms, it does not mean the patients have a lung cancer but the patients have a small probability of having lung cancer.
3.3. P-value and T-value
P-Values is a measure used in hypothesis testing to determine the significance of the results. It represents the probability of obtaining test results at least as extreme as the observed results, assuming that the null hypothesis is true. A lower P-value suggests that the feature is statistically significant and unlikely to be zero. In other words, the feature has a meaningful relationship with the target. Whereas, T-Values is a statistic used in t-tests to determine whether there is a significant difference between the means of two groups. It is calculated as the ratio of the difference between the sample mean and the population mean to the standard error of the sample mean. The T-value helps in determining the P-value, which in turn helps in deciding whether to reject the null hypothesis. Higher absolute T-values (positive or negative) indicate that a feature is statistically significant in predicting the target variable. Based on T-values and P-values, features like ‘Fatigue’, ‘Air Pollution’, ‘ Coughing of Blood’, ‘Passive Smoker’, and ‘Dry Cough’ are highly significant. They have both high absolute T-values and low P-values, suggesting that they are strongly associated with the target variable. In the meanwhile, the features like ‘Snoring’, ‘Frequent Cold’, and ‘Gender’ have high P-values and low T-values, indicating that they are not statistically significant in predicting the target. These could potentially be dropped from the model to simplify it without much loss in predictive power. For negative relationships, some features, such as ‘Dust Allergy’ and ‘Age’, have negative T-values, suggesting an inverse relationship with the target. This means that as the values of these features increase, the likelihood or severity of the target condition may decrease. Figure 3. p -value and t -value in the cancer patient data sets.csv
3.4. Spearman Correlation
In this section, we aim to measure the correlation between lung cancer risk, deforestation, and air pollution by Spearman correlation. Specifically, we use Spearman correlation to assess their influence on one another. The annual data on tree cover loss is presented in Figure 5, which shows an increasing trend. Additionally, Figure 4 illustrates that both the area of tree cover loss and the number of lung cancer patients are on the rise. The relationship between CO₂ emissions from all gases (in Megagrams) and the number of lung cancer patients are observed and may reflect broader environmental and societal factors rather than a direct cause-and-effect relationship. Therefore, higher CO₂ emissions may be associated with increased industrial and transportation activities, which often release other harmful pollutants. These pollutants, rather than CO₂ itself, may contribute to lung cancer risk by degrading air quality. Areas with higher CO₂ emissions are likely to experience industrial growth and urbanization, which may also lead to an increase in lung cancer diagnoses due to better healthcare infrastructure and more comprehensive reporting of cancer cases. Figure 4. Tree Cover Loss (in hectares) and
Number of Lung Cancer Patients
Figure 5. Year and Tree Cover Loss
(in hectares)
Figure 6. CO₂ Emissions from All Gases and Number of Lung Cancer Patients
4. CLASSIFICATION MODELS AND RESULT ANALYTICS
In this paper, we utilized four machine learning models which are Decision Tree (DT), Random Forest (RF), Support Vector Machine (SVM), and K-means clustering to train and evaluate the data for risk factor prediction. The dataset is divided into two parts: train and test, with training accounting for 70% and testing for 30%, which included 219 low, 235 medium, and 246 high-risk level data points in training and 84 low, 97 medium, and 119 high-risk level datapoint in test portions. The model training pace is quick; training all four models took about 1-2 seconds. The classification models were evaluated using precision, recall, and F1 scores to assess their performance.
These metrics validate the effectiveness of machine learning models in identifying and classifying lung cancer risk levels with high precision. Decision Tree (DT) and Random Forest (RF)
The DT depicts how the dataset is divided depending on its attributes, with ‘Passive Smoker’, ‘Wheezing’, ‘Obesity’, and ‘Snoring’ serving as the primary splitting criteria. At each node, a decision is taken based on feature thresholds, and the tree classifies samples into certain classes (Low, Medium, High) as indicated by the leaf nodes. Figure 7. Visualization of Decision Tree using the spilt-train method
- Root Node : The dataset starts with 700 samples and is first split by ‘Passive Smoker ≤ 6.5’, splitting samples into two groups. - Intermediate Nodes : Features such as ‘Wheezing’ and ‘Obesity’ help to refine the classification, while the Gini index indicates the purity of splits at each node. - Leaf Nodes_ : Each leaf indicates a pure group, with all samples belonging to the same class (e.g., Low, Medium, or High), as indicated by a Gini index 0. RF is a collection of DTs. In this experiment, for DT and RF, the prediction is 100% as the number of actual samples matches the predicted samples for all classes: 119 for Low, 84 for Medium, and 97 for High. Figure 8. SVM’s data in the 2D
PCA-reduced data
Figure 9. SVM’s decision boundary
Support Vector Machine (SVM) and Principle Component Analysis (PCA)
The dataset likely has many features, making it difficult to visualize in a higherdimensional space. PCA helps reduce the data into two main components while preserving as much variance in the data as possible. Preparing for SVM to be trained and to learn, we apply PCA to reduce the number of features into 2 PCA. Each point is a patient data plotted in Figure 8 . Then, we applied the resulted dataset into SVM and the result is demonstrated in Figure 9 . The different colors (black, red, and blue) likely represent different classes or categories in the dataset, such as different types or stages of cancer or groups related to diagnosis results (e.g., benign, malignant). The experimental result proves that SVM gives a high accuracy as DT and RF, it reaches 100%
with these datasets. K-means Clustering
Each dot in Figure 10 represents a patient in the dataset, and its position is determined by the values of the principal components (after dimensionality reduction with PCA). There are 3 clusters (purple, green, yellow) we use in this method. Each cluster represents patients with similar characteristics (e.g., patients with low cancer risk, patients with medium risk, etc.). These clusters can help understand underlying patterns in the dataset. For example, one cluster could correspond to patients with high air pollution and genetic risk factors, while another could represent patients with lower risk factors. Figure 10. K-means clustering with
PCA
Figure 11. Confusion matrix of K-means
clustering
We measure the confidence score of K-means clustering method using confusion matrix, however, as visualized in Figure 11, the overall clustering accuracy is very low. The number of actual samples poorly matches the predicted samples: none for High, 30 out of 303 samples for Low, and 10 out of 332 samples for Medium. The overall clustering accuracy is very low, indicating significant misclassification by the K-means clustering algorithm.
5. CONCLUSION
This study emphasizes the critical role of understanding the interaction between environmental and health factors in the development of lung cancer. Key risk factors, such as air pollution, deforestation and health have been identified. The insight findings can enable public health initiatives to more effectively prevent lung cancer and foster healthier communities. Moreover, the machine learning model is a promising tool to predict, however, we need further deep researches. For future work, we will collect more datasets and leverage more advanced machine models to find out more helpful insights and improve the accuracy of models.