# US 2023/0410481 A1 · Machine learning method for continual learning and electronic device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0410481 A1
- Document ID: US20230410481A1
- Status: Published application
- Kind: A1
- Application number: 17/951,043
- Filed: 2022-09-22
- Published: 2023-12-21
- Earliest claimed: 2022-06-17
- Assignees: Wistron Corporation
- Applicants: Wistron Corporation
- Inventors: Jiun-In Guo; Cheng-Fu Liou
- Web page: https://patentgrep.com/patent/US20230410481A1

## CPC

- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06V 10/774: Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/09: Supervised learning
- G06V 10/32: Normalisation of the pattern dimensions
- G06V 10/7715: {Feature extraction, e.g. by transforming the feature space, e.g. multi-dimensional scaling [MDS]; Mappings, e.g. subspace methods}
- G06V 10/776: Validation; Performance evaluation
- G06V 10/82: using neural networks
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

A machine learning method for continual learning is provided, and the method includes following steps. Capturing an input image. Performing feature extraction on the input image by a plurality of sub-models to obtain a plurality of feature maps, where the sub-models correspond to a plurality of tasks, and the sub-models are determined by a neural network model and a plurality of channel-wise masks. Converting the feature maps into a plurality of energy scores. Selecting a target sub-model corresponding to a target task of the tasks from the sub-models according to the energy scores. Outputting a prediction result corresponding to the target task by the target sub-model.

## Claims

### Claim 1

A machine learning method for continual learning, comprising:
capturing an input image;
performing feature extraction on the input image by a plurality of sub-models to obtain a plurality of feature maps, wherein the sub-models correspond to a plurality of tasks, and the sub-models are determined by a neural network model and a plurality of channel-wise masks;
converting the feature maps into a plurality of energy scores;
selecting a target sub-model corresponding to a target task of the tasks from the sub-models according to the energy scores; and
outputting a prediction result corresponding to the target task by the target sub-model.

### Claim 2 (depends on 1)

The machine learning method according to claim 1, wherein the neural network model comprises at least one convolutional layer and at least one batch normalization layer.

### Claim 3 (depends on 2)

The machine learning method according to claim 2, wherein each of the channel-wise masks comprises a plurality of scaling factors of the at least one batch normalization layer, and the scaling factors are associated with a plurality of convolutional kernels of the at least one convolutional layer, wherein the step of performing the feature extraction on the input image by the sub-models to obtain the feature maps comprises:
putting the input image through the at least one convolutional layer to obtain an input feature map; and
performing normalization calculation on the input feature map and the scaling factors of each of the channel-wise masks through at least one batch normalization layer to obtain the feature maps.

### Claim 4 (depends on 3)

The machine learning method according to claim 3, wherein the normalization calculation is performed by a following formula:
{dot over (X)}=γlt×((X*−μlt)/σlt)+βlt
wherein {dot over (X)} is the feature maps, X* is the input feature map, γlt is the scaling factors, μlt is an average value, σlt is a standard deviation, and βlt is a shifting factor.

### Claim 5 (depends on 1)

The machine learning method according to claim 1, wherein the step of converting the feature maps into the energy scores is calculated by a following formula:
E
=
-
log
⁢
∑
c
=
1
C
′
exp
⁢
{
f
⁡
(
X
)
c
}
wherein E is the energy scores, f(X)c is a value of the feature maps in a class c, and C′ is the number of classes.

### Claim 6 (depends on 1)

The machine learning method according to claim 1, wherein the step of selecting the target sub-model corresponding to the target task of the tasks from the sub-models according to the energy scores comprises:
selecting a sub-model corresponding to a minimum value of the energy scores as the target sub-model.

### Claim 7 (depends on 1)

The machine learning method according to claim 1, wherein each of the channel-wise masks comprises a plurality of importance factors, and the step of performing the feature extraction on the input image by the sub-models to obtain the feature maps comprises:
putting the input image through the neural network model to obtain an output feature map;
performing an element-wise multiplication on the output feature map and the importance factors of each of the channel-wise masks to obtain the feature maps.

### Claim 8 (depends on 7)

The machine learning method according to claim 7, wherein the importance factors are calculated by a following formula:
IF
l
t
=
1
1
+
e
kx
l
t
wherein IFlt is the importance factors, xlt is the output feature map, and k is a parameter.

### Claim 9 (depends on 1)

The machine learning method according to claim 1, further comprising:
receiving training data associated with the tasks, wherein the training data comprise a training image and a class label corresponding to the training image;
performing the feature extraction on the training image according to the neural network model and the channel-wise masks to obtain a training feature map;
converting the training feature map into a feature energy score;
determining a loss function according to the class label, the channel-wise masks, and the feature energy score;
determining a backward propagation gradient according to the loss function; and
updating the neural network model and the channel-wise masks according to the backward propagation gradient, wherein the channel-wise masks correspond to the tasks, and a channel-wise mask of the channel-wise masks corresponding to at least one training task of the tasks is updated.

### Claim 10 (depends on 9)

The machine learning method according to claim 9, wherein the neural network model comprises at least one convolutional layer and at least one batch normalization layer, each of the channel-wise masks comprises a plurality of scaling factors of the at least one batch normalization layer, and the scaling factors are associated with a plurality of convolutional kernels of the at least one convolutional layer, wherein the step of performing the feature extraction on the training image according to the neural network model and the channel-wise masks to obtain the training feature map comprises:
putting the training image through the at least one convolutional layer to obtain an input feature map; and
performing normalization calculation on the input feature map and the scaling factors through the at least one batch normalization layer to obtain the training feature map.

### Claim 11 (depends on 10)

The machine learning method according to claim 10, wherein the loss function comprises a linear combination of:
a cross entropy loss;
a channel-wise mask polarization regularization term; and
an energy loss, wherein
the channel-wise mask polarization regularization term is associated with the scaling factors, and
the energy loss is associated with the feature energy score.

### Claim 12 (depends on 11)

The machine learning method according to claim 11, wherein the channel-wise mask polarization regularization term is associated with the scaling factors.

### Claim 13 (depends on 12)

The machine learning method according to claim 12, wherein the channel-wise mask polarization regularization term is calculated by a following formula:
Rs(r)=Σl=1LΣc=1C≡lk|l,ct|−|rl,ct−r|, r=Σl−1LΣc=1C≡lrl,ct/Σl=1Cl
wherein Rs(r) is the channel-wise mask polarization regularization term, rl,ct is the scaling factors, L the number of layers, Cl is the number of channels, and k is a parameter.

### Claim 14 (depends on 11)

The machine learning method according to claim 11, wherein the energy loss is calculated by a following formula:
LossE=max(0, Esame−ELsame)+max(0, ELdiff−Ediff)
wherein LossE is the energy loss, Esame is the energy score of samples of the same task, Ediff is the energy score of samples of different tasks, and ELsame and ELdiff are parameters.

### Claim 15 (depends on 10)

The machine learning method according to claim 10, wherein the step of updating the neural network model and the channel-wise masks according to the backward propagation gradient comprises:
determining a plurality of activation parameters according to the channel-wise masks;
adjusting the backward propagation gradient as an adjusted backward propagation gradient according to the activation parameters; and
updating the neural network model and the channel-wise masks according to the adjusted backward propagation gradient.

### Claim 16 (depends on 15)

The machine learning method according to claim 15, wherein the adjusted backward propagation gradient is calculated by a following formula:
g
l
′
=
(
1
-
act
⁡
(
γ
l
≤
t
)
)
⁢
g
l
,
{
act
⁡
(
x
)
=
1
⁢
if
⁢
x
≠
0
act
⁡
(
x
)
=
0
⁢
if
⁢
x
=
0
wherein g′l is the adjusted backward propagation gradient, gl is the backward propagation gradient, γl≤t is a cumulative maximum value of the scaling factors of task 1 to task t corresponding to convolutional parameters at a same location, and act(γl≤t) corresponds to the activation parameters determined by the cumulative maximum value γl≤t.

### Claim 17 (depends on 9)

The machine learning method according to claim 9, wherein each of the channel-wise masks comprises a plurality of importance factors, the loss function comprises an importance factor regularization term, and the importance factor regularization term is associated with the importance factors.

### Claim 18 (depends on 17)

The machine learning method according to claim 17, wherein the step of updating the neural network model and the channel-wise masks according to the backward propagation gradient comprises:
determining a plurality of activation parameters according to the channel-wise masks;
adjusting the backward propagation gradient as an adjusted backward propagation gradient according to the activation parameters; and
updating the neural network model and the channel-wise masks according to the adjusted backward propagation gradient, wherein the adjusted backward propagation gradient is calculated by a following formula:
g′l=(1−IFl≤t)gl
wherein g′l is the adjusted backward propagation gradient, gl is the backward propagation gradient, and IFl≤t is a cumulative maximum value of the importance factors of task 1 to task t corresponding to convolutional parameters at a same position.

### Claim 19

An electronic device for continual learning, comprising:
a storage medium, storing a plurality of modules; and
a processor, coupled to the storage medium and executes the modules, wherein the modules comprise:
an image capturing module, capturing an input image;
an inference module, performing feature extraction on the input image by a plurality of sub-models to obtain a plurality of feature maps, wherein the sub-models correspond to a plurality of tasks, the sub-models are determined by a neural network model and a plurality of channel-wise masks, the feature maps are converted into a plurality of energy scores, a target sub-model corresponding to a target task of the tasks is selected from the sub-models according to the energy scores, and a prediction result corresponding to the target task is output by the target sub-model.

### Claim 20 (depends on 19)

The electronic device according to claim 19, wherein the modules further comprise:
a training module, receiving training data associated with the tasks, wherein the training data comprise a training image and a class label corresponding to the training image; performing the feature extraction on the training image according to the neural network model and the channel-wise masks to obtain a training feature map; converting the training feature map into a feature energy score; determining a loss function according to the class label, the channel-wise masks, and the feature energy score; determining a backward propagation gradient according to the loss function; and updating the neural network model and the channel-wise masks according to the backward propagation gradient, wherein the channel-wise masks correspond to the tasks, and a channel-wise mask of the channel-wise masks corresponding to at least one training task of the tasks is updated.
