# IPA: A deep CNN based on Inception for Petroleum Analysis

F. Haffner, M. Lacoue-Negre, A. Pirayre, D. Gonçalves, J. Gornay, M.

Moreaud

► To cite this version:

F. Haffner, M. Lacoue-Negre, A. Pirayre, D. Gonçalves, J. Gornay, et al., IPA: A deep CNN based on Inception for Petroleum Analysis. Fuel, 2025, 379, pp.133016. 10.1016/j.fuel.2024.133016. hal-04929129

HAL Id: hal-04929129

https://ifp.hal.science/hal-04929129v1

Submitted on 4 Feb 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Full Length Article

IPA: A deep CNN based on Inception for Petroleum Analysis

F. Haffner<sup>a</sup>, M. Lacoue-Negre<sup>a,c,*</sup>, A. Pirayre<sup>b</sup>, D. Gonçalves<sup>a</sup>, J. Gornay<sup>a</sup>, M. Moreaud<sup>a</sup>

<figure><img src="image_2.png" /></figure>

ARTICLE INFO

Keywords:

Deep learning (DL)

Convolutional neural network (CNN)

Machine learning (ML)

Chemometrics

Near-infrared (NIR) analysis

ABSTRACT

Deep learning is emerging as a challenger to chemometrics which was used for decades to predict properties of petroleum cuts using Near-Infrared spectroscopy (NIR). In this study, a new CNN "Inception for Petroleum Analysis" (IPA) has been developed and its performance compared with both PLS and recent deep learning reference model DeepSpectra to predict CN of middle distillates. IPA, is inspired from state-of-the-art computer vision architectures. It is based on several computational blocks with the ambition to meet the daily needs in NIR analysis and is especially suited for small datasets like less than 250 samples. Two datasets were considered, a first one with a reduced spectral range, using variable selection, in which saturated variables have been removed for PLS modeling, and a larger dataset, without variable selection, to evaluate the robustness of IPA. IPA demonstrates regression errors 40% smaller than PLS, and therefore much closer to measured data. Compared with a benchmark Deep Learning model, in particular DeepSpectra, IPA is 20% more accurate. On the same dataset in its full-range of 4150 features, IPA demonstrates a regression error 50% smaller than PLS, and 21% more accurate than DeepSpectra. These results are due to the ability of IPA to both extract complex representation from spectra and not being distracted by parts of the dataset who are considered saturated by experts. This new method improves the performance and reduces the dependence on complex pre-processing operations on dataset, like variable selection and digital signal processing.

1. Introduction

Evaluating the properties of middle distillates, derived from the 180 °C-360 °C boiling range in crude oil distillation, is essential for determining their intended applications in an oil refinery, including production of diesel, jet fuels, low sulfur marine fuels, heating fuels, and renewable fuels. Standard methods provided by standardization organisms such as ASTM International and ISO are applied to obtain the properties required to qualify a fuel. Many analyses are applied to each sample, regardless of the type of oil cut considered. Therefore, qualifying a fuel is time-consuming and requires significant sample volumes. As an example, cetane number is essential to quantify fuel ignitability in a diesel engine and can be determined following ASTM D613 [1], involving fuel combustion in an indirect injected, single cylinder, four-stroke diesel engine with variable compression ratio. This standard method requires up to 500 ml of fuel and a couple of hours to deliver the cetane number of a sample. When a complete overview of the properties of a fuel is required to evaluate if the fuel meets the standard specification [2], having a less time-consuming analysis is of interest.

Near infrared spectroscopy (NIR) is a fast, simple, and non-destructive analytical method used to obtain multiple properties when combined with machine learning methodologies, especially Chemo-metric methods. It is used for decades in the petroleum industry to predict fuel properties [3]. The flexibility of NIR spectrometer makes it possible to be deployed in laboratories as well as online for real-time monitoring, for example, in the control of the industrial processes [4,5], in fuel quality control [6], in diesel analysis [7–9] and in biodiesel analysis [9–11].

The frequent practice to build a predictive model using NIR data and Chemometrics is a time-consuming trial-and-error experimentation that must be reiterated when changing the spectrometer, for a change in acquisition conditions, to implement in real-time for process monitoring, etc. A major task of this approach is to determine a consensus on which preprocessing applied to the spectra for the selected properties and which optimal settings to use for the chosen method (regression, classification, etc.). Digital signal processing [12–14] is the key-step to improve the quality of modeling, with an important number of pre-processing methods existing to correct the undesired variations affecting the quality of the NIR spectra. Without previous knowledge

<footnote><sup>a</sup> IFP Energies nouvelles, Rond-point de l'échangeur de Solaize, BP 3, 69360 Solaize, France</footnote>

<footnote><sup>b</sup> IFP Energies nouvelles, 1 et 4 avenue de Bois-Préau, 92852 Rueil-Malmaison, France</footnote>

<footnote><sup>c</sup> ChemHouse Research Group, Montpellier, France</footnote>

<footnote>* Corresponding author at: IFP Energies nouvelles, Rond-point de l'échangeur de Solaize, BP 3, 69360 Solaize, France.
E-mail address: marion.lacoue-negre@ifpen.fr (M. Lacoue-Negre).</footnote>
on the dataset studied, finding the correct way to preprocess spectra is time-consuming and can lead to test several preprocessing methods and their combinations.

Deep Learning (DL) has a different philosophy in comparison to Chemometrics since it is interested in representation learning, which builds internal abstract representation to perform its tasks. These models extract knowledge from data and try to simplify or in certain case remove crafted operations on datasets [15]. Additionally, they are able to extract non-linearity by design, which enable the model to learn more complex information from data. Deep learning, used in computer vision, yields a number of notable advancements with Convolutional Neural Networks (CNNs) around 2015, leading to a range of discoveries and intriguing networks that incorporate innovative concepts and enhance performance on 2D images. These networks are based on convolution operations that, when stacked in multiple layers, can extract meaningful neighborhood features from the input data.

A major idea emerged from the “Inception” architecture [16], an image recognition model trained on a general-purpose dataset of 2D images. According to the authors, the biggest performance improvements are not due to the simple application of ever-deeper networks, but rather to the combination of new architectures and advanced “computing blocks”. The usage of multiple “modules” composed of convolution layers in parallel, setup with different sizes, can reduce dimensionality and integrate complex representation within the network. Furthermore, the improvement of performance gained by this approach, enables the usage of deep CNNs on mobile and embedded device for a reasonable computational cost.

Another idea that “deep networks do not need large datasets” has given rise to sophisticated architectures like U-Net [17]. These demonstrate the feasibility of training deep networks with modest-sized datasets, also using networks designs that are more intricate than mere stacks of convolutional and dense layers [18].

Concerning NIR data, recently published studies on DL demonstrate deep networks can learn critical patterns from raw data [19]. A rational approach could be to draw inspiration from 2D computer vision architectures and adapt them to fulfill specific tasks on 1D signal data. Finally, computer vision-inspired architectures adapted for NIR analysis will be considerably smaller than their generic counterparts, as they are optimized for smaller, task-specific problems rather than designed for broad, general-purpose applications. It is then possible to consider deep learning as a challenger for Chemometrics traditional practices, simplifying its processes and leverage a more generic way to characterize products.

The current state of the art of DL applied to NIR is still in its infancy, compared to computer vision, which is powered by incredibly sophisticated networks. The field began to attract attention in 2016 with a first paper of interest [20] using a shallow CNN and proposing a new direction for Chemometrics by reducing the need for preprocessing, yet still continuing to rely on it. Currently, the most popular types of networks used on NIR analysis are CNN based architectures [19]. Those can be classified into two groups. A group that is close to Chemometrics following the direction proposed by its precursor to feed a shallow CNN [21–25], which usually applies digital signal processing and variable selection. Another group, which is more closely related to modern deep networks, maximizes the networks’ capacity to extract knowledge from raw data using models such as DeepSpectra or SpectraTr [26,27]. Investigating this second approach is what this study is interested about.

Therefore, a specific CNN architecture has been built, based on DeepSpectra then improved still relying on Inceptions ideas, to predict the cetane number of middle distillates samples. The IPA architecture as well as a new approach for training a DL model has been developed to meet day-to-day needs, with improved performance and robustness, for near infrared analysis of hydrocarbon data. The results of both IPA and the DeepSpectra reference model were compared with the classical Chemometric model.

<figure><img src="image_3.png" /><figcaption>Fig. 1. Distribution of cetane property (y).</figcaption></figure>

## 2. Materials and methods

**NIR analysis.** In this study, 249 middle-distillates samples, mainly kerosene and diesel, produced from various processes including hydrotreatment, hydrocracking or fluid catalytic cracking for example were used [4,5]. For each sample, the cetane number was obtained following the standardized method ASTM D613-95 [1] whose reproducibility is 2.8. Statistics of the given target suggest a smooth and wide distribution for the cetane property, which can be difficult to learn for some algorithms. It is respectively composed a minimum value of 19.0, maximum of 71.1, mean of 43.3, and a standard deviation of 11.1, with a proposed graphical visualization in Fig. 1.

The NIR spectra of the samples were recorded on a purged Bomem MB160 equipped with a DTGS detector in transmission mode using a 2 ± 0.02 mm cell (QX quality, Hellma). The measurements were taken at 27.5 °C using a Peltier cell. Spectra are displayed in the 4000–12 000 cm⁻¹ spectral range on Fig. 2.

**Model evaluation.** To compare the performance of DL models with PLS, the initial dataset was split using the Kennard and Stone algorithm [28] into a calibration set (70% samples) used to train both models, and a validation set (30% samples) for performance evaluation. Both models were evaluated, using the Root Mean Squared Error (RMSE), the coefficient of determination (R2), and a “Fit ratio”. These are important complementary metrics that provide a complete evaluation of model performance.

$$RMSE = \sqrt{\frac{1}{n} \sum_{i}^{n} (y_i - \hat{y}_i)^2} \qquad (1)$$

$$R2 = 1 - \frac{\sum_{i} (y_i - \hat{y}_i)^2}{\sum_{i} (y_i - \bar{y})^2} \qquad (2)$$

$$Fit ratio = \frac{RMSEP}{RMSEC} \qquad (3)$$

The RMSE is given by Eq. (1), where $y_i$ and $\hat{y}_i$ are the cetane number measured and predicted on sample i respectively, and n is the number of samples. It measures the distance between the model’s prediction and the reference values. Additionally, by using the squared correlation coefficients given by Eq. (2), where $\bar{y}$ represent the mean of the measured value, the ability of the model to follow the data’s trend is measured. Finally, the “Fit ratio” given by Eq. (3), calculates the learning equilibrium for a given model using its RMSE on a calibration dataset (RMSEC), and its RMSE on a validation (RMSEC).

Although in the context of DL, RMSEC is mostly needed to calculate the fit ratio, it is an important input throughout the Chemometrics calibration procedure. In addition, analogous prediction statistics, RMSECV and R2V, were calculated on the validation set as with RMSEP and
<figure><img src="image_4.png" /><figcaption>Fig. 2. Middle-distillates NIR raw spectra features (X).</figcaption></figure>

<table><caption>**Table 1**
Signal processing method evaluated on the NIR spectra of middle-distillates.</caption><thead><tr><th>#</th><th>Baseline</th><th>Scatter</th><th>Smoothing</th></tr></thead><tbody><tr><td>1</td><td>WLSB</td><td>SNV</td><td>SavGol</td></tr><tr><td>2</td><td>WLSB</td><td>SNV</td><td>None</td></tr><tr><td>3</td><td>WLSB</td><td>None</td><td>SavGol</td></tr><tr><td>4</td><td>WLSB</td><td>None</td><td>None</td></tr><tr><td>5</td><td>None</td><td>SNV</td><td>SavGol</td></tr><tr><td>6</td><td>None</td><td>SNV</td><td>None</td></tr><tr><td>7</td><td>None</td><td>None</td><td>SavGol</td></tr><tr><td>8</td><td>None</td><td>None</td><td>None</td></tr></tbody></table>

R2P for prediction. These two metrics are equally important, both in a DL and Chemometrics context. Finally, the “Fit ratio” shows reduced overfit if close to 1, since the distance of calibration and prediction is “balanced”.

**Chemometrics methodology.** Partial Least Squares (PLS) is the most popular regression tool for Chemometrics [29,30]. This linear algorithm try to find the relationship, represented by the maximum covariance, between a given feature (X) and its corresponding target output (Y). The PLS algorithm requires manual tasks on the dataset to achieve optimal performance. Therefore, the calibration procedure involves trial and error on both variable selection and digital signal processing until the optimum model is obtained.

Before developing the PLS regression model, a preliminary analysis was performed to determine the spectral region of interest. Since the region below $4500 \text{ cm}^{-1}$ is mostly saturated, it was established to use the spectral region between $4500 \text{ cm}^{-1}$ and $12000 \text{ cm}^{-1}$ which provides the most informative spectral features for these data [8]. In the following of this study, the expression “reduced spectral range” refers to this range.

A design of experience [31] of best practices was used to build the digital signal processing procedure. Therefore, eight different combinations were tested as shown in Table 1. Weighted Least Squares Baseline (WLSB) was used for baseline correction, while Standard Normal Variate for scatter and Mean-centering for scaling [14]. For smoothing and derivative, the Savitzky-Golay (SavGol) [32] technique was combined with different combinations, starting with a window width of 15 points and a polynomial order of 1. All techniques were evaluated, taking into account the possible combinations. Special care were given for the SavGol parametric technique, testing different combinations to determine its optimal combination for the dataset.

Finally, the optimal number of latent variables was determined for each case when the RMSECV calculated using K-Fold cross-validation reached a minimum, with still the RMSEP/RMSEC ratio close to 1.

The models were implemented using the PLS Toolbox version 9.2 (Eigenvector Research Inc., Wenatche, WA, USA) for MATLAB R2022b (The MathWorks Inc., Natick, MA, USA).

**Deep learning methodology.** As shown by [27], DL does not rely too heavily on preprocessing algorithms to remove noises such as baseline drift in spectra, but needs to be standardized to allow faster gradient convergence. For each feature (X) and its corresponding

target output (Y), the mean is subtracted from each feature, and the result is divided by its standard deviation. This process, identified as StandardScaler in the Scikit-learn library [33], centers the data distribution around zero and standardizes it to a standard deviation of one. Furthermore, given the stochastic nature of the optimization algorithms, it is necessary to feed the algorithms with a seed using an arbitrary number, in this case the number one, for both Python, Keras and TensorFlow.

The architecture of the proposed model, IPA, is illustrated in Fig. 3. In the figure, the convolutions with a kernel of 1 are represented by a red rectangle and uses stride 2. The convolutions with a kernel of 3 are represented by a blue rectangle. The Max-pooling layer is represented by a light grayish orange rectangle. The concatenation of the filters constructs a fresh matrix from the output obtained in the multi-branch module. IPA is inspired by two parts of the multiple versions of the inception's architectures [34,35], however it is considerably smaller than its generic counterparts, as it is optimized for smaller, task-specific datasets. The initial segment of the model, referred to as the stem, is a smaller version of the Inception-V4 module [35]. It is based on three convolutions at the input of the network, while the multi-branch module is composed of four different paths which assemble in the last part of the network. The second part, referred to as multi-branch module, first used the custom module proposed by DeepSpectra [26], but was replaced later for the Inception-V2's 35 × 35 module [34] to make it more efficient. None of the convolutions use padding. The final section includes a flatten layer, optimized with a Dropout strategy, then a Dense layer.

To summarize, the model incorporate a total of ten convolution layers leading to 215,000 parameters, maintaining a balanced distribution in terms of both width and depth. The loss of such balance is to provide the network with sufficient visibility of the signal to deliver good enough decision and, in the end, estimate properly the property to be predicted.

Computation efficiency was a major concern, which explain why this network relies on convolutions with maximal kernel size of 3. The IPA network does not possess any large spatial filters, such as a kernel of size 5 or 7, since they were factored into multiple smaller convolutions using a kernel size of 3, following the recommendation in [16]. Furthermore, the allocation of feature maps, often denoted as the count of neurons within each convolutional layer, follows a progressive trajectory. Initially configured at 16, this count undergoes a twofold augmentation in the preliminary segment of the multi-branch module, following a practice that has been advocated to enhance network capacity and capture hierarchical features effectively [36]. Subsequently, this twofold augmentation is further amplified in the latter part of the multi-branch module.

The fundamental hyperparameter who defines the initial point of the network's internal parameters, known as gradient initialization, uses He Initialization technique [36]. It mitigates the issues associated with vanishing or exploding gradients frequently encountered in contemporary deep neural networks. This method is expected to be
<figure><img src="image_5.png" /><figcaption>Fig. 3. The IPA deep CNN architecture. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

utilized in conjunction with modern activation functions, such as ReLU or LeakyReLU, to manage the output of the networks layers [36]. The selection of LeakyReLU is motivated by its enhanced performance in the context of spectral modeling [26].

During the hyperparameters tuning process, intervals were used to define the specific hyperparameter for the CNN's initial learning rate and the L2 lambda. Adam optimizer is used to train models [21–23,26,27]. The learning rate (Lr) is a key hyperparameter of DL which determines the step size taken during the optimization process. In this study, the initial learning rate is defined between $10^{-2}$ and $10^{-5}$. Its selection was fast and intuitive thanks to visual analysis of the training loss, then fine-tuned using measures defined in the model evaluation section. Furthermore, the initial step size is reduced regularly during the training process to make smaller steps by using an optimization schedule called “Exponential Decay”, which uses two parameters: “Lr decay” as $10^{-3}$ and “Lr decay steps” as $10^4$. In summary, the initial Lr was adjusted thanks to the visualization of the loss function Fig. 4, while the L2 lambda of Eq. (4) is adjusted, until its Eq. (3) is closer to 1. The number of epochs defines the number of iterations where the network sees the entire data set of the training database is defined as 500. To reduce overfitting, early stopping patience measures when the metrics did not continue to improve, and is defined to 50 epochs. Finally, IPA use a single Dropout layer with a 20% exclusion rate to ensure overfitting is reduced in the regression part of the network.

Furthermore, when considering the number of training examples processed per iteration, known as batch size, it is important to note that defining a large batch size is often restricted by available CPU or GPU memory, usually for a large dataset with millions of examples. While a large batch size can lead to faster convergence, it may also result in local minima [19]. Conversely, a smaller batch size can lead to convergence on one of the best possible solutions, but increases the randomness of model training. This hyperparameter has a visual impact on the loss plot and can therefore be seen when it is too small, as it appears “noisy” or “jumpy”. Given the size of the studied dataset and the duration of the epochs, and inspired by some networks using a single example as batch size [17], this study opted for a batch size of 16.

A specific loss function Eq. (4) is used to optimize the parameters $w$ of the network. This function comprises a combination of an optimization driven by the data and network regularization. The loss function uses the Mean Absolute Error (MAE) to calculate the model's error from the data. MAE is less sensitive to outliers since it calculates the absolute

distance, between the measured value $y_i$ and the predicted value $\hat{y}_i$. For model evaluation, mean squared error is used, involving squaring the difference between measured and predicted values. Mean squared error makes the evaluation sensitive to outliers, ensuring the robustness of the model and a balanced calibration and validation performance. L2 regularization [37] is applied to the weights of the networks convolutions, i.e. parameters $w$, is incorporated into the loss function [26]. Specifically, it indirectly influences the importance of learned input features and encourages the network to give less importance to irrelevant features by reducing their corresponding weights. In this sense, it helps the model focus on the most informative features, but it does not select specific variables. $\lambda$ was carefully selected between $10^{-2}$ and $10^{-5}$ to maximize Eq. (3) towards 1.

$$ \text{Loss}(\mathbf{w}) = \frac{1}{n} \sum_{i=1}^{n} |\hat{y}_i - y_i| + \underbrace{\lambda \cdot \|\mathbf{w}\|_2}_{\text{Network regul. (L2)}} \quad (4) $$

A diagram depicting the loss of the IPA CNN during learning is presented in Fig. 4. The learning rate has been carefully chosen to facilitate a gradual reduction of the loss function over time, avoiding the scenario where it is too small and leads to slow optimization or too large and gets stuck in a local minimum. Furthermore, it is clear that the functions appear smooth, also suggesting that the mini-batch of 16 is a suitable choice. Finally, whilst this architecture does not incorporate residual connections in its network, the module comprising four branches within the network presents possible difficulties to optimize. However, an analysis of the loss function's evolution over epoch numbers reveals that this is not the case, and is simple for the optimizer to train.

The models were implemented with the open-source software applications Python 3.10 and Keras/TensorFlow 2.10 [38,39]. Training was carried out on a Windows OS workstation with 2x Intel Xeon 6240Y, 128 GB of RAM and Nvidia Quadro RTX 6000 with 24 GB of GPU RAM.

Access to the code implementation: https://github.com/florent-haffner/inception-pretroleum-analysis.

### 3. Results and discussions

In this study, it should be noted that the PLS serves as a reference point against IPA in a dataset containing a reduced spectral range, where non-linearity impacting the performance of the PLS are removed.
<figure><img src="image_6.png" /><figcaption>**Fig. 4.** Loss curve of the Deep CNN IPA during training.</figcaption></figure>

<caption>**Table 2**</caption>

Performance measurement of models prediction on the validation dataset. Mean and SD are calculated for each metrics after 5 calibrations. RMSEPs are provided to one decimal place, as they are strongly correlated with the cetane number, which is measured to one decimal place.

<table><thead><tr><th>Model</th><th>PLS</th><th>IPA</th><th>DeepSpectra</th></tr></thead><tbody><tr><td>Parameters</td><td>6 (LV)</td><td>215k</td><td>32k</td></tr><tr><td>RMSEP</td><td>1.8</td><td><strong>1.1</strong></td><td>1.5</td></tr><tr><td>R2P</td><td>0.974</td><td><strong>0.990 ± 0.001</strong></td><td>0.983 ± 0.000</td></tr><tr><td>Fit ratio</td><td>1.013</td><td><strong>0.927 ± 0.021</strong></td><td>0.942 ± 0.001</td></tr><tr><td>Time to train</td><td>1 s.</td><td>1 min 30.</td><td>0 min 35 s</td></tr></tbody></table>

The two models will be presented sequentially, starting with the PLS and followed by IPA on Table 2. Note that the RMSEC is not provided because it duplicates the Fit Ratio. To illustrate IPA's contribution in terms of architecture and methodology, the performance of the reference CNN for NIR analysis “DeepSpectra” [26] is added. A complementary analysis, both on IPA and DeepSpectra, was carried out on the full spectral range in which some wavenumbers are saturated to explore how they react in this new context.

For the Chemometric model, after following the DoE described in Table 1, the fourth case shown the best performance. It denoted a baseline correction to eliminate unwanted signal deviation and a mean-centering for scaling. After applying digital signal processing, the PLS demonstrated its optimal performance using six latent variables. The calibration process for PLS produced highly consistent results, with RMSEP 1.8, R2P 0.974 and fit ratio of 1.013, as shown in Table 2.

The IPA model produces results that are much closer to the original data than the PLS, with an RMSEP of 1.1. In addition, its R2P is closer to 1 at 0.990 while maintaining a relatively low fit ratio, indicating that the network is in slight overfit on the reduced range. Therefore, the L2 lambda parameter could be fine-tuned to acquire a fit ratio closer to 1. The selected value for the initial learning rate was 0.001, while the L2 lambda was 0.0095. As a result, the tuning of the model becomes much simpler, with only these two hyperparameters to be updated.

To ensure that IPA evolves in a comparable context, the reference CNN DeepSpectra is calibrated on the reduced spectral range dataset for comparison. It produced an RMSEP of 1.5, an R2P of 0.983 for a fit ratio of 0.942, which is a little improvement over the PLS, but does not beat the metrics given by IPA. The model's RMSEP had a low standard deviation, which indicates consistent performance across different calibrations. It might come from the VarianceScaling initialization, which differs from the modern standard He initialization used by IPA.

In Fig. 5, a parity plot is proposed for the models' predictions on the validation set. The confidence interval was established using the reproducibility of the reference method [1]. The PLS's and DeepSpectra's plot, respectively in (a) and (b), indicates dispersed results, with

<caption>**Table 3**</caption>

Performance measurement of the IPA model under two different scenarios: the reduced (4500–1200 cm⁻¹) and the full spectral range (4000–1200 cm⁻¹).

<table><thead><tr><th>Model</th><th>IPA (Reduced)</th><th>IPA (Full)</th><th>DeepSpectra (Full)</th></tr></thead><tbody><tr><td>RMSEP</td><td>1.1</td><td><strong>0.9</strong></td><td>1.3 ± 0.2</td></tr><tr><td>R2P</td><td>0.990 ± 0.001</td><td><strong>0.994 ± 0.001</strong></td><td>0.987 ± 0.004</td></tr><tr><td>Fit ratio</td><td>0.927 ± 0.021</td><td><strong>1.001 ± 0.010</strong></td><td>0.943 ± 0.024</td></tr></tbody></table>

forecasted values evenly spread throughout the confidence interval. More than ten PLS-predicted values surpass the limit, but they are in proximity. IPA's plot in (c) displayed highly condensed outcomes, since the estimated values were nearly identical to the measured values. There were a few scattered estimations, and only two samples surpassed the threshold delineated by the confidence interval. DeepSpectra produced slightly better results than PLS, with seven points out of the limit but failed to produce predictions as good as IPA. An important difference between the models can be seen in the extremes part of the plot. PLS and DeepSpectra have difficulty making predictions on high and low extreme cetane values as between 18–20 and 70–72, while IPA is stable. Therefore, while when both the PLS and DeepSpectra results must be welcomed skeptically in some range, IPA is able to offer robust predictions over the whole range.

In Fig. 6, the error distributions of the models appeared dissimilar. The PLS model generated sparse error with a standard deviation of 4, and a few predictions outside the limit as demonstrated in Fig. 5(a), which validated the diffused error of the model. DeepSpectra's error had a sparse distribution with a standard deviation of 4, it was better than the PLS, but worse than IPA. IPA's errors showed a tight distribution, with a standard deviation of 2, but struggled to predict very few samples, confirmed by visual analysis in Fig. 5(c).

Another test was carried out but on the full spectral range dataset, results are proposed in Table 3. The same architecture and hyperparameters were utilized both for IPA and DeepSpectra. DeepSpectra's and IPA's parity plots are available respectively in Fig. 8(a) and (b). It seems that feeding the full range dataset makes IPA even better, producing an RMSEP of 0.9 on a full spectral range, with an improvement of 21.3% compared to the previous results of 1.1 on Table 2. In addition, its R2P is closer to 1 with 0.994 on the full spectral range, compared to previous results of 0.990 on the reduced spectral range. Its fit ratio is closer to 1 indicating a very balanced model in terms of overfit/underfit, compared to results which flirted with overfit, but had a poorer RMSEP. In comparison, DeepSpectra also performs better with a RMSEP of 1.3, an R2P of 0.987 and a similar fit ratio of 0.942, but in contrast with IPA is not able to better regularize. The improvements measured on both DL models might be due to the fact that the full spectral range data set is 6.25% more representative than the reduced range dataset. However, the IPA network might be able to capture a little more information in the full range dataset while not being confused by the saturated part, which present non-linearities that are not present in the reduced spectral range. It is possible that greater representativeness also led to a network to a great balance of fit with improved performance.

The error analysis in Fig. 7 confirmed that IPA with its standard deviation of 2.5 on the full range dataset produced results with very low errors, while DeepSpectra with a standard deviation of 3.5 produced diffuse error.

IPA model proposes a simplified calibration workflow for cetane number calibration. Indeed, its intuitive tweaking, as well as reduced digital signal processing, facilitate NIR analysis, especially for oil analysis.

## 4. Conclusion

This study proposes a practical high-performance deep learning calibration methodology on real experimental data, offering code implementation. We developed a new deep learning architecture for near-infrared analysis, especially applied to a fuel dataset, which showed a
<figure><img src="image_7.png" /><figcaption>Fig. 5. Parity plots of the models' prediction on the validation dataset (reduced range of 4500–1200 cm⁻¹).</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Fig. 6. Errors distribution of the models on the reduced range of 4500–1200 cm⁻¹.</figcaption></figure>

<caption>Fig. 7. Errors distribution of the deep learning models on dataset in its full range of 4000–1200 cm⁻¹.</caption>

large robustness improvement over PLS. Taking an overview of CNNs, parallel branch architectures, especially using our proposed dedicated IPA architecture, proved advantageous for delivering accurate results in near-infrared analysis. This study states that the performance of IPA, with its low error, enables significantly closer quantitative approximations than PLS modeling, or other CNN DeepSpectra. The limited number of hyperparameters of this methodology, and the visual and

intuitive fine-tuning method, proposes a substantial opportunity for properties prediction.

Several aspects still need to be addressed to fully endorse IPA, such as model generalizability and interpretability. The high reproducibility of IPA on such a small dataset and the topology of the loss function are positive indicators for the generalization to other datasets. The interpretability of deep learning models is an important point for the
<figure><img src="image_9.png" /><figcaption>Fig. 8. Parity plots of the DL models' prediction on the validation dataset (full range of 4000–1200 cm⁻¹).</figcaption></figure>

chemometrics community, particularly in NIR analysis. To the best of our knowledge, no study has explored yet this subject in depth.

### CRediT authorship contribution statement

F. Haffner: Writing – original draft, Software, Methodology, Investigation, Conceptualization. M. Lacoue-Negre: Writing – review & editing, Validation, Supervision, Conceptualization. A. Pirayre: Writing – review & editing, Validation. D. Gonçalves: Validation, Resources. J. Gornay: Validation. M. Moreaud: Writing – review & editing, Project administration, Conceptualization.

### Declaration of competing interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

### Data availability

The code and data are available on GitHub.

### References

[1] ASTM. Standard test method for cetane number of diesel fuel oil. 1995.

[2] Brouillette C, Smith W, Shende C, Gladding Z, Farquharson S, Morris RE, Cramer JA, Schmitgal J. Analysis of twenty-two performance properties of diesel, gasoline, and jet fuels using a field-portable near-infrared (NIR) analyzer. Appl Spectrosc 2016;70(5):746–55. http://dx.doi.org/10.1177/0003702816638279.

[3] Chung H. Applications of near-Infrared spectroscopy in refineries and important issues to address. Appl Spectrosc Rev 2007;42(3):251–85. http://dx.doi.org/10.1080/05704920701293778.

[4] Zanier-Szydlowski N, Quignard A, Baco F, Biguerd H, Carpot L. Control of refining processes on mid-distillates by near infrared spectroscopy. Oil Gas Sci Technol – Rev IFP 1999;54(4).

[5] Aji S, Schildknecht-Szydlowski N, Faraj A. Partial least square modeling for the control of refining processes on mid-distillates by near infrared spectroscopy. Oil Gas Sci Technol 2004;59(3):303–21. http://dx.doi.org/10.2516/ogst:2004022.

[6] Correia RM, Domingos E, Cáo VM, Araujo BRF, Sena S, Pinheiro LU, Fontes AM, Aquino LFM, Ferreira EC, Filgueiras PR, Romão W. Portable near infrared spectroscopy applied to fuel quality control. Talanta 2018;176:26–33. http://dx.doi.org/10.1016/j.talanta.2017.07.094.

[7] Zheng Q, Huang H, Zhu S, Qi B, Tang X. Quantitative and qualitative prediction of sulfur content in diesel by near infrared spectroscopy. J Near Infrared Spectrosc 2023;31(2):63–9. http://dx.doi.org/10.1177/09670335231153960.

[8] Buendia Garcia J, Lacoue-Negre M, Gornay J, Mas Garcia S, Bendoula R, Roger JM. Diesel cetane number estimation from NIR spectra of hydrocracking total effluent. Fuel 2022;324:124647. http://dx.doi.org/10.1016/j.fuel.2022.124647.

[9] Balabin RM, Lomakina EI, Safieva RZ. Neural network (ANN) approach to biodiesel analysis: Analysis of biodiesel density, kinematic viscosity, methanol and water contents using near infrared (NIR) spectroscopy. Fuel 2011;90(5):2007–15. http://dx.doi.org/10.1016/j.fuel.2010.11.038.

[10] García-Martín JF, Alés-Álvarez FJ, Del López-Barrera MC, Martín-Domínguez I, Álvarez-Mateos P. Cetane number prediction of waste cooking oil-derived biodiesel prior to transesterification reaction using near infrared spectroscopy. Fuel 2019;240:10–5. http://dx.doi.org/10.1016/j.fuel.2018.11.142.

[11] Cunha CL, Torres AR, Luna AS. Multivariate regression models obtained from near-infrared spectroscopy data for prediction of the physical properties of biodiesel and its blends. Fuel 2020;261:116344. http://dx.doi.org/10.1016/j.fuel.2019.116344.

[12] Buendia Garcia J, Gornay J, Lacoue-Negre M, Mas Garcia S, Er-Rmyly J, Bendoula R, Roger J-M. A novel methodology for determining effectiveness of preprocessing methods in reducing undesired spectral variability in near infrared spectra. J Near Infrared Spectrosc 2022;30(2):74–88. http://dx.doi.org/10.1177/09670335211047959.

[13] Schoot M, Kapper C, van Kollenburg GH, Postma GJ, van Kessel G, Buydens LM, Jansen JJ. Investigating the need for preprocessing of near-infrared spectroscopic data as a function of sample size. Chemometr Intell Lab Syst 2020;204:104105. http://dx.doi.org/10.1016/j.chemolab.2020.104105.

[14] Rinnan Å, den van Berg F, Engelsen SB. Review of the most common pre-processing techniques for near-infrared spectra. TRAC Trends Anal Chem 2009;28(10):1201–22. http://dx.doi.org/10.1016/j.trac.2009.07.007.

[15] LeCun Y, Bengio Y, Hinton G. Deep learning. Nature 2015;521(7553):436–44. http://dx.doi.org/10.1038/nature14539.

[16] Szegedy C, Liu W, Jia Y, Sermanet P, Reed S, Anguelov D, Erhan D, Vanhoucke V, Rabinovich A. Going deeper with convolutions. In: 2015 IEEE conference on computer vision and pattern recognition. CVPR, IEEE, 2015, p. 1–9. http://dx.doi.org/10.1109/CVPR.2015.7298594.

[17] Ronneberger O, Fischer P, Brox T, editors. U-Net: Convolutional networks for biomedical image segmentation. 2015, URL: http://arxiv.org/pdf/1505.04597v1.

[18] Hammoumi A, Moreaud M, Ducottet C, Desroziers S. Adding geodesic information and stochastic patch-wise image prediction for small dataset learning. Neurocomputing 2021;456:481–91. http://dx.doi.org/10.1016/j.neucom.2021.01.108.

[19] Yang J, Xu J, Zhang X, Wu C, Lin T, Ying Y. Deep learning for vibrational spectral analysis: Recent progress and a practical guide. Anal Chim Acta 2019;1081:6–17. http://dx.doi.org/10.1016/j.aca.2019.06.012.

[20] Acquarelli J, van Laarhoven T, Gerretzen J, Tran TN, Buydens LMC, Marchiori E. Convolutional neural networks for vibrational spectroscopic data analysis. Anal Chim Acta 2016;954:22–31. http://dx.doi.org/10.1016/j.aca.2016.12.010.

[21] Cui C, Fearn T. Modern practical convolutional neural networks for multivariate regression: Applications to NIR calibration. Chemometr Intell Lab Syst 2018;182:9–20. http://dx.doi.org/10.1016/j.chemolab.2018.07.008.

[22] Malek S, Melgani F, Bazi Y. One-dimensional convolutional neural networks for spectroscopic signal regression. J Chemometr 2018;32(5):e2977. http://dx.doi.org/10.1002/cem.2977.

[23] Mishra P, Passos D. A synergistic use of chemometrics and deep learning improved the predictive performance of near-infrared spectroscopy models for dry matter prediction in mango fruit. Chemometr Intell Lab Syst 2021;212:104287. http://dx.doi.org/10.1016/j.chemolab.2021.104287.

[24] Xue Y, Zhu C, Jiang H. Comparison of the performance of different one-dimensional convolutional neural network models-based near-infrared spectra for determination of chlorpyrifos residues in corn oil. Infrared Phys Technol 2023;132:104734. http://dx.doi.org/10.1016/j.infrared.2023.104734.
[25] Li G, Deng S. Quantitative analysis of near-infrared spectroscopy using the BEST-1DConvNet model. Processes 2024;12(2):272. http://dx.doi.org/10.3390/pr12020272.

[26] Zhang X, Lin T, Xu J, Luo X, Ying Y. DeepSpectra: An end-to-end deep learning approach for quantitative spectral analysis. Anal Chim Acta 2019;1058:48-57. http://dx.doi.org/10.1016/j.aca.2019.01.002.

[27] Fu P, Wen Y, Zhang Y, Li L, Feng Y, Yin L, Yang H. Spectratr: A novel deep learning model for qualitative analysis of drug spectroscopy based on transformer structure. J Innov Opt Health Sci 2022;15(03). http://dx.doi.org/10.1142/S1793545822500213.

[28] Kennard RW, Stone LA. Computer aided design of experiments. Technometrics 1969;11(1):137-48. http://dx.doi.org/10.1080/00401706.1969.10490666.

[29] Wold S, Sjostrom M, Eriksson L. PLS-regression: a basic tool of chemometrics. Chemometr Intell Lab Syst 2001;58.

[30] Geladi P. Chemometrics in spectroscopy. Part 1. Classical chemometrics. Spectrochim Acta B 2003;58(5):767-82. http://dx.doi.org/10.1016/S0584-8547(03)00037-5.

[31] Gerretzen J, Szymańska E, Jansen JJ, Bart J, van Manen H-J, van den Heuvel ER, Buydens LMC. Simple and effective way for data preprocessing selection based on design of experiments. Anal Chem 2015;87(24):12096-103. http://dx.doi.org/10.1021/acs.analchem.5b02832.

[32] Savitzky A, Golay MJE. Smoothing and differentiation of data by simplified least squares procedures. Anal Chem 1964.

[33] Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O, Blondel M, Prettenhofer P, Weiss R, Dubourg V, Vanderplas J, Passos A, Cournapeau D, Brucher M, Perrot M, Duchesnay E. Scikit-learn: Machine learning in python. J Mach Learn Res 2011;12:2825-30.

[34] Szegedy C, Vanhoucke V, Ioffe S, Shlens J, Wojna Z, editors. Rethinking the inception architecture for computer vision. 2015, URL: http://arxiv.org/pdf/1512.00567v3.

[35] Szegedy C, Ioffe S, Vanhoucke V, Alemi A, editors. Inception-v4, inception-ResNet and the impact of residual connections on learning. 2016, URL: http://arxiv.org/pdf/1602.07261v2.

[36] He K, Zhang X, Ren S, Sun J, editors. Deep residual learning for image recognition. 2015, URL: http://arxiv.org/pdf/1512.03385v1.

[37] Ng Andrew. Feature selection - L1 L2 regularization and rotational invariance. In: Proceedings. 2004.

[38] Chollet F. Keras. 2015, URL: https://github.com/fchollet/keras.

[39] Abadi M, Agarwal A, Barham P, Brevdo E, Chen Z, Citro C, Corrado GS, Davis A, Dean J, Devin M, Ghemawat S, Goodfellow I, Harp A, Irving G, Isard M, Jia Y, Jozefowicz R, Kaiser L, Kudlur M, Levenberg J, Mane D, Monga R, Moore S, Murray D, Olah C, Schuster M, Shlens J, Steiner B, Sutskever I, Talwar K, Tucker P, Vanhoucke V, Vasudevan V, Viegas F, Vinyals O, Warden P, Wattenberg M, Wicke M, Yu Y, Zheng X, editors. TensorFlow: Large-scale machine learning on heterogeneous distributed systems. 2016, URL: http://arxiv.org/pdf/1603.04467v2.