In this section, all the results extracted from the experimental analysis, simulation, and ML model are presented. Firstly, the optoelectronic model used in extracting the degradation coefficient is trained and validated agonist experimental data. Consequently, the machine learning model utilized for cell performance prediction is demonstrated.

The basic model for the Long Short-Term Memory machine learning algorithm.
Optoelectronic degradation model validation
Before investigating the tome-dependent degradation of the DSSCs explored in the current study, we initially characterized TiO2 thin films, deposited on bk7 microscopic glass, to verify the appropriate formation of the layer, as well as to capture piezochemical parameters, typically porosity. FT-IR, and XRD data for thin film of TiO2 is displayed in Fig. 3. The FT-IR, and XRD patterns distinct peaks were observed at specific 2θ values, namely 25.2°, 37.6°, 47.9°, 53.7°, 54.8°, 62.6 °, and 74.8°. These peaks were assigned to the crystallographic planes (101), (004), (200), (105), (211), (204), and (215) of anatase TiO2, respectively30. It is worth highlighting that the porosity of the examined samples was investigated using our devolved model in31. Herein, the model utilizes image postprocessing mechanisms to extract the occupied area concerning the air gap to estimate a rough 2D porosity. Such porosity is a valuable indicator of the air gaps that the dye can occupy. An example of samples of various porosity is demonstrated in Fig. 4. While utilizing the data extracted from the SEM measurements to scale up to device level analysis, and to validate the proposed numerical model, the PCE of the DSSCs under a porosity of 55% were experimentally calculated and plotted against the simulation results outputted from COMSOL, see Fig. 5. The results recorded an increasing trend with saturation behavior, with relatively thicker layers, due to the optical absorption saturation associated with the pours size and the N719 absorption capabilities. Additionally, the recorded results in Fig. 5 approves the FEM model effectiveness to simulate the DSSC performance with root mean-square error (RMSE) of 2.19%, indicating the deviation between the simulation results and the experimentally measured PCEs.
For understanding the ageing behavior of DSSCs, this section presents a detailed analysis of the variation in power conversion efficiency of dye-sensitized solar cells over time, measured at 12-hour intervals. The impact of TiO2 thickness on the PCE is illustrated in Fig. 6-(a). Two thicknesses are examined: 1 μm and 2 μm, see Table 2. The PCE shows a declining trend over time for both thicknesses, with the 1 μm TiO2 layer (blue circles) exhibiting a lower initial efficiency compared to the 2 μm layer (orange circles). All electrical output parameters are listed in Table 3, where the error bar reflects the variation of the 10 samples per set. However, the degradation rate of the 1 μm layer appears to be steeper, leading to a more rapid decline in efficiency. Data fitting lines extracted from the ML model indicate that while the initial performance of the thinner layer is lower, its long-term stability may be compromised compared to the thicker layer, which demonstrates a slower degradation rate, as indicated in Table 4. Another interesting feature, especially with a thicker TiO2 layer, is related to a transient jump in PCE, mainly during the first time step, concerning the initial PCE. We can attribute such performance to the adsorption of the dye during the first 12 h of cell operation, which impacted the absorption capability of the cell in the short term. We used \(\:{D}_{dye\:}\)in Eq. (2) to express such an effect mathematically.
Figure 5-(b) presents the results of varying the porosity of the TiO2 layer, specifically at 55% and 65% porosity levels. The PCE trends reveal that both porosity levels initially exhibit similar efficiencies; however, the 65% porosity (orange circles) shows a more pronounced decline over time compared to the 55% porosity (blue circles). The data fitting curves support this observation, indicating that while higher porosity may enhance light absorption and charge transport initially, it also accelerates degradation processes, possibly due to increased susceptibility to environmental factors. This insight underscores the importance of optimizing porosity to balance performance and stability, see Table 4.

(a) FT-IR measurement for bare TiO2. (b) In the XRD pattern of TiO2, distinct peaks were observed at specific 2θ values, namely 25.2°, 37.6°, 47.9°, 53.7°, 54.8°, 62.6 °, and 74.8°. These peaks were assigned to the crystallographic planes (101), (004), (200), (105), (211), (204), and (215) of anatase TiO2, respectively.

SEM measurements for TiO2 samples on FTO coated glass typically used in DSSC fabrication with variation in porosity, given as: (a) 45%, (b) 55%, (c) 65%, and (d) 70%.

Experimentally calculated PCE of DSSCs under various TiO2 layer thicknesses, ranging from 0.1 μm to 7 μm, against FEM simulation results. Error bars are associated to experimental results to indicate the variations observed across each set of samples.

The study investigates the influence of several key parameters: (a) TiO2 thickness, (b) porosity of the TiO2 layer, (c) dye concentration using N719 dye, and (d) iodine-based electrolyte concentration. The provided figures illustrate the results, showing how each variable impacts the PCE degradation of the cells. Error bars are associated to experimental results to indicate the variations observed across each set of samples.
In Fig. 6-(c), the influence of dye concentration on PCE is analyzed, comparing concentrations of 0.08 mmol/cm² and 0.10 mmol/cm². The results indicate that the higher dye concentration (orange circles) initially leads to a greater PCE than the lower concentration (blue circles). However, the degradation pattern reveals that the 0.08 mmol/cm² dye concentration maintains a more stable efficiency over time, as evidenced by the data fitting lines. This suggests that while higher dye concentrations can enhance initial performance, they may also contribute to faster degradation, highlighting the need for careful optimization of dye loading to achieve long-term stability.
Finally, panel Fig. 5-(d) examines the effect of iodine-based electrolyte concentration, comparing 0.4 mol/L and 0.5 mol/L. The PCE for both concentrations decline over time, with the 0.5 mol/L electrolyte (orange circles) initially providing higher efficiency than the 0.4 mol/L electrolyte (blue circles) because of higher carrier mobility. However, the degradation rate for the 0.5 mol/L electrolyte appears to be more rapid, as indicated by the steepness of the decline in efficiency, see coefficients in Table 4. The data fitting curves reinforce this observation, suggesting that higher electrolyte concentrations can enhance ionic conductivity, and initial performance may lead to increased degradation rates, potentially due to greater ion migration and associated side reactions.
The analysis of PCE variation in DSSCs over time reveals critical insights into how TiO2 thickness, porosity, dye concentration, and electrolyte concentration influence solar cells’ initial performance and long-term stability. All previously reported literature were mainly used \(\:{T}_{80}\) indicator to assess the ageing performance of solar cells in general. The \(\:{T}_{80}\) is defined as the time the cell took to decay to 80% of its initial PCE., cf. Table 4. Although \(\:{T}_{80}\) is a generic parameter that can be utilized to demonstrate the degradation profile, still it is limited in giving a clear depth on the degradation trends or the weighting effect for each individual degradation contributor. We propose that our newly developed Figure of Merit, as illustrated by the coefficients presented in Table 4, has the potential to significantly advance the research community’s understanding of the degradation signatures associated with dye-sensitized solar cells. These findings emphasize the complexity of optimizing DSSC parameters for enhanced efficiency and durability, providing a foundation for the next stage in this research to improve the design and operational strategies for dye-sensitized solar cells. As indicated in the next section, integrating these insights with machine learning models can further enhance our understanding of degradation mechanisms, ultimately contributing to the advancement of reliable and efficient renewable energy technologies.
Machine learning algorithm training and validation
With 400 experientially fabricated cells and the optoelectronic time-dependent model described in Sect. 3, we have collected a dataset of 40,000 samples providing more than 228,000 points while considering around 57-time steps. The dataset underwent a rigorous preprocessing phase to meticulously shape it into the requisite format for the Long Short-Term Memory model, ensuring that the input and output columns were appropriately segregated. To ensure the integrity and neutrality of our dataset, we implemented a comprehensive cleaning and preprocessing phase. This process was essential to eliminate any potential biases that could arise from outliers or inconsistencies in the data. To effectively clean the dataset, a series of preprocessing steps including removing duplicates to ensure each sample is unique, handling missing values through imputation or removal to avoid skewed results, standardizing the data to bring all features onto a similar scale, and filtering out outliers to prevent distortion in model training were conducted. Additionally, we validate the data types and formats of each column, ensuring they are consistent and appropriate for analysis, which will help maintain the neutrality of the dataset and improve the reliability of the subsequent model performance. This crucial step laid the foundation for the subsequent model training and evaluation stages.
Following preprocessing, the dataset was partitioned into three distinct sections—training, testing, and validation—observing a distribution ratio of 70% for training, 20% for testing, and 10% for validation. This stratified division facilitated robust model training, allowing reliable performance assessment of unseen data. The training commenced by feeding the prepared data into the LSTM model, initiating the iterative learning process to optimize model performance. Post-training, the validation step emerged as a pivotal checkpoint to validate the model’s efficacy and generalization capabilities. Upon meticulous tuning and refinement, the model exhibited an impressive accuracy rate of 99%, see Fig. 7, accompanied by a remarkably low RMSE of 0.0009335%, and Mean Absolute Error (MAE) for the LSTM algorithm is approximately 0.0007468%. on the validation dataset. This exceptional performance can be attributed to the inherent near-linear relationship between the model’s input variables and the output time series, underscoring the model’s adeptness at capturing and extrapolating patterns within the data, thereby yielding highly accurate predictions, see Fig. 7-(c), and (d).
In Table 5, LSTM is compared against various, ML algorithms in terms of both accuracy and computational time. For faire evaluation, all the models were operated using our lab workstation. The computational unit is a 2x Xeon Gold 6240 2.6 GHz processor, with 36 cores and 24 MB. cache, each with 32 GB RAM, supported by 2 × 480 GB SSD HD. Based on the data presented in Table 5, LSTM model displays the highest accuracy of 99.01% among all the models evaluated. In terms of computational efficiency, LSTM also shows a relatively low computational time of 255 s, which is faster than several other algorithms. Comparing the accuracy metrics, LSTM outperforms all the other models listed. The closest competitors in terms of accuracy are Gradient Boosting and K-Neighbor models. When considering computational time, ridge prediction has the lowest time at 229 s, but it also showcases the lowest accuracy at 77.91%. On the other hand, LSTM provides both high accuracy and a relatively efficient computational time, making it a strong performer in this evaluation.
To provide a macroscopic view of the data extracted from our proposed model, 3D illustrations are used, with interactive visitation attached as Supplementary Material to this manuscript. We consider such an illustration combining time variation, material parameter, and conversion efficiency as a unique procedure to demonstrate the impact of various design parameters on the PCE and the degradation performance across time. Figure 8-(a) illustrates the variation of PCE concerning porosity (0–80%); a normalized axis to 4 is used for better illustration). As time progresses, we observe a consistent decline in efficiency across all porosity levels. The surface plot shows that higher porosity levels exhibit a more pronounced degradation in efficiency, with the PCE dropping from approximately 4% at the start to below 1% at the 360-hour mark. Initially, the highest efficiency noted is around 4.0% for porosities below 40%. By 360 h, the efficiency decreases to approximately 0.5% for 80% porosity, illustrating the detrimental effect of increased porosity on long-term stability. Alternatively, Fig. 8-(b) represents the variation of the PCE under range of dye concentration (0–20 mmol/cm²).

The LSTM training and validation (a) losses, (b) accuracy, and for prediction outside the range (c) losses, and (d) accuracy.
In Fig. 8-(c), the impact of varying TiO2 thickness (0–5 μm) on PCE over time is analyzed. The graph illustrates a relatively stable efficiency across different thicknesses within the initial measurement period, but all thicknesses decline as time progresses. The highest initial efficiency of approximately 5.44% is observed for a thickness of 2 μm, while the efficiency remains above 2.0% for thicknesses up to 5 μm throughout the observation period. By 360 h, efficiencies drop below 1.0% for thinner layers, suggesting thicker layers provide enhanced stability over time. In contrast, Fig. 8-(d) assesses the effect of iodine-based electrolyte concentration (0–6 mmol/L) on PCE over time. The results indicate that electrolyte concentration significantly influences initial efficiencies, with higher concentrations yielding better initial performance. The highest efficiency of around 5.45% is initially noted for the 0.5 mol/L concentrations. However, as degradation progresses, efficiencies drop sharply to approximately 0.6% at 360 h. Notably, lower concentrations exhibit a slower degradation rate, maintaining efficiency levels above 1.5% for the duration of the study.

Three-dimensional surface plots illustrating the relationship between power conversion efficiency (PCE) and various parameters over time in dye-sensitized solar cells (DSSCs). (a) PCE as a function of time and porosity, applying a normalization factor of 4. (b) PCE against time, under various dye concentration (0–20 mmol/cm²). (c) PCE as a function of time and TiO2 thickness (0–5 μm). (d) PCE related to time and electrolyte concentration (0–6 mmol/L). Dataset raw data and visualized data are accessed as a supplementary material. Figure 6-(b) presents the relationship between PCE and dye concentration (0–20 mmol/cm²) over time. Initially, higher dye concentrations correlate with higher efficiency values, peaking at about 4.0% for concentrations around 10 mmol/cm². However, efficiencies decline significantly over time, with the steepest degradation occurring at concentrations above 15 mmol/cm². Post 360 h, efficiencies drop to around 1.0% for concentrations above 15 mmol/cm², indicating that high dye concentrations can enhance initial performance and accelerate degradation.
This quantitative analysis underscores the critical role of structural and compositional factors in determining the efficiency and stability of DSSCs over time. The findings suggest that higher porosity, dye concentration, and electrolytic concentration may enhance initial performance but are associated with accelerated degradation. Conversely, optimized TiO2 thickness offers a more favorable balance between initial efficiency and long-term stability. These insights contribute to a better understanding of the degradation mechanisms and highlight the importance of optimizing these parameters for improved DSSC performance in sustainable energy applications. Alternatively, LSTM can face several limitations when applied to long-term degradation predictions32. One significant challenge is their tendency to overfit on training data, particularly when the dataset is small or lacks sufficient variability, which can lead to poor generalization over extended time scales. Herein, we use our optoelectronic model for dataset enlargement, as described in earlier in this section, to avoid such overfitting issues. Additionally, LSTMs may struggle to capture long-range dependencies effectively, as the vanishing gradient problem can still affect their ability to learn from distant time steps. In the current study, mostly degradations are in an exponential, fast decaying, behavior, accordingly, no long-range dependencies are observed. When it comes to handling uncertainty, LSTMs typically rely on deterministic outputs, which may not adequately represent the inherent uncertainties in long-term predictions. To address this, incorporating uncertainty quantification through Bayesian approaches are employed. These strategies aim to provide a measure of confidence in the predictions, allowing for a more robust assessment of degradation over time. Nevertheless, the complexity of accurately modeling long-term degradation processes remains a challenge, necessitating further advancements in LSTM architectures and training methodologies. We consider such challenges as a part of a future extension to the current study.
