Further author information: (Send correspondence to Anton Orlichenko)
Anton Orlichenko: E-mail<EMAIL_ADDRESS>
# Identifiability in Functional Connectivity May Unintentionally Inflate
Prediction Results

Anton Orlichenko  Department of Biomedical Engineering, Tulane University, New
Orleans, LA, USA  Gang Qu  Department of Biomedical Engineering, Tulane
University, New Orleans, LA, USA  Kuan-Jui Su  School of Medicine, Tulane
University, New Orleans, LA, USA  Anqi Liu  School of Medicine, Tulane
University, New Orleans, LA, USA  Hui Shen  School of Medicine, Tulane
University, New Orleans, LA, USA  Hong-Wen Deng  School of Medicine, Tulane
University, New Orleans, LA, USA  Yu-Ping Wang  Department of Biomedical
Engineering, Tulane University, New Orleans, LA, USA

###### Abstract

Functional magnetic resonance (fMRI) is an invaluable tool in studying
cognitive processes in vivo. Many recent studies use functional connectivity
(FC), partial correlation connectivity (PC), or fMRI-derived brain networks to
predict phenotypes with results that sometimes cannot be replicated. At the
same time, FC can be used to identify the same subject from different scans
with great accuracy. In this paper, we show a method by which one can
unknowingly inflate classification results from 61% accuracy to 86% accuracy
by treating longitudinal or contemporaneous scans of the same subject as
independent data points. Using the UK Biobank dataset, we find one can achieve
the same level of variance explained with 50 training subjects by exploiting
identifiability as with 10,000 training subjects without double-dipping. We
replicate this effect in four different datasets: the UK Biobank (UKB), the
Philadelphia Neurodevelopmental Cohort (PNC), the Bipolar and Schizophrenia
Network for Intermediate Phenotypes (BSNIP), and an OpenNeuro Fibromyalgia
dataset (Fibro). The unintentional improvement ranges between 7% and 25% in
the four datasets. Additionally, we find that by using dynamic functional
connectivity (dFC), one can apply this method even when one is limited to a
single scan per subject. One major problem is that features such as ROIs or
connectivities that are reported alongside inflated results may confuse future
work. This article hopes to shed light on how even minor pipeline anomalies
may lead to unexpectedly superb results.

###### keywords:

fMRI, functional connectivity, identifiability, fingerprinting, replicability,
UKB, PNC, BSNIP, OpenNeuro

##  1 Introduction

Functional magnetic resonance is a non-invasive imaging modality that uses the
blood oxygen level dependent (BOLD) signal to infer the level of neural
activity in different regions of the brain. [1] fMRI has been used to localize
visual processing, [2] attention, [3][4] emotional processing, [5][6][7] and
language[8] to specific locations in the cortex. It has also been used to
identify hemispheric dominance for, e.g., language. [9] Functional
connectivity is the Pearson correlation between the time-varying BOLD signal
of different regions of the brain. [10] It has recently been used to predict
age, [11][12] sex, [13][14] general fluid intelligence, [15][14] pre-clinical
Alzheimer’s disease, [16] and schizophrenia. [17][18] Classification based on
4D fMRI images, not FC, is also an active area of research.[19] Naturally, the
ability to predict cognition-related endophenotypes or pre-clinical disease
status is an exciting avenue for translational applications.

Although fMRI offers unmatched ability to observe neural activity in vivo in
human subjects, there are two questions that must be addressed when
interpreting the results of predictive studies. First, are these studies meant
to establish a groundwork for a clinical system such as, e.g., an AI-based
breast cancer screening tool?[20] If so, then these studies must be validated
in a randomized trial with thousands of subjects.[21] By contrast, fewer than
1% of fMRI studies in 2017 and 2018 enrolled more than 100 subjects, with most
recruiting less than 30.[22] A large number of subjects is needed partly
because, in the past, fMRI has faced several replicability crises.[23] For
example, Bennett et al. (2010) made the case that multiple comparison
correction was indispensable in fMRI by revealing emotion-associated voxels in
a dead salmon.[24] It is suspicious that fMRI-based predictions of
schizophrenia status achieve above 90% accuracy with fewer than 100 training
subjects,[17][18] whereas genome-wide association studies find single-
nucleotide polymorphisms (SNPs) explain only 23% of schizophrenia
variance,[25] and prediction studies based on SNPs in the UK Biobank report a
maximum AUC of 0.71. [26] In fact, recent studies[27] and many recent posters
at OHBM 2023 give a classification accuracy for schizophrenia diagnosis using
FC (often times cited as the best metric) of 70-80%.[28][29][30]

If these pipelines are not meant to be introduced clinically, are they meant
to provide mechanistic insights into human cognition? This is more likely to
be the case, but there is sometimes a very loose interpretation of what FC
actually is. For example, the UKB description of fMRI processing[31] makes the
point that, compared to PC, FC “has various practical and interpretational
disadvantages including an inability to differentiate between directly
connected nodes and nodes that are only connected via an intermediate
node.”[32] Many recent studies also implicitly assume that connectivity in the
context of fMRI implies physical connections.[33]

In reality, there is no signal traveling from node to node: fMRI essentially
measures blood flow,[1] and any correlation-based metric is only looking at
how much the bandpass-filtered BOLD signals between two regions are in
sync.[10] Thus, at first order, fMRI is not measuring the electrical activity
of neurons or the release of neurotransmitters, although reframing the problem
as connectivity or graph edges may be a useful construct.[34] On the other
hand, fMRI has identified several robust characteristics of BOLD signal. In
particular, it has been shown that, on average, FC intensity decreases
progressing from children to young adults,[35] and that females have greater
relative intra-default mode network (DMN) connectivity compared to
males.[36][37] FC has also shown some ability to predict race, even between
different datasets,[38] and it has been used in mechanistic studies of
aggression related to olfactory stimulus. [39]

One thing that fMRI-based FC is very good at is identifying the same subject
from different scans, referred to as fingerprinting.[40] FC can easily achieve
60% fingerprinting accuracy,[40] and with post-processing, fingerprinting
accuracy can become greater than 95%.[41][42] Some studies have explicitly
aimed to improve prediction of Alzheimer’s disease by maximizing
identifiability after processing with PCA.[43] At the same time, recent work
shows that confounder elimination[44] or intentional but undetectable data
manipulation[45] can greatly improve prediction performance.

In this work, we present a procedure by which FC-based prediction results may
be unintentionally inflated. By including different scans of the same subject
in both train and test sets, the machine learning algorithm learns to memorize
subjects from different scans rather than to select task-specific features.
Connectivities or regions that are reported in such studies may confuse other
researchers when surveying the literature. Abu-Mostafa et al. (2012) gives the
example of a machine learning algorithm that was able to predict exchange rate
direction 52.1% of the time, resulting in a theoretical profit of 22% over 2
years.[46] In live trading, the program actually lost money. The reported
problem was that the training set was normalized using the statistics of the
entire cohort, and this was enough to poison the results.[46] If these
problems show up in finance, where money is on the line, then we posit it may
be prudent to look for them in scientific procedures as well.

##  2 Methods

We first present the procedure for exploiting identifiability by treating
independent scans as independent subjects. Second, we describe what we mean by
identifiability or fingerprinting. Third, we give a brief review of how we
derive FC or dFC from 4D fMRI volumes. Finally, we list revelant
characteristics of the four datasets used in this study.

###  2.1 Procedure for Exploiting Identifiability

The procedure for exploiting identifiability is simple, and example code
demonstrating exploitation of identifiability is provided in the link in the
footnote.111https://github.com/aorliche/fc-identifiability-exploit When
multiple longitudinal or contemporaneous scans of the same subject are
available, treat these scans as independent subjects when creating training
and test sets. If only one subject scan is available, use dynamic functional
connectivity to create FC from multiple non-overlapping windows, and treat
these FC matrices as independent subjects. In our experiments, to highlight
the maximum possible gap in prediction, each subject has one scan in the
training set and one scan in the test set. A random distribution of scans will
achieve an accuracy somewhere between the double-dipping and legitimate
results.

###  2.2 Identifiability

We define successful identification (identifiability) of a subject as a same-
subject, different-scan FC pair having a higher cosine similarity (Equation 1)
compared to all other scan pairs in the cohort, where $\mathbf{a}$ and
$\mathbf{b}$ are vectorized subject FCs. An alternative is to use Euclidean
distance as the similarity metric; the numbers we present, however, are based
on cosine similarity.

$\text{sim}(\mathbf{a},\mathbf{b})=\frac{\mathbf{a}^{\text{T}}\mathbf{b}}{{\lVert\mathbf{a}\rVert}_{2}{\lVert\mathbf{b}\rVert}_{2}}$
(1)

We see in Figure 1 that plain FC has 62.5% identiability among 3,843 subjects
in the PNC dataset. With preprocessing, this number can be increased to
97.3%.[40][41][42]

Figure 1: Demonstration of identifiability/fingerprinting with plain FC (62.5%
left) vs with FC factor analysis residual (84.9% middle) vs with FC angle
basis residual (97.3% right). Among 1,529 subjects having 3,843 scans, same-
subject, different-scan FC has the highest cosine similarity among all scan
pairs 62.5% of the time. Scans from the PNC dataset. Reproduced from
Orlichenko et al. (2023).[42]

###  2.3 Functional and Dynamic Functional Connectivity

First, we register 4D fMRI volumes into MNI space using
SPM12.222http://www.fil.ion.ucl.ac.uk/spm/software/spm12/ Second, we identify
regions of interest and extract the BOLD signal from those regions. These
regions may be defined either using ICA[47] or a template. We use the Power264
template in this work.[48] Third, we bandpass filter these timeseries within a
0.01 to 0.15 Hz envelope. This removes both low-frequency scanner drift and
high-frequency noise as well as heartbeat and breathing signal. Finally, we
calculate the Pearson correlation between the timeseries of each region to
find the region-to-region FC. This symmetric matrix is reduced to the upper
right triangle and vectorized. The entire procedure is illustrated in Figure
2.

When no longitudinal or contemporaneous scans are available for a subject, we
create multiple FC matrices from the same scan using windowing in time. Non-
overlapping windows of the bandpass-filtered timeseries are used to create
multiple FC matrices. In this study we use a window size of $N=50$ repetition
times (TRs).

Figure 2: Illustration of the pipeline for creating FC matrices from fMRI
data.

###  2.4 Predictive Models

We use simple logistic and ridge regression models for all predictive tasks.
The scikit-learn implementation[49] is used in all cases.333https://scikit-
learn.org/stable/ All prediction tasks are performed with an 80/20
training/test split, over 20 bootstrap iterations. The optimal hyperparameter
(there is only one for both logistic and ridge regression) is chosen via grid
search with grid locations at powers-of-ten intervals, i.e., on a logarithmic
grid.

###  2.5 Datasets

We verify the potential of identiability to skew results in a favorable manner
on four different datasets: the UK Biobank, the Philadelphia
Neurodevelopmental Cohort, the Bipolar and Schizophrenia Network for
Intermediate Phenotypes, and an OpenNeuro Fibromyalgia dataset.

####  2.5.1 UK Biobank (UKB)

We have processed the scans of more than 40,000 UK Biobank[50] subjects using
SPM12. Of these, 2,722 subjects have two longitudinal scans, taken
approximately two years apart. An additional 154 subjects have the second scan
but not the first, resulting from quality control or a failure in our pipeline
during pre-processing. We use the longitudinal subjects to predict age and
genetic sex. We also predict age and sex on the non-longitudinal cohort in
order to provide a baseline for model performance without double-dipping.

####  2.5.2 Philadelphia Neurodevelopmental Cohort (PNC)

The Philadelphia Neurodevelopmental Cohort is a dataset of 9,267 children and
young adults aged 8-23 years old containing demographics, cognitive battery,
questionaire responses, and SNP data.[51] Among the cohort, 1,529 subjects
have fMRI scans with up to 3 scanner tasks: resting state, working memory
(nback), and emotion identification (emoid).[52] The data includes Wide Range
Achievement Test (WRAT) scores[53] that have had the effects of age regressed
out. It has previously been shown that the ability to predict WRAT score from
FC was mostly due to the different distribution of WRAT scores among races and
the ability to predict race from FC.[38]

####  2.5.3 OpenNeuro Fibromyalgia Dataset (Fibro)

We include a 66-subject dataset of 33 female fibromyalgia patients and 33
female healthy controls from the OpenNeuro repository,[54] study identifier
ds004144.[55] Out of the entire cohort, 65 subjects have two different scans:
resting state and epr. A variety of medication, demographic, and questionnaire
data are available.

####  2.5.4 Bipolar and Schizophrenia Network for Intermediate Phenotypes
(BSNIP)

The Bipolar and Schizophrenia Network for Intermediate Phenotypes is a large
study of schizophrenia, bipolar, and schizoaffective disorder patients;
relatives of patients; and healthy controls from several sites.[56] Our data
contains 199 schizophrenia patients and 243 healthy controls. Patient sex is
slightly skewed toward males in the schizophrenia group. Only one scan is
available per subject, necessitating use of dFC in order to exploit
identifiability.

##  3 Results

We present a summary of our results in Table 1, before highlighting results in
each individual dataset.

Dataset | Task | Null Model | Best Prediction | Double-Dipping | Unintentional
---|---|---|---|---|---
|  |  |  | Prediction | Improvement
UKB | Sex (Accuracy) | $0.528$ | $0.82\pm 0.02$ | $0.89\pm 0.006$ | $\mathbf{7\%}$
UKB | Age (RMSE) | $7.68$ | $5.92\pm 0.03$ | $4.97\pm 0.50$ | $\mathbf{12.4\%}$
PNC | WRAT (RMSE) | $14.6$ | $14.45\pm 0.92$ | $11.0\pm 0.28$ | $\mathbf{23.6\%}$
Fibro | Diagnosis (Accuracy) | $0.51$ | $0.61\pm 0.17$ | $0.86\pm 0.038$ | $\mathbf{25\%}$
BSNIP | Diagnosis (Accuracy) | 0.5 | $0.78\pm 0.05$ | $0.89\pm 0.04$ | $\mathbf{11\%}$
Table 1: Prediction results with and without erroneous exploitation of
identifiability. Best Prediction for UKB is reported for 1350 subjects in the
training set, whereas for all other datasets it is reported with the maximum
number of training subjects available.

###  3.1 UKB

The accuracy of UKB predictions with and without unintentional identifiability
enhancement (double-dipping) is shown in Figure 3. We find that misusing
identifiability in the longitudinal cohort leads to prediction performance
with 50 subjects not matched by 10,000 training subjects in the full cohort.

Figure 3: Prediction performance in the UKB with and without misuse of
identifiability. Age prediction (left) and sex prediction (right). We find
misused identifiability can lead to superb results with very small number of
training subjects.

###  3.2 PNC

Figure 4 (top) shows the possibility of incorrectly attributing achievement
score prediction to fMRI because of a race confound.[38] In fact, an even
greater prediction accuracy can be achieved by treating independent scans as
different subjects, as seen in Figure 4 (bottom).

Figure 4: Incorrect attribution of FC ability to predict race as FC ability to
predict achievement score (top), and the greater predictive accuracy
enhancement possible by treating independent scans as independent subjects
(bottom). EA refers to European Ancestry and AA refers to African Ancestry.
Top graph from Orlichenko et al. (2023).[38]

###  3.3 Fibromyalgia

We see in Figure 5 that in cohorts with a limited number of subjects, such as
the Fibromyalgia dataset, the difference between proper and improper placement
of scans in training and test sets in term of prediction accuracy is
maximized.

Figure 5: Prediction accuracy in the Fibromyalgia dataset using resting state
scans as the training set and epr scans as the test set (and vice versa)
compared to performing prediction on only one set of scans.

###  3.4 BSNIP

As the BSNIP dataset only provides one scan per subject, identifiability
enhancement must rely on the use of dynamic functional connectivity, with
different windows treated as independent subjects. Identiability enhancement
(Figure 6) leads to predictive accuracy results in keeping with some of the
larger values found in the literature.

Figure 6: Schizophrenia diagnosis prediction using FC, correctly applied dFC,
and dFC with using different connectivity matrices as independent subjects. We
find that treating different FC matrices of the same subject as independent
subjects leads to skewing of prediction results.

##  4 Discussion

Various studies have examined the reproducibility of regions identified
through fMRI studies.[23][57] To our knowledge, few studies have examined the
reproducibility of, e.g., fMRI schizophrenia classification results. One
multi-site study did report classification accuracies of 79.8 to 97.1%,[58]
the lower end of which is consistent with our own findings. Another
methodology-based study found various methods to provide between 56.7 and
92.5% classification accuracy.[59] We use schizophrenia as an example, but any
type of phenotype prediction may be used instead. While not a predictive
study, van den Heuvel et al. (2017) showed that with a small number of
subjects, minor manipulation of proportional thresholding can cause group
differences to appear or disappear in an fMRI schizophrenia dataset.[60] There
is another effect where an artificially inflated 95% classification accuracy
existing in the literature may inhibit other researchers from publishing
results that only achieve a 70-80% accuracy in their own data.

There have been at least three recent high-profile cases of data manipulation
in academia: a Harvard scientist faking data,[61] a Stanford scientist
implicitly allowing graduate students to fake data,[62] and evidence of fake
graphs in a room temperature semiconductor publication.[63] We are not sure
how prevalent this practice is in the fMRI literature, but we think based on
evidence presented earlier that some misuse may occur, especially since we
provide a procedure by which one may misuse longitudinal or contemporaneous
scans unintentionally.

In regards to the UK Biobank, as more data is released, people may have a
greater opportunity to reuse longitudinal data from the same individuals for
prediction. Another potential unexplored effect is whether identifiability
extends to family members. In this case, FC similarity due to relatedness may
be mistaken for true FC-phenotype correlations.

###  4.1 Potential Solutions

The most obvious solution is not treating different scans as independent
subjects and not using different dynamic FC windows as independent subjects.
Otherwise, we recommend training a model on one dataset and testing on
another, thus eliminating the possibility of subject memorization.
Additionally, prediction results should be corroborated through different
machine learning models and methods. This means that a result should only be
considered valid when it is identified by several different models, not just a
single newly proposed model, except with good justification. The use of very
reduced feature sets (only up to 10 features per subject) may also hinder the
ability of complex models to memorize identifiable subject features, even
though predictive performance will almost certainly decrease. Finally, the use
of a mixup model, as found in the computer science literature, may be explored
as a mitigating strategy.[64]

##  5 Conclusion

We find that unintentional treatment of independent scans as independent
subjects can greatly increase predictive accuracy. Prediction accuracy is
increased by 7 to 25% compared to the best legitimate training procedure,
using a small fraction of training subjects. This highlights the importance of
reproducibility studies, as well as meaningful physiological interpretations
of prediction results in contrast to optimization of prediction accuracy. It
would be especially helpful if machine learning studies using neuroimaging
data made proposals that could be tested in an independent manner.

##  6 Acknowledgements

The authors would like acknowledge the NIH (grants R01 GM109068, R01 MH104680,
R01 MH107354, P20 GM103472, R01 EB020407, R01 EB006841, R56 MH124925) and NSF
(grant #1539067) for partial funding support.

fMRI and phenotype data for the PNC dataset came from the Neurodevelopmental
Genomics: Trajectories of Complex Phenotypes database of genotypes and
phenotypes repository, dbGaP Study Accession ID phs000607.v3.p2. The authors
would also like to thank the UK Biobank (UKB application ID 61915), the BSNIP
study organizers, and OpenNeuro as well as the Fibromyalgia dataset curators
for making data publicly available or available to authorized researchers.

## References

  * [1] Belliveau, J. W., Kennedy, D. N., McKinstry, R. C., Buchbinder, B. R., Weisskoff, R. M., Cohen, M. S., Vevea, J. M., Brady, T. J., and Rosen, B. R., “Functional mapping of the human visual cortex by magnetic resonance imaging.,” Science 254 5032, 716–9 (1991).
  * [2] Cox, D. D. and Savoy, R. L., “Functional magnetic resonance imaging (fMRI) “brain reading”: detecting and classifying distributed patterns of fMRI activity in human visual cortex,” Neuroimage 19, 261–270 (June 2003).
  * [3] Coull, J. T. and Nobre, A. C., “Where and when to pay attention: the neural systems for directing attention to spatial locations and to time intervals as revealed by both PET and fMRI,” J. Neurosci. 18, 7426–7435 (Sept. 1998).
  * [4] Pugh, K. R., Shaywitz, B. A., Shaywitz, S. E., Fulbright, R. K., Byrd, D., Skudlarski, P., Shankweiler, D. P., Katz, L., Constable, R. T., Fletcher, J., Lacadie, C., Marchione, K., and Gore, J. C., “Auditory selective attention: An fMRI investigation,” Neuroimage 4, 159–173 (Dec. 1996).
  * [5] Phan, K. L., Wager, T., Taylor, S. F., and Liberzon, I., “Functional neuroanatomy of emotion: a meta-analysis of emotion activation studies in PET and fMRI,” Neuroimage 16, 331–348 (June 2002).
  * [6] Ochsner, K. N., Bunge, S. A., Gross, J. J., and Gabrieli, J. D. E., “Rethinking feelings: An fmri study of the cognitive regulation of emotion,” Journal of Cognitive Neuroscience 14(8), 1215–1229 (2002).
  * [7] Koelsch, S., Fritz, T., Cramon, V, D. Y., Müller, K., and Friederici, A. D., “Investigating emotion with music: an fMRI study,” Hum. Brain Mapp. 27, 239–250 (Mar. 2006).
  * [8] Hernandez, A. E., Dapretto, M., Mazziotta, J., and Bookheimer, S., “Language switching and language representation in Spanish-English bilinguals: an fMRI study,” Neuroimage 14, 510–520 (Aug. 2001).
  * [9] Szaflarski, J. P., Holland, S. K., Schmithorst, V. J., and Byars, A. W., “fMRI study of language lateralization in children and adults,” Hum. Brain Mapp. 27, 202–212 (Mar. 2006).
  * [10] van den Heuvel, M. P. and Hulshoff Pol, H. E., “Exploring the brain network: a review on resting-state fMRI functional connectivity,” Eur. Neuropsychopharmacol. 20, 519–534 (Aug. 2010).
  * [11] Orlichenko, A., Qu, G., Zhang, G., Patel, B., Wilson, T. W., Stephen, J. M., Calhoun, V. D., and Wang, Y.-P., “Latent similarity identifies important functional connections for phenotype prediction,” IEEE Transactions on Biomedical Engineering 70(6), 1979–1989 (2023).
  * [12] Hu, W., Cai, B., Zhang, A., Calhoun, V. D., and Wang, Y.-P., “Deep collaborative learning with application to the study of multimodal brain development,” IEEE Transactions on Biomedical Engineering 66(12), 3346–3359 (2019).
  * [13] İçer, S., İrem Acer, and Baş, A., “Gender-based functional connectivity differences in brain networks in childhood,” Computer Methods and Programs in Biomedicine 192, 105444 (2020).
  * [14] Sen, B. and Parhi, K. K., “Predicting biological gender and intelligence from fmri via dynamic functional connectivity,” IEEE Transactions on Biomedical Engineering 68(3), 815–825 (2021).
  * [15] Qu, G., Xiao, L., Hu, W., Wang, J., Zhang, K., Calhoun, V. D., and ping Wang, Y., “Ensemble manifold regularized multi-modal graph convolutional network for cognitive ability prediction,” IEEE Transactions on Biomedical Engineering 68, 3564–3573 (2021).
  * [16] Millar, P. R., Luckett, P. H., Gordon, B. A., and Benzinger, T. L., “Predicting brain age from functional connectivity in symptomatic and preclinical alzheimer disease,” NeuroImage 256, 119228 (2022).
  * [17] Wang, S., Zhan, Y., Zhang, Y., Lyu, L., Lyu, H., Wang, G., Wu, R., Zhao, J., and Guo, W., “Abnormal long- and short-range functional connectivity in adolescent-onset schizophrenia patients: A resting-state fMRI study,” Progress in Neuro-Psychopharmacology and Biological Psychiatry 81, 445–451 (Feb. 2018).
  * [18] Rashid, B., Arbabshirani, M. R., Damaraju, E., Cetin, M. S., Miller, R., Pearlson, G. D., and Calhoun, V. D., “Classification of schizophrenia and bipolar patients using static and dynamic resting-state fMRI brain connectivity,” Neuroimage 134, 645–657 (July 2016).
  * [19] Shamrat, F. M. J. M., Akter, S., Azam, S., Karim, A., Ghosh, P., Tasnim, Z., Hasib, K. M., De Boer, F., and Ahmed, K., “Alzheimernet: An effective deep learning based proposition for alzheimer’s disease stages classification from functional brain changes in magnetic resonance images,” IEEE Access 11, 16376–16395 (2023).
  * [20] McKinney, S. M., Sieniek, M., Godbole, V., Godwin, J., Antropova, N., Ashrafian, H., Back, T., Chesus, M., Corrado, G. S., Darzi, A., Etemadi, M., Garcia-Vicente, F., Gilbert, F. J., Halling-Brown, M., Hassabis, D., Jansen, S., Karthikesalingam, A., Kelly, C. J., King, D., Ledsam, J. R., Melnick, D., Mostofi, H., Peng, L., Reicher, J. J., Romera-Paredes, B., Sidebottom, R., Suleyman, M., Tse, D., Young, K. C., De Fauw, J., and Shetty, S., “International evaluation of an AI system for breast cancer screening,” Nature 577, 89–94 (Jan. 2020).
  * [21] Salehinejad, H., Kitamura, J., Ditkofsky, N. G., Lin, A. W., Bharatha, A., Suthiphosuwan, S., Lin, H.-M., Wilson, J. R., Mamdani, M., and Colak, E., “A real-world demonstration of machine learning generalizability in the detection of intracranial hemorrhage on head computerized tomography,” Scientific Reports 11 (2021).
  * [22] Szucs, D. and Ioannidis, J. P., “Sample size evolution in neuroimaging research: An evaluation of highly-cited studies (1990–2012) and of latest practices (2017–2018) in high-impact journals,” NeuroImage 221, 117164 (2020).
  * [23] Chen, X., Lu, B., and Yan, C.-G., “Reproducibility of R-fMRI metrics on the impact of different strategies for multiple comparison correction and sample sizes,” Hum. Brain Mapp. 39, 300–318 (Jan. 2018).
  * [24] Bennett, C. M. and Miller, M. B., “How reliable are the results from functional magnetic resonance imaging?,” Ann. N. Y. Acad. Sci. 1191, 133–155 (Mar. 2010).
  * [25] Lee, S. H., The Schizophrenia Psychiatric Genome-Wide Association Study Consortium (PGC-SCZ), DeCandia, T. R., Ripke, S., Yang, J., Sullivan, P. F., Goddard, M. E., Keller, M. C., Visscher, P. M., Wray, N. R., The International Schizophrenia Consortium (ISC), and The Molecular Genetics of Schizophrenia Collaboration (MGS), “Estimating the proportion of variation in susceptibility to schizophrenia captured by common SNPs,” Nat. Genet. 44, 247–250 (Mar. 2012).
  * [26] Bracher-Smith, M., Rees, E., Menzies, G., Walters, J. T. R., O’Donovan, M. C., Owen, M. J., Kirov, G., and Escott-Price, V., “Machine learning for prediction of schizophrenia using genetic and demographic factors in the UK biobank,” Schizophr. Res. 246, 156–164 (Aug. 2022).
  * [27] Caputi, L., Pidnebesna, A., and Hlinka, J., “Promises and pitfalls of topological data analysis for brain connectivity analysis,” Neuroimage 238, 118245 (Sept. 2021).
  * [28] Buckova, B. R., Erus, G., Spaniel, F., Davatzikos, C., and Hlinka, J., “Multimodal analysis of second-level neuroimaging features to identify first-episode schizophrenia,” Poster presented at OHBM 2023 (2023).
  * [29] Popov, P., Mahmood, U., Kolesnikov, S., and Plis, S., “An mlp that could: A simple model with remarkable accuracy on fmri prediction tasks,” Poster presented at OHBM 2023 (2023).
  * [30] Kanyal, A., Kandula, S., Calhoun, V., and Ye, D. H., “Deep learning on multimodal neuroimaging data for schizophrenia classification,” Poster presented at OHBM 2023 (2023).
  * [31] Smith, S. M., Alfaro-Almagro, F., and Miller, K. L., “Uk biobank brain imaging documentation,” tech. rep., UK Biobank (September 2022).
  * [32] Smith, S. M., “The future of FMRI connectivity,” Neuroimage 62, 1257–1266 (Aug. 2012).
  * [33] Bastos, A. M. and Schoffelen, J.-M., “A tutorial review of functional connectivity analysis methods and their interpretational pitfalls,” Front. Syst. Neurosci. 9, 175 (2015).
  * [34] Cui, H., Dai, W., Zhu, Y., Kan, X., Gu, A. A. C., Lukemire, J., Zhan, L., He, L., Guo, Y., and Yang, C., “Braingb: A benchmark for brain network analysis with graph neural networks,” IEEE Transactions on Medical Imaging 42(2), 493–506 (2023).
  * [35] Dosenbach, N. U. F., Nardos, B., Cohen, A. L., Fair, D. A., Power, J. D., Church, J. A., Nelson, S. M., Wig, G. S., Vogel, A. C., Lessov-Schlaggar, C. N., Barnes, K. A., Dubis, J. W., Feczko, E., Coalson, R. S., Pruett, Jr, J. R., Barch, D. M., Petersen, S. E., and Schlaggar, B. L., “Prediction of individual brain maturity using fMRI,” Science 329, 1358–1361 (Sept. 2010).
  * [36] Mak, L. E., Minuzzi, L., MacQueen, G., Hall, G., Kennedy, S. H., and Milev, R., “The default mode network in healthy individuals: A systematic review and meta-analysis,” Brain Connect. 7, 25–33 (Feb. 2017).
  * [37] Ficek-Tani, B., Horien, C., Ju, S., Xu, W., Li, N., Lacadie, C., Shen, X., Scheinos, D., Constable, T., and Fredericks, C., “Sex differences in default mode network connectivity in healthy aging adults,” Cereb. Cortex (Dec. 2022).
  * [38] Orlichenko, A., Daly, G., Liu, A., Shen, H., Deng, H.-W., and Wang, Y.-P., “ImageNomer: developing an fMRI and omics visualization tool to detect racial bias in functional connectivity,” (2023).
  * [39] Mishor, E., Amir, D., Weiss, T., Honigstein, D., Weissbrod, A., Livne, E., Gorodisky, L., Karagach, S., Ravia, A., Snitz, K., Karawani, D., Zirler, R., Weissgross, R., Soroka, T., Endevelt-Shapira, Y., Agron, S., Rozenkrantz, L., Reshef, N., Furman-Haran, E., Breer, H., Strotmann, J., Uebi, T., Ozaki, M., and Sobel, N., “Sniffing the human body volatile hexadecanal blocks aggression in men but triggers aggression in women,” Sci. Adv. 7, eabg1530 (Nov. 2021).
  * [40] Finn, E. S., Shen, X., Scheinost, D., Rosenberg, M. D., Huang, J., Chun, M. M., Papademetris, X., and Constable, R. T., “Functional connectome fingerprinting: identifying individuals using patterns of brain connectivity,” Nat. Neurosci. 18, 1664–1671 (Nov. 2015).
  * [41] Cai, B., Zhang, G., Hu, W., Zhang, A., Zille, P., Zhang, Y., Stephen, J. M., Wilson, T. W., Calhoun, V. D., and Wang, Y.-P., “Refined measure of functional connectomes for improved identifiability and prediction,” Hum. Brain Mapp. 40, 4843–4858 (Nov. 2019).
  * [42] Orlichenko, A., Qu, G., Zhou, Z., Ding, Z., and Wang, Y.-P., “Angle basis: A generative model and decomposition for functional connectivity,” (2023).
  * [43] Svaldi, D. O., Goñi, J., Abbas, K., Amico, E., Clark, D. G., Muralidharan, C., Dzemidzic, M., West, J. D., Risacher, S. L., Saykin, A. J., and Apostolova, L. G., “Optimizing differential identifiability improves connectome predictive modeling of cognitive deficits from functional connectivity in alzheimer’s disease,” Hum. Brain Mapp. 42, 3500–3516 (Aug. 2021).
  * [44] Hamdan, S., Love, B. C., von Polier, G. G., Weis, S., Schwender, H., Eickhoff, S. B., and Patil, K. R., “Confound-leakage: Confound removal in machine learning leads to leakage,” (2022).
  * [45] Rosenblatt, M., Rodriguez, R. X., Westwater, M. L., Dai, W., Horien, C., Greene, A. S., Constable, R. T., Noble, S., and Scheinost, D., “Connectome-based machine learning models are vulnerable to subtle data manipulations,” Patterns (N. Y.) , 100756 (May 2023).
  * [46] Abu-Mostafa, Y. S., Magdon-Ismail, M., and Lin, H.-T., [Learning from Data ], AMLBook (2012).
  * [47] Calhoun, V. D., Liu, J., and Adali, T., “A review of group ICA for fMRI data and ICA for joint inference of imaging, genetic, and ERP data,” Neuroimage 45, S163–72 (Mar. 2009).
  * [48] Power, J. D., Cohen, A. L., Nelson, S. M., Wig, G. S., Barnes, K. A., Church, J. A., Vogel, A. C., Laumann, T. O., Miezin, F. M., Schlaggar, B. L., and Petersen, S. E., “Functional network organization of the human brain,” Neuron 72, 665–678 (Nov. 2011).
  * [49] Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, E., “Scikit-learn: Machine learning in Python,” Journal of Machine Learning Research 12, 2825–2830 (2011).
  * [50] Sudlow, C., Gallacher, J., Allen, N., Beral, V., Burton, P., Danesh, J., Downey, P., Elliott, P., Green, J., Landray, M., Liu, B., Matthews, P., Ong, G., Pell, J., Silman, A., Young, A., Sprosen, T., Peakman, T., and Collins, R., “UK biobank: An open access resource for identifying the causes of a wide range of complex diseases of middle and old age,” PLoS Med. 12, e1001779 (Mar. 2015).
  * [51] Glessner, J. T., Reilly, M. P., Kim, C. E., Takahashi, N., Albano, A., Hou, C., Bradfield, J. P., Zhang, H., Sleiman, P. M. A., Flory, J. H., Imielinski, M., Frackelton, E. C., Chiavacci, R., Thomas, K. A., Garris, M., Otieno, F. G., Davidson, M., Weiser, M., Reichenberg, A., Davis, K. L., Friedman, J. I., Cappola, T. P., Margulies, K. B., Rader, D. J., Grant, S. F. A., Buxbaum, J. D., Gur, R. E., and Hakonarson, H., “Strong synaptic transmission impact by copy number variations in schizophrenia,” Proc. Natl. Acad. Sci. U. S. A. 107, 10584–10589 (June 2010).
  * [52] Satterthwaite, T. D., Elliott, M. A., Ruparel, K., Loughead, J., Prabhakaran, K., Calkins, M. E., Hopson, R., Jackson, C., Keefe, J., Riley, M., Mentch, F. D., Sleiman, P. M. A., Verma, R., Davatzikos, C., Hakonarson, H., Gur, R. C., and Gur, R. E., “Neuroimaging of the philadelphia neurodevelopmental cohort,” NeuroImage 86, 544–553 (2014).
  * [53] Sayegh, P., Arentoft, A., Thaler, N. S., Dean, A. C., and Thames, A. D., “Quality of education predicts performance on the wide range achievement test-4th edition word reading subtest.,” Archives of clinical neuropsychology : the official journal of the National Academy of Neuropsychologists 29 8, 731–6 (2014).
  * [54] Markiewicz, C. J., Gorgolewski, K. J., Feingold, F., Blair, R., Halchenko, Y. O., Miller, E., Hardcastle, N., Wexler, J., Esteban, O., Goncavles, M., Jwa, A., and Poldrack, R., “The OpenNeuro resource for sharing of neuroscience data,” Elife 10 (Oct. 2021).
  * [55] Balducci, T., Rasgado-Toledo, J., Valencia, A., van Tol, M.-J., Aleman, A., and Garza-Villarreal, E. A., “A behavioral, clinical and brain imaging dataset with focus on emotion regulation of females with fibromyalgia,” (2022).  doi:10.18112/openneuro.ds004144.v1.0.1.
  * [56] Tamminga, C. A., Pearlson, G., Keshavan, M., Sweeney, J., Clementz, B., and Thaker, G., “Bipolar and schizophrenia network for intermediate phenotypes: outcomes across the psychosis continuum,” Schizophr. Bull. 40 Suppl 2, S131–7 (Mar. 2014).
  * [57] Elliott, M. L., Knodt, A. R., Ireland, D., Morris, M. L., Poulton, R., Ramrakha, S., Sison, M. L., Moffitt, T. E., Caspi, A., and Hariri, A. R., “What is the test-retest reliability of common task-functional MRI measures? new empirical evidence and a meta-analysis,” Psychol. Sci. 31, 792–806 (July 2020).
  * [58] Salman, M. S., Verner, E., Bockholt, H. J., Fu, Z., Misiura, M., Baker, B. T., Osuch, E., Sui, J., and Calhoun, V. D., “Multi-study evaluation of neuroimaging-based prediction of medication class in mood disorders,” Psychiatry Res. Neuroimaging 333, 111655 (Aug. 2023).
  * [59] Zhang, Y., Zhang, H., Xiao, L., Bai, Y., Calhoun, V. D., and Wang, Y.-P., “Multi-modal imaging genetics data fusion via a hypergraph-based manifold regularization: Application to schizophrenia study,” IEEE Transactions on Medical Imaging 41(9), 2263–2272 (2022).
  * [60] van den Heuvel, M. P., de Lange, S. C., Zalesky, A., Seguin, C., Yeo, B. T. T., and Schmidt, R., “Proportional thresholding in resting-state fMRI functional connectivity networks and consequences for patient-control connectome studies: Issues and recommendations,” Neuroimage 152, 437–449 (May 2017).
  * [61] Simmons, J., Nelson, L., and Simonsohn, U., “[109] data falsificada (part 1): “clusterfake”.” https://datacolada.org/109 (2023).  Accessed: 2023-08-02.
  * [62] Baker, T., “Stanford president’s research under investigation for scientific misconduct, university admits ‘mistakes’.” https://stanforddaily.com/2022/11/29/stanford-presidents-research-under-investigation-for-scientific-misconduct-university-admits-mistakes/ (2023).  Accessed: 2023-08-02.
  * [63] Marel, D. v. d. and Hirsch, J. E., “Room-temperature superconductivity — or not? comment on Nature 586, 373 (2020) by e. snider et al.,” Int. J. Mod. Phys. B 37 (Feb. 2023).
  * [64] Zhang, H., Cisse, M., Dauphin, Y. N., and Lopez-Paz, D., “mixup: Beyond empirical risk minimization,” (2017).


# Real-time Caller Intent Detection In Human-Human Customer Support Spoken
Conversations

Author Name Affiliation<EMAIL_ADDRESS>Mrinal Rawat1 Victor Barres1
1Uniphore Software Systems Inc.
{mrinal.rawat<EMAIL_ADDRESS>
###### Abstract

Agent assistance during human-human customer support spoken interactions
requires triggering workflows based on the caller’s intent (reason for call).
Timeliness of prediction is essential for a good user experience. The goal is
for a system to detect the caller’s intent at the time the agent would have
been able to detect it (Intent Boundary). Some approaches focus on predicting
the output offline, i.e. once the full spoken input (e.g. the whole
conversational turn) has been processed by the ASR system. This introduces an
undesirable latency in the prediction each time the intent could have been
detected earlier in the turn. Recent work on voice assistants has used
incremental real-time predictions at a word-by-word level to detect intent
before the end of a command. Human-directed and machine-directed speech
however have very different characteristics. In this work, we propose to apply
a method developed in the context of voice-assistant to the problem of online
real time caller’s intent detection in human-human spoken interactions. We use
a dual architecture in which two LSTMs are jointly trained: one predicting the
Intent Boundary (IB) and then other predicting the intent class at the IB. We
conduct our experiments on our private dataset comprising transcripts of
human-human telephone conversations from the telecom customer support domain.
We report results analyzing both the accuracy of our system as well as the
impact of different architectures on the trade off between overall accuracy
and prediction latency.

##  1 Introduction

Conversational AI finds one a key application in reducing the time-to-
resolution of customer support calls. It does so by assisting the support
agents during a call as well as in their after call work Adam et al. (2021).
If after call work usually focuses on call disposition, assistance during the
call consists in triggering actions at the right time. Such actions can
encompass surfacing relevant information, extracting values from the ongoing
call, suggest strategies, etc. In this work, we focus on an application of
conversational AI to agent assistance during the call.

A typical contact center solution provides agents with predefined workflows to
follow depending on the caller’s intent. One of the first tasks of the agent
is therefore to recognize the reason for the call and select the appropriate
workflow. We will focus in this work on the goal of detecting the caller’s
intent in real time.

Although some systems are designed to operate directly on the speech signal,
we focus here on NLU solutions processing the output generated by an automated
speech recognition (ASR) system. ASR systems convert audio streams into output
word sequences. The frequency at which the output is generated vary. In this
work however, without loss of generality, we abstract away the considerations
related to ASR output frequencies by assuming that transcriptions will be
available one word at a time.

Previous attempts Chen et al. (2019); Haihong et al. (2019); Qin et al. (2019)
approached these problems using machine learning and deep learning based
techniques in which predictions are carried out at the end of each utterance
or turn. An obvious limitation is that the AI system has to wait until the
entire word sequence is available before triggering actions, even when enough
cues are available early on for a human to reliably trigger the same action.
Consider an example, i’m calling because i wanted to change my phone number
but aah if this call gets disconnected with you call me back, it is evident
that as soon as the word number appears, the agent can predict the caller’s
intent, but a model working on entire turns would have to wait till the word
back is available to generate its prediction.

A lag between machine prediction and human prediction can lead to increased
cognitive load and overall poor user experience. This could in turn make the
use of conversational AI systems counterproductive.

We propose a novel solution where we process the ASR output incrementally (one
word at a time) and generate a prediction at each step. Our approach comprises
of two step process 1) Intent Boundary (IB) detection: predicts whether the
input word is the end of the intent statement 2) Intent detection: predicts
the intent. Both these tasks are trained in a multi-task setting. Further, we
propose the use of lookahead i.e. incorporating future right context to assist
the intent boundary detection. We also study the model performance without the
intent boundary task. Finally, we propose two metrics Mean Turn Difference
(MTD) and Mean Position Difference (MPD) that aims to understand the effect of
the Intent Boundary task in the early prediction.

##  2 Related Work

Most of the previous research works mainly focus on intent detection using a
full input sequence. Guo et al. (2014); Zhang and Wang (2016); Kim et al.
(2017) proposes a method that aims to train the NLU tasks such as intent
detection, slot filling, etc. jointly using RNN and attention based
approaches. Recently, some works Qin et al. (2019) have also tried to use
transformers based architectures such as BERTDevlin et al. (2018). Wu et al.
(2020) proposes a two-pass refine mechanism to handle uncoordinated slots
problem. They claim to have better performance than CRF based architectures.

In recent years, the demand for real-time applications has increased
tremendously. This includes incremental processing of the sequence outputting
the prediction at each time step. Schlangen and Skantze (2009) first proposes
a way that requires the input to be continually processed based on incremental
input. Recently, Shivakumar et al. (2021) proposed a model that jointly trains
two tasks 1) Intent Detection and 2) End-of-sentence(EOS) boundary using LSTM
and generates the output at each time step. To imitate the real-time
processing the authors randomly concatenate the sentences from the ATIS
dataset and consider the last token as the EOS. Ma et al. (2019) also uses a
similar approach where they use an incremental encoder by limiting each source
word to attend to its previous input and recompute the representation.
Constantin et al. (2019) also process the input incrementally while boosting
the performance in noisy datasets using data augmentation techniques. A
thorough investigation of the use of non-incremental encoders such as
transformers for the incremental systems was conducted by Madureira and
Schlangen (2020). Kahardipraja et al. (2021) proposed an approach that uses a
restart-incrementally approach along with the linear transformers
Katharopoulos et al. (2020) that reduces the overall quadratic complexity to
linear. Our approach process the input sequence incrementally using the LSTM
network by incorporating the lookahead based intent detection.

##  3 Dataset

In this work, we use our organization’s private dataset which comprises
manually annotated transcripts of human-human spoken telephone conversation
from the telecom customer support domain. Transcripts were generated by our
in-house Kaldi-based ASR system, fine-tuned for this particular domain.
Speaker diarization and recognition was not required since agent’s and
customer’s speech was recorded on separate channels. Each transcript defines a
sequence of turns (single speech sequence until the other speaker starts
speaking). Each turn is and each turn is further broken into utterances based
on inter lexical pause duration. The time offsets for each word is provided by
the the ASR engine. We use this information to analyze the impact of real-time
prediction as compared to offline prediction. Table 1 describes an example
transcript where the highlighted text represents the span of the intent.

Agent | Customer
---|---
you’re welcome |
to XXX my |
name is XXX great |
how can i help |
you today |
| um yeah uh
| calling to i
| guess uh remove
| my grandma’s
| phone number
| from her account
⋮ | ⋮
Table 1: Example

We collect 1544 transcripts and asked annotators to highlight the first text
span that would allow a reasonable agent to identify the caller’s intent. We
also asked that the intent be classify into one of 16 different intent domain
relevant classes. Although in very few transcripts the caller mentions
multiple reasons for contacting customer support, the vast majority of the
transcripts contain a single intent. The goal is therefore to identify the
first and most often only intent stated by the customer.

For our work, we consider only the turns where the intent is present which
comprises of 1917 samples and is split into (80%) train, (20%) validation and
(20%) test sets. We provide the exact numbers for each split/class in Table 2
for clarity.

Split | Total
---|---
Training | 1526
Validation | 194
Test | 197
Total | 1917
Table 2: Dataset Statistics

Table 3 provides an example of training set which describes the input and
output format of both tasks. We set the IB token to 1 and rest of the tokens
to O.

Sentence | I | need | my | account | number | rotor | number ..
---|---|---|---|---|---|---|---
IB | O | O | O | O | 1 | O | O ..
Intent | O | O | O | O | AM | O | O ..

Table 3: Training example: AM refers to the ‘Account Management‘ intent.

(a) Distribution of offset difference

(b) Cumulative Distribution of offset difference

Figure 1: Distribution of the difference in the offset of intent statement and
end of the turn. Here the difference is in seconds

Figure 2: Real-Time Intent Detection Architecture

Further, we performed an analysis on the dataset to understand the advantages
of employing the real-time systems. We discover that 61.84 % of the
conversations had the intent at the end of the turn which implies that there
is no additional benefit of using a real-time system. In the remaining 38.16 %
transcripts, we plot the distribution of the difference in the offset of the
intent statement i.e. last uttered word of the highlighted intent statement
and the end of the turn (See Figure 1). This helps us to measure the average
time saved when our approach is used. This clearly demonstrates that in 80% of
the remaining calls the time duration between the statement of intent and the
end of the turn is less than 10 seconds.

##  4 Approach

In this section, we first discuss the methodology used for the offline intent
detection and then describe the real-time intent detection approach (See
Figure 2).

###  4.1 Offline Intent Detection (Turn Level

)

We use the standard LSTM architecture used in supervised classification
problem to detect the intent in an offline way. We use an entire input
sequence i.e. turn consisting of sequence of words $w=(w_{1},w_{2},...,w_{T})$
and pass it to an embedding layer. The output from the embedding layer is then
passed into a BiLSTM network which finally assigns an intent class $c$ from a
pre-defined set of intents, such that :

$\begin{split}\hat{c}=\underset{c}{arg\ max}\ \ P(c|w)\end{split}$ (1)

###  4.2 Real-time Intent Detection

We use a similar technique proposed by Shivakumar et al. (2021) for our
dataset. The approach comprises two tasks 1) Intent Boundary Detection and 2)
Intent Detection which is described below. Both the tasks use similar
architecture with slight modifications. To train the network in a real-time
setting, we pass the input sequence consisting of words
$w=(w_{1},w_{2},...,w_{T})$ incrementally, i.e. one word at a time. The input
word $w_{t}$ is passed to an embedding layer followed by a uni-directional
LSTM. Finally, we pass it to a dense layer and generate the output at each
time step. Since the processing is performed incrementally, we store the
hidden states generated by LSTM and forward them to the next word $w_{t+1}$.

  * •

Intent Boundary (IB) Detection : This task detects whether the given input
word is the intent boundary or not. Since there is no notion of boundary or
where to stop, thus we independently train the network with this objective. We
use the sigmoid activation function at the output since the task is the
binary-classification problem while keeping the rest of the architecture the
same. We use the binary focal loss described in Equation 2 as there is a huge
class imbalance in the IB task.

$\begin{split}L_{IB}&=-\frac{\alpha}{T}\sum_{t=1}^{T}(y_{t}(1-p_{t})^{\gamma}log(p_{t})+\\\
&(1-y_{t})(p_{t})^{\gamma}log(1-p_{t}))\end{split}$ (2)

where t is the $t^{th}$ time step, $\alpha$ and $\gamma$ are the hyper-
parameters of the focal loss Lin et al. (2017), $y_{t}$ is the ground truth,
and $p_{t}$ is the output from sigmoid function.

  * •

Intent Detection : We employ a similar method described above where we predict
the intent for each word. At the final level, we use the softmax function
since intent detection is a multi-class classification problem. We want to
highlight that the intent is the same for the entire sequence, hence we mask
the loss function with an indicator function and only compute loss at the
Intent boundary. The loss function used here is :

$L_{INT}=-\sum_{t=1}^{T}I_{IB}\sum_{c=1}^{C}y_{o,c}\ log\ \hat{y}_{o,c}$ (3)

where $T$ is the length of the sequence, $I_{IB}$ is equal to 1 at intent
boundary , $y_{o,c}$ is the actual ground truth if o belongs to class c,
$\hat{y}_{o,c}$ is the output from the network.

####  4.2.1 Multi-Task Training Objective

We train both the Intent Boundary (IB) and Intent detection jointly in a
multi-task setting where we share an embedding layer and create separate task-
specific LSTMs. We train the network with the following objective:

$Loss=\beta L_{IB}+(1-\beta)L_{INT}$ (4)

where $\beta$ is the hyperparmater used to assign weightage to the tasks. We
set the $\beta$ to 0.5 after performing a detailed empirical evaluation.

####  4.2.2 Lookahead based Intent Detection

Since the intent detection task is highly dependent on IB detection, improving
boundary detection task leads to better performance. We analyze the impact
that delaying prediction has on IB detection performance. To do so, we
experiment by adding the option of a lookahead i.e. including the future right
context where we shift the IB token and the intent token by $k$ words. We
evaluated lookahead of one, two and three and concluded that a lookahead of
more than one word didn’t correlate with better performance. Hence we set the
lookahead to 1 (See Table 4). We would also like to note that in the cases
where the IB is at the end of the turn, we compared appending for lookahead
either random word or the first token of the next turn after the end of the
turn. We found that the performance was identical, hence we use the randomly
selected token for lookahead. We use the same methodology as described in the
above section on the modified dataset.

Sentence | remove | my | grandma’s | phone | number | she | got ..
---|---|---|---|---|---|---|---
IB | O | O | O | O | 1 | O | O..
Intent | O | O | O | O | AM | O | O ..
|  |  |  |  | $\rightarrow$ |  |
IB (lookahead) | O | O | O | O | O | 1 | O..
Intent (lookahead) | O | O | O | O | O | AM | O ..

Table 4: Example sentence of lookahead based approach

####  4.2.3 Context based Detection

We further investigate the use of context in the intent detection task. We
hypothesize that the previous context, i.e previous $n$ turns, can assist the
network in improving the performance of the tasks. For instance, based on our
analysis we found that intent is usually present in the turn following the
agent’s greeting message e.g.

AGENT : Hello my name is James and how can i help you today
CUSTOMER: Hi uh i wanted to change my phone number.

To encode the context, we take the previous $3$111Selected with empirical
evaluation and manual analysis after trying 2, 3, 4 turns and concatenate them
and pass them to an LSTM layer. We further initialize the network for the IB
and intent detection with the hidden states generated from the context LSTM.
We note that the embedding layer is shared across the tasks and the rest of
the network is optimized using the method above.

| Intent Boundary | Intent @ OB | Intent @ PB | Intent
---|---|---|---|---
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1
Offline (Turn Level) | - | - | - | - | - | - | - | - | - | 0.4271 | 0.3120 | 0.3463
With Intent Boundary
Baseline | 0.4671 | 0.4702 | 0.4686 | 0.8285 | 0.8122 | 0.8205 | 0.3521 | 0.4745 | 0.389 | - | - | -
Baseline + Lookahead | 0.430 | 0.572 | 0.491 | 0.8259 | 0.8183 | 0.8221 | 0.255 | 0.4136 | 0.3032 | - | - | -
Baseline + Context | 0.4659 | 0.623 | 0.5328 | 0.8551 | 0.8375 | 0.8364 | 0.2194 | 0.4152 | 0.2814 | - | - | -
Without Intent Boundary
Intent + Lookahead | - | - | - | - | - | - | - | - | - | 0.399 | 0.5577 | 0.4532

Table 5: Evaluation of Intent Boundary (IB), Intent, Intent @ Oracle Boundary
(OB), and Intent @ Predicted Boundary (PB) on the test set using precision
(P), recall (R) and F1-score (F1).

##  5 Experimental Setup

We train both the tasks i.e 1)Intent Boundary Detection and 2) Intent
Detection in a multi-task learning framework. The embedding layer is
initialized randomly with the size 300 and is shared across both tasks. We use
task-specific separate LSTMs with hidden dimensions of 128 and the number of
layers as 2 for both tasks. We trained the network for 30 epochs using Adam
optimizer with a learning rate of 0.001 and drop out as 0.25. We use the focal
loss to optimize the IB task and set its hyperparameters $\alpha$ to 1 and
$\gamma$ to 8. We ran experiments multiple times to ensure model convergence.
All models are implemented in Pytorch Paszke et al. (2019).

###  5.1 Evaluation Metrics

We perform evaluation at two levels:

Model Evaluation:

We evaluate both the tasks along with the combined performance by looking at
precision, recall and f1-score computed on a test set composed only of turns
containing an intent.

Real Time Evaluation: Since the goal is for the model to operate on
conversations in real time, we analyze the intent detection performance on
temporally unfolding conversations. Given a transcript, the customer turns are
passed to the system in order, and each turn is processed one word at time.
The hidden states of the network are reset before a new turn starts. We stop
when an intent boundary and its associated intent class $c$ is detected (See
Algorithm 1). For the lookahead based approach, we also add a random token at
the end of the turn. We evaluate the performance of the real-time processing
using metrics defined below:

  * •

Accuracy: It is computed by comparing the first predicted intent and the
ground truth.

  * •

Accuracy at right turn: It is computed by comparing the first predicted intent
and the turn position with the ground truth intent and turn position.

  * •

Accuracy at right position: It is computed by comparing the first predicted
intent, turn position, and intent position within the turn with ground truth
intent, turn position, and intent word position.

  * •

Mean Turn Difference (MTD): The average difference between the ground truth
intent turn position and the predicted intent turn position.

$MTD=\frac{1}{N}\sum_{n=1}^{N}t_{n}-\hat{t}_{n}$ (5)

where N is the number of samples in the evaluation set, $t$ is the actual turn
position and $\hat{t}$ is the predicted turn position.

  * •

Mean Position Difference (MPD): The average difference between the ground
truth intent word position and the predicted intent word position.

$MPD=\frac{1}{N}\sum_{n=1}^{N}p_{n}-\hat{p}_{n}$ (6)

where N is the number of samples in the evaluation set, $p$ is the actual word
position and $\hat{p}$ is the predicted word position.

Input: transcripts $t$, model, true_intents

1

2

3$pred\\_intents\leftarrow\emptyset$;

4foreach  _$t_{i}\in t$_ do

5

6 foreach  _$turn\in t_{i}$_ do

7 $previous\\_intent\\_state\leftarrow\emptyset$;

8 $previous\\_ib\\_state\leftarrow\emptyset$;

9 if  _$turn[^{\prime}speaker^{\prime}]$ == ’customer’_ then

10 foreach  _$token\in turn$_ do

11 $o\\_ib$, $score$, $previous\\_ib\\_state$ $\leftarrow$
model.predict_ib($token$, $previous\\_ib\\_state$)

12 if  _$o\\_ib=1$ & $score>T$_ then

13 $o\\_int$, $previous\\_intent\\_state$ $\leftarrow$
model.predict_intent(token,

14 previous_intent_state)

15 $pred\\_intents.add$($o\\_int$);

16 break {turn loop};

17

18

19

20

21$Get\\_Metrics(true\\_intents,pred\\_intents)$

22

Algorithm 1 Pseudo-code for the real-time evaluation | Real-Time Evaluation
---|---
| Acc | Acc @ RT | Acc @ RP | MTD | MPD
Offline (Turn Level) | 0.7697 | 0.7236 | - | -0.78 | -
With Intent Boundary
Baseline | 0.7763 | 0.7631 | 0.3618 | -0.59 | -13.56
Baseline + Lookahead | 0.7894 | 0.7236 | 0.4539 | -0.88 | -19.56
Baseline + Context | 0.75 | 0.6578 | 0.4539 | -0.344 | -7.76
Without Intent Boundary
Intent + Lookahead | 0.8355 | 0.6842 | 0.4934 | 2.37 | 44.66
Table 6: Evaluation on the test set by simulating the conversation in real-
time using accuracy (Acc), accuracy at right turn (Acc @ RT), accuracy at
right position (Acc @ RP), mean turn difference (MTD), and mean position
difference (MPD)

##  6 Results & Discussion

We evaluate our approach using the metrics defined in Section 5.1 The overall
results are described in two parts 1) Evaluation of the test dataset created
using the intent statements from the transcripts 2) Evaluation of the test
data by simulating the actual conversation in a real time environment.

The results for part 1 are illustrated in Table 5 using the methods described
in Section 4. We break the results task wise where we describe the precision,
recall, and F1 score for Intent Boundary (IB) task, Intent @ oracle boundary
and Intent @ Predicted boundary. We can clearly see that incorporating
lookahead yields a better F1-score than the baseline method in the IB task
since we also provide the future context to the model. Further, we see that
adding context yields the best performance in the Intent Boundary task and
Intent @ OB task, but has the worst F1 score of intent @ PB which is the
metric we desire for better performance when used in real time setting.

We also investigate the model performance by excluding the Intent Boundary
objective. In contrast to the method described in Section 4, we compute the
loss at each time step since we do not train with explicit intent boundary in
this case. We achieve an F1-score of 0.4532 which is computed based on $c$
classes while excluding the $O$ class. Similar to the previous method, we also
incorporate the lookahead where we shift the intent towards the right.
Finally, we report the results on the offline methodology described in Section
4.1 where we classify the entire turn into one of the $c$ classes.

Further, we see that the addition of context did not improve the performance
proving our initial hypothesis wrong. We achieve an accuracy of 75 % which is
the worst amongst all. One of the reasons could be the long sequences due to
the addition of context which negatively affected the LSTM performance.
However, we want to investigate this in detail by encoding the context using
the more advanced methods and comparing it with other datasets as well.

Table 6 illustrates the results where we perform the online i.e. real-time
evaluation. For evaluation, we use the same test dataset to compare with
previous results and avoid data leakage issues. Similar to the previous
results, incorporating lookahead yields better performance. We achieve an
accuracy of 83.55% without the IB task outperforming the rest of the models.

(a) With IB

(b) Without IB

Figure 3: Distribution of the turn difference in the predicted IB and actual
IB with and without using Intent Boundary (IB). Here the difference is in
#turns. Blue color bar represents the early prediction and orange color
represents the late prediction

We see a consistent performance in the accuracy at the right turn and accuracy
at the right position as well. We also describe the results using the Mean
turn difference (MTD) and Mean Position Difference (MPD) which essentially
explains the early or late prediction of the intents. Table 6 demonstrates
that the inclusion of the intent boundary task helps in predicting the intents
much before the actual intent boundary. Our best model can predict 0.88 turns
and 19.56 words earlier reducing the overall latency. Further, we see that
without the explicit IB task, there is a delay of 2.37 turns in the prediction
even though we achieve the best accuracy of 83 %. We also plot the
distribution of the predicted turn difference w.r.t to the actual turn. Figure
3 clearly demonstrates the importance of including IB for the early
prediction. This explains the trade-off between the system with the overall
higher accuracy and the system that reduces the latency.

##  7 Conclusion and Future Work

In this work, we present a systematic method to detect intent in real-time in
human-human customer support conversations. We propose a dual architecture
approach to detect intent and intent boundary by incorporating the lookahead.
We also investigate various methodologies such as the adding context,
excluding the IB task, etc. We discuss the results on our private dataset
comprised of text transcripts of human-human conversations from the telecom
domain. To evaluate the methodology in real-time, we also propose metrics such
as Mean turn difference (MTD) and Mean Position difference (MPD). We conclude
that the intent boundary task significantly helps in reducing latencies by
predicting the intents earlier. Our method achieves the best overall intent
accuracy of 83.55 % when IB task is excluded.

In the future, we would like to use our method to reproduce this study with
other datasets and ensure that our method is consistent. Further, we also want
to explore more advanced deep learning techniques such as transformers to
encode the sequences and context. We also want to extend this work to predict
the entities in real-time.

## References

  * Adam et al. [2021] Martin Adam, Michael Wessel, and Alexander Benlian.  Ai-based chatbots in customer service and their effects on user compliance.  Electronic Markets, 31(2):427–445, June 2021.  Published online:17. March 2020.
  * Chen et al. [2019] Qian Chen, Zhu Zhuo, and Wen Wang.  BERT for joint intent classification and slot filling.  CoRR, abs/1902.10909, 2019.
  * Constantin et al. [2019] Stefan Constantin, Jan Niehues, and Alex Waibel.  Incremental processing of noisy user utterances in the spoken language understanding task.  CoRR, abs/1909.13790, 2019.
  * Devlin et al. [2018] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova.  BERT: pre-training of deep bidirectional transformers for language understanding.  CoRR, abs/1810.04805, 2018.
  * Guo et al. [2014] Daniel Guo, Gokhan Tur, Wen-tau Yih, and Geoffrey Zweig.  Joint semantic utterance classification and slot filling with recursive neural networks.  In 2014 IEEE Spoken Language Technology Workshop (SLT), pages 554–559, 2014.
  * Haihong et al. [2019] E. Haihong, Peiqing Niu, Zhongfu Chen, and Meina Song.  A novel bi-directional interrelated model for joint intent detection and slot filling.  In ACL, 2019.
  * Kahardipraja et al. [2021] Patrick Kahardipraja, Brielen Madureira, and David Schlangen.  Towards incremental transformers: An empirical analysis of transformer models for incremental NLU.  In Marie-Francine Moens, Xuanjing Huang, Lucia Specia, and Scott Wen-tau Yih, editors, Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, 2021, pages 1178–1189. Association for Computational Linguistics, 2021.
  * Katharopoulos et al. [2020] A. Katharopoulos, A. Vyas, N. Pappas, and F. Fleuret.  Transformers are rnns: Fast autoregressive transformers with linear attention.  In Proceedings of the International Conference on Machine Learning (ICML), 2020.
  * Kim et al. [2017] Young-Bum Kim, Sungjin Lee, and Karl Stratos.  Onenet: Joint domain, intent, slot prediction for spoken language understanding.  pages 547–553, 12 2017.
  * Lin et al. [2017] Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollár.  Focal loss for dense object detection.  CoRR, abs/1708.02002, 2017.
  * Ma et al. [2019] Mingbo Ma, Liang Huang, Hao Xiong, Renjie Zheng, Kaibo Liu, Baigong Zheng, Chuanqiang Zhang, Zhongjun He, Hairong Liu, Xing Li, Hua Wu, and Haifeng Wang.  STACL: Simultaneous translation with implicit anticipation and controllable latency using prefix-to-prefix framework.  In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3025–3036, Florence, Italy, July 2019. Association for Computational Linguistics.
  * Madureira and Schlangen [2020] Brielen Madureira and David Schlangen.  Incremental processing in the age of non-incremental encoders: An empirical assessment of bidirectional models for incremental NLU.  In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 357–374, Online, November 2020. Association for Computational Linguistics.
  * Paszke et al. [2019] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala.  Pytorch: An imperative style, high-performance deep learning library.  In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019.
  * Qin et al. [2019] Libo Qin, Wanxiang Che, Yangming Li, Haoyang Wen, and Ting Liu.  A stack-propagation framework with token-level intent detection for spoken language understanding.  In EMNLP, 2019.
  * Schlangen and Skantze [2009] David Schlangen and Gabriel Skantze.  ”a general, abstract model of incremental dialogue processing”.  volume 2, pages 710–718, 01 2009.
  * Shivakumar et al. [2021] Prashanth Gurunath Shivakumar, Naveen Kumar, Panayiotis G. Georgiou, and Shrikanth Narayanan.  RNN based incremental online spoken language understanding.  In IEEE Spoken Language Technology Workshop, SLT 2021, Shenzhen, China, January 19-22, 2021, pages 989–996. IEEE, 2021.
  * Wu et al. [2020] Di Wu, Liang Ding, Fan Lu, and Jian Xie.  SlotRefine: A fast non-autoregressive model for joint intent detection and slot filling.  In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1932–1937, Online, November 2020\. Association for Computational Linguistics.
  * Zhang and Wang [2016] Xiaodong Zhang and Houfeng Wang.  A joint model of intent determination and slot filling for spoken language understanding.  In IJCAI, 2016.