3.1. Data Analysis, Feature Distributions and Correlations
The statistical analysis was conducted on a dataset of 62,250 samples, and the distributions of all variables are shown in
Figure 4 using box plots.
The six-layer width parameters showed distinct distribution patterns across the samples. The mean layer widths ranged from 19.61 Å for layer 3 to 91.59 Å for layer 6. Layer 2, with a mean thickness of 78.05 Å and a standard deviation of 14.47 Å, demonstrated moderate variability, positioned between the tightly controlled thinner barrier layers. Layers 1 and 3 had relatively low dispersion (standard deviations of 5.63 Å and 3.50 Å, respectively), indicating tighter control over their thicknesses, as expected for barrier layers. In contrast, layers 4, 5, and 6 exhibited substantially higher variability, with standard deviations exceeding 15 Å, suggesting increased structural flexibility or design diversity in these regions. The interquartile ranges further confirmed that layers 4 and 5 have nearly identical thickness distributions, implying coordinated structural tuning.
The external electric field strength had a mean value of 22.43 kV/cm with a narrow spread (standard deviation 3.03 kV/cm). The range extended from 17.5 kV/cm to 27.5 kV/cm, indicating that the applied field was varied within a limited operational range. The box plot confirmed the uniformity of the field distribution. The material gain exhibited a broad, asymmetric distribution, with a mean of 6.48 cm−1 and a relatively large standard deviation of 19.93 cm−1. Material gain values ranged from −89.31 cm−1 to 103.09 cm−1, indicating the coexistence of absorptive and amplifying regimes in the dataset. The high variability and the presence of outliers (4.64%) suggest a strong dependence on multiple structural parameters. The interquartile range extended from −4.12 cm−1 to 22.51 cm−1, indicating that most samples achieved moderate gain. The emission frequency values were concentrated within a relatively narrow range, from 1.04 THz to 4.96 THz, with a mean of 2.91 THz and a standard deviation of 1.13 THz. The approximately symmetric distribution suggests stable spectral operation governed primarily by the quantum well structure and layer composition. The current density exhibited the broadest dynamic range, ranging from 11.75 A/cm2 to nearly 11,940 A/cm2, with a mean of 1399 A/cm2 and a large standard deviation of 1509 A/cm2. Outliers accounted for 6.48% of the samples, indicating the presence of extreme cases or nonlinear behavior under specific structural and field conditions. The box plot confirmed a highly skewed distribution, demonstrating that while most configurations produce moderate current densities, a small subset exhibits exceptionally high conduction.
Figure 5,
Figure 6 and
Figure 7 illustrate the distributions of material gain, emission frequency, and current density for a random subset of 1000 samples, selected for visual clarity and to prevent overcrowding. In each figure, green points represent individual sampled values, emphasizing the variability within the dataset.
Figure 5 shows material gain, with the dashed blue line indicating the mean of 6.48 cm
−1 across the entire dataset, demonstrating that most samples cluster around this overall mean. However, individual points still cover a broad range of values, reflecting the impact of structural variability and other inherent factors.
Figure 6 shows the emission frequency distribution, with the overall dataset mean of 2.91 THz marked by the blue dashed line.
Figure 7 depicts current density, with a mean of 1399 A/cm
2 across all samples (blue dashed line). The distribution exhibits greater spread and a few extreme values, indicating that while most configurations yield moderate currents, some reach exceptionally high levels.
The Pearson correlation coefficient is commonly used in exploratory data analysis to identify potential dependencies between features and target variables, providing insight into which variables may directly influence each other [
66].
Figure 8 presents the Pearson correlation heatmap for all input parameters and target variables. The heatmap highlights the strength and direction of linear relationships, with red denoting positive correlations and blue denoting negative correlations. The correlation matrix for the considered dataset reveals generally weak linear relationships among most features and targets, which can be summarized as follows:
Material gain shows a weak negative correlation with layer width 5 (r = −0.21), while correlations with other layers are very weak (r ≤ 0.2). The negative correlation between the material gain and the thickness of the doped central region of the second well layer (layer width 5) is explained by increased ionized impurity scattering. Although the doping concentration is kept constant, increasing the thickness of the doped region increases the total sheet doping and extends the spatial overlap between the dopants and the lower laser level wavefunction. This enhances ionized impurity scattering, broadens the intersubband transition linewidth, and increases effective dephasing. Together, these effects reduce the coherent polarization and steady-state gain, explaining the observed negative correlation between material gain and doped-region thickness across the varied structures.
Frequency is very weakly correlated with all input parameters, and shows the largest correlation with layer width 5 (r = −0.13). Increasing the thickness of the doped region in the second well affects the laser transition frequency by modifying the local potential profile and the spatial distribution of the electron wavefunctions. This changes the energies of the lower and upper laser levels, shifting the intersubband transition energy.
Current density exhibits moderate correlations with layer widths 1 and 5 (r = −0.40 and 0.58, respectively), a weak correlation with layer width 3 (r = −0.25), and very weak correlations with the other layer widths. The current density increases with the thickness of the doped region in the second well (layer width 5) because a thicker doped layer provides a higher carrier sheet density, thereby enhancing injection into the upper laser level. In contrast, increasing the thickness of the barrier layers (layer widths 1 and 3), and particularly the injection barrier (layer width 1), reduces the current by lowering the tunneling probability between adjacent wells. Thicker barriers reduce wavefunction overlap, thereby limiting carrier transport through the cascade and decreasing the overall current.
While some layer widths have a moderate influence on current density, the absolute values of the Pearson correlation coefficients do not exceed 0.6, with the maximum observed value being 0.58. This indicates that linear models would capture only a small fraction of the observed variability. Overall, these low-to-moderate correlation values suggest that linear dependencies are generally insufficient to fully describe the dataset’s behavior. This clearly justifies the use of nonlinear ML models (RF, XGBoost, and ANN) to predict material gain, emission frequency, and current density. By employing these approaches, predictive accuracy can be significantly improved compared to linear models, which are inherently limited by the low correlations observed.
3.2. Machine Learning Models for Predicting Material Gain, Emission Frequency, and Current Density
RF, XGBoost, and ANN models were employed to predict three output parameters of QCL structures: material gain, emission frequency, and current density. The dataset contained 62,250 samples, which were randomly split into a training subset of 43,575 samples (70%), a validation subset of 9337 samples (15%) for hyperparameter tuning, and a test subset of 9337 samples (15%) for final model assessment. Kolmogorov–Smirnov two-sample statistical tests confirmed that the training, validation, and test subsets were drawn from statistically equivalent distributions (p > 0.05 for all features), demonstrating the absence of sampling bias during dataset splitting. Hyperparameter tuning was carried out using different optimization strategies according to the learning algorithm. For the Random Forest and XGBoost models, a random search was performed over a predefined hyperparameter space, with 2000 randomly sampled configurations evaluated for each model. The search space included key model parameters such as tree depth, number of estimators, learning rate (for XGBoost), subsampling ratios, and regularization parameters. For the ANN model, Bayesian optimization was used to efficiently explore the continuous hyperparameter space, focusing on both architectural parameters (number of hidden layers and neurons) and optimization parameters (learning rate, batch size, and weight decay). After hyperparameter tuning, the final models were trained with the best parameters for each learning algorithm, and their generalization performance was assessed on both the training and test datasets.
For material gain prediction, the optimal RF model was configured with 250 estimators, a maximum tree depth of 27, a minimum sample split of 2, a minimum of 1 sample per leaf, a feature sampling ratio of 0.9, and bootstrap enabled. This setup yielded Root Mean Square Error (RMSE) values of 2.75 cm
−1 on the training set and 7.19 cm
−1 on the test set. The top-performing XGBoost regressor, optimized with a learning rate of 0.08, a maximum depth of 13, 140 estimators, a gamma of 0.3, and a minimum child weight of 5, achieved RMSE values of 1.55 cm
−1 on the training data and 6.07 cm
−1 on the test data. The optimal ANN model was trained for 150 epochs and consisted of four hidden layers with 64, 128, 128, and 256 neurons, respectively. The network was trained using the Adam optimizer with a learning rate of 6.59 × 10
−4, weight decay of 4.40 × 10
−6, and a batch size of 64. ReLU activation functions were applied in the hidden layers, while a linear activation function was used in the output layer. This model achieved the lowest test RMSE of 1.13 cm
−1, outperforming the tree-based models. These results are summarized in
Table 1.
To further evaluate the predictive performance of the developed models, the distribution of relative prediction errors was analyzed.
Figure 9 shows the violin-box plot analysis of the relative prediction errors, highlighting clear differences in the stability and robustness of the evaluated approaches. The ANN model exhibits the narrowest interquartile range with a median relative error of approximately 0.55%, indicating that most predictions were closely aligned with the reference values. In contrast, the RF and XGB models show negative median errors of approximately −5.88% and −3.36%, respectively, demonstrating a systematic tendency towards underprediction. Therefore, the ANN model achieved the most accurate and stable performance, with a median error below 1%, which is considered highly satisfactory for this regression problem.
Additionally, the standardized RMSE relative to the standard deviation of the target variable (SRMSE) was 0.36 for RF, 0.30 for XGBoost, and 0.06 for the ANN model. These results confirm that all models achieve good predictive accuracy (SRMSE < 0.4), with the ANN model demonstrating significantly better performance (SRMSE < 0.2).
For emission frequency prediction, the RF model was configured with 250 estimators, a maximum depth of 27, a minimum sample split of 2, a minimum of 1 sample per leaf, and a feature sampling ratio of 0.9. This setup resulted in RMSE values of 0.23 THz on the training set and 0.62 THz on the test set. The best-performing XGBoost regressor, optimized with a learning rate of 0.1, a maximum depth of 12, 130 estimators, and a minimum child weight of 5, achieved RMSE values of 0.27 THz on the training data and 0.58 THz on the test data. For emission frequency prediction, the best-performing ANN configuration was achieved after 150 training epochs and comprised four hidden layers with 32, 256, 256, and 16 neurons, respectively. The training procedure used the Adam optimizer with a learning rate of 9.58 × 10
−4, weight decay of 7.622 × 10
−6, and a batch size of 32. ReLU activation was applied in the hidden layers, while a linear activation function was used in the output layer. The resulting model achieved a test RMSE of 0.25 THz, outperforming all tree-based methods. The corresponding RMSE values are presented in
Table 2.
The performance of the models for emission frequency prediction is further examined through the error distribution shown in
Figure 10. All three models have median errors close to zero, indicating no strong systematic bias. However, differences are more apparent in terms of dispersion, where the ANN model shows a noticeably tighter interquartile range than the RF and XGBoost models, reflecting greater consistency across samples. Despite this overall stability, all models show extreme deviations in the error tails, with values exceeding 300%, which is attributed to the sensitivity of the relative error metric to small reference frequencies. The ANN model offers the most balanced performance, combining lower RMSE with improved error stability for emission frequency prediction.
The corresponding SRMSE values were 0.55 for RF, 0.51 for XGBoost, and 0.22 for ANN. While all models exhibit acceptable predictive performance, the ANN model clearly outperforms the tree-based approaches. As SRMSE values below 0.40 are generally considered solid indicators of predictive accuracy, these results demonstrate that the ANN model provides reliable and precise emission frequency predictions.
For current density prediction, the RF model employed 250 estimators, a maximum depth of 27, and a feature sampling ratio of 0.9, achieving RMSE values of 118.8 A·cm
−2 on the training set and 320.8 A·cm
−2 on the test set. The best-performing XGBoost regressor, tuned with a learning rate of 0.15, a maximum depth of 12, 170 estimators, gamma of 0.2, and a minimum child weight of 4, reached RMSE values of 52.2 A·cm
−2 for the training data and 247.1 A·cm
−2 for the test set. The optimal ANN model for current density prediction is composed of four hidden layers with 32, 256, 128, and 32 neurons, respectively. The model was trained using the Adam optimizer with a learning rate of 1.16 × 10
−3, a weight decay of 1.99 × 10
−4, and a batch size of 32. ReLU activation functions were applied in the hidden layers, while a linear activation function was used in the output layer. This model achieved the most accurate test predictions, with an RMSE of 55.0 A·cm
−2, outperforming both tree-based models. These results are summarized in
Table 3.
In addition to RMSE-based evaluation, the distribution of relative prediction errors in
Figure 11 highlights notable differences in model stability. Although all models have relatively low median errors close to zero, their distributions differ significantly in spread and asymmetry. The ANN model has the most compact interquartile range and greater robustness, while RF and XGBoost show wider dispersion and stronger skewness in the error distribution. The RF model, in particular, exhibits a highly skewed distribution, where extreme outliers compress the main body of the violin plot, making the central distribution appear less pronounced. These results confirm that the ANN model provides the most stable and accurate predictions for current density among the evaluated approaches.
SRMSE values across the current-density range were 0.21 for RF, 0.16 for XGBoost, and 0.04 for ANN, confirming that all models provided accurate predictions, with the ANN model delivering the most precise estimates.
3.3. ANN Performance on the Entire Configuration Space
The results in the previous section show that the ANN outperformed both RF and XGB in predicting material gain, current density, and emission frequency on the test subset. In this section, the performance of the ANN is further evaluated across the entire configuration space. Its ability to deliver reliable results is demonstrated by significantly reduced computational time compared to the numerical solver used to generate the training dataset for the ML models.
The mean absolute percentage error (MAPE) between the ANN predictions and the numerical solver results is used as a metric to assess the model’s reliability. For comparison, the MAPE values obtained for the ANN on the test subset for material gain, current density, and emission frequency, presented in the previous section, are summarized in
Table 4.
Simulating a single configuration with the numerical solver takes about 20 s. In comparison, the ANN model can generate roughly 250,000 configurations in the same time. Using this method, an algorithm was created to explore the configuration space and identify the 500 best structures that meet a specific criterion.
The construction of the configuration space involved varying each layer’s width by up to ±40% of the nominal value in steps of 2.825 Å (monolayer width), and adjusting the electric field from 17.5 kV/cm to 27.5 kV/cm in 0.5 kV/cm increments. Additionally, because the last three layers (4, 5, and 6) represent the second well layer, only variations resulting in a total width within ±40% of the nominal width of this well layer were considered. The variation parameters for each feature are listed in
Table 5.
With this number of combinations for each feature, the total number of configurations in the configuration space was 9 × 22 × 5 × 2106 × 21 = 43,783,740, roughly 44 × 106 configurations. Each configuration was evaluated by each ANN to predict the respective value. The criteria for selecting the best 500 structures were a current density between 1000 A·cm−2 and 3000 A·cm−2 and maximum material gain.
The entire process of generating all possible combinations, running them through the networks, and saving the best 500 configurations out of approximately 44·106 took 314.4 s. In comparison, simulating the entire dataset (62,250 configurations) took 11.24 h. This provides an approximately 130 times faster way to explore the full configuration space than simulating the complete dataset, and about 90,000 times faster to estimate a single configuration using an ANN than the simulator.
Algorithmically, due to the large number of configurations, it is impossible to keep all of them in memory during the sweep, so a method was developed to process configurations in batches. In this way, only 1,000,000 configurations are processed per batch, resulting in a constant space complexity.
To further validate the accuracy of the ANN across the entire configuration space, the numerical solver was run on the 500 best configurations. The MAPE between the ANN predictions and the corresponding numerical results was calculated for all three output variables and is shown in
Table 6.
The parameters of the five configurations with the highest predicted material gain are listed in
Table 7, while
Table 8 shows the ANN predictions and the corresponding numerical simulator results for material gain, emission frequency, and current density.
It can be observed that in all designs shown in
Table 7, both the injection barrier and the second barrier (layers 1 and 3) are generally lowered compared to the initial design, while the widths of the well layers (layers 2 and 4 + 5 + 6) are increased relative to the original configuration. Thinner barrier layers may result in enhanced carrier injection into the upper laser state, which may contribute to increased optical gain. In addition, wider well regions can modify the energy spacing and wavefunction overlap between the relevant subbands, potentially improving the optical transition strength, suggesting that the ANN optimization process captures physically relevant dependencies present in the DM generated dataset.
As shown in
Table 8, the predicted values of material gain and emission frequency closely match the results from the numerical simulator. While the predicted current density values show slightly larger deviations, they generally stay within a ±15% relative error range.
For comparison, the values obtained from the numerical simulator for the initial structure corresponding to the design with a record operating temperature of 261 K, which served as the starting point for generating the varied configurations and the entire configuration space, are 64.23 cm−1 for material gain, 2591.12 A·cm−2 for current density, and 3.685 THz for the emission frequency, all at an electric field of 22.5 kV·cm−1.
By training the ANN and applying it to the configuration space, we could reliably identify configurations with higher material gain than the initial design. Additionally, the predicted results for all configurations can now be filtered to optimize, maximize, or select any of the quantities predicted by the ANN, such as material gain, current density, and emission frequency. Since the entire configuration space of approximately 44 million structures has been evaluated using the ANN, this approach allows for an unprecedented speed in searching and analyzing configurations—roughly 90,000 times faster than the simulator—while maintaining a high level of prediction reliability.