# Thermal field estimation in CFRTP composites using an attention-enhanced U-Net

Borja Ferrándiz, Mabel Palacios, Clément Mailhé, Anaïs Barasinski, Francisco Chinesta

► To cite this version:

Borja Ferrándiz, Mabel Palacios, Clément Mailhé, Anaïs Barasinski, Francisco Chinesta. Thermal field estimation in CFRTP composites using an attention-enhanced U-Net. International Journal of Material Forming, 2025, 18 (3), pp.76. 10.1007/s12289-025-01939-y. hal-05265498

HAL Id: hal-05265498

https://imt-mines-albi.hal.science/hal-05265498v1

Submitted on 17 Sep 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
# Thermal field estimation in CFRTP composites using an attention-enhanced U-Net

Borja Ferrándiz<fnref n="1" /> · Mabel Palacios<fnref n="2" /> · Clément Mailhé<fnref n="3" /> · Anaïs Barasinski<fnref n="4" /> · Francisco Chinesta<fnref n="1" />,<fnref n="3" />

Received: 12 July 2025 / Accepted: 6 August 2025

© The Author(s) 2025

## Abstract

This study presents a surrogate model based on the convolutional U-Net architecture to predict the thermal field in a carbon fibre-reinforced thermoplastic tape at the microscale during brief and localized heating. Leveraging microstructure data within a machine learning framework, the proposed model aims to enhance the accuracy of temperature field predictions at a low computational cost. The incorporation of a co-attention mechanism to handle image channels of different nature significantly improves precision, resulting in a strong correlation between the model's predictions and the ground truth obtained from the numerical solution of the heat equation. This capability enables rapid assessment of diverse microstructures, facilitating optimization and real-time applications in manufacturing settings.

**Keywords** Carbon fibre reinforced thermoplastic · CFRTP · Machine learning · UNet · Microstructure

## Introduction

Carbon fibre-reinforced thermoplastic (CFRTP) composites have emerged as a key solution to some of the most demanding challenges across various industry sectors, owing to their excellent mechanical properties, low weight, and recyclability, among other characteristics [1, 2]. In the transportation industry, for instance, there is a growing need for lighter and more durable components [3]. Simultaneously, the energy sector is actively seeking greener solutions, and CFRTP composites are being used in applications such as hydrogen storage vessels, energy storage devices, and wind turbines [4–6]. These factors have driven the steady expansion of the composite materials market since the 1950s, with global consumption of carbon fibre-reinforced composites expected to

surpass 250 kilotonnes in 2024 and reach 285 kilotonnes by the end of 2025 [7].

In composites engineering, the traditional approach to achieving desired properties has centered on carefully selecting constituents, such as the fibre and matrix types along with their volume fractions [8]. These studies commonly rely on homogenization techniques and simple rules of mixture to model composite behaviour, providing valuable insights [9]. However, these methods face significant limitations due to the essential simplifications inherent in homogenization [10]. For instance, in pre-impregnated CFRTP composite tapes, an ideal microstructure is often assumed, where fibres are uniformly distributed within the matrix and the tape maintains a constant thickness across the transverse section [11].

In practice, real microstructures exhibit various types of heterogeneities intrinsic to manufacturing processes, such as matrix-rich regions, fibre clusters, non-uniform thickness and porosities. As highlighted in numerous studies, the microstructure of a material significantly influences its macroscopic performance [12–14]. To develop more advanced and tailored properties, it is essential to gain a deeper understanding of how microstructural features impact the macroscopic behaviour of composite materials.

Another factor that critically influences the mechanical properties of CFRTP is the thermal history throughout the fabrication process, as localized heating is applied to the tape

<footnote>Francisco Chinesta
Francisco.Chinesta@ensam.eu</footnote>

<footnote n="1">¹ PIMM Laboratory, Arts et Métiers Institute of Technology, 151 boulevard de l'Hôpital, 75013 Paris, France</footnote>

<footnote n="2">² IPREM, Université de Pau et des Pays de l'Adour (UPPA), 2 Av. du Président Pierre Angot, 64053 Pau Cedex 9, France</footnote>

<footnote n="3">³ CNRS@CREATE Ltd, 1 Create Way, #08-01 CREATE Tower, Singapore 138602, Singapore</footnote>

<footnote n="4">⁴ Institut Clément Ader (ICA), IMT Mines Albi, Campus Jarlard, F-81013 Albi, France</footnote>
surfaces for short durations during automated fibre placement (AFP) and filament winding (FW) [15]. At this stage, obtaining reliable experimental data to capture the internal temperature distribution is extremely challenging. Consequently, simulation methods—such as finite element (FE) analysis—are commonly employed to approximate the thermal behavior and are highly valuable in process optimization.

In this study, a machine learning (ML) model is proposed to assess the influence of specific microstructural heterogeneities on the evolution of the temperature field in CFRTP tapes during the AFP manufacturing process, using ML image analysis. This model can replace FE simulations to perform faster predictions of the temperature field within CFRTP tapes after a predefined thermal process, from a given microstructure, setting the stage for further applications of image-based ML algorithms requiring intensive simulation and analysis of large microstructure datasets, such as the study of the influence of each of the aforementioned microstructural heterogeneities, and real-time optimization of manufacturing processes.

First, a dataset of CFRTP microstructure images is created from both real and synthetic micrographs. Each image consists of the matrix, reinforcement fibres, and air pores, with varying sizes, volume fractions, and layouts. Then, the ground truth (temperature fields resulting from simulations) are obtained numerically. Next, a deep learning (DL) model is introduced, built upon the U-net architecture [16], a kind of convolutional neural network (CNN) [17] that excels at extracting meaningful information from images. Diverse forms of CNN have effectively been applied to image segmentation [16] and used as surrogate models in fluid flow [18–20] and heat transfer [21] problems through porous media, as well as computational fluid dynamics (CFD) simulations [22].

In addition, special attention is given to the preprocessing of the input images to enhance the model’s performance, by incorporating the time-of-flight (ToF) transform [18, 20] as additional input information. Consequently, an attention mechanism [23] is employed in the network, as the U-Net includes a two-branch encoder [24–26] to handle two families of input data (categorical material images and continuous ToF transforms).

The paper is structured as follows: “Transient heat conduction model” section presents the transient thermal problem under study, where a CFRTP is subjected to heating on one side for a short duration. The ground truths are obtained numerically in “Transient heat conduction model” section, using the diffusion-on-a-graph method, due to the nature of the input data (images). “Machine learning-based approach” section presents the ResU-Net architecture, employed to estimate the thermal field at the moment of interest. In “Results” section, the performance of the ML model is evaluated and compared against the numerical method. Finally,

“Conclusions” section summarizes the study’s findings and discusses future work and potential applications.

## Transient heat conduction model

Figure 1 illustrates the transient heat conduction problem analyzed in this study, where a CFRTP tape with homogeneous initial temperature of $T(\mathbf{x}, 0) = T_0 = 23$ °C is heated on the upper side, by considering a constant heat flux of magnitude $q = 20e3$ W/m$^2$. Conduction takes place within the tape’s domain, whose thickness usually lies in the range of [200, 350] µm. This process is dominated by the heterogeneous thermal diffusivity $\alpha(\mathbf{x})$. Simultaneously, heat convection is applied on the lower surface, assuming a heat transfer coefficient $h = 10$ W/m$^2$C and ambient temperature $T_\infty = 23$ °C.

## Ground truth

Various methods can be used to solve the transient heat conduction problem within the tape domain, such as the finite element method (FEM) [27]. However, given the nature of the microstructure representation (images) the diffusion-on-a-graph method [28] has been adopted with a view to reducing the computational complexity. In this approach, the graph’s nodes represent discrete points within the domain, while the edges denote the connections between nodes, and therefore the pathways for heat conduction from one point to another. This method allows the efficient evaluation of the Laplacian term in any diffusion equation, such as in the case of heat conduction [28]:

$$ \frac{\partial T}{\partial t} = \alpha \nabla^2 T = \alpha L T, \qquad (1) $$

<figure><img src="image_2.png" /><figcaption>Fig. 1 Problem schematic and boundary conditions</figcaption></figure>
<figure><img src="image_3.png" /><figcaption>Fig. 2 Node connectivity in a 3x3 node graph</figcaption></figure>

where *T* and *t* denote temperature and time, respectively, while *L* is the Laplacian operator [28].

Figure 2 illustrates the node connectivity in a small 3x3 regular graph. One node per pixel is employed hereinafter in this study. For Node 5 of the aforementioned graph, the Laplacian in Eq. 1 can be expressed as [28]:

$$LT_5 = \frac{1}{h^2}(T_2 + T_4 + T_6 + T_8 - 4T_5), \quad (2)$$

which after some mathematical manipulation, can be represented in matrix form as:

$$LT = \frac{1}{h^2} (A - D) T, \quad (3)$$

where **A** and **D** are called the graph adjacency and degree matrices, respectively (further details can be found in [28]). The solution at the time of interest is obtained by considering

<table><caption>**Table 1** Thermal properties of the matrix, fibres and air</caption><thead><tr><th></th><th>Matrix</th><th>Fibre</th><th>Air</th></tr></thead><tbody><tr><td>Density ρ [kg/m³]</td><td>1290</td><td>1960</td><td>1.27</td></tr><tr><td>Specific heat c<sub>p</sub> [J/kgK]</td><td>1020</td><td>1296</td><td>1005</td></tr><tr><td>Thermal conductivity k [W/mK]</td><td>0.27</td><td>1.05</td><td>0.024</td></tr></tbody></table>

an implicit time integration scheme [29]:

$$T_{n+1} = T_n + \tau \alpha L T_{n+1}, \quad (4)$$

where the timestep $\tau$ is set to 1e-3 s.

In this study, perfect thermal contact was assumed at the fiber-matrix interface, neglecting any interfacial thermal resistance, including Kapitza resistance [30]. Regarding porosity, nanopores were not explicitly considered in the model due to their expected minimal impact on thermal transport at this scale. Instead, larger pores were directly modeled as air-filled voids, where heat transfer occurs via conduction through air, inherently introducing thermal resistance without requiring additional interfacial resistance terms. This approach ensures that the effect of macroporosity on heat transfer is captured while maintaining computational efficiency and model consistency.

Nevertheless, the authors expect that the machine learning-based models proposed in “Machine learning-based approach” section remain adaptable to diverse temperature fields and capable of capturing the intrinsic thermal characteristics of the composite, regardless of these specific modeling assumptions.

## Machine learning-based approach

In this section, a machine learning model is presented, aimed at rapidly predicting the thermal field of a CFRTP tape based

<figure><img src="image_4.png" /><figcaption>Fig. 3 Microstructures from the dataset. Matrix (light grey), fibres (dark grey) and air pores (white)</figcaption></figure>
<table><caption>**Table 2** Ranges for the geometric descriptors of microstructures</caption><thead><tr><td>Parameter</td><td>Minimum</td><td>Maximum</td></tr></thead><tbody><tr><td>V<sub>f</sub></td><td>0.35</td><td>0.50</td></tr><tr><td>V<sub>a</sub></td><td>0.02</td><td>0.05</td></tr><tr><td>a [μm]</td><td>10</td><td>20</td></tr><tr><td>b [μm]</td><td>3</td><td>8</td></tr><tr><td>β [°]</td><td>-20</td><td>20</td></tr><tr><td>r [μm]</td><td></td><td>5</td></tr></tbody></table>

on an image of its microstructure. To achieve this, a dataset comprising 4000 images was designed to provide a representative sample of the microstructures observed after the fabrication process, with each image sized at 256x256 μm (256x256 pixels). The corresponding thermal fields (ground truths) were computed by using the method outlined in “Transient heat conduction model” section, and are subsequently used to train the neural network as its output.

## Microstructure data sampling

First, a dataset of 1000 segmented microscopy images was created from real micrographs of CFRTP composite tapes, capturing the matrix, fibres, and pores. All samples were carefully selected to encompass a wide range of heterogeneities, including matrix-rich surfaces, fibre-rich regions, and pores of varying sizes. Examples of these images are shown in Fig. 3a, b, and c.

The physical properties involved in the thermal conduction process, for the three considered phases, are detailed in Table 1. Diffusivity can be found as $\alpha = k/\rho c_p$.

## Generation of additional stochastic microstructures

Next, the dataset was expanded with an additional 1000 synthetic microstructure images, aimed at enriching the diversity of large-scale structural layouts and interconnections, which

are primarily captured by the deeper layers of the U-Net. Each sample was generated as follows, based on the ranges for each parameter shown in Table 2: first, the fibre and air volume fractions $V_f$ and $V_a$ were randomly chosen. Elliptical air pores were first randomly placed within the image up to the desired $V_a$, by varying the following geometric features: major semi-axis $a$, minor semi-axis $b$, and orientation angle $\beta$. Finally, circular fibres with a radius $r$ were randomly positioned within each image (without intersecting the air pores or other fibres) until the corresponding $V_f$ was reached.

Figure 4a, b, and c illustrate several feasible microstructures given the aforementioned constraints.

## Data processing

In order to speed up the training process and enhance the accuracy of the thermal field predictions, the time-of-flight transforms (from both the upper and lower boundaries) of the microstructure were considered as additional inputs in this study, as suggested by previous studies [18, 20]. This transform represents the minimum distance from each pixel to the respective boundary, accounting for variations in speed $v$ along the way. Based on preliminary studies, only air cavities were considered with $v=0$. Furthermore, categorical data, such as the locations of air pores and reinforcement fibres, were used as input to the surrogate model, resulting in a 4-channel image (see examples in Fig. 5a, b, c, and d).

On the other hand, Fig. 6 shows the corresponding target output used to train the models, whose only channel (temperature field) corresponds to the ground truth obtained in “Ground truth” section

## Data augmentation and normalization

Due to the horizontal symmetry of the problem, additional samples were generated by reflecting all 2000 images across the vertical axis, resulting in a total of 4000 images, randomly split into training and validation datasets in a 70-30% ratio.

<figure><img src="image_5.png" /><figcaption>**Fig. 4** Microstructures from the dataset. Matrix (light grey), fibres (dark grey) and air pores (white)</figcaption></figure>
<figure><img src="image_6.png" /><figcaption>Fig. 5 Input channels</figcaption></figure>

On the other hand, data in each channel of the dataset was
normalized based on its maximum and minimum values, and
a sigmoid activation function was used at the model’s output
for convenience.

ResU-Net

First, a standard residual U-Net (ResU-Net) was trained
to predict the temperature field of interest. This archi-
tecture, presented in Fig. 7, employs an encoder-decoder

<figure><img src="image_7.png" /><figcaption>Fig. 6 Target output</figcaption></figure>

structure, where the encoder (left) captures hierarchical fea-
tures through a series of downsampling operations, while
the decoder (right) reconstructs the output by progres-
sively upsampling these features to their original resolution.
Additionally, skip connections are introduced between cor-
responding layers in the encoder and decoder. These con-
nections allow the decoder to access high-resolution features
from the encoder, helping to preserve fine details and improve
the quality of the reconstructed output.

Additional details for each layer can be found in Table 3a
and b.

Both the encoder and decoder blocks utilized a residual
architecture (including a shortcut), which helps mitigate the
vanishing gradient problem, thereby enhancing convergence
during training. The architectures of the corresponding resid-
ual blocks are depicted respectively in Fig. 8a and b.

ResU-Net with two-branch encoder
and attention-based fusion

Based on preliminary studies, another more complex model
was also implemented to enhance results, using the architec-
ture described in “ResU-Net” section as the backbone. This
<figure><img src="image_8.png" /><figcaption>Fig. 7 U-Net architecture</figcaption></figure>

new model incorporated a two-branch encoder, featuring two independent flows of information, each handling data of different nature [25, 26]. In particular, each 4-channel image was divided into two 2-channel sub tensors of size (2,256,256) (corresponding to the continuous ToF maps and categorical microstructural images, see Fig. 5), which were fed into the separate branches, as shown in Fig. 9.

As it can be seen in Fig. 9, after every encoder stage, the features from both branches are fused in an attention module and passed through the skip connection to the decoder, where they are concatenated with the feature maps from the main path. Table 4a and b summarize the architectures of the two-branch encoder as well as the decoder:

Attention module

Finally, the multimodal fusion blocks $F^i$ in Fig. 9 use the attention mechanism [23] to capture the dependencies and interactions between the two input modalities.

<table><caption>Table 3 Architecture of the proposed ResU-Net</caption><thead><tr><th>Block</th><th>Channels<sub>in</sub></th><th>Channels<sub>out</sub></th><th>Kernel</th><th>Stride</th><th>Output shape</th></tr></thead><tbody><tr><td colspan="6">(a) Convolutional encoder</td></tr><tr><td>E<sup>1</sup></td><td>2 or 4</td><td>8</td><td>(4,4)</td><td>(2,2)</td><td>(8,128,128)</td></tr><tr><td>E<sup>2</sup></td><td>8</td><td>16</td><td>(4,4)</td><td>(2,2)</td><td>(16,64,64)</td></tr><tr><td>E<sup>3</sup></td><td>16</td><td>32</td><td>(4,4)</td><td>(2,2)</td><td>(32,32,32)</td></tr><tr><td colspan="6">(b) Convolutional decoder</td></tr><tr><td>D<sup>3</sup></td><td>32</td><td>16</td><td>(4,4)</td><td>(2,2)</td><td>(16,64,64)</td></tr><tr><td>D<sup>2</sup></td><td>16+16</td><td>8</td><td>(4,4)</td><td>(2,2)</td><td>(8,128,128)</td></tr><tr><td>D<sup>1</sup></td><td>8+8</td><td>1</td><td>(4,4)</td><td>(2,2)</td><td>(1,256,256)</td></tr></tbody></table>

A schematic of the process of deriving attention from a given input (source) A to another given input (target) B is shown in the upper half of Fig. 10, called Attention ($A \to B$), where cross product is denoted by $\otimes$, while PC stands for point-wise convolution (using a 1x1 filter).

First, queries $Q$, keys $K$ and values $V$ are obtained after a point-wise convolution and reshaping of the initial tensors $A$ and $B$ [23]:

* Queries $Q$ represent the information sought from the other modality, effectively guiding the attention mechanism.

* Keys $K$ are the features from the target modality that can potentially match the queries, serving as reference points for attention scoring.

* Values $V$ contain the actual information associated with each key that will be aggregated based on the computed attention scores.

Then, the attention weights can be obtained as:

$$W_{A \to B} = \mathrm{softmax} \left( \frac{Q_A^T K_B}{\sqrt{d_k}} \right), \quad (5)$$

where the scaling parameter $d_k$ refers to the dimensionality of the key vectors. The attention from $A$ to $B$ can be finally expressed as:

$$\mathrm{Attention} (A \to B) = \mathrm{softmax} \left( \frac{Q_A^T K_B}{\sqrt{d_k}} \right) V_B . \quad (6)$$

Due to the limited understanding of the relationships between the subsets of microstructure (categorical) and ToF (continuous) images in the problem under study, a co-attention mechanism was utilized in this investigation, formulated as:

$$F = \mathrm{Attention} (A \to B) + \mathrm{Attention} (B \to A) . \quad (7)$$

Loss function

Lastly, due to the form of the ground truth images $X$, and following [31], the loss function $L$ employed to enhance predictions $\hat{X}$ consisted of three components:

$$L(X, \hat{X}) = L_1 + L_{1,grad} + L_{ssim}, \quad (8)$$

where the absolute norm $L_1$ is defined as:

$$L_1 = \frac{1}{N \cdot H \cdot W} \sum_{i=1}^{N} \sum_{j=1}^{H} \sum_{k=1}^{W} \left| X_{i,j,k} - \hat{X}_{i,j,k} \right|, \quad (9)$$
<figure><img src="image_9.png" /><figcaption>**Fig. 8** Layers of the encoder/decoder blocks. DW stands for depth-wise convolution (each channel is convoluted using one distinct filter independently)</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>**Fig. 9** U-net architecture with a two-branch encoder and fusion modules</figcaption></figure>
<table><caption>**Table 4** Architecture of the attention-enhanced ResU-Net</caption><thead><tr><th>Blocks</th><th>Channels<sub>in</sub></th><th>Channels<sub>out</sub></th><th>Kernel</th><th>Stride</th><th>Output shape</th></tr></thead><tbody><tr><td colspan="6">(a) Convolutional encoder branches</td></tr><tr><td>E<sub>1</sub><sup>1</sup>, E<sub>2</sub><sup>1</sup></td><td>2</td><td>4</td><td>(4,4)</td><td>(2,2)</td><td>(4,128,128)</td></tr><tr><td>E<sub>1</sub><sup>2</sup>, E<sub>2</sub><sup>2</sup></td><td>4</td><td>8</td><td>(4,4)</td><td>(2,2)</td><td>(8,64,64)</td></tr><tr><td>E<sub>1</sub><sup>3</sup>, E<sub>2</sub><sup>3</sup></td><td>8</td><td>16</td><td>(4,4)</td><td>(2,2)</td><td>(16,32,32)</td></tr><tr><td colspan="6">(b) Convolutional decoder</td></tr><tr><td>D<sup>3</sup></td><td>16</td><td>8</td><td>(4,4)</td><td>(2,2)</td><td>(8,64,64)</td></tr><tr><td>D<sup>2</sup></td><td>8+8</td><td>4</td><td>(4,4)</td><td>(2,2)</td><td>(4,128,128)</td></tr><tr><td>D<sup>1</sup></td><td>4+4</td><td>1</td><td>(4,4)</td><td>(2,2)</td><td>(1,256,256)</td></tr></tbody></table>

<figure><img src="image_11.png" /><figcaption>**Fig. 10** Top: Co-attention mechanism. Upper section: Attention (A → B). Lower section: Attention (B → A)</figcaption></figure>

<table><caption>**Table 5** Model comparison</caption><thead><tr><th>Model</th><th>Training time</th><th>Inference time</th></tr></thead><tbody><tr><td>ResU-Net (2-channel input)</td><td>~4 h</td><td>0.064 s</td></tr><tr><td>ResU-Net (4-channel input)</td><td>~4 h</td><td>0.099 s</td></tr><tr><td>Attention-enhanced ResU-Net</td><td>~30 h</td><td>0.912 s</td></tr></tbody></table>

Training and inference times

<table><caption>**Table 6** Model comparison</caption><thead><tr><th>Model</th><th>N# params.</th><th>L (validation)</th></tr></thead><tbody><tr><td>ResU-Net (2-channel input)</td><td>149957</td><td>4.9031e-3</td></tr><tr><td>ResU-Net (4-channel input)</td><td>150411</td><td>3.1560e-3</td></tr><tr><td>Attention-enhanced ResU-Net</td><td>35983</td><td>4.9089e-4</td></tr></tbody></table>

Number of parameters and loss in the training dataset
$N$, $H$, and $W$ being the batch size, and the height and width of the images. The absolute norm defined over the image

gradients in the $x$ and $y$ directions $\nabla_x$ and $\nabla_y$ [31] is built up as:

$$L_{1,grad} = \frac{1}{N \cdot H \cdot W} \sum_{i=1}^{N} \sum_{j=1}^{H} \sum_{k=1}^{W} \left( |\nabla_x X_{i,j,k} - \nabla_x \hat{X}_{i,j,k}| + |\nabla_y X_{i,j,k} - \nabla_y \hat{X}_{i,j,k}| \right). \quad (10)$$

<figure><img src="image_12.png" /><figcaption>(c) Attention-enhanced ResU-Net with two-branch encoder.</figcaption></figure>
In third place, $L_{ssim}$ is known as the structural similarity loss, and is widely employed in image reconstruction applications [32]. It uses the structural similarity (SSIM) index:

$$L_{SSIM} = \frac{1}{N} \sum_{i=1}^{N} (1 - SSIM(X, \hat{X})) \\ = \frac{1}{N} \sum_{i=1}^{N} \left( 1 - \frac{(2\mu_X \mu_{\hat{X}} + c_1)(2\sigma_{X\hat{X}} + c_2)}{(\mu_{X}^2 + \mu_{\hat{X}}^2 + c_1)(\sigma_{X}^2 + \sigma_{\hat{X}}^2 + c_2)} \right), \quad (11)$$

where $\mu_X$, $\mu_{\hat{X}}$, $\sigma_X$, $\sigma_{\hat{X}}$, and $\sigma_{X\hat{X}}$ are the mean values of each image, the corresponding variances, and the covariance between $X$ and $\hat{X}$. More information can be found in [32].

## Results

In this section, the performance of three different ML models is compared to quantify the gains in accuracy from using more complex, yet more computationally demanding tools. These models, described in “ResU-Net” and “ResU-Net with two-branch encoder and attention-based fusion” sections, were implemented using PyTorch 2.6.0 and trained with the 4000-image dataset outlined in “Data processing” section: two versions of the standard ResU-Net were tested: (a) the first was trained solely using 2-channel data, corresponding to the categorical microstructure images (location of air pores and fibres), while (b) the second model was trained on the 4-channel image dataset. Finally, (c) the attention-enhanced ResU-Net was also developed.

### Model performance

Training was performed on a workstation equipped with a NVIDIA RTX 4060 GPU (8 GB VRAM) and an Intel Core

i7-13700H CPU (16 GB RAM). Table 5 shows the training and inference times using each model:

It can be noticed that the higher complexity of the attention mechanism resulted in longer training and inference times with respect to the simpler models. Next, the performance of the three trained models was assessed using the loss function defined in “Loss function” section, and results are shown in Table 6. As expected, the attention-enhanced model provided the best accuracy, despite using less parameters. It is also noteworthy that, for the standard ResU-Net, the incorporation of ToF data resulted in a decrease in $L$ by 35.7% with only a slight increase in the number of parameters, in line with the results obtained in other applications.

Finally, Fig. 11a, b, and c present parity plots comparing expected and predicted values of mean and maximum temperatures for each sample, corresponding to the three proposed models. Consistent with the behaviour of the loss function $L$, the discrepancy in both metrics decreases with increasing model complexity, reaching a mean relative absolute error (RAE) of 0.051% for $T_{mean}$ and 0.55% for $T_{max}$ across the entire dataset for the attention-enhanced model.

### Examples

Figure 12 shows two examples of ground-truth temperature fields, which will hereinafter be used to illustrate the accuracy of the three deep learning surrogate models. These correspond to two microstructures in the validation dataset, depicted in Figs. 3c and 4c, called hereinafter cases (i) and (ii).

Figures 13 and 14 present the temperature field predictions given by the aforementioned deep learning models (left), as well as the relative absolute error (RAE) of these outputs with respect to the ground truth (right), for cases (i) and (ii). As shown, the use of the 2-channel material maps as input provided a rough approximation of the overall temperature field. This approach, while useful, resulted in the RAE locally

<figure><img src="image_13.png" /><figcaption>Fig. 12 Ground truths</figcaption></figure>
reaching nearly 2.5% in both cases (i) and (ii). This level of error suggests that while the model was able to capture some aspects of the temperature distribution, it lacked the precision necessary for applications requiring higher accuracy.

The incorporation of time-of-flight data significantly enhanced the model's precision and reduced artifacts in the decoded image, aligning here with findings noted in previous literature. However, despite this improvement, the model struggled to accurately capture the local effect of fibres

on the temperature field. This limitation indicates the challenges of convolving channels of different nature together and effectively capturing the interactions among them by using standard convolutional neural networks.

Lastly, the separation of both information flows and their handling through co-attention fusion modules provided the closest approximation of the temperature field to the ground truth. This mechanism enabled the model to focus on relevant features and capture different scale effects more accurately.

<figure><img src="image_14.png" /><figcaption>**Fig. 13** Comparison of model performance. Case (i). Prediction (left) and relative absolute error (right)</figcaption></figure>
<figure><img src="image_15.png" /><figcaption>**Fig. 14** Comparison of model performance. Case (ii). Prediction (left) and relative absolute error (right)</figcaption></figure>

As a result, the attention-enhanced model demonstrated superior performance, highlighting the importance of advanced techniques in achieving better accuracy in temperature field predictions in composite materials.

However, even the most advanced ResU-Net exhibits reduced accuracy for samples with some pores located near the upper heated boundary, where locally elevated temperatures are obtained (case (i)). To better capture this effect, the

dataset should be enriched with more representative samples exhibiting such morphology.

## Conclusions

This study presents two surrogate models based on the convolutional U-Net architecture, aimed at solving the transient
thermal problem during the CFRTP manufacturing process at the microscale, using microstructure images within a machine learning framework.

Results showed that the more advanced model, which incorporates a two-branch encoder and a co-attention mechanism for improved precision, provides a strong correlation between its predictions and the ground truth derived from the numerical solution of the heat equation. This validates the model's capability in capturing the thermal history during fabrication, critical to CFRTP manufacturing.

Therefore, future work will focus on modeling the impact of various microstructural heterogeneities (such as matrix-rich regions, fibre clusters, non-uniform thickness, and porosities) on the resulting temperature history, ultimately aiming to identify the most critical heterogeneity types that affect the thermal history and the resulting mechanical properties.

Moreover, the ability to swiftly evaluate a large number of microstructures also positions this approach for process optimization and other real-time applications, by facilitating rapid assessments that can enhance manufacturing decisions.

**Author Contributions** All authors contributed to the study conception and design. The software was implemented by B. Ferrándiz. Simulations, data collection and analysis were performed by M. A. Palacios. The first draft of the manuscript was written by B. Ferrándiz and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.

**Funding** Open access funding provided by Arts et Metiers Institute of Technology.

**Data Availability** No datasets were generated or analysed during the current study.

## Declarations

**Competing Interests** The authors declare no competing interests.

**Compliance with Ethical Standards** The authors declare that they have no conflict of interest.

**Declaration of Generative AI and AI-assisted Technologies in the Writing Process** During the preparation of this work the authors used ChatGPT in order to improve the text style and wording in some sections. After using this tool, the authors reviewed and edited the content as needed and take full responsibility for the content of the publication.

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the

permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## References

1. Yao S-S, Jin F-L, Rhee KY, Hui D, Park S-J (2018) Recent advances in carbon-fiber-reinforced thermoplastic composites: a review. Compos Part B: Engineering 142:241–250

2. Teltschik J, Matter J, Woebbeking S, Jahn K, Adasme YB, Paepegem WV, Drechsler K, Tallawi M (2024) Review on recycling of carbon fibre reinforced thermoplastics with a focus on polyetheretherketone. Compos A: Appl Sci Manuf 184

3. Wazeer A, Das A, Abeykoon C, Sinha A, Karmakar A (2023) Composites for electric vehicles and automotive sector: a review. Green Energy Intell Transp 2:100043

4. Condé-Wolter J, Ruf MG, Liebsch A, Lebelt T, Koch I, Drechsler K, Gude M (2023) Hydrogen permeability of thermoplastic composites and liner systems for future mobility applications. Compos A: Appl Sci Manuf 167

5. Ismail KBM, Kumar MA, Mahalingam S, Raj B, Kim J (2024) Carbon fiber-reinforced polymers for energy storage applications. J Energy Storage 84

6. Murray RE, Beach R, Barnes D, Snowberg D, Berry D, Rooney S, Jenks M, Gage B, Boro T, Wallen S, Hughes S (2021) Structural validation of a thermoplastic composite wind turbine blade with comparison to a thermoset composite blade. Renew Energy 164:1100–1107

7. Zhang J, Lin G, Vaidya U, Wang H (2023) Past, present and future prospective of global carbon fibre composite developments and applications. Compos Part B: Engineering 250

8. Karandikar HM, Mistree F (1992) Tailoring composite materials through optimal selection of their constituents. J Mech Des 114:451–458

9. Whitaker S (1999) The method of volume averaging, vol 13. Springer, Netherlands

10. Torquato S (2002) Random heterogeneous materials, vol 16. Springer, New York

11. Hyer MW, Waas AM (2018) Micromechanics of linear elastic continuous fiber composites, pp 295–326. Elsevier

12. Chung D (2017) Processing-structure-property relationships of continuous carbon fiber polymer-matrix composites. Mater Sci Eng: R: Reports 113:1–29

13. Baskaran A, Kautz EJ, Chowdhary A, Ma W, Yener B, Lewis DJ (2021) The adoption of image-driven machine learning for microstructure characterization and materials design: a perspective. arXiv:2105.09729

14. Peng X-L, Fathidoost M, Lin B, Yang Y, Xu B-X (2024) What can machine learning help with microstructure-informed materials modeling and design? arXiv:2405.18396

15. Tafreshi OA, Hoa SV, Shadmehri F, Hoang DM, Rosca D (2019) Heat transfer analysis of automated fiber placement of thermoplastic composites using a hot gas torch. Adv Manuf: Polym Compos Sci 5:206–223

16. Ronneberger O, Fischer P, Brox T (2015) U-net: convolutional networks for biomedical image segmentation. In: Navab N, Hornegger J, Wells WM, Frangi AF (eds) Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015. TU München, pp 234–241

17. Goodfellow I, Bengio Y, Courville A (2016) Deep learning. MIT Press

18. Santos JE, Xu D, Jo H, Landry CJ, Prodanović M, Pyrcz MJ (2020) Poreflow-net: a 3d convolutional neural network to predict fluid flow through porous media. Adv Water Resour 138
19. Wu J, Yin X, Xiao H (2018) Seeing permeability from images: fast prediction with convolutional neural networks. Sci Bull 63:1215-1222

20. Marcato A, Santos JE, Boccardo G, Viswanathan H, Marchisio D, Prodanović M (2023) Prediction of local concentration fields in porous media with chemical reaction using a multi scale convolutional neural network. Chem Eng J vol 455

21. Xu J, Wei H, Bao H (2023) Physics-informed neural networks for studying heat transfer in porous media. Int J Heat Mass Transfer 217:124671

22. Guo X, Li W, Iorio F (2016) Convolutional neural networks for steady flow approximation. In: Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp 481-490, ACM

23. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser L, Polosukhin I (2017) Attention is all you need. arXiv:1706.03762

24. Luo Y, Liang C, Qin S, Liu J, Fu Q, Yang S (2024) A two-branch encoder-decoder network for image tampering localization. Appl Soft Comput 164

25. Zhou H, Qi L, Huang H, Yang X, Wan Z, Wen X (2022) Canet: co-attention network for rgb-d semantic segmentation. Pattern Recognit vol 124

26. Liu B, Li B, Sreeram V, Li S (2024) Mbt-unet: Multi-branch transform combined with unet for semantic segmentation of remote sensing images. Remote Sens vol 16

27. Zienkiewicz O, Taylor R, Zhu JZ (2013) The finite element method: its basis and fundamentals: Seventh Edition. Butterworth-Heinemann

28. Godsil C, Royle G (2001) Algebraic graph theory. Springer, New York

29. Johnson C (1987) Numerical solution of partial differential equations by the finite element method. Dover Publications

30. Chen J, Xu X, Zhou J, Li B (2022) Interfacial thermal resistance: past, present, and future. Rev Mod Phys 94

31. Ma R, Chen S, Whang Q (2022) Lightweight monocular depth estimation. arXiv:2212.11363

32. Wang Z, Bovik A, Sheikh H, Simoncelli E (2004) Image quality assessment: from error visibility to structural similarity. IEEE Trans Image Process 13:600-612

**Publisher's Note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.