{'fraction_non_alphanumeric': 0.027608607389362567, 'fraction_numerical': 0.013949306884751465, 'mean_word_length': 4.945344827586207, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Open-plan Glare Evaluator (OGE): A Demonstration of a New Glare Prediction Approach Using Machine Learning Algorithms

Predicting discomfort glare in open-plan offices is a challenging problem. Although glare research has existed for more than 50 years, all current glare metrics have accuracy limitations, especially in open-plan offices with low lighting levels. Thus, it is crucial to develop a new method to predict glare more accurately. This paper is the first to adopt Machine Learning (ML) approaches in the prediction of glare. This research aims to demonstrate the validity of this approach by comparing the accuracy of the new ML model for open-plan offices (OGE) to the accuracy of the existing glare metrics using local dataset. To utilize and test this approach, Post-Occupancy Evaluation (POE) and High Dynamic Range (HDR) images were collected from 80 occupants (n=80) in four different open-plan offices in Brisbane, Australia. Consequently, various multi-region luminance values, luminance, and glare indices were calculated and examined as input features to train ML models. The accuracy of the ML model was compared to the accuracy of 24 indices which were also evaluated using a Receiver Operating Characteristic (ROC) analysis to identify the best cutoff values (thresholds) for each index in open-plan configurations. Results showed that the ML approach could predict glare with an accuracy of 83.8% (0.80 true positive rate and 0.86 true negative rate), which outperformed the accuracy of the previously developed glare metrics. OGE is applicable for open-plan office situations with low vertical illuminance (200 to 600 lux). However, ML models can be trained with more substantial datasets to achieve global model.


Introduction
Discomfort glare is the main source of visual discomfort in daylit open-plan offices, and its prevention requires an accurate prediction model to successfully achieve the benefits of utilizing natural daylight in this type of space. Several studies demonstrated the significance of visual discomfort in open-plan office through Post-Occupancy Evaluation (POE) where 56% and 49% of the occupants reported discomfort form daylight in Konis [1] and in Hirning, Isoardi [2] respectively. Various glare metrics have been developed to predict glare zones and distinguish the disturbing feeling by setting numerical thresholds. Basically, glare predictive metrics use mathematical equations based on either contrast effect, saturation effect, absolute threshold or derived from empirical equations [3]. The equations are mainly constructed from luminance and solid angle of glare source, adaptive level, and position index [4]. The majority of these metrics were developed and tested under certain conditions which make it difficult to extrapolate results to other conditions [5]. Also, the inherent subjectivity in glare responses makes glare prediction even more complex. Temporal variables can randomly affect occupants' glare sensation. Through a field experiment, it was found that occupants became more tolerant of glare from daylight as the day progressed [6]. Several other studies have tested the limitations of glare indices in predicting visual discomfort [5,7]. Hence, modifications or new metrics are continuously evolving based on new experiments that assess users' visual comfort. Still, limitations exist in these experiments which are being conducted under particular luminous environments and controlled settings e.g. fixed window sizes and view direction [3].
Glare metrics are usually derived from subjective ratings and luminance-based measurements. A number of studies correlated glare metrics with quantitative illuminance-based metrics to avoid the computationally expensive luminance renderings [8][9][10]. They have considered illuminance-based metrics as the most weighted factor for predicting discomfort glare. For example the simplified version of the DGP metric developed by Wienold [8]. Mardaljevic, Andersen [9] examined the relation between Useful Daylight illuminance (UDI) and Daylight Glare Probability (DGP) aiming to find the potential of using UDI as a proxy of DGP. Karlsen, Heiselberg [10] suggested the use of simple vertical illuminance at the eye and horizontal illuminance at desk level to indicate glare perception; however, this approach did not consider eye adaptation.
Recently, a study by Wienold, Iwata [3] evaluated 22 glare metrics regarding their performance and robustness for daylit workspaces. Experimental datasets were collected in 6 different countries to offer more general results. According to their statistical results, DGP was found to be the most robust with the highest performance for predicting glare which is only valid for daylit dominated spaces with 0.74 True Positive Rate (TPR) and 0.72 True Negative Rate (TNR) over the combined dataset. The TPR refers to the prediction rate of disturbing glare situations and TNR refers to the prediction rate of no glare situations and theses rates are detailed in Rodriguez, Yamín Garretón [11]. The equations of the highest six ranked metrics were found to be based on the saturation effect. On the other hand, metrics mainly based on contrast effect or empirical equations had lower performance and robustness. However, the spaces under study by Wienold, Iwata [3] were daylit cellular offices, unlike openplan offices where dimmer lighting conditions prevailed. Hirning, Isoardi [12] investigated discomfort glare in open office spaces of 5 green buildings through 493 surveys. They compared the occupant responses with glare indices, and they found that prediction of glare indices was statistically correlated to discomfort; however, all indices underestimated discomfort glare. Thus, they developed a new index UGP, which is derived from the UGR glare metric, to determine the likelihood of being glare disturbed in open office spaces. They achieved an overall accuracy of 69% for predicting discomfort glare (0.49 TPR and 0.78 TNR). Although UGP was specifically optimized for open-plan offices, it is still evident that 51% false negative prediction rate of discomfort glare indicates low prediction accuracy according to Wienold, Iwata [3]. Therefore, this research aimed to develop a more accurate glare prediction model for open-plan offices using a new method.
The existing research on discomfort glare focuses particularly on statistical methods to derive a threshold for glare indices to discriminate between discomfort and comfortable lighting situation which may not be the ideal method for this task. Therefore, this paper sheds new light on the potential advantages of using Machine Learning models to predict discomfort glare with higher accuracy than the statistical methods. In general, Machine Learning (ML) techniques are divided into two categories; supervised and unsupervised learning. Unsupervised is usually used for solving clustering problems, which require just unlabeled datasets for the machine learning algorithms to search for the best way to group and interpret the data. Unlike unsupervised learning, supervised machine learning algorithms can be used to develop a predictive model based on a classification or regression technique which requires labelled data [13,14]. In this paper, we used the supervised learning technique (i.e. classifiers) to classify HDR images captured during POE where the true labels/ responses were collected from the occupants of the open-plan offices.
We present an innovative method that shows how to adopt Machine Learning (ML) to learn the relationship between different features and human visual discomfort in open-plan offices. Machine learning techniques are suitable models for the glare prediction problem for four reasons; -First is the stochastic nature of the input-output data where it is possible to find two different subjects having different discomfort glare levels at the same daylit space. In other words, the response corresponding to any input predictors is a distribution rather than a single point in the response space.
-Second, the problem is multivariate and the relationships between variables are nonlinear.
-Third, there is no closed mathematical form (model) that can be used to explain the relationship between the input predictors (i.e. various multi-region luminance values, luminance, illuminance and glare indices) and the discomfort glare. -Fourth, The ability of machine learning to learn from noise meant that all data points were used without needing to exclude any data that might typically be excluded for reasons like veiling luminance on screen as a glare source, and differences in glare sensibility or susceptibility of the subjects. This simplifies experimental analysis of all the data collected.
Hence, this study focuses on developing a novel glare prediction model based on extracting features from HDR images using several techniques including; various multi-region luminance values, luminance, illuminance and glare indices which were tested as input features for machine learning algorithms.
This research aims to demonstrate the usability of the machine learning (ML) techniques in glare evaluation. The ultimate objective is to generate a simplified workflow (see supplementary material) which enables architects and lighting engineers to classify HDR images of open-plan offices to glare/no glare categories using our machine learning model Open-plan Glare Evaluator (OGE) as an easy to use tool.

Methodology
The methodology section describes the workflow used to develop glare predictive model for open-plan offices through machine learning as well as the current statistical methods usually used to derive thresholds for glare indices. First, the subjective user assessments were collected which was coupled with HDR images taken at the head position during POE. This was followed by data processing to evaluate the HDR images in preparation for training the predictive models. As shown in Figure 1, the methodology follows three parallel steps; 1) HDR images were tessellated into a smaller grid pattern, where the average luminance of each grid element was calculated and used as the input feature for ML training. 2) HDR images were evaluated using Evalglare to compute 24 luminance, illuminance and glare scores that were then used as input features for ML training.
3) The 24 Evalglare outputs were used to conduct ROC curve analysis and to calculate a cut-off value for each glare metric specifically for open-plan offices.
First, the overall accuracy as well as TPR, and TNR in step 1 and 2 were compared and ranked to identify the best ML glare predictive model for open-plan offices. Then, in step 3, the same criteria were used to assess and rank the performance of 24 glare metrics using their calculated cut-off values. Finally, the selected ML glare predictive model was compared to the performance of Evalglare outputs (24 indices) in terms of overall accuracy, TPR, TNR as well as Area under the curve (AUC), and Squared Distance (SqD).

Dataset overview: survey + HDRi
Post occupancy evaluation (POE) was conducted on 80 subjects in four open-plan office located in Brisbane, Australia. The users' assessments of their visual environment were collected through their responses based on the current lighting condition at their workstation. The number of occupant responses that experienced discomfort glare was 30 (37.5%) and 50 (62.5%) for those reported no glare. At the same time, LDR images were captured to compute HDR images which were calibrated based on best practices [15][16][17][18][19]. Vertical illuminance (Ev) was calculated from HDR images to show the variability in the lighting conditions. The key statistical characteristics of Ev were represented in violin plot (see Figure 2) which confirms the low light levels usually found in openplan offices since the majority of Ev values ranged from 200 to 600 lux.

Machine Learning Model
Prior to training a machine learning model, the input data (features and responses) need to be acquired and formatted in a matrix * ( +1) where n is the number of occupants (i.e. 80) and m is the number of the extracted features. First, features were extracted from HDR images and then coupled with the categorical responses of the occupant (Glare/ No Glare) which was the last column in the matrix . Two methods of feature extraction were explored in this research; The HDR images were tessellated into equally sized regions at different resolutions to compute the average luminance for each region within the field of view. This method was previously proposed by Wagdy, Garcia-Hansen [20] as a multi-region contrast method to easily detect glare based on per-pixel luminance measurements of HDR images. In this study, seven (7) different sizes of the grid were parametrically generated using the bruteforce method [21,22]; starting from dividing the HDR images into 10 by 10 segments to 40 by 40 with an increment of 5 segments as shown in Table 1 and Figure 3.
For a given grid, the average luminance of each region was calculated as shown in Figure 4. These averages and the corresponding occupant's response were concatenated to form a row vector in the matrix D. This process was repeated for all HDR images to construct the whole matrix which was then named according to the reference code shown in Table 1. The seven Multi Region Luminance (MRL) matrix files were analyzed one after another from MRL-62 (62 features) to MRL-980 (980 features).

B) Twenty-four (24) Glare Metrics
The second feature extraction method was done through Evalglare [23] which was used to conduct a detailed glare analysis in which 24 values of luminance, illuminance and glare scores of multiple glare metrics including the maximum and task luminance were calculated and formatted in an 80 x 25 matrix (i.e. 24 features + response). The score of each of the 24 indices was then used as a predictive feature for the twenty-five ML classification models. Cut-off values of glare indices established in experimental scenarios may not be transferred practically to field settings [24], and previous research has indicated that one single metric may not be sufficient to accurately predict glare experience [25]. Therefore, two sets of multiple glare indices were combined as groups of features to explore the possibility of getting better prediction accuracy when multiple metrics were used together. The first set included 6 metrics (DGP, DGI, UGR, VCP, CGI, Lveil) which are the default outputs of Evalglare. The second set included the 22 glare, luminance and illuminance outputs of Evalglare plus the task and maximum luminance when the detailed option in Evalglare was activated.
These results were combined with the subjective responses of the occupants (n=80) regarding their lighting conditions in each matrix in order to use them as features of HDR images. These data were imported into the classification learner app in MATLAB. A cross validation scheme was applied to these data by randomly partitioning the data into five folds (k-fold = 5) to estimate the accuracy of the predictive model over each fold following the recommended settings by Rodriguez, Perez [26]. In 5-fold cross validation, the 80 row vectors are divided into five data blocks each consists of 16 row vectors. Then the ML model was trained using four data blocks and consequently was tested using the fifth remaining data block. This process was repeated five times, with each of the five data blocks used exactly once to test the model. The five testing results were then averaged to produce a single estimation for the model performance. Twenty-five (25) classification models in MATLAB were evaluated to identify the most accurate algorithm for classifying (Glare/No-Glare) situation based on field data while using different set of features each time. These algorithms included decision trees, discriminant analysis, support vector machines, logistic regression, nearest neighbors, naive bayes, and ensemble classification which are explained in detail in [13,14].

ROC Curve Analysis
After all training was carried out, all ML models as well as the 24 luminance, illuminance and glare metric scores were used to generate Receiver Operating Characteristic (ROC) curves to evaluate the performance of each prediction model and to derive the optimal cut-off value for the 24 indices. The cut-off value for each metric was the value that discriminate between the glare and no glare situation. Five-fold cross validation was used in generating ROC to avoid any biasing that may accrue due to random splitting the data, and to maximize the training and testing datasets as recommended by Rodriguez, Perez [26]. The five testing cut-off values of each metric were calculated then averaged to produce a single estimation for the optimal cut-off value for each glare metric derived for open-plan offices. In addition to dividing the data (n=80) into 5 folds, the data was treated as one combined dataset to get a larger range of lighting conditions. The cut-off values derived from the 5-fold trained (C1) and combined (C2) datasets were compared to find the cut-off variation between the two datasets and to indicate robustness of the model. The smaller the variation, the more likely the same accuracy can be obtained when applying this cut-off for other datasets. The variation error (E) was calculated using equation 1.
Then, the prediction accuracy of each glare metric was compared to the accuracy of the best ML model in terms of overall accuracy, TPR, and TNR. The overall accuracy was calculated based on the equation (TP+TN)/ (TP+FP+TN+FN) where TP is the number of true positive cases indicating the number of correct predictions of glare situations, TN is the number of true negative cases indicating the number of correct predictions of no glare situations, FP is the number of false positive cases, and FN is the number of false negative cases representing incorrect predictions of glare and no glare situations respectively. TPR and TNR were also calculated to avoid misleading performance interpretations that may be caused by overall accuracy alone.
Further diagnostic tests [11] were conducted in which the Area Under the Curve (AUC), and the squared distance (SqD) were calculated. AUC is the area under the ROC curve, and it is used as a measure to indicate the ability of the model to discriminate glare situations. According to Hosmer Jr, Lemeshow [27], if AUC equals or is larger than 0.8 means an excellent discrimination ability, whereas 0.7 and 0.6 can be interpreted as good and fair discrimination respectively [26]. The Squared Distance (SqD) is the length of the shortest line from the ROC curve to the top left corner point where TPR and TNR equal to one. If SqD equals zero, it means that the model has 100% prediction accuracy. Therefore, the smaller the SqD, the higher the prediction accuracy it delivers. This value was computed for the trained 5-fold data as well as for the combined data.

Performance Assessment Criteria
In order to assess the performance of the glare predictive models, all results were saved in multiple tables to evaluate the accuracy of each model relative to the feature used. Successful models were assumed to pass the following criteria: -An overall prediction accuracy of 70% or higher. Since this paper focused on open-plan offices, our proposed model should achieve better performance than the current related glare metric which had 69% overall accuracy Hirning, Isoardi [12]. -Both of the True Positive Rate (TPR) and the True Negative Rate (TNR) need to be larger than 0.5 in order to be considered successful as a potential model for predicting glare. Thus, TPR and TNR lower than 0.5 was a terminating threshold to avoid random prediction results following the proposed performance criteria by Wienold, Iwata [3]. -AUC equals to or larger than 0.6 was considered acceptable following Wienold, Iwata [3] criteria.
-The SqD was considered acceptable with values smaller than 0.5.
Since this paper proposes new cut-off values for glare metrics which can increase the prediction accuracy for glare in open plan offices, an additional variation error criterion was evaluated to the generality of the new cutoff values. Any model with a variation error below 10% indicated that this cut-off value can be generalized and extrapolated on other datasets for this type of office space.

Machine Learning Model
Results have shown a high potential for machine learning algorithms to predict glare across most of HDR images features that represented multi-region luminance and glare scores. The overall accuracy matrix of 825 trained ML models were detailed in the supplementary materials. Each algorithm provided different accuracy for different features with an overall prediction accuracy ranging from 30% to 83.8%. Twelve (12) out of the 33 features failed to reach the assigned criterion which include glare metrics like DGP, UGR and CGI where the maximum accuracy they reached were 69%, 68% and 65% respectively.. On the other hand, models that were trained with luminance-based indices like the Multi-Region Luminance, background luminance (lum background), average luminance (Av_Lum), median luminance of image (Med_lum), and size of the glare source (Omega_S) showed higher overall performance and larger numbers of successful models using multiple ML algorithms. The total number of ML models succeeded in passing the first criterion across all features was 164 models. Some ML models perform better than the others; therefore, they were filtered according to the maximum overall accuracy acquired by each feature as shown in Table 2 where TPR and TNR were then analyzed.
When combining the 6 default glare metrics as features in the same training model, no significant improvement was noticed, where only one model reached an overall accuracy of 70%. In the second combination of glare metrics when all 24 glare indices were used, higher overall accuracies were achieved where the maximum (73.8%) was reached using Coarse Gaussian SVM [28]. However, by analyzing the TPR and TNR, it was found that TPR reached only 33% whereas TNR was 98% which indicated the underestimation of glare cases by 67%.
In multi-region luminance MRL, all grid sizes reached high accuracy using various ML algorithms. By analyzing TPR and TNR, most of them passed the assigned threshold. Only in MRL-62 and MRL 244, the TPR failed to exceed 0.5 which indicated that glare was under-predicted. The highest accuracy of all models (83.8%) was found to be achieved by MRL-374 using RUS Boosted Trees algorithms [29]. In the case of MRL-374, both TPR and TNR values were higher than 50%; they reached 80 and 86% respectively. ROC curve was then generated to evaluate AUC and SqD. It was found that this model has an excellent discrimination ability since the calculated AUC was equal to 0.85 with very small SqD of 0.06 as shown in Figure 5. It outperformed the previously developed metrics for open plan offices with a higher accuracy of more than 14% and without any bias towards glare or no glare. Therefore, the trained ML model with RUS Boosted Trees algorithms using MRL-374 features was selected as the best ML glare predictive model for open-plan offices. This ML model was developed as a tool for glare assessment in open plan offices with a friendly user interface which was named as Open-plan Glare Evaluator (OGE).

ROC results for glare metrics
In order to compare the predictive power of the selected training ML model along with the existing glare metrics, all previously used glare metrics were evaluated using ROC analysis to evaluate their prediction accuracy using the same field data. A fair comparison can be achieved by randomly dividing the data into five folds (k-fold=5) similar to the data processing method used for ML. The accuracy and the general cut-off value of each glare metric were obtained by averaging the accuracy results and the cut-off values from the 5 tests. Although the UGP metric was developed for open plan offices, the overall accuracy was only 52% with TPR and TNR 0.57 and 0.51 respectively based on our dataset. The highest prediction accuracy was reached by the luminance background metric, where TPR and TNR were 0.66 and 0.89 with overall accuracy of 78.75%, AUC and SqD were 0.68 and 0.22 respectively as shown in Table 3 (left). When using the combined data, more glare metrics passed the assigned criteria as shown in Table 4 where metrics were sorted based on the overall accuracy. In addition to luminance background, average luminance position, medium luminance position, and vertical illuminance showed potential for use in open plan offices. By comparing the cut-off values for the five folds dataset and the combined data, small variation errors were noticed in most of glare metrics which ranged from 0.1% in DGI and DGI modified to 7.3% in Luminance maximum. No variation was found between the two datasets in three metrics; Luminance background, Medium Luminance, and DGP. Thus, the assigned criteria (E<10%) was met by most of the glare metrics except Lum_Sources, Lveil_cie, and Lveil.

Discussion
Large open plan offices, which are dim and mainly depend on electric lighting, have different lighting conditions from cellular offices and this is confirmed by the majority of Ev values (200 to 600 lux) collected during field study. Thus, most of the available glare metrics studies and their cut-off values are not suitable for this type of office since most of these metrics are developed in experimental setups that simulate daylight-dominated cellular offices where the occupants sit next to the window. Therefore, this study investigates three methods aiming to achieve the best predictive model for open plan offices.
Based on the literature, the UGP metric, which is derived from UGR, was specifically optimized for open plan offices and reached an overall prediction accuracy of 69% (0.49 TPR and 0.78 TNR) according to Hirning, Isoardi [12]. However, 49% accuracy in detecting glare cases is not high enough to reduce random results. By applying the ROC curve analysis over the score of each index, new cut-off values are proposed. More insights are depicted through plotting scores of each index and color coding them into red (Glare) and blue (No-Glare) based on the 80 survey responses, then deriving cut-off values from Table 3. It is evident in Figure 6 that no cut-off value can totally discriminate glare situations which confirms on the non-linear relationship between the glare score and people perception of glare. However, a cut-off is derived in this paper which is optimized to reduce the number of incorrectly predicted cases by striking a balance between the true positive and true negative rates. By ranking the indices based on their performance we notice that the 4 out of the top 5 indices are luminance based while the vertical illuminance Ev raked number 4. In term of glare metrics, DGI performed better than other glare metrics after UGR_exp. To confirm the significance of using ML models, their predictive accuracy is compared to the accuracy derived from conventional statistical methods. Therefore, ROC analysis was applied to obtain cut-off values, AUC, SqD of all glare metrics that are used previously as features in ML models. Background luminance achieved the highest prediction accuracy (78.75%) among all glare metrics computed by Evalglare detailed analysis. The same field data of ML models are used for ROC analysis in two ways; in the first, the average performance is computed from 5 data folds to resemble the k-fold method of ML model training and thus can ensure fair comparison between both methods. In the second, all data combined is used and analysis results are compared with 5-fold through calculating percentage error. This provides an insight into the robustness of the proposed cut-off values for open-plan offices. Adapting machine learning ML indicates strong potential for models with high overall accuracy since it can identify the non-linear relationships between developed luminance or glare indices and survey responses. Multiple ML algorithms succeed in predicting discomfort glare with high accuracy between 70% and 83.8%. This includes a wide range of well-known glare metrics and luminance scores used to train ML models after correlating their values with the corresponding survey response collected from 80 subjects. Their actual thresholds were not used, instead, they are used as features to train the ML algorithms which find its own pattern to classify the input data into glare/no glare situations.  Table 4 shows a comparative analysis between machine learning and statistical approaches when using the 24 glare scores for glare prediction. It can be noticed that in machine learning, most glare indices achieve high overall accuracy; however, it is achieved by high TNR whereas TPR is less than 0.5 except in task luminance. On the other hand, when applying the cut-off values, both TPR and TNR were unbiased, though the overall accuracy is not high enough. Yet, using luminance background with cut-off value 103 can balance between required criteria.
Multi-Region Luminance MRL was used as a predictive feature in ML models and succeeded in finding the nonlinear relationship between glare responses and extracted features. Consideration should be taken on the applied resolution (number of regions) which represents the number of features. Accordingly, the smallest number of regions that obtain the highest accuracy is sought to avoid too detailed data that can cause overfitting. MRL of grid size 25 by 25 reached the highest accuracy; however, further optimization could be beneficial to find more optimal results in the size range between 20 and 30 with 1 step increment. In general, the MRL method achieved high prediction accuracy as it extracts contrast from luminance measurements which is a serious cause of glare open plan offices.
The best performance of the model is obtained when using Multi-Region Luminance MRL-374 as input features. This differs from other features in correlating multi luminance measurements rather than a single measurement of the glare indices. The MRL method uses location characteristics similar to the position index. Therefore in this study, various sizes were tested, which ranged from 10 by10 (MRL-62) to 40 by 40 (MRL-980) with 5 increments finding that 25 by 25 (MRL-374) delivers the highest performance using RUS Boosted Trees algorithm [31]. Small numbers of regions in MRL-62 means averaging a large number of pixels to calculate the average luminance of the region. Thus, significant contrast ratios can be skipped. By increasing the number of regions (small grid size), this issue can be resolved which clarifies the high accuracy of MRL-374 (83.8%). However, by increasing the tessellation to higher resolution with a larger number of regions, the prediction accuracy decreases as in MRL-980 (76.3%). This is due to the incapability of the ML model to find the relationship of regions luminance values and glare response with large number of regions and limited data (n=80).
Although the overall accuracy of the trained models achieves high values, TPR, and TNR are evaluated as well to detect if there is any glare bias. For example, in the case where all glare metrics are used as features, accuracy reaches 73.8%; however, TPR goes below 50% and is compensated by high TNR (98%) which means it is biased to no glare situations. Another example is when using Ev as a predictive feature, it achieves better performance in ML; however, it comes with high bias towards no glare prediction (TNR=0.92) and misclassifies glare situations by 67% (TPR=0.33) as shown in Table 4.

Conclusion
The novelty of using machine learning in glare prediction application is demonstrated here to yield better prediction power for the data collected in this scenario than any previous experimental method including all glare indices. This shows the potential for incorporating machine learning algorithms in glare analysis to help design more visually comfortable buildings. Our machine learning model achieves higher prediction power (83.8% overall accuracy, TPR of 0.8 and TNR of 0.86) than the previously developed glare metric for open-plan offices such as UGP which was only 69% overall accuracy (0.49 TPR and 0.78 TNR). This method showed a high potential for extending the use of ML models, after adding more field data of different light scenarios, to accumulate its learning patterns in order to make it be more generalized.
The proposed ML model as well as the reported cut-off values of other glare metrics are only valid to open-plan offices situations with overall low light levels in general. However, the same machine learning methodology could also be applied over cellular offices which are typically daylight-dominated, and this will be investigated in future study. In this paper, 80 survey responses are included in training the ML model though more field data that have already been taken in other glare studies can be incorporated in our developed model to evaluate the robustness of our predictive model and validate it on more space prototypes.
All glare metrics except task luminance are found not to be good predictive features for training machine learning models even when combining different data sets. On the contrary, adopting Multi-Region Luminance MRL as a predictive feature succeeded in explaining the relationship between the input predictors and the occupant visual discomfort in open-plan offices.
It's evident that a model with 100% accuracy is not possible due to the fact that discomfort glare is a subjective phenomenon, and as such it is very difficult to accurately assess through subjective qualitative methods.
An important limitation of using current machine learning models is that they depend on selected features that are supplied to the models. Therefore, improper selections may affect negatively on the prediction power of the model which is experienced when using some glare scores as features. On the contrary, Deep Learning (DL) can learn directly from data (end-to-end learning workflow) which may achieve higher accuracy. However, to develop a DL prediction model it will require tens to hundreds of thousands of images to train such models, and this will be investigated in a future study.