IP Library Granted Patent US 12,554,795
Granted Patent B2
US 12,554,795 · App. 17/706,298 · Granted Feb 17, 2026

Reducing class imbalance in machine-learning training dataset

Inventors: Jhelum Chakravorty (Montreal, CA); Nandinee Haq (Nepean, CA); Pawel Dawidowski (Malopolskie, PL)
Assignee: HITACHI ENERGY LTD
G06F18/2148G06F18/2431G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,554,795
App. No.
17/706,298
Granted
Feb 17, 2026
Kind
B2
Abstract

Class imbalance in a training dataset may negatively impact the accuracy of a machine-learning model in classifying rare events that are underrepresented in the training dataset. Training datasets comprising time-series data present a unique challenge. Accordingly, resampling techniques for up-sampling and/or down-sampling a training dataset of time series are disclosed. The up-sampling may respect the temporal correlation of time samples in the time series, while generating synthetic time series that mimic the feature values of time series belonging to the minority class. Down-sampling may be used to fine-tune the ratio of time series belonging to the minority class to the time series belonging to the majority class.

Claims (53)

1 . A method for reducing class imbalance in a training dataset for machine learning, the method comprising using at least one hardware processor to execute a process to:

receive at least a subset of a training dataset, the training dataset comprising a plurality of time series, each of the plurality of time series comprising a plurality of labeled time samples, each of the plurality of labeled time samples comprising a value of each of one or more features at a particular time within a time frame of the time series and a label representing one of a plurality of classes into which the time sample has been classified;

for each time series in the at least a subset of the training dataset,

identify a number of neighboring time series in the at least a subset of the training dataset based on a distance metric,

for each of one or more of the neighboring time series,

for each of the one or more features and for each of the plurality of labeled time samples in that neighboring time series, generate a synthetic value of the feature in a synthetic time sample, wherein, for each of the one or more features and for each of the plurality of labeled time samples in that neighboring time series, generating a synthetic value of the feature comprises

when the label of a corresponding labeled time sample in the time series represents a minority one of the plurality of classes, generating the synthetic value of the feature according to a first bias towards the minority class, and,

when the label of the corresponding labeled time sample in the time series does not represent the minority class, generate the synthetic value of the feature according to a second bias that is less biased towards the minority class than the first bias, and

generate a synthetic time series from the synthetic time samples comprising the synthetic values of the one or more features; and

add the generated synthetic time series to the training dataset.

2 . The method of claim 1 , wherein receiving at least a subset of a training dataset comprises selecting a random sample from the training dataset, wherein the random sample consists of a predefined number of time series.

3 . The method of claim 1 , wherein receiving at least a subset of a training dataset comprises selecting a sample, consisting of a predefined number of time series, from the training dataset, to contain a higher proportion of minority time series than non-minority time series, relative to the training dataset, wherein a minority time series is defined as a time series in which a majority of the plurality of labeled time samples comprise a label representing the minority class, and a non-minority time series is defined as a time series in which a majority of the plurality of labeled time samples comprise a label representing one of the plurality of classes that is not the minority class.

4 . The method of claim 1 , wherein the plurality of classes consists of two classes.

5 . The method of claim 1 , wherein the number of neighboring time series is a predefined number greater than one.

6 . The method of claim 1 , further comprising using the at least one hardware processor to, for each time series in the at least a subset of the training dataset, generate a predefined number of synthetic time series.

7 . The method of claim 6 , wherein generating a predefined number of synthetic time series comprises randomly selecting one of the identified number of neighboring time series to use to generate a synthetic time series until the predefined number of synthetic time series has been generated.

8 . The method of claim 1 , wherein the minority class is defined as one of the plurality of classes that is less represented by labels in the plurality of time samples in the plurality of time series in the training dataset than at least one other one of the plurality of classes.

9 . The method of claim 8 , wherein generating the synthetic value of the feature according to the first bias comprises adding a randomly generated value to the value of the feature in the corresponding labeled time sample in the time series.

10 . The method of claim 8 , wherein generating the synthetic value of the feature according to the second bias comprises:

calculating a distance between the value of the feature in the corresponding labeled time sample in the time series and the value of the feature in the labeled time sample in the neighboring time series;

randomly generating a scaling factor;

calculating a scaled value by multiplying the calculated distance by the randomly generated scaling factor; and

adding the scaled value to the value of the feature in the corresponding labeled time sample in the time series.

11 . The method of claim 10 , wherein, when the label of the corresponding labeled time sample in the time series does not represent the minority class and the label of the labeled time sample in the neighboring time series represents the minority class, a range of the scaling value is constrained to produce a scaled value that is closer to the value of the feature in the labeled time sample in the neighboring time series than to the value of the feature in the corresponding labeled time sample in the time series.

12 . The method of claim 10 , wherein, when the label of the corresponding labeled time sample in the time series does not represent the minority class and the label of the labeled time sample in the neighboring time series does not represent the minority class, a range of the scaling value is constrained to produce a scaled value that is closer to the value of the feature in the corresponding labeled time sample in the time series than to the value of the feature in the labeled time sample in the neighboring time series.

13 . The method of claim 1 , wherein generating the synthetic time series comprises labeling the synthetic time series with a label value derived based on a label representing one of the plurality of classes into which the time series is classified and a label representing one of the plurality of classes into which the neighboring time series is classified.

14 . The method of claim 13 , wherein the label value is further derived based on a distance between the synthetic time series and the time series and a distance between the synthetic time series and the neighboring time series.

15 . The method of claim 14 , wherein the plurality of classes consists of two classes, and the label value is derived by binarizing a value that is based on the distance between the synthetic time series and the time series and the distance between the synthetic time series and the neighboring time series.

16 . The method of claim 1 , further comprising using the at least one hardware processor to, after adding the generated synthetic time series to the training dataset, train a machine-learning algorithm using at least a portion of the training dataset.

17 . The method of claim 1 , wherein the one or more features represent parameters of an electrical system, and wherein at least one of the plurality of classes represents an action to be taken in response to an anomaly in the electrical system.

18 . A system comprising:

at least one hardware processor;

a memory storing software; and

the software configured to, when executed by the at least one hardware processor,

receive at least a subset of a training dataset, the training dataset comprising a plurality of time series, each of the plurality of time series comprising a plurality of labeled time samples, each of the plurality of labeled time samples comprising a value of each of one or more features at a particular time within a time frame of the time series and a label representing one of a plurality of classes into which the time sample has been classified,

for each time series in the at least a subset of the training dataset,

identify a number of neighboring time series in the at least a subset of the training dataset based on a distance metric,

for each of one or more of the neighboring time series,

for each of the one or more features and for each of the plurality of labeled time samples in that neighboring time series, generate a synthetic value of the feature in a synthetic time sample, wherein, for each of the one or more features and for each of the plurality of labeled time samples in that neighboring time series, generating a synthetic value of the feature comprises

 when the label of a corresponding labeled time sample in the time series represents a minority one of the plurality of classes, generating the synthetic value of the feature according to a first bias towards the minority class, and,

 when the label of the corresponding labeled time sample in the time series does not represent the minority class, generate the synthetic value of the feature according to a second bias that is less biased towards the minority class than the first bias, and

generate a synthetic time series from the synthetic time samples comprising the synthetic values of the one or more features, and

add the generated synthetic time series to the training dataset.

19 . A non-transitory computer-readable medium having instructions stored thereon, wherein the instructions, when executed by a processor, cause the processor to:

receive at least a subset of a training dataset, the training dataset comprising a plurality of time series, each of the plurality of time series comprising a plurality of labeled time samples, each of the plurality of labeled time samples comprising a value of each of one or more features at a particular time within a time frame of the time series and a label representing one of a plurality of classes into which the time sample has been classified;

for each time series in the at least a subset of the training dataset,

identify a number of neighboring time series in the at least a subset of the training dataset based on a distance metric,

for each of one or more of the neighboring time series,

for each of the one or more features and for each of the plurality of labeled time samples in that neighboring time series, generate a synthetic value of the feature in a synthetic time sample, wherein, for each of the one or more features and for each of the plurality of labeled time samples in that neighboring time series, generating a synthetic value of the feature comprises

when the label of a corresponding labeled time sample in the time series represents a minority one of the plurality of classes, generating the synthetic value of the feature according to a first bias towards the minority class, and,

when the label of the corresponding labeled time sample in the time series does not represent the minority class, generate the synthetic value of the feature according to a second bias that is less biased towards the minority class than the first bias, and

generate a synthetic time series from the synthetic time samples comprising the synthetic values of the one or more features; and

add the generated synthetic time series to the training dataset.

Assignments (2)
MERGER Recorded Nov 13, 2023
From: HITACHI ENERGY SWITZERLAND AG
To: HITACHI ENERGY LTD
Reel/Frame 065548/0918 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 28, 2022
From: CHAKRAVORTY, JHELUM; HAQ, NANDINEE; DAWIDOWSKI, PAWEL
To: HITACHI ENERGY SWITZERLAND AG
Reel/Frame 059417/0260 →
Continuity (1)
Related Publication 20230306079A1 · Sep 28, 2023
References Cited (13)
US 20100016740A1 · Sigg · 2010 [cited by examiner]
US 20210326680A1 · Chaaraoui et al. · 2021 [cited by applicant]
US 20220414526A1 · Darrah · 2022 [cited by examiner]
CN 105930856A · 2016 [cited by applicant]
CN 109993229A · 2019 [cited by applicant]
CN 111652268A · 2020 [cited by applicant]
JP 2013161298A · 2013 [cited by applicant]
WO 2020178936A1 · 2020 [cited by applicant]
WO 2022029844A1 · 2022 [cited by applicant]
Li et al., “Shapelets-based Data Augmentation for Time Series Classification”, 2021 20th IEEE International Conference on Machine Learning and Applications (ICMLA), p. 1373-1378, 978-1-6654-4337-1/21, DOI 10.1109/ICMLA5… [cited by applicant]
Cao et al., Integrated Oversampling for Imbalanced Time Series Classification, IEEE Transactions on Knowledge and Data Engineering, Dec. 2013, https://www.researchgate.net/publication/237053351, DOI: 10.1109/TKDE.2013.3… [cited by applicant]
Chawla et al., SMOTE: Synthetic Minority Over-sampling Technique, Journal of Artificial Intelligence Research 16 (2002), pp. 321-357, Jun. 2002, AI Access Foundation and Morgan Kaufmann Publishers, 38 pages. [cited by applicant]
Moniz et al., Resampling strategies for imbalanced time series forecasting, International Journal of Data Science and Analytics (2017) 3, pp. 161-181, DOI 10.1007/s41060-017-0044-3, Springer International Publishing Swi… [cited by applicant]