1. Methods and tools
1.1. Irregular grid of CLOUDY models
We compute a grid of 3,500,000 photoionization models for H ii regions using the multi-purpose photoionization code CLOUDY in its version 17.03. The input space-parameter is of dimension 13: log(U), O/H, N/O, C/O, Ne/O, S/O, Ar/O, ionizing cluster age, shape-factor, hydrogen density, optical depth, dust content, filling factor. The ionizing SED is defined by BPASS binary-including library (Eldridge et al. Reference Eldridge, Stanway, Xiao, McClelland, Taylor, Ng, Greis and Bray2017; Stanway & Eldridge Reference Stanway and Eldridge2018). For extremely large grids, we adopt a practical approach involving using randomly-distributed independent parameters, which offers an efficient way to populate datasets to train ML algorithms. The models are stored under reference HII_24 in 3MdB_17, which is a large database of photoionization models, with public access through the mySQL protocol since 2014 (http://3mdb.astro.unam.mx, see Morisset et al. Reference Morisset, Delgado-Inglada and Flores-Fajardo2015).
1.2. CLOUDY emulator using ANN
A subset of 800,000 models is defined to train the ANN. The ANN is implemented through the Tensorflow python library (http://tensorflow.org). The ANN of the 256-512-256 GELU neurons (Hendrycks & Gimpel Reference Hendrycks and Gimpel2016) takes 13 input parameters and predicts 14 emission line ratios + electron temperature + H
$\alpha$
absolute luminosity. The training time is 2 hours on a standard GPU. The ANN allows us to generate 1 million models in 0.2 seconds (!). The ANN and the first results are described in paper I (Morisset et al. Reference Morisset, Charlot, Sánchez, Espinosa-Ponce, Barat and Dautremer2025) : https://ui.adsabs.harvard.edu/abs/2025MNRAS.538.1884M
2. Some results
250,000 galaxy models are produced containing between 100 and 3000 H ii regions each. Global DIG emission and dust attenuation (individually defined for each H ii region) are taken into account. In Fig. 1 we show that the direct-method determination of O/H in metal-rich H ii regions and galaxies can strongly underestimate the true value. This is due to the combination of: 1) the contamination of [O
$\,$
iii]
$\lambda$
4363 by recombination, 2) the natural electron temperature gradient in cold regions, described by Stasińska (Reference Stasińska2005), and 3) the effect of phosphorescence contamination of [O
$\,$
iii]
$\lambda$
4363, see Morisset et al. in prep.
Distribution of the logarithmic difference between O/H derived from the direct method and true, H
$\alpha$
-weighted O/H as a function of 12 + log (O/H), for the subset of 207 750 composite star-forming galaxies with log([O
$\,$
iii]
$\lambda$
4363/H
$\beta$
)
$\gt -3$
. Left: Colour-coded as a function of model number density. Right: Colour-coded as a function of root-mean-square t of H II-region temperature fluctuations. Taken from Morisset et al. (Reference Morisset, Delgado-Inglada and Flores-Fajardo2015).

Figure 1 Long description
Panel A: A scatter plot shows the distribution of the logarithmic difference between oxygen abundance derived from the direct method and true values as a function of 12 + log (O/H) true. The x-axis represents 12 + log O/H true, ranging from 6.5 to 9.5. The y-axis represents the difference in log O/H (direct - true), ranging from -0.6 to 0.6. The color scale indicates the number density of models, with yellow representing higher densities and purple representing lower densities. Panel B: Another scatter plot shows the same x and y axes but is color-coded as a function of the root-mean-square of H II-region temperature fluctuations. The color scale ranges from yellow (higher values) to purple (lower values). Both plots reveal a trend where the difference in log O/H (direct - true) varies with the true oxygen abundance, showing a noticeable pattern around 12 + log O/H true values of 8.5 to 9.0.
Models are compared to observations: some galaxy models are selected if they reproduce simultaneously [N ii]/H
$\beta$
, [O
$\,$
ii]/H
$\beta$
, [O
$\,$
iii]/H
$\beta$
, and [S
$\,$
ii]/H
$\beta$
. He
$\,$
i/H
$\beta$
, and [Ar
$\,$
iii]/H
$\beta$
can also be used if present in the observational set. These models are shown in Fig. 2, in the case of fitting the stacked observations from Curti et al. (Reference Curti, Cresci, Mannucci, Marconi, Maiolino and Esposito2017). The selected galaxies can then be plotted in Strong Line (SL) calibrators vs. O/H diagrams. In Fig. 3 we show the effect of changing the N/O vs. O/H relationship at the level of the galaxy models. The scatter observed in the SL calibrators can be identified with real dispersions in the relationships between the different parameters, here N/O vs. O/H, but also log(U) vs. O/H, among others.
Plots for BPT-type diagrams for the results of best SF galaxies models. Black dots are from Curti et al. (Reference Curti, Cresci, Mannucci, Marconi, Maiolino and Esposito2017). Plots are taken from Morisset et al. in prep.

Strong line calibrators vs. oxygen abundance for the SF synthetic galaxies selected by fitting Curti et al. (Reference Curti, Cresci, Mannucci, Marconi, Maiolino and Esposito2017) observations. The color code follows the departure from canonical N/O vs. O/H relationship. Plots are taken from Morisset et al. in prep.

Figure 3 Long description
The image contains twelve scatter plots arranged in a 3x4 grid. Each plot shows the relationship between different emission lines and oxygen abundance (12 + log O/H) in synthetic star-forming galaxies. The color code represents the departure from the canonical N/O vs. O/H relationship, ranging from blue to red. Panel A: log [N II]/[O II] vs. 12 + log O/H. Panel B: log [N II]/[S II] vs. 12 + log O/H. Panel C: log ([N II]6584/Hα) vs. 12 + log O/H. Panel D: log ([S II]6725/Hα) vs. 12 + log O/H. Panel E: log ([O II]3727/Hβ) vs. 12 + log O/H. Panel F: log ([O III]5007/Hβ) vs. 12 + log O/H. Panel G: log ([O III] + [O II])/Hβ vs. 12 + log O/H. Panel H: log ([O III]/Hα + [S II]/Hα) vs. 12 + log O/H. Panel I: log ([O III]/Hβ) vs. 12 + log O/H. Panel J: log ([O III]/[O II]) vs. 12 + log O/H. Panel K: log ([S II]/[O II]) vs. 12 + log O/H. Panel L: log ([N II]/[O II]) vs. 12 + log O/H.
3. Conclusions and future work
ANN is a powerful tool to create very fast CLOUDY ersatz. Synthetic galaxy models obtained by summing individual H ii region models allow us to explore the effects of parameter scatters. Stay tuned for paper II. The ANN can also be used for any massive production of H ii region models, e.g. in an MCMC method or a Genetic algorithm, to derive physical/chemical parameters from observed line ratios. The results will soon be updated using a grid of models using new CLOUDY c25.00.
Acknowledgments
The initial stages of this work were conceived and developed during a CM sabbatical at the Institut d’Astrophysique de Paris (IAP) to collaborate with SC. CM gratefully acknowledges the PASPA grant that supported this sabbatical. CM acknowledges the support of UNAM/DGAPA/PAPIIT grants IN101220 and IG101223.


α
λ
β
>−3
