3.1. Data Description
In this work, we used the ULg Multimodality Drowsiness Database (DROZY) [
31], which was introduced to facilitate the development of robust drowsiness monitoring systems, especially with contactless camera-based sensing in transportation contexts. The dataset is explicitly designed to support research on drowsiness and related operator states by providing synchronized multi-sensor recordings centered on facial analysis and physiology. It combines remote sensing with classical sleepiness/vigilance assessment tools, making it suitable for both vision-based and physiology-inspired modeling.
The data were collected from 14 healthy participants (3 males and 11 females), with a mean age of approximately 22.7 years. The protocol aimed to induce increasing levels of sleep deprivation across two consecutive days. Each subject performed three Psychomotor Vigilance Tests (PVTs) under controlled laboratory conditions, progressing from a well-rested state to acute sleep deprivation. Participants were required to follow a normal sleep routine prior to the first test and then remain awake until the third PVT, resulting in roughly 28–30 h of total sleep deprivation. The study environment was carefully controlled (e.g., reduced external stimuli and limited prior screen exposure), and the Karolinska Sleepiness Scale (KSS) self-assessment was recorded before each PVT to provide a subjective estimate of drowsiness.
A key strength of DROZY is its multimodality and strict temporal synchronization. For each subject and each of the three PVT sessions, the database provides four major categories of data: (1) KSS scores, (2) PVT event markers and reaction times, (3) polysomnography (PSG) signals, and (iv) facial recordings captured by a Microsoft Kinect v2 sensor. The PSG includes five EEG channels, two EOG channels, ECG, and EMG, offering an objective physiological reference for sleepiness-related changes. The Kinect v2 provides near-infrared (NIR) intensity and range facial images, enabling analysis that is robust to lighting variations; these modalities are well aligned with the database motivation of contactless in-vehicle-like monitoring. Additionally, the dataset offers 68 facial landmarks with both 2D image coordinates and 3D camera-space coordinates, obtained via a combination of manual annotations on selected frames and automatic tracking across all frames.
In terms of scale, DROZY contains approximately 500,000 frames of facial data and a total data volume of about 283 GB. This size reflects the richness of the synchronized recordings and the inclusion of both image and physiological streams. The dataset structure supports several experimental directions, such as estimating level of drowsiness from PSG, extracting ocular or facial-behavioral indicators from NIR images, and studying the relationship between visual fatigue cues and objective vigilance outcomes derived from PVT reaction times.
Figure 1 presents representative segments of four physiological modalities EEG (Cz channel), EMG, ECG, and EOG. Each comparing the Alert and Drowsy states over time; across these signals, the drowsy condition generally shows more pronounced baseline shifts and transient events, while the alert condition tends to exhibit more regular dynamics, illustrating that vigilance changes can be captured through complementary neural, muscular, cardiac, and ocular patterns.
3.2. Data Pre-Processing
The raw input to the proposed KAN-CLUE framework consists of near-infrared (NIR) facial recordings and associated drowsiness annotations provided by the DROZY database. Before these signals can be used to train and evaluate the TinyML model, they must be transformed into a consistent, compact, and well-labeled representation. The pre-processing pipeline is designed not only to prepare the data from a machine learning perspective, but also to respect the constraints of TinyML deployment on microcontrollers, namely limited memory, limited computational power, and the need for stable and well-normalized inputs.
3.2.1. Temporal Alignment and Frame Selection
Let denote the index of a subject in the database. For each subject s, the NIR facial recording can be represented as a sequence of frames , with , where is the total number of frames in the recording for that subject. The raw recording includes initialization periods, rest phases, and the active Psychomotor Vigilance Test (PVT) interval. The drowsiness analysis is only meaningful within the experimentally defined PVT interval and potentially in its immediate neighborhood.
Using the session metadata or synchronization markers, we determine the frame indices corresponding to the beginning and end of the valid PVT interval for subject s, denoted by and , respectively. We then define a binary selection mask such that if , and otherwise, which identifies frames that belong to the valid experimental interval. The set of valid frame indices for subject s is then given by . Only frames with are retained for subsequent stages. If necessary, a temporal subsampling factor can be applied to reduce redundancy, for example by keeping one frame every k frames, which lowers storage and computational costs and is consistent with TinyML constraints.
3.2.2. Face and Eye Region Localization
After temporal selection, the next goal is to spatially localize the most informative part of each frame for fatigue detection. In vision-based driver monitoring, the face and especially the periocular (eye) region are highly indicative of drowsiness, as they capture blink patterns, eyelid closure, and other fatigue-related cues.
For each valid frame with , we assume the availability of a set of two-dimensional facial landmarks , where K denotes the number of landmarks. The k-th landmark is written as , with and giving its horizontal and vertical coordinates in pixel units. These landmarks may be provided by the database or estimated using a robust facial landmark detector applied to each frame.
A global face bounding box is defined as the smallest axis-aligned rectangle that contains all landmarks, namely , where , , , and . To avoid truncating facial regions due to small landmark inaccuracies, this bounding box can be enlarged by a fixed margin on all sides, resulting in an expanded box .
In addition to the global face region, the periocular area is often particularly informative for fatigue monitoring. Let denote the indices of landmarks corresponding to the left and right eyes. The eye bounding box is defined in terms of these landmarks as , with , , , and . A small padding margin may also be added to this box to include surrounding context such as eyebrows and upper cheeks, which further stabilizes the appearance of the region.
Given a selected bounding box , either for the face or for the eye region, a cropping operator is applied to extract the corresponding region of interest from the full frame. The cropped image is defined as , where denotes the raw ROI image at its original spatial resolution . In practice, short gaps in landmark detection may arise due to occlusions or motion blur. To avoid discarding all such frames, the last valid bounding box can be propagated forward over a small temporal horizon, under the assumption that head motion is relatively smooth from frame to frame.
3.2.3. Geometric Normalization and Resizing
The cropped ROIs may have different sizes and positions across subjects and sessions, and the TinyML model requires a fixed input size. In addition, approximate geometric consistency across samples is beneficial for learning. For these reasons, each ROI is geometrically normalized and resized to a common resolution.
Let H and W denote the target height and width of the input images. A resizing operator is applied to each as , where . In this work, H and W are chosen to offer a compromise between preserving relevant visual detail and keeping the number of pixels, and thus the number of operations and memory usage, as low as possible. The resizing is implemented via bilinear interpolation, which provides a smooth mapping between the original pixel grid and the target grid.
3.2.4. Intensity Normalization and Pixel Scaling
Even when the imaging setup is controlled, NIR recordings can exhibit variations in overall brightness and contrast across subjects, sessions, or time, due to sensor characteristics, camera gain, and small lighting changes. Without normalization, such variations may dominate the variance in the data and hinder the learning process, especially for compact TinyML models.
To homogenize the intensity distribution, each resized ROI is standardized. The mean intensity and standard deviation of are computed as and , where indexes the pixel coordinates and is a small constant, for example , introduced for numerical stability. The normalized ROI is then defined element-wise by . With this transformation, each input image has approximately zero mean and unit variance, which helps stabilize and accelerate training. In an alternative configuration, global statistics and can be computed over all training ROIs and used in place of and , thereby enforcing a common normalization across the entire dataset as . In both cases, the normalized images constitute the actual input to the KAN-CLUE model.
3.2.5. Temporal Windowing and Local Context
A single normalized frame contains relevant information about the instantaneous facial appearance, such as partial eyelid closure. However, fatigue is also expressed through temporal patterns, including blink frequency and duration, or gradual eye closure over several frames. To incorporate such local temporal context without resorting to heavy recurrent structures that may not be feasible on TinyML hardware, temporal windows can be constructed by grouping consecutive frames.
Let L denote the window length in frames. For a subject s and sequence , a temporal segment is formed as , where denotes the starting frame index of the n-th window and is chosen such that all indices in the set belong to . The step between consecutive starting indices controls the amount of overlap between windows and can be adapted depending on the desired number of training samples and redundancy. In the strict TinyML setting, the model may operate directly on single frames by setting , in which case the temporal segment reduces to .
3.2.6. Data Augmentation in the Training Phase
To improve robustness and generalization, especially to unseen drivers and small variations in camera placement or illumination, synthetic perturbations of the normalized ROIs are applied during training [
32]. These perturbations are designed to be lightweight and computationally inexpensive so that they do not contradict the TinyML deployment constraints.
Let denote a stochastic transformation parameterized by a set of random variables . Given a normalized ROI , an augmented version is obtained as . The transformation may include, for example, random horizontal flips, small in-plane rotations, and mild brightness and contrast adjustments. A typical implementation can be expressed as a composition , where applies a horizontal flip with a certain probability, rotates the image by an angle drawn from a small interval around zero, and modifies brightness and contrast through , with a and b drawn from narrow ranges around 1 and 0, respectively. The ranges are chosen so that the visibility of the eye region is preserved while the training set is enriched with realistic, yet modest, variations.
3.2.7. Label Derivation from Drowsiness Annotations
The DROZY database provides subjective drowsiness annotations in the form of Karolinska Sleepiness Scale (KSS) scores, typically taking integer values from 1 (extremely alert) to 9 (very sleepy). These scores can be recorded at the session level or at specific time points during the experiment. The database may also include objective performance measures, such as reaction times during the PVT, which can correlate with fatigue.
To transform these annotations into class labels suitable for supervised classification, a mapping is defined from KSS scores to a discrete set of fatigue levels. Let denote the KSS score associated with subject s at time t. In the simplest case, is constant within a session and equal to a session-level KSS score . A label mapping function is introduced so that , where takes values in and C denotes the number of fatigue classes. For example, in a three-class setting with alert, mildly drowsy, and severely drowsy states, the mapping can be defined as if for the alert class, if for the mildly drowsy class, and if for the severely drowsy class. When temporal windows of length L are used as inputs, a single label is assigned to each window based on the KSS score associated with the time interval covered by that window. A simple choice is to use the session-level KSS score, in which case for all windows extracted from that session. More refined strategies can also be adopted, for example aligning windows with time-varying KSS or reaction-time measurements when such information is available.
3.2.8. Construction of Training, Validation, and Test Sets
After pre-processing and labeling, the dataset can be expressed as a collection of labeled samples. In practice, we randomly assign of the subjects to , to , and the remaining to .
To make the evaluation protocol fully explicit, the DROZY dataset was partitioned at the subject level before any model training or testing. Since the database contains 14 subjects in total, the nominal 60%/20%/20% split corresponds in practice to 8 subjects for training, 3 subjects for validation, and 3 subjects for testing. This yields an approximate subject ratio of 57.1%/21.4%/21.4%, which is the closest feasible integer split to the intended 60%/20%/20% partition.
Most importantly, all data from a given subject were assigned to a single subset only. Therefore, frames from the same subject never appear in more than one of the training, validation, and test sets. Because each subject in DROZY contributes multiple recording sessions, this also means that all sessions of the same subject remain within the same subset. As a result, no frame, sequence, or session from one subject can be shared across different partitions, which prevents identity leakage and ensures a strictly subject-independent evaluation protocol.
Table 3 summarizes the final partition. This split ensures that the reported results reflect generalization to unseen subjects rather than memorization of subject-specific appearance or recording conditions.
3.3. TinyML Model Architecture
The proposed KAN-CLUE framework is organized as a compact convolutional–KAN architecture that is explicitly tailored for TinyML deployment on resource-constrained microcontrollers. The model comprises two main components. The first component is a very small convolutional neural network (CNN) that operates on the normalized eye or upper-face region and extracts a low-dimensional feature vector. The second component is a Kolmogorov–Arnold Network (KAN) head that receives this vector and produces uncertainty-aware fatigue predictions. The CNN is responsible for capturing local spatial patterns such as eyelid opening, blink-related texture, and periocular structure using a limited number of filters and pooling operations. The KAN head then provides flexible nonlinear transformations of these features with a parameter-efficient structure.
The input to the architecture is the normalized region of interest obtained from the pre-processing pipeline, where H and W denote the spatial resolution of the cropped eye or upper-face patch. For concreteness, and without loss of generality, we consider the case and a single input channel corresponding to the NIR intensity. The CNN feature extractor maps this tensor to a compact feature vector in , where is chosen to balance expressivity and TinyML feasibility. The KAN head then operates on this low-dimensional vector. In the following, the CNN feature extractor is described in detail, including its layer structure, mathematical formulation, parameter count, and approximate MAC complexity.
3.3.1. CNN Feature Extractor
The CNN feature extractor is a small two-layer network that maps each grayscale ROI to a compact embedding for the KAN head. It uses two convolutional layers with ReLU and max-pooling: the first layer has filters, the second has filters. After the two pooling operations, the feature maps are reduced to and flattened into a -dimensional vector, which is then projected by a fully connected layer to a -dimensional embedding. In total, the CNN feature extractor has trainable parameters and requires MACs per forward pass, which fits comfortably within typical TinyML memory and compute budgets when using 8-bit quantization.
3.3.2. Kan-Based Classification Head
The convolutional feature extractor described in the previous subsection produces, for each input region of interest, a compact embedding vector that summarizes the most salient periocular patterns related to driver fatigue. This embedding is denoted by , where is the embedding dimension, for example in the configuration considered here. In a conventional TinyML classifier, this vector would typically be fed into one or more fully connected layers with pointwise nonlinearities. In the KAN-CLUE framework, we replace this traditional dense head by one or two Kolmogorov–Arnold Network (KAN) layers that operate on and produce a compact intermediate representation which is then mapped to class-wise evidence for fatigue prediction and uncertainty estimation.
A KAN layer approximates multivariate nonlinear mappings by composing learnable univariate functions along each input dimension with linear combinations across dimensions. Concretely, each KAN unit computes a weighted sum of univariate nonlinear transformations of the individual input coordinates. To make this idea compatible with TinyML constraints, each univariate function is parameterized using a low-order spline basis defined on a fixed grid, with a small number of basis functions and aggressively quantized control points.
The KAN head first normalizes the embedding coordinates to a common interval before applying spline-based univariate functions. Let denote the embedding, and let and be precomputed mean and standard deviation values for dimension r. A normalized coordinate is defined as , and then linearly rescaled and clipped to the unit interval by , where and are scalar parameters that define an affine transformation from the standardized space to the spline grid domain. In practice, and are chosen such that most values of lie in on the training set. This normalization step ensures that all univariate spline functions operate over the same fixed interval, which simplifies their implementation and facilitates sharing of precomputed basis functions across edges.
Each normalized coordinate is then passed through a univariate function associated with hidden unit i and input dimension r. In KAN, these univariate functions are represented as linear combinations of basis functions defined on a fixed grid, typically B-splines or piecewise polynomial splines. In this work, we employ a uniform B-spline basis of low degree, for example linear or cubic, with a small number M of segments, which strikes a balance between approximation power and computational simplicity.
Let denote a set of M basis functions supported on the unit interval , for instance uniform B-splines of a chosen degree defined on a fixed knot vector. The univariate function is written as , where are learnable coefficients, or control points, associated with the M basis functions for the pair . The set of all determines the shape of the learned univariate function along dimension r for hidden unit i. In the most general case, each pair has its own collection of control points, but to improve efficiency on TinyML hardware, simplifications can be introduced, such as sharing control points across subsets of units or across all units corresponding to the same input dimension.
The output of the first KAN layer is obtained by linearly combining the univariate transformations across input dimensions. Denoting the activation of hidden unit i by , the KAN hidden layer is defined as , where is a scalar weight that modulates the contribution of the univariate function to unit i, and is a bias term. The index i runs from 1 to , where denotes the number of hidden KAN units in the classification head. For TinyML deployment, is chosen to be relatively small, for example , in order to limit the number of parameters and operations. An elementwise nonlinearity may be applied to , yielding the first-layer hidden representation , with typically chosen as a smooth nonlinearity such as tanh or a rectified function. In practice, and especially under quantization constraints, using a simple and monotonic nonlinearity such as tanh or a clipped linear function helps to maintain numerical robustness.
If an additional KAN layer is employed, the activations serve as input to a second KAN layer of the same general form. For a second layer with units, one first defines normalized inputs obtained from through an affine transformation and clipping analogous to the unit-interval normalization described above, then parameterizes new univariate functions as linear combinations of the same fixed basis , and combines them linearly as , with corresponding activations . In many TinyML scenarios, a single KAN layer is already sufficiently expressive when combined with the CNN feature extractor, and thus the first-layer hidden representation alone is used. The optional second layer provides additional nonlinear capacity at the cost of extra parameters and MACs, and can be enabled or disabled depending on the available resources.
The final classification logits are produced by a linear layer that maps the KAN hidden representation to C output units, where C is the number of fatigue classes, for example corresponding to alert, mildly drowsy, and severely drowsy. If a single KAN layer is used, the logits are defined as for , where are the weights of the output layer and are the bias terms. When a second KAN layer is present, the same expression holds with replaced by and replaced by . The vector is then passed to the evidential output layer described elsewhere, which converts it into class-wise evidence and predictive uncertainty.
The KAN head has a relatively small number of trainable parameters compared to the CNN feature extractor. For a single KAN layer with units, each applied to a -dimensional embedding with M spline control points per input dimension, the total parameter count combines: (i) spline coefficients, (ii) linear mixing weights and biases in the hidden layer, and (iii) the output layer weights and biases. With the configuration used in this work, , , , and output classes, the KAN head contains trainable parameters in total. This is substantially smaller than the parameters of the CNN feature extractor and comfortably fits TinyML memory constraints once quantized.
From a computational standpoint, the dominant cost of a KAN layer lies in evaluating the spline expansions and performing the linear combinations in the hidden layer and output logits. If each basis function is computed on the fly, evaluating requires M multiplications and additions. However, in TinyML deployments, it is advantageous to precompute the basis function values on a fixed grid of L points in and store them in a look-up table. Each normalized input is then quantized to an index in this grid, and evaluating reduces to fetching M basis values and performing M multiplications and additions with the quantized coefficients . As a result, the MAC complexity of the KAN layer scales approximately as , where the first term accounts for the spline evaluations, the second term covers the linear combination weights , and the third term corresponds to the output logits. Using the same example values as above, and ignoring the relatively small contribution of the output layer, the leading term is , which is orders of magnitude smaller than the approximately MACs required by the CNN feature extractor. This confirms that the KAN head adds negligible computational overhead compared with the convolutional part of the model, while providing significantly enhanced flexibility and expressivity in the final classification stage.
To further adapt the KAN head to TinyML constraints, several simplifications are adopted. A single uniform spline grid is shared across all input dimensions and KAN units, so that the basis functions and the knot vector are common and can be implemented once for all edges. Low-order splines, typically linear or at most cubic, are used to minimize the number of basis functions and avoid expensive higher-order polynomial evaluations. All control points , linear weights and , and biases are quantized to 8-bit integers after training, and the normalized inputs are quantized to a fixed-point representation. This aggressive quantization, combined with shared grids and low-order splines, yields a KAN-based classification head that remains compatible with the constraints of microcontroller-class devices, yet preserves the key modeling advantage of KANs: the ability to learn rich, dimension-wise nonlinear transformations and combine them in a structured way for driver fatigue detection.
3.3.3. What Is Technically New in Kan-Clue?
KAN-CLUE is not intended as a claim that any one of its ingredients is individually unprecedented. Compact convolutional backbones, KAN layers, evidential uncertainty estimation, OOD scoring, and continual-learning regularization each exist in the literature in different forms. The novelty of the present work lies instead in how these components are specialized, coupled, and constrained for a single deployment target: uncertainty-aware continual driver fatigue detection on microcontroller-class TinyML hardware.
More specifically, the contribution goes beyond simply replacing a dense classifier with a KAN head. First, the KAN component is used as a compact evidential decision layer, not merely as a drop-in nonlinear classifier. The convolutional backbone produces a low-dimensional embedding, and the KAN head transforms this embedding into class-wise evidence that parameterizes a Dirichlet predictive distribution. This design lets the same lightweight head support both classification and predictive uncertainty estimation without requiring ensembles, Monte Carlo sampling, or a large Bayesian approximation.
Second, KAN-CLUE combines two complementary reliability signals within a TinyML-compatible pipeline: evidential uncertainty from the Dirichlet output and a lightweight activation-histogram OOD score computed from the embedded feature space. The role of the OOD module is not only to detect samples that deviate from the training distribution, but also to support decision gating and sample selection under severe edge constraints. This combination is particularly important for embedded fatigue monitoring, where false confidence on unusual facial appearances, lighting conditions, or driver-specific patterns can be operationally harmful.
Third, the continual-learning component is not a generic add-on. In KAN-CLUE, on-device adaptation is driven by the uncertainty/OOD logic and regularized through a KAN-aware consolidation mechanism. Rather than updating the entire model indiscriminately, the adaptation strategy selectively updates a small parameter subset and constrains it with an EWC-style penalty applied to the KAN-sensitive parameters, namely the spline/control-point representations and associated mixing weights that govern the nonlinear edge functions. This is different from a standard continual-learning treatment of dense layers, because the parameters being preserved and updated have a different structural role in KANs.
Finally, the overall contribution is architectural at the system level. The proposed framework is designed so that compact feature extraction, uncertainty-aware prediction, OOD detection, and controlled continual adaptation are all achieved within a single TinyML-ready pipeline. In this sense, the novelty is not the isolated existence of CNNs, KANs, evidential learning, OOD scoring, or continual learning, but the fact that they are integrated in a deployment-constrained and mutually reinforcing way for trustworthy driver fatigue detection at the IoT edge (see
Table 4).
3.3.4. Quantization and Deployment
The KAN-CLUE model is ultimately intended to run on microcontroller-class devices under the TinyML paradigm, where both compute and memory resources are highly constrained. In this context, quantization is a crucial step that converts the floating-point model trained on a workstation into an integer-arithmetic implementation suitable for deployment. The goal of this process is to reduce model size, improve inference speed, and lower energy consumption, while preserving as much predictive accuracy and calibration quality as possible.
After the CNN feature extractor and the KAN-based classification head have been trained in floating-point, typically using 32-bit single precision, a post-training quantization procedure is applied [
33]. In post-training quantization, the learned weights and, optionally, the activations are converted from floating-point values to low-bit integer representations without modifying the training procedure itself. Let
w denote a scalar weight in the floating-point model. The quantized version
in an
-bit integer format, for example
, is obtained by applying an affine mapping parameterized by a scale factor
and a zero-point
, followed by rounding and clipping to the representable integer range. This mapping can be written as
, where
denotes the set of integers representable in the chosen format, for example
for signed 8-bit quantization, and
projects the value onto
if it falls outside this range. The corresponding dequantized value used in integer–float mixed analysis is given by
, which is used internally to reason about the effect of quantization, even though at inference time the microcontroller operates directly on the integer representation
.
The same principle is applied to activations. Given a floating-point activation a at some layer, the quantized activation is , where and are layer-specific scale and zero-point parameters obtained from calibration data or from the training distribution. The forward pass of the quantized model therefore consists primarily of integer MAC operations and integer additions, which can be implemented very efficiently on microcontrollers with support for SIMD-like instructions, for example ARM Cortex-M devices with DSP extensions.
In the context of KAN-CLUE, both the CNN parameters, namely convolutional kernels, biases, and fully connected weights, and the KAN-specific parameters, namely spline control points, linear combination weights, and biases, are quantized to 8-bit integers. The total number of trainable parameters in the CNN feature extractor was previously denoted by , and the number of parameters in the KAN head by . The total parameter count of the complete model is . When using bits per parameter, the storage required to hold all weights and biases in non-volatile memory, for example Flash, can be approximated by bytes. For instance, using the example values and leads to , and with bits per parameter, one obtains kB, which comfortably fits within the Flash memory budgets of common TinyML platforms.
The memory required for intermediate activations during inference is stored in volatile memory, SRAM, and depends on the largest feature map that needs to be kept in memory at any point in the forward pass. An approximate bound on the activation memory can be obtained by summing the sizes of the main tensors that must coexist, multiplied by the number of bytes per activation. For 8-bit activations, the memory needed for a tensor with elements is bytes. If the largest feature map in the CNN occurs after the first convolution, with dimensions , then , corresponding to approximately 18 kB of activation memory for that particular tensor. In practice, the memory allocator of the deployment framework, for example TensorFlow Lite Micro, reuses activation buffers across layers, and additional space is reserved for other tensors such as input, output, and auxiliary scratch buffers. The total RAM footprint is therefore slightly larger than the simple sum of tensor sizes, but remains within a typical budget of a few tens of kilobytes for the architectures considered here.
The KAN-specific operations are implemented in an efficient integer-friendly manner. During training, spline basis functions are defined over the continuous interval . For deployment, the interval is discretized into a regular grid of L points , with , and the basis functions are precomputed at these locations, yielding a look-up table of size , where M is the number of basis functions. The resulting table entries can themselves be quantized to a fixed-point representation with bits. The memory required to store this look-up table in Flash is approximately bytes. For example, with basis functions, grid points, and bits, one obtains bytes, which is negligible compared with the overall model size.
At inference time, each normalized and quantized input is mapped to the closest grid points on this grid. Let denote the grid spacing, and suppose that lies between and . An index j is obtained as , and a local interpolation coefficient is computed as . The value of a basis function can then be approximated by linear interpolation between its precomputed values at and , namely , where and are fetched from the look-up table. Since all quantities involved are represented in fixed-point, the interpolation step reduces to a small number of integer MACs and shifts, which are highly efficient on microcontrollers. The univariate spline is then evaluated by combining these approximate basis values with quantized control points , resulting in a computation dominated by integer MACs and table look-up operations.
The entire quantized KAN-CLUE model is deployed using a lightweight inference framework such as TensorFlow Lite Micro or an equivalent embedded inference runtime. These frameworks provide a static memory arena for tensors, avoid dynamic memory allocation at runtime, and implement integer kernels for convolution, fully connected layers, activation functions, and generic elementwise operations. Custom kernels are implemented for the KAN-specific spline evaluation and interpolation routines, making use of the precomputed look-up tables and quantized control points. The compiled binary is generated with compiler optimizations enabled, for example -O3, and, where available, DSP-like instructions, such as ARM CMSIS-NN intrinsics, are used to accelerate integer MACs.
For clarity and completeness, the overall architecture can be summarized in a table that reports, for each major layer, the output tensor size, the number of trainable parameters, and the number of MACs. An example of such a summary is given in
Table 5, which assumes the configuration described in the previous subsections.
3.5. Uncertainty-Aware Continual Learning
The KAN-CLUE framework is designed not only to produce uncertainty-aware predictions, but also to adapt over time to changing driving conditions, new drivers, and evolving sensor characteristics. This adaptation is performed under strict TinyML constraints, which means that both the memory budget and the available computation for online updates are severely limited. To reconcile these constraints with the need for personalization and robustness, KAN-CLUE adopts an uncertainty-aware continual learning strategy in which only a small subset of carefully selected samples is stored on the device and later used to perform lightweight parameter updates. The selection of these samples is driven by the uncertainty and OOD scores described in
Section 3.4, which helps focus the limited adaptation capacity on the most informative examples.
3.5.1. Online Data Collection
During deployment, the system processes an incoming stream of samples indexed by time
. For each new input frame (or temporal window)
that has been pre-processed into a normalized region of interest as described earlier, the KAN-CLUE model produces a predictive probability vector
, an evidential uncertainty score
, and an OOD score
. The predicted class label
is given by
and can be represented in one-hot form as a vector
with components
The triplet
, together with the raw input
or its embedded representation, forms the basic information associated with sample
t.
To enable uncertainty-aware continual learning under memory constraints, KAN-CLUE maintains a fixed-size buffer that stores a limited number of recent or informative samples. Let
B denote the maximum buffer capacity, for example
, and let
represent the buffer contents at time
t, where
and
denotes either the raw normalized input, the compressed embedding
, or a combination thereof. Storing the embedding instead of the raw frame can substantially reduce the memory footprint, as
is typically much smaller than the full image. In this case, the stored input representation is given by
The buffer is updated online as new samples arrive. At each time step
t, the system decides whether to store the current sample
in the buffer based on its uncertainty and OOD characteristics. The intuition is that samples with very low uncertainty and low OOD score are already well captured by the current model, whereas samples with extremely high uncertainty or OOD score may be too noisy or anomalous to be useful for stable adaptation. Therefore, KAN-CLUE focuses on samples in an intermediate regime of informativeness. A simple selection rule can be expressed using two constants
and
, with
, and an OOD threshold
. The sample at time
t is considered for inclusion in the buffer if
that is, if it has moderate uncertainty or if it lies significantly outside the training distribution. When (
25) holds and the buffer is not yet full, the sample is appended to
. If the buffer is full, a replacement strategy is used, such as discarding the oldest entry (first-in first-out) or preferentially removing samples with low uncertainty that are less likely to drive useful updates.
The contents of the buffer must be associated with labels in order to perform supervised continual learning updates. In some scenarios, ground-truth labels for online samples may be available, for example through manual annotation or explicit driver feedback (such as a button indicating that the driver feels drowsy). Let
denote the true class label for sample
t, if available, and let
be its one-hot encoding. In this case, the stored label component
in (
23) is set to the ground-truth one-hot vector:
In many realistic deployments, however, explicit labels may not be available or may be provided only sporadically. Under such constraints, KAN-CLUE can operate with weak or proxy labels derived from heuristic rules, physiological signals, or aggregated model predictions.
One possible weak labeling strategy is to combine the model’s own predictions over short time windows with simple heuristics based on observable quantities such as eye closure duration or PERCLOS (percentage of eyelid closure). For example, if a sequence of frames exhibits prolonged eye closure or a high PERCLOS value, the corresponding samples can be weakly labeled as “fatigued” even in the absence of explicit ground truth. Formally, a weak label
is assigned based on a function
that maps observable features (including but not limited to the model output) to a one-hot vector:
where
denotes a simple eye-closure metric at time
t and the ellipsis represents other possible indicators such as blink rate or head pose cues. The function
can be implemented as a thresholding rule that associates high-eye-closure intervals with fatigued labels and low-eye-closure intervals with alert labels, leaving ambiguous cases unlabeled or labeled as “unknown” and not used for training.
Alternatively, in a self-supervised or unsupervised adaptation scenario where no labels or reliable proxies are available, KAN-CLUE can still exploit the stored samples to refine its internal representation without relying on explicit class labels. This can be achieved by using pseudo-labels derived from the model’s own high-confidence predictions, or by employing auxiliary consistency objectives that encourage stability of predictions under data augmentation or temporal perturbations. For pseudo-labeling, a sample is assigned a pseudo-label
equal to
from (
22) only if its uncertainty
is below a stricter threshold
:
with undefined labels excluded from supervised updates. In this way, only highly confident predictions contribute to self-training, which mitigates the risk of reinforcing incorrect labels.
Regardless of the specific source of labels—true labels, weak labels, or pseudo-labels—the buffer thus contains a small set of representative and informative samples that characterize the new operating regime encountered by the system. During idle periods or scheduled adaptation intervals, the KAN-CLUE framework uses these buffered samples to perform regularized updates of the KAN parameters on-device, as described in the subsequent subsections. This online data collection strategy is therefore a crucial link between uncertainty-aware prediction and resource-constrained continual learning in TinyML-based driver fatigue detection.
3.5.2. Sample Selection Using Uncertainty and OOD
The uncertainty and out-of-distribution scores produced by the evidential KAN head play a central role in deciding which samples should be stored in the replay buffer and subsequently used for continual learning. At each time step t, the model processes an input and outputs the class-probability vector , the scalar uncertainty score , and the OOD score . The objective of the selection strategy is to focus limited memory and adaptation capacity on samples that are informative about the current distribution shift, while avoiding both uninformative and overly noisy examples.
Conceptually, samples with very low uncertainty are already well explained by the current model and lie in regions of the input space that the model has seen frequently during training. Including too many such samples in the buffer would lead to redundant updates that bring little new information. Conversely, samples with extremely high uncertainty or very large OOD scores may correspond to severe noise, sensor glitches, or extreme outliers, which can destabilize the learning process if used directly for parameter updates. Therefore, the selection mechanism targets an intermediate regime of uncertainty, while also giving special attention to samples that exhibit clear signs of distribution shift.
To formalize this, two uncertainty thresholds
and
are introduced, with
and a threshold
is defined on the OOD score. A sample at time
t is considered eligible for storage in the buffer when its uncertainty falls within the prescribed interval,
which captures moderately uncertain predictions that are likely to be informative rather than purely noisy. In addition, samples with an OOD score exceeding the threshold,
are also marked as candidates for storage, since they signal a potential distribution shift even if their uncertainty is not in the moderate range. In practice, the selection rule at time
t can be expressed as storing the sample whenever at least one of the conditions (
30) or (
31) is satisfied. When a candidate sample arrives and the buffer is full, a replacement policy is used that preferentially discards older or less informative samples, for instance by removing entries with low uncertainty or low OOD scores first.
Through (
29)–(
31), the model dynamically curates a compact set of samples that are most representative of the novel conditions encountered during deployment. These samples are therefore well suited to guide subsequent adaptation of the KAN parameters, while the avoidance of extremely low-uncertainty and extremely high-uncertainty examples helps maintain stability and efficiency in the continual learning process.
3.5.3. Parameter Update Scheme
Once the replay buffer has accumulated a small set of informative samples, the KAN-CLUE framework performs lightweight parameter updates in order to adapt to the new distribution while respecting TinyML constraints. Because memory and computation are limited, it is neither feasible nor desirable to update all parameters of the CNN and KAN head. Instead, only a restricted subset of parameters is adapted, and the updates are carried out intermittently, for example when the vehicle is stopped, when the driver is idle, or at low frequency during operation.
In the configuration considered here, the parameters chosen for adaptation are those of the final KAN-based classification stage, which directly maps the KAN hidden representation to class evidence. Let
denote the vector of parameters that are allowed to change online, and let
denote the original values of these parameters learned during offline training. A simple choice is to include in
the output layer weights and biases
while keeping all CNN parameters and spline control points
fixed. This already provides a degree of adaptation by reweighting the KAN hidden units according to the new operating conditions. An alternative, slightly more flexible scheme is to introduce a small adapter layer on top of the KAN hidden representation. For instance, one can define an additional linear mapping
where
denotes the first-layer KAN activations,
and
are adapter parameters, and
is a small adapter dimension. The logits are then computed from
rather than directly from
, and only the adapter parameters
and
are updated online. This isolates adaptation to a very small parameter subset and further reduces the risk of catastrophic forgetting.
Regardless of the exact choice of
, the continual learning updates are performed using mini-batches drawn from the buffer. Let
denote the current buffer contents, and let
denote a mini-batch of size
sampled from
. For each sample in
, the model computes the evidential KAN loss
as in (
12), where
is the stored label (true, weak, or pseudo) and
are the current Dirichlet parameters produced by the adapted model. To prevent the adapted parameters from drifting too far from their original values and thereby degrading performance on previously seen conditions, a regularization term is added that penalizes large deviations from
. A quadratic anchoring penalty of the form
is used, where
controls the strength of the constraint. The total loss for a mini-batch
is then given by
where
is the per-sample evidential loss from (
12) and
are computed with the current values of
.
The parameters
are updated by stochastic gradient descent or a related optimizer with a small learning rate
. A generic gradient descent update at adaptation step
can be written as
where
denotes the loss evaluated on the current mini-batch at step
. The number of adaptation steps
performed in one adaptation phase is kept small, for example on the order of a few tens of gradient steps, in order to limit computation and energy consumption.
From an operational perspective, these continual learning updates are scheduled so as not to interfere with real-time monitoring. One simple strategy is to trigger adaptation only when the vehicle is stationary, for example when the speed is zero or below a small threshold, or when the ignition is turned on or off and the microcontroller has some spare time before shutdown. Another strategy is to perform updates periodically at a low frequency, such as once every few minutes, while ensuring that the total number of gradient steps per unit time remains within the device’s energy budget. In both cases, the use of a small buffer, a restricted parameter subset, and a regularized loss in (
35) allows KAN-CLUE to gradually personalize its behavior to new drivers and conditions, without compromising its TinyML deployment constraints or its baseline performance on previously seen scenarios.
3.5.4. Regularization Against Catastrophic Forgetting (KAN-EWC-like)
While uncertainty-aware sample selection and restricted parameter updates already mitigate catastrophic forgetting, online adaptation can still degrade performance on previously learned conditions if the updated KAN parameters drift too far from their original values. To counter this effect in a more principled way, KAN-CLUE incorporates a regularization mechanism inspired by Elastic Weight Consolidation (EWC), tailored specifically to the structure of KAN. The central idea is to assign an importance score to each KAN parameter, with particular emphasis on the spline control points that define the univariate functions, and to penalize changes to parameters in proportion to their importance. Parameters that are critical for the original task are thus constrained to remain close to their offline values, while less important parameters are free to adapt more.
In the KAN head, each univariate spline function is parameterized by a set of control points. If the KAN layer has
hidden units and receives
input dimensions, and each univariate function uses
M spline basis functions, then the control points can be indexed by a single index
e that runs over all edge–basis combinations. Formally, each parameter
corresponds to a particular control point
, and the index set
collects all such edges:
For each
, the parameter value at the end of offline training is denoted by
. These offline values constitute the “reference” KAN configuration that should be preserved as much as possible while still allowing useful adaptation. The corresponding adapted value during online learning is denoted by
, and the deviation
measures how far the parameter has moved from its original setting.
To quantify the importance of each parameter
, an importance score
is computed offline using the original training data. Intuitively, parameters that have a strong influence on the training loss for the original task should receive higher importance and be penalized more strongly during online updates. One practical way to define
is to use a gradient-based approximation, reminiscent of the diagonal of the Fisher information matrix in EWC. Let
denote the original training dataset and
the offline training loss (for example the evidential loss in (
13)). For a given sample
from
, the gradient of the loss with respect to
is
where
denotes the Dirichlet parameters produced by the KAN head for input
under the offline-trained model. The importance score
is then defined as the average squared gradient over the training set:
This quantity approximates the sensitivity of the offline loss to changes in
: if small perturbations in
cause large changes in the loss, then
will be large, indicating that
is important and should be preserved during online adaptation. Conversely, parameters with small
can be modified more freely without significantly affecting the original performance.
The importance scores and the reference parameters are computed once after offline training and stored in non-volatile memory. Because only the KAN control points (and optionally a small subset of additional KAN parameters) are considered, the total number of importance scores remains manageable for TinyML deployment. During online learning, these scores are used to construct an EWC-like regularization term that penalizes deviations of the adapted parameters from their reference values in proportion to their importance.
Let
denote the loss used for online adaptation on buffered samples, such as
in (
35) without the anchoring term. The KAN-EWC-like regularized online loss is then defined as
where
is a hyperparameter that controls the overall strength of the regularization. The second term in (
40) acts as a quadratic penalty that grows rapidly when a highly important parameter
deviates from its original value
. Parameters with small
are effectively less constrained and can be adapted more freely to fit the new data in the replay buffer.
The gradient of the regularized loss with respect to
is given by
which can be seamlessly integrated into the gradient descent update rule in (
36). The additional term in (
41) pulls each parameter
back toward
with a strength proportional to its importance score
and the chosen
. This mechanism effectively creates a “soft constraint” that preserves the functionality learned during offline training, particularly for parts of the KAN head that are crucial for the original task.
From an implementation perspective, the EWC-like regularization requires storing only two additional quantities for each KAN control point: the reference value
and the importance score
. Both can be quantized to low-bit fixed-point representations to conform with TinyML memory constraints. Because the EWC penalty in (
40) is quadratic and separable across parameters, its computation during online updates involves only a small number of additional integer multiplications and additions per parameter, which adds negligible computational overhead relative to the main forward and backward passes.
By focusing the EWC-like regularization on the KAN spline control points, which encode the shape of the univariate nonlinearities, KAN-CLUE preserves the core structure of the learned representation while still allowing the output weights or small adapter layers to adjust to new conditions. This KAN-EWC-like mechanism thus provides a principled and efficient way to regularize online adaptation against catastrophic forgetting, ensuring that continual learning enhances performance in new regimes without sacrificing the reliability achieved during offline training on the DROZY dataset.