# Embedded Machine Learning Model for an accurate real-time MOSFET temperature estimation

Nicolas Lamarque, Maxime Baba, Thomas Manz, Pierre-Edouard Signor

► To cite this version:

Nicolas Lamarque, Maxime Baba, Thomas Manz, Pierre-Edouard Signor. Embedded Machine Learning Model for an accurate real-time MOSFET temperature estimation. 13th European Congress of Embedded Real Time Systems (ERTS), Feb 2026, Toulouse, France. 10.82331/ERTS.2026.29. hal-05513770

HAL Id: hal-05513770

https://hal.science/hal-05513770v1

Submitted on 19 Feb 2026

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 CC BY 4.0 - Attribution - International License
# Embedded Machine Learning Model for an accurate real-time MOSFET temperature estimation

Nicolas Lamarque¹, Maxime Baba¹, Thomas Manz², and Pierre-Edouard Signor¹

¹ Schaeffler Group, 40 avenue du Général De Croutte, 31100 Toulouse, France
nicolas.lamarque@vitesco.com, maxime.baba@vitesco.com, pierre-edouard.signor@vitesco.com

² Schaeffler Group, Siemensstrasse 12, 93055 Regensburg, Deutschland
thomas.manz@vitesco.com

## ABSTRACT

Estimating the real-time value of state variables is crucial in various industrial embedded applications, such as automotive and aeronautical systems. The most straightforward way to obtain such information is through physical sensors. However, their implementation can be both costly and complex, prompting the use of models as substitutes, often referred to as virtual sensors. In this context, artificial intelligence (AI) has recently demonstrated its suitability for designing these advanced solutions. In this work, an embedded machine learning (ML) algorithm is explored as a virtual sensor to predict the actual temperature of an automotive power electronics component, thereby ensuring effective thermal management. This methodology is proposed as an alternative to conventional modeling approaches based on simplified physical laws, which are often used in the automotive industry, such as in internal combustion engine or electric machine controls. The study outlines each phase, from data preprocessing to prototype testing, including feature engineering, model design, and the embedding process. Several ML models, including linear regression and different types of neural networks, are evaluated and demonstrated to be excellent and relevant alternatives to traditional modeling, as they are accurate and can be trained and deployed quickly.

**Keywords:** Artificial Intelligence, Machine Learning, Embedded Real-Time Systems, Electronic Control Unit, Thermal Management, Temperature Estimation, Virtual Sensors.

## 1. INTRODUCTION

The electric Drive Control Unit (eDCU), dedicated to the electric powertrain of two- and three-wheelers and developed at Schaeffler AG, includes both engine control and vehicle functions, which implement power electronics systems. A critical aspect of developing power electronics is thermal management, aimed at ensuring system reliability and meeting performance targets in terms of power and longevity. A key challenge identified is the junction temperature of the MOSFETs that comprise the inverter section of the control unit. MOSFET stands for metal-oxide-semiconductor field-effect transistor.

These are semiconductor devices with low thermal inertia, yet capable of conducting very high currents. Consequently, temperature variations can be significant and difficult to estimate.

The most common ways to monitor real-time temperature in embedded systems are sensors, models or a mix of them. In electric machines or power electronics, sensors, like thermistors or thermocouples, indeed provide reliable temperature measurements [1]. However, besides the difficulty of their integration and their potential failure, these sensors generally do not provide the temperature exactly where it is expected or needed. For instance, in the case of transistors, the sensor value usually corresponds to the semi-conductor substrate temperature [2]. Consequently, these sensor outputs cannot be used as is and are most often combined with other quantities in physics-based models, like thermal networks [3], or ML algorithms [2]. Physics-based models are based on first principles and are therefore inherently transparent, offering clear insight into the underlying physical processes, making them easier to interpret. For years, these physics-based approaches have been used with success in the automotive industry [4]. They can provide high accuracy, but their calibration remains a long, complex and costly task. On the other hand, ML models have been shown to be a reliable alternative, even in the context of embedded real-time systems. State-of-the-art data-driven techniques for estimating real-time temperatures in electric machine rotors or power electronics components are detailed in [1, 2, 5] and confirm that AI is highly suitable for such problems. These references also show that very different strategies are possible when building and training an ML model and the final embedded algorithm strongly depends on the context.

The present study encompasses all steps from data preparation to deployment, including model design. The objective is to show that different approaches are possible: either based on a combination of feature engineering and classical ML techniques [5], or on a more sophisticated state-of-the-art AI architecture recently introduced in the literature [6]. Unlike typical academic studies [1, 2, 5], this analysis goes beyond merely evaluating model accuracy and also includes other essential practical criteria. It also assesses overall model behavior, computational and memory costs when embedded in the microcontroller and considers practical aspects like training and model

<footnote>Nicolas Lamarque et al.. This is an open-access article distributed under the terms of the Creative Commons Attribution 4.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.</footnote>
initialization when the vehicle starts.

## 2. STATE-OF-THE-ART AND OBJECTIVES

### 2.1. Estimating a Real-Time Temperature with ML in Power Electronics

When possible, physics-based approaches are favored, because of their explainability and transparency. Initially, different modeling techniques were evaluated internally, but each encountered failures at various stages. A thermal network [1] was first constructed to model heat transfers between the MOSFETs and their environment. Its physical basis was promising, yet the simplifications needed for real-time calculation resulted in excessively challenging parameter identification [1] and an unacceptable loss of accuracy. Luenberger observers and Kalman filters were also discarded, as they could not simultaneously satisfy accuracy, robustness, and cost criteria. Lastly, a simple first-order model with dynamic time constant and temperature target - often successful for electric machines - was also assessed but proved unsuitable due to the very low inertia of the MOSFETs. ML has then been chosen, following its recent successes in many disciplines [7], especially to estimate electric machine or power electronics component real-time temperatures [1, 2, 5, 6, 8]. Literature is much less exhaustive than for physics-based methods, even if the interest is growing rapidly. There are two main strategies, when dealing with ML for temperature estimation and both are explored in this work. In his nice review of electric motor thermal monitoring techniques [1], Wallscheid calls them static and dynamic ML models.

It should be reminded that heat transfer is a dynamic time-dependent process. As a result, the correlations between the various exogeneous variables and the target temperatures evolve over time. Static ML models, like ordinary least-squares or fully-connected neural networks (FCNN), do not map such dynamics [1]. Consequently, the high accuracy objective often leads to use special feature engineering [1, 9]. Otherwise, the ML model size can quickly grow if choosing a brute force approach [10]. Building sophisticated physics-informed features [5, 8] or using temperature sensitive electrical parameters (or TSEPs) [10] improve the model performances, but these solutions are also often application-dependent and sometimes even need some calibration, which is why they are not chosen in the present paper. On the other hand, as underlined in [1, 5], it is common to derive, from the heat equation, a simplified first-order ordinary differential equation to monitor a temperature. Therefore, a cheap yet very efficient way to strongly improve the correlation between the available inputs from the CAN (controller area network) bus and the target values: using low-pass filtering. The complete model, including this feature pre-processing, can then reach good accuracy, while remaining compact and rather simple to optimise.

This first, rather straightforward, strategy is compared in this document with a recently published dynamic ML model architecture called thermal neural networks (TNN). TNNs have been first introduced to estimate electric machine stator and rotor temperatures [6]. They combine in a small and neat architecture both structures of lumped-parameter thermal networks (LPTN) and recurrent neural nets [6]. Not only are they based on heat transfer time-dependent equations, but they have

been shown to be very accurate and robust in different applications [6, 11]. Moreover, very lately they have been shown to be also very accurate for power electronics applications [12]. Up to our knowledge, this method has not been tested to estimate MOSFET junction temperatures, but the potential is undeniable.

In the present paper, the choice is then to compare both strategies on a real application, keeping in mind the final model should not only be accurate, but also remain robust, cheap and easy to train and maintain.

<figure><img src="image_2.png" /><figcaption>Figure 1. Sketch of the experimental setup used for data acquisition.</figcaption></figure>

### 2.2. Objectives

To ensure system safety, the temperature estimated by the model should be the target temperature with a root mean square (RMS) error of less than 3°C. It is important to note that this constraint can vary between applications and may be stricter at higher temperature ranges (requiring an absolute error of less than 5°C, ideally). Beyond the accuracy of the AI model, it is crucial that the model be constructed using inputs available on the CAN bus, and its size must remain compact enough to be embedded and executed within the system's control unit. For the current application, the model has a recurrence of 10ms, a notably short timestep, especially when compared to those typically found in electric machines or combustion engine components, which have much higher inertia.

<figure><img src="image_3.png" /><figcaption>Figure 2. Measurement durations for the different profiles.</figcaption></figure>
# 3. DATA PROCESSING AND MODELS

## 3.1. Data Collection

This database consists of measurements from a prototype control unit equipped with thermocouples on the MOSFETs. The electric machine is simulated using a load bench, providing realistic currents and voltages to the control unit. The variables used as model inputs are directly collected from the CAN signal (see Figure 1). To enhance realism, measurements are conducted according to World Motorcycle Test Cycles (WTMC), standardized cycles typically used to assess energy consumption and emissions (in the case of combustion engines), thereby yielding behaviors closely aligned with real-world conditions. To expand the database and cover varying temperature conditions, certain steps or current ramps are induced at the start of the cycles, artificially heating the components to simulate worst-case scenarios. Overall, nearly 23 hours of measurements are available, split into 33 records (see Figure 2). Records containing current steps will hereafter be designated as static profiles, as opposed to cycles, which are designated as dynamic profiles. There are six MOSFETs in this controller prototype and all temperatures are recorded during the tests. Nevertheless, in the subsequent analyses, and to streamline the study, only the worst-case MOSFET temperature is considered and will be referred simply as the MOSFET temperature. The acquisition time matches the target recurrence, i.e., 10ms.

<figure><img src="image_4.png" /><figcaption>Figure 3. Time evolutions for different measurement profiles, showing the data variety. Orange: current in Amps, Blue: target temperature in °C.</figcaption></figure>

Figures 3, 4, 5 and 6 show the time evolution of the input current, input PCB temperature and the target MOSFET temperature for different records. Figures 5 and 6 provide specific zooms. Note that straight lines in the current signal are not due a lack of resolution. Constant values in the PCB temperature, on the other hand, are due to both the original time resolution (1s) and quantisation of this variable (1°C) on the CAN. These four different measurements are selected over the whole dataset to properly illustrate the different types of recordings available in the dataset. Profile 0 depicts the most typical and realistic variations. They are here obtained by carrying out consecutive driving cycles. Despite the small thermal inertia of a MOSFET, its temperature varies much slower than current (or voltage). Profiles 4 and 8 are showing dynamic behaviours and correspond to fast and strong variations of current (steps and ramps) to stress the MOSFETs. Eventually, profile 12 de-

<figure><img src="image_5.png" /><figcaption>Figure 4. Time evolutions for different measurement profiles, showing the data variety. Orange: PCB temperature in °C, Blue: MOSFET temperature in °C.</figcaption></figure>

scribes the typical response of the MOSFETs when facing a current step. Figures 4 and 6 demonstrate the strong relationship between the PCB and the target temperatures. Because of the small inertia, the phase shift between both is hardly existing and they exhibit the same trends in time. Nevertheless, while the linear correlation is very strong, the relationship remains nonlinear, especially when the variables vary quickly in time.

## 3.2. Data Processing and Feature Engineering

As in many machine learning projects, raw data cannot be used directly, it must be structured and processed [7]. Signals either originate from the CAN bus or thermocouples, and thus initially require synchronization to ensure consistent sampling times. Following synchronization, outliers and noise are mitigated using straightforward low-pass filtering techniques. Feature selection is simplified due to the limited availability of sensors, unlike most automotive engine or machine controls. Most signals exhibit very low correlation with the target temperature. Additionally, the developed solution is intended for use across various configurations, necessitating the consideration of only generic features available irrespective of the application. Consequently, only PCB (printed circuit board) temperature—measured by an onboard sensor—along with current and voltage, are retained in the dataset. In addition, some polynomial features such as the square of current (related to heat dissipation through Joule effect) can be computed and used. Thanks to the limited number of exogeneous variables, the models remain compact and more robust. The final set of variables is provided in Table 1.

While the chosen inputs can show a globally good correlation with the MOSFET temperature, it has been discussed in the previous section that some low-pass filtering is mandatory when the ML model is static. As in [1], the choice is to use recursive exponentially moving averages $x$ of any input value $o[k]$ at timestep $k$:

$$x[k+1] = (1 - \alpha)x[k] + \alpha o[k+1], \quad (1)$$

and the constant $\alpha$ in Eq. (1) tunes here the filter and is directly
<figure><img src="image_6.png" /><figcaption>Figure 5. Focus on some parts of the profiles shown in Figure 3. Orange: current in Amps, Blue: target temperature in °C.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Figure 6. Focus on some parts of the profiles shown in Figure 4. Orange: PCB temperature in °C, Blue: MOSFET temperature in °C.</figcaption></figure>

linked to a characteristic time of the heat process. Because the PCB is composed of several different materials and there are some nonlinear effects, $\alpha$ is not expected to be unique and several filtered values can be produced from one raw input value, as in [5]. The final ML model is then less compact because of the additional inputs, but the much-improved accuracy is worth the extra cost, as shown in [1, 5] and further in this paper. After several tests, only two values of $\alpha$ are considered, corresponding to characteristic times of 1 and 30s. Only the current is filtered with these values.

<figure><img src="image_8.png" /><figcaption>Figure 7. Illustration of the effect of filtering on the current variable. Profile = 8.</figcaption></figure>

As can be seen in Figure 7, the first filter (1s) is subtle and en-

ables to smooth and dampen strong discontinuities and peaks which cannot be seen in the temperature curves but could make the neural networks less stable. On the other hand, the second filter (30s) produces a new variable which is strongly correlated with the target value. Therefore, it helps the regression static models to be much more performing.

<table><caption>Table 1. Input and target parameters used for all models.</caption><thead><tr><th></th><th>Variable</th><th>Symbol</th><th>Unit</th></tr></thead><tbody><tr><td rowspan="3">Inputs</td><td>Squared current (vector norm)</td><td>$i_s^2$</td><td>A<sup>2</sup></td></tr><tr><td>DC voltage</td><td>$vdc$</td><td>V</td></tr><tr><td>PCB temperature</td><td>$T_{PCB}$</td><td>°C</td></tr><tr><td>Target</td><td>MOSFET temperature</td><td>$T_M$</td><td>°C</td></tr></tbody></table>

### 3.3. Modelling Strategy

As mentioned in the previous section, static and dynamic models are compared in detail. The two families of static methods studied here are LASSO regression models (ordinary least squares models with $L^1$ penalization) and fully connected neural networks (FCNN). The target temperature estimation $T[k]$ at timestep $k$ is modeled as a simple regression problem [7]:

$$T_M[k+1] = f_\theta(x_1[k], x_2[k], \dots, o_1[k], o_2[k], \dots), \quad (2)$$

where $f_\theta$ is the LASSO model or a small FCNN. Equation (2) recalls that static models are not autoregressive, as previous temperature estimations are not used. The lack of temporal information is compensated by using time-filtered inputs. These models have proven to be effective choices for heat transfer problems [1, 5, 13]. Moreover, variable initialization can be a tedious step when vehicle control units are activated, as not all variables are immediately available upon vehicle start. While this issue can be circumvented during model training and validation on a computer, it can become a significant obstacle once the model is embedded. Poor initializations can lead to errors that propagate over time, undermining predictive accuracy. For these reasons, this class of static models was first developed for the present work. Specifically, the high flexibility of neural networks enables them to represent any complex functions (see the universal approximation theorem [14]), achieving high accuracy even with few hidden layers. Additionally, they are well-suited and relatively easy to convert into C-functions for microcontrollers involving mostly matrix-vector operations.

The chosen dynamic model is the novel architecture called TNN, introduced in [6], which can be seen as a hybrid AI model. TNNs are recurrent neural networks (RNN) where the internal topology is adjusted to align with the general structure of LPTN, using simple and small sub-neural networks to provide thermal conductances, heat capacitances, and power losses, as can be seen in Figure 8. This makes them physically interpretable and means they do not require expert knowledge or detailed material and geometry information, unlike LPTN [6]. Besides, there is no longer a need to time-filter the inputs.

In many examples found in the literature [6, 11, 15], several
<figure><img src="image_9.png" /><figcaption>Figure 8. Architecture of a thermal neural networks. Illustration from [11].</figcaption></figure>

temperature nodes are considered, some are the targets and other are known and provided by sensors. In the present case, as there are only two temperature variables, the TNN then solves Eq. (3), which is a first-order explicit Euler discretised LPTN heat transfer equation.

$$T_M[k+1] = T_M[k] + \Delta t C^{-1} \left\{ G[k] (T_{PCB}[k] - T_M[k]) + P[k] \right\}, \quad (3)$$

where $T_M$ is the MOSFET junction temperature, $T_{PCB}$ the PCB temperature, $C$ the MOSFET capacitance, $G$ the conductance between the MOSFET and PCB nodes and $P$ the thermal losses. $C$, $G$ and $P$ are here scalars as there are only one target and one external (also called ancillary in [6]) temperatures. These three quantities result from the training process. While $C$ is constant at the inference, $G$ and $P$ are the respective outputs of two small neural networks which inputs are the current, voltage and temperatures at the current timestep.

## 3.4. Architectures and Training Procedure

Besides the LASSO regression models, Table 2 summarizes the different neural network architectures tested in the present article. The objective is not here to find the absolute most accurate model, but rather identify the main trends and see whether deeper models can provide higher accuracy, which is why no hyperparameter optimization [16] is presented here. Therefore, the model sizes are chosen to offer a similar number of degrees of freedom (d.o.f). Because their CPU footprint is much smaller, only Rectifier Linear Unit (ReLU) are considered [17].

Both the LASSO and FCNN algorithms are derived and trained with the Scikit-Learn [18] library. The chosen optimizer is ADAM [19], the learning rate is adaptive, batch size is chosen by the optimizer, early stopping is chosen while a maximum of 100 epochs is used. The TNN was built and trained with the PyTorch [20] version developed by Kirchgässner et al and distributed open-source. The chosen optimizer is also ADAM [19], the learning rate is fixed to 0.001, the batch size is 16 a maximum of 100 epochs is used.

Group K-fold cross-validation has been used in this work to assess and confirm the model stability and performance. The measurements are not fragmented and each recording is included either in the training or validation dataset. Care is taken to ensure distributions of the variables are comparable and representative in each set. Most importantly, both static and dynamic profiles are fairly distributed between training and validation. To properly discriminate the measurements, a criterion based on the squared current mean and standard deviation is given by Eq. (4).

<table><caption>Table 2. Neural network architectures evaluated in this study (d.o.f means degrees of freedom or parameters). The number of neurons per hidden layers is between brackets.</caption><thead><tr><th>Model Name</th><th>FCNN</th><th>TNN</th></tr></thead><tbody><tr><td>small</td><td>(12; 12)<br>216 d.o.f</td><td>(8; 8) * 2 nets<br>243 d.o.f</td></tr><tr><td>medium</td><td>(18; 18; 18)<br>811 d.o.f</td><td>(18; 18) * 2 nets<br>903 d.o.f</td></tr><tr><td>big</td><td>(24; 24; 24; 24)<br>1993 d.o.f</td><td>(28; 28) * 2 nets<br>1963 d.o.f</td></tr></tbody></table>

$$criterion = \frac{\sigma(i_s^2)}{\mu(i_s^2) + \varepsilon}. \quad (4)$$

If criterion is more than 0.5, then the profile is dynamic (see Figure 9). The split is performed so that around 80% of the data is assigned to the training dataset.

<figure><img src="image_10.png" /><figcaption>Figure 9. Clustering into static and dynamic profiles based on the current variations. Orange: static, Blue: dynamic.</figcaption></figure>

To greatly speed up the training process without any significant loss of accuracy, the training dataset is subsampled using every 100th point, which makes the timestep be 1s. This procedure is only possible because heat transfer remains a relatively slow phenomenon and the characteristic times are here bigger than the chosen timestep of 1s. While current may vary sometimes much faster, the direct effects are time-filtered by the component thermal inertias. Subsampling further has an impact and this method is, of course, problem dependent, so it is advised to make tests and check the effect on the input and output distributions and spectra before doing such a move. On the other hand, this subsampling enables to have a complete training in less than 5 minutes on a standard laptop. Therefore, even if it is not the focus of the present study, hyperparameter optimization becomes much more affordable.
## 3.5. A Word on Embedding

The microcontroller used in the tested vehicle control unit is a 32-bit Infineon CYT2B9. Of course, the embedded models must first be converted to C code. Models either from Scikit-Learn [18] or PyTorch [20] are converted in the open standard ONNX format [21]. An in-house converter allows to quickly convert models into C code, which can be integrated in the software embedded in the control unit. This process has been shown to be very efficient to test new models in vehicles. Considering the control unit and microcontroller characteristics, after discussions with software architect specialists, weights are stored in Read-Only Memory (ROM), while the local variables used in the models are automatically and temporarily stored in Read-Access Memory (RAM).

The linear regression model footprint is negligible. Regarding the FCNN and TNN, both models have inference times of the order of magnitude of dozens of microseconds. The present architectures use between 0.15 and 1% of the CPU load. Moreover, they use between 1 and 8kB of flash memory to store the weights and biases, while the footprint on RAM remains negligible. Although these values can be considered as very small in absolute terms, one should keep in mind that other predictions, diagnoses and control functions run in parallel and share the same resources. Therefore, amongst the different tested architectures, only the smaller ones are really considered for the final applications now.

# 4. RESULTS AND DISCUSSION

## 4.1. Quantitative Results

Because the $T_{PCB}$ variable has a very strong linear correlation (around 0.98), all models have, overall, excellent quantitative performances. As a reference, a simple linear regression with the variables in Table 1 provides the results given in Table 3, with the testing set. Quantitatively speaking, the results are indeed very good and close to the expected requirements as far the RMSE is concerned. On the other hand, a simple linear model also exhibits very high maximum errors, even in the training set. Unfortunately, these extreme values, while rare, are also very dangerous for the MOSFETs and make such a model unsuitable for deployment.

<table><caption>Table 3. Reference results obtained with a simple linear model.</caption><thead><tr><td>Bias in °C</td><td>RMSE in °C</td><td>Max abs error in °C</td><td>First and last centiles in °C</td></tr></thead><tbody><tr><td>-0.32</td><td>3.62</td><td>49.9</td><td>-12.6 / 9.33</td></tr></tbody></table>

Figure 10 presents the results obtained with the smaller TNN model. Only this algorithm is shown here, as, overall, the estimations from the other static and dynamic models described above are very similar. The estimated temperatures are always extremely close to the target for both static and dynamic profiles, even when the MOSFET temperature is quickly changing. Moreover, the overall behaviour of all models looks rather smooth and stable, which is encouraging in the perspective of deployment in the vehicle. Estimations are as accurate with the testing dataset as they are with the training one, which

confirms the expected good generalization capabilities.

<figure><img src="image_11.png" /><figcaption>Figure 10. Time variations of the MOSFET temperature. Modelled vs target value. TNN small model. Up: Train dataset. Down: Test dataset. Gray: Reference +/- 5°C.</figcaption></figure>

As the model is intended for component safety purposes, special attention is given to higher temperatures. While the models meet the most stringent requirements regarding dynamic profiles, they still encounter some difficulties and tend to slightly underpredict the last short profiles in the datasets (see the graphs on the far right of Figure 10). Underprediction is not to be especially limited. However, it is accepted here since the conditions producing such profiles are extreme and not expected to be encountered in real conditions. Figure 11 shows a scatter plot for the three main architectures of the study. Only the estimations from the linear model and the smaller NN architectures are displayed here, for simplicity. The results are overall excellent, for both training and testing sets. When comparing more carefully the three algorithms, it should be noted that the two static models, while sometimes even better sometimes on the testing set, also are more susceptible to produce, at least locally, higher errors than the TNN.

<figure><img src="image_12.png" /><figcaption>Figure 11. Scatter plots with modelled vs target temperature. All small models. Left to right: LASSO, small FCNN and small TNN.</figcaption></figure>

Table 4 validates TNNs, whatever the size, have smaller maximum errors. This behaviour is expected because the LPTN equations are embedded in the TNN structure. As a consequence, TNNs can be expected to be more robust and produce more realistic solutions. On the other hand, the FCNN have better raw performances provided they are used with filtered inputs. It is essential to mention that the filtered inputs, while
improving the accuracy, are also greatly limiting overfitting. Without them, the FCNN can reach similar performance on the training set but behave way worse on the testing set.

<table><caption>Table 4. Results obtained with the different models on the testing dataset.</caption><thead><tr><th>Model</th><th>Bias in °C</th><th>RMSE in °C</th><th>Max abs error in °C</th><th>Centiles in °C</th></tr></thead><tbody><tr><td>LASSO + filters</td><td>0.11</td><td>2.09</td><td>19.5</td><td>-6.71 / 6.96</td></tr><tr><td>Small FCNN + filters</td><td>-0.23</td><td>1.49</td><td>21.2</td><td>-4.26 / 4.19</td></tr><tr><td>Med FCNN + filters</td><td>-0.19</td><td>1.41</td><td>21.0</td><td>-3.90 / 4.52</td></tr><tr><td>Big FCNN + filters</td><td>-0.25</td><td>1.44</td><td>20.0</td><td>-4.81 / 4.00</td></tr><tr><td>Small TNN</td><td>0.28</td><td>1.94</td><td>11.0</td><td>-5.72 / 5.04</td></tr><tr><td>Med TNN</td><td>-0.56</td><td>1.84</td><td>16.1</td><td>-4.81 / 3.78</td></tr><tr><td>Big TNN</td><td>0.67</td><td>1.95</td><td>16.9</td><td>-2.79 / 4.95</td></tr></tbody></table>

Provided that the training and testing datasets are constructed carefully, overfitting does not appear to be a significant issue with TNNs. Table 4 indicates that adding more parameters does not yield significant improvements on the testing set for this problem. This is mainly because the underlying system is relatively simple and often exhibits first-order LPTN behaviour.

Eventually, Figures 12 to 17 display detailed results obtained for 3 different profiles from the testing set (04, 05 and 23), with the LASSO, FCNN (small) and TNN (small). As already aforementioned when commenting Figure 10, the estimations are both qualitatively and quantitatively excellent, with the linear model being slightly worse. Zooming on certain parts highlights the smooth variations the TNN is producing in comparison with the outputs from the other two models. They are not identified as a major issue, though, as a simple low-pass filter could dampen these small wiggles.

<figure><img src="image_13.png" /><figcaption>Figure 12. Time variations of the MOSFET temperature for profile 04 (dynamic). Comparisons between the small ML models.</figcaption></figure>

The TNN may tend to suffer from slight overestimations when the MOSFET temperature is quickly heating up, especially for

<figure><img src="image_14.png" /><figcaption>Figure 13. Time variations of the MOSFET temperature for profile 04 (dynamic). Zooms from Figure 12. Comparisons between the small ML models.</figcaption></figure>

higher values. As the objective is system protection, this error remains acceptable. On the other hand, the TNN is overperforming the static models during the cooling phases and all other transitions.

<figure><img src="image_15.png" /><figcaption>Figure 14. Time variations of the MOSFET temperature for profile 05 (dynamic). Comparisons between the small ML models.</figcaption></figure>

<figure><img src="image_16.png" /><figcaption>Figure 15. Time variations of the MOSFET temperature for profile 05 (dynamic). Zooms from Figure 14. Comparisons between the small ML models.</figcaption></figure>

In this problem, the choice ultimately depends on the final application. The linear LASSO model, associated with feature engineering based on exponentially moving averages, is performing a little less and might produce more outliers, but it is the most lightweight by far, the easier to implement (and to maintain) and remains completely explainable. At the other end of the spectrum, the FCNN with time-filtered inputs, gives the best raw estimations. These good results come at the expense of the model being a black box, which remains unacceptable in some cases despite its apparent robustness and gen-
erally good behaviour. It is also still compact and relatively easy to implement in a microcontroller.

<figure><img src="image_17.png" /><figcaption>Figure 16. Time variations of the MOSFET temperature for profile 23 (dynamic). Comparisons between the small ML models.</figcaption></figure>

<figure><img src="image_18.png" /><figcaption>Figure 17. Time variations of the MOSFET temperature for profile 23 (dynamic). Zooms from Figure 16. Comparisons between the small ML models.</figcaption></figure>

The TNN is a hybrid approach, combining the best of the machine learning and heat transfer modelling worlds. The TNN is a resource-efficient and flexible model, both robust and accurate, and could be classified as a gray-box model. It naturally provides smooth estimations and realistic solutions, because the LPTN equations are integrated over time. It should also be recalled that no feature engineering is used in the present study with the TNN (except for the use of the square current rather than the current itself). Consequently, there is room for improvement, especially at higher temperatures.

Finally, it should be noted that all examples reported in the literature [6, 11, 15, 22] involve many more temperature nodes (both external and internal), and they demonstrate even better performance in such configurations, outperforming the other two approaches described in this article. More external temperature nodes provide additional prescribed information to the model, whereas more internal nodes result in a higher-order, more flexible system of equations to solve. Hence, to the best of our knowledge, the TNN presented here corresponds to the smallest possible thermal network (only two temperatures) and represents the least favourable configuration for TNNs. Nevertheless, the performance remains outstanding.

## 4.2. Effects of Training Only with Static Profiles

Static profiles, with steps and ramps, are very classic as they bring information on how a system responds to a step command and often help for dynamical system identifications. Consequently, datasets are often constituted with these kinds of recordings, especially during the first steps of design. It is then tempting to train ML models with these data and evaluate if they can be deployed in the vehicle, even if the input distributions might be very different from real-life cases.

Figure 18 illustrates the behavior of the small TNN when trained solely on the static profiles present in the current dataset. At first glance, the machine learning model appears to have been properly trained, and the differences compared to a well-constructed training dataset are not large. However, as shown in Table 5, the model is significantly less accurate and exhibits stronger bias, particularly at higher temperatures. Due to the poor statistical distribution of the input variables, often with only a single current value per recording, for example, the sub-networks responsible for thermal conductances and power losses lack sufficient information for more realistic and dynamic cases. Despite these statistical limitations in the training dataset, it is noteworthy that the TNN still performs well.

<table><caption>Table 5. Results obtained with the different models (small versions) on the testing dataset when training only with static profiles.</caption><thead><tr><td>Model</td><td>Bias in °C</td><td>RMSE in °C</td><td>Max abs error in °C</td><td>Centiles in °C</td></tr></thead><tbody><tr><td>LASSO + filters</td><td>2.19</td><td>3.54</td><td>20.9</td><td>-4.90 / 12.0</td></tr><tr><td>FCNN + filters</td><td>2.47</td><td>3.89</td><td>56.6</td><td>-4.04 / 15.3</td></tr><tr><td>TNN</td><td>1.08</td><td>3.73</td><td>15.3</td><td>-3.83 / 12.5</td></tr></tbody></table>

As shown by Table 5 and Figure 19, the situation is even more critical for the static models. Indeed, they do not benefit from the robustness provided by the LPTN structure embedded within the TNN. As a consequence, although these models perform well on the training set, they suffer from strong overfitting (or, said differently, inability to extrapolate). Their bias is also increased. While the raw metrics (particularly the RMSE) are not catastrophic, it is evident that these models produce unexpected large temperature estimation errors, with errors sometimes being extremely high, especially for the FCNN. The situation is even worse when training larger architectures.

This small study, while predictable, highlights the crucial importance of using balanced training and testing sets, and illustrates how data collection and machine learning training strategies can differ significantly from classical approaches commonly used in engineering.

## 5. CONCLUSIONS

The present article describes how embedded AI models to predict the real time temperature variations of MOSFETs were
<figure><img src="image_19.png" /><figcaption>Figure 18. Time variations of the MOSFET temperature. Modelled vs target value. TNN small model. Up: Train dataset only with static profiles. Down: Test dataset. Gray: Reference +/- 5°C.</figcaption></figure>

<figure><img src="image_20.png" /><figcaption>Figure 19. Scatter plots with modelled vs target temperature, when using static profiles to train. All small models. Left to right: LASSO, small FCNN and small TNN.</figcaption></figure>

built and validated. This temperature is essential to ensure the component is not damaged when facing critical events and hot contexts. Several models were derived and compared. This study shows again the very high potential of simple AI models, like small neural networks to carry out such tasks, as they are both accurate and robust, while being easy and fast to train as well. The evaluated models follow two different strategies. The first is based on the combination of static models (LASSO regression or FCNN) and feature engineering consisting in time-filtering the inputs. The second strategy deals with a dynamic recurrent NN, very recently introduced and called TNN [6], hybridizing a heat transfer system of equations with small sub-FCNN to provide the thermal parameters. The heat transfer problem investigated here involves various temperature variations, but the underlying system to be modeled remains relatively simple and typically exhibits first-order behavior characteristic of Lumped Parameter Thermal Networks (LPTN). As a result, despite the particularly stringent requirements, all models demonstrate very good performance. Moreover, the study indicates increasing the model size does not improve the results, here. The final choice between the three types of models depends on the final application and, in addition to raw performances, considerations like explainability, trustworthiness and easiness to deploy and maintain, are to be considered.

## ACKNOWLEDGMENT

The authors would like to thank all their colleagues directly or indirectly involved in this project for the many valuable discussions, comments and advices.

## REFERENCES

[1] O. Wallscheid, “Thermal monitoring of electric motors: State-of-the-art review and future challenges,” *IEEE Open Journal of Industry Applications*, vol. 2, pp. 204–223, 2021.

[2] L. Liu, Q. Peng, H. Jiang, L. Ran, Y. Wang, C. Du, J. Chen, H. Zhou, Y. Chen, and Z. Peng, “Bp neural network for non-invasive igbt junction temperature online detection,” *Microelectronics Reliability*, vol. 141, p. 114882, 2023.

[3] M. Ma, X. Yan, W. Guo, S. Yang, G. Cai, and W. Chen, “Online junction temperature estimation using integrated ntc thermistor in igbt modules for pmsm drives,” *Microelectronics Reliability*, vol. 114, p. 113836, 2020.

[4] D. Cho and J. K. Hedrick, “Automotive powertrain modeling for control,” *Journal of Dynamic Systems, Measurement, and Control*, vol. 111, pp. 568–576, 12 1989.

[5] R. Hughes, T. Haidinger, X. Pei, and C. Vagg, “Real-time temperature prediction of electric machines using machine learning with physically informed features,” *Energy and AI*, vol. 14, p. 100288, 2023.

[6] W. Kirchgässner, O. Wallscheid, and J. Böcker, “Thermal neural networks: Lumped-parameter thermal modeling with state-space machine learning,” *Engineering Applications of Artificial Intelligence*, vol. 117, p. 105537, 2023.

[7] A. Géron, *Hands-on machine learning with Scikit-Learn, Keras, and TensorFlow.* ” O’Reilly Media, Inc.”, 2022.

[8] O. Solomakha, V. Afanasenko, and I. Kallfass, “Online junction temperature estimation of power semiconductor devices using neural network and model-based design,” in *IEEE EUROCON 2023-20th International Conference on Smart Technologies*, pp. 187–192, IEEE, 2023.

[9] J. Lee and J.-I. Ha, “Temperature estimation of pmsm using a difference-estimating feedforward neural network,” *IEEE Access*, vol. 8, pp. 130855–130865, 2020.

[10] K. M. Barón, D. K. Melgar, V. Afanasenko, R. Schnitzler, and I. Kallfass, “Machine learning based sensor fusion for junction temperature estimation,” in *2024 IEEE 10th International Power Electronics and Motion Control Conference (IPEMC2024-ECCE Asia)*, pp. 4076–4081, IEEE, 2024.

[11] N. Wiese, K. Etzold, R. Reinhardt, and M. Henke, “Thermal neural networks for high-resolution temperature modeling of electric traction machines with oil spray cooling,” *IEEE Transactions on Transportation Electrification*, vol. 11, no. 1, pp. 870–879, 2024.

[12] J. Yu, P. Alagarsamy, and O. Wallscheid, “Thermal neural networks for temperature estimation of traction inverters in electric vehicles,” in *PCIM Conference 2025; International Exhibition and Conference for Power Electronics, Intelligent Motion, Renewable Energy and Energy Management*, pp. 143–152, VDE, 2025.
[13] N. Lamarque, "Embedded machine learning algorithm to predict the real-time temperature of an automotive component," in SIA: IA pour les nouvelles mobilités, 2022.

[14] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT press, 2016.

[15] A. I. Ramones, B. Shi, M. Engels, M. Eisenbarth, and J. Andert, "Estimating the real-time temperature of a 48v permanent magnet synchronous motor using a thermal neural network," Energy Conversion and Management: X, vol. 27, no. 101140, 2025.

[16] T. Akiba, S. Sano, T. Yanase, T. Ohta, and M. Koyama, "Optuna: A next-generation hyperparameter optimization framework," in Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pp. 2623-2631, 2019.

[17] V. Nair and G. E. Hinton, "Rectified linear units improve restricted boltzmann machines," in Proceedings of the 27th international conference on machine learning (ICML-10), pp. 807-814, 2010.

[18] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, et al., "Scikit-learn: Machine learning in python," the Journal of machine Learning research, vol. 12, pp. 2825-2830, 2011.

[19] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization," 2017.

[20] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al., "Pytorch: An imperative style, high-performance deep learning library," Advances in neural information processing systems, vol. 32, 2019.

[21] J. Bai, F. Lu, K. Zhang, et al., "Onnx: Open neural network exchange," 2019. https://github.com/onnx/onnx.

[22] S. Jiang and Z. Hu, "Thermal parameters identification method for induction machines based on a parallel branches network," SAE Technical Paper, vol. 01, no. 7054, 2025.