# Allowing humans to interactively guide machines where to look does _not_
always improve human-AI team’s classification accuracy

Giang Nguyen1, *, Mohammad Reza Taesiri2, *, Sunnie S. Y. Kim3, Anh Totti
Nguyen1
1Auburn University, 2University of Alberta, 3Princeton University
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
*Equal contributions

###### Abstract

Via thousands of papers in Explainable AI (XAI), attention maps [50] and
feature importance maps [9] have been established as a common means for
finding how important each input feature is to an AI’s decisions. It is an
interesting, unexplored question whether allowing users to edit the feature
importance at test time would improve a human-AI team’s accuracy on downstream
tasks. In this paper, we address this question by leveraging CHM-Corr, a
state-of-the-art, ante-hoc explainable classifier [48] that first predicts
patch-wise correspondences between the input and training-set images, and then
bases on them to make classification decisions. We build CHM-Corr++, an
interactive interface for CHM-Corr, enabling users to edit the feature
importance map provided by CHM-Corr and observe updated model decisions. Via
CHM-Corr++, users can gain insights into if, when, and how the model changes
its outputs, improving their understanding beyond static explanations.
However, our study with 18 expert users who performed 1,400 decisions finds no
statistical significance that our interactive approach improves user accuracy
on CUB-200 bird image classification over static explanations. This challenges
the hypothesis that interactivity can boost human-AI team accuracy [46, 47,
42, 44, 34, 30, 16, 32] and raises needs for future research. We open-source
CHM-Corr++, an interactive tool for editing image classifier attention (see an
interactive demo here). We release code and data on github.

##  1 Introduction

Despite much attention from the community, the practical utility of
Explainable AI (XAI) tools in downstream applications (e.g., image
classification [20, 24, 37, 43]) remains limited, hindering human-AI
collaboration in real-world settings. A major limitation is that there is no
interface for humans to provide feedback to the model so that it can update
its decisions, which could change users’ thoughts and final decisions. For
example, feature importance maps [9, 15] and example-based explanations [37]
are among the most popular XAI methods that offer insights into “what a model
is looking at” and which real examples support a model decision, respectively.
However, they only offer a static, one-time explanation of the input. Here, we
test allowing users to edit the “attention” input to the model and observe
updated model decisions iteratively until they are ready to make the final
decisions (Fig. 1).

Figure 1: Users provide feedback to the explainable AI by editing the feature
importance map (like an “attention map” [50]).

We perform our study on CHM-Corr, a recent explainable CUB-200 bird classifier
[48] that combines the best of both worlds by first finding, at the patch
level, how the input image is similar to the nearest training-set examples,
and then using these patch-wise correspondences to predict the image label
(see Fig. 2–b and Supp. A3 for examples of CHM-Corr explanations). CHM-Corr
explanations enabled users to achieve state-of-the-art human-AI team accuracy
in bird identification on CUB-200 [48].

We build an interactive interface called CHM-Corr++ for CHM-Corr, allowing
users to manipulate the “attention” of the CHM-Corr classifier by selecting
the set of patches that the classifier uses in its decision-making step (Fig.
1). By iteratively telling the model where to look, and observing the changes
in the output space (see Fig. 2), users could better understand the AI model
and make more informed and accurate decisions.

Via a user study of 1400 decisions, surprisingly, we did not find the
interactivity to help improve users’ decision-making accuracy (Tab. 1). This
finding is intriguing and in stark contrast to the common hypothesis that
interactive explanations might improve human-AI collaboration effectiveness
and therefore human-AI team accuracy [42, 44, 34, 30].

Figure 2: Our CHM-Corr++ interactive interface. We let users interact with the
image classification model (here CHM-Corr [48]) via controlling the attention
(selecting patches) the model should look at (a). Based on the user-guided
attention, the model compares the input image (GT class: Cardinal) with
candidate, training examples to simultaneously generate visual-correspondence
explanations (b) and predictions (c). The user iteratively observes the
dynamic explanations (b) and predictions (c) to understand the image
classification model to accept or reject (d) the _original_ top-1 predicted
label (here Summer Tanager).

##  2 Related Work

Fine-grained visual classification is a domain with active XAI research.
Numerous explanations methods have been proposed, producing explanations of
various forms. Representative forms include heatmaps [31, 40], examples [21,
49, 48, 38], concepts [41, 26, 54], and prototypes [14, 18, 35]. Regardless of
the form, however, most explanations are _static_. They are presented to users
in a unidirectional manner without opportunities for follow-up interactions.
In this work, we explore _interactive_ XAI, following growing calls from the
AI and HCI communities [30, 22, 28, 33, 55, 1].

Prior work has demonstrated the needs and benefits of interactive XAI.
Notably, Lakkaraju _et al_. [30] found practitioners strongly prefer
interactive interfaces when making decisions with AI systems. Hohman _et al_.
[22] found that interactivity was fundamental for data scientists in
interpreting and comparing AI systems. Kulesza _et al_. [28] found that
interactivity increased users’ understanding of the AI system and ability to
correct its mistakes.

However, there is a lack of interactive XAI tools that help users gain a
better understanding of _computer vision_ models through direct interaction
with the models. Many existing tools are proprietary (e.g., AIFinnity [12],
Symphony [10]), not applicable to computer vision models (e.g., Gamut [22],
EluciDebug [28], TalkToModel [45], AVTALER [56]), or support different
functionalities (e.g., Shared Interest [11], ActiVis [23], CNN Explainer
[53]). In contrast, our interactive tool, CHM-Corr++, enable users to directly
control an image classification model’s attention to particular regions of the
input and observe changes to its outputs (see Fig. 2). We expect CHM-Corr++ to
help users build an understanding of if, when, and how the model changes its
outputs, on top of the understanding provided by static explanations.

Finally, our work builds on and contributes to research on human-AI
collaboration [29, 5, 6, 13, 52, 27, 8, 7, 39, 36] that explores how humans
work together with AI systems to achieve shared goals. Particularly relevant
is work that studied explanations’ role in human-AI decision making,
especially in the context of fine-grained visual recognition [24, 48, 37, 17,
25, 38]. However, most if not all explanations studied in prior work are
_static_. In this work, we further the field’s understanding by exploring the
role of _dynamic_ explanations in human-AI collaboration.

##  3 Method

###  3.1 CHM-Corr++: An interactive interface for controlling model attention

For interactive human-AI collaboration, we developed an interactive interface
that enables users to control model attention. Our interface is built on CHM-
Corr [48], a visual correspondence-based image classification model that
produces static explanations of its outputs. Given an input image, CHM-Corr
employs a kNN approach to extract the $N=50$ most similar candidate images
from the training set. It then divides the input image into $7\times 7$ non-
overlapping patches and compares them with corresponding patches in each
candidate image. Based on the cosine similarity among patches, CHM-Corr makes
the prediction.

However, CHM-Corr is completely automatic and sometimes focuses on image
patches that are not semantically meaningful to users (e.g., background or
indiscriminative features – Figs. 1(a) & 3(a)). Therefore, we built an
interactive interface named CHM-Corr++ that enables users to select image
patches that the model should focus on, or in other words, control the model’s
attention. At a high level, users are presented with the new attention,
support samples, and model outputs. The interface was developed using Python
and Gradio [2]. We utilized Gradio with a custom HTML component that enables
users to control model attention in a $7\times 7$ grid. Compared with CHM-
Corr, CHM-Corr++ enables a more interactive and user-centric image
classification process, accompanied by dynamic explanations of the model’s
outputs.

###  3.2 User study

We next explore the effectiveness of static and dynamic explanations with a
user study. Our problem setup is as follows (see Fig. 2): Given an input image
(e.g., Cardinal), the model predicts its class (c) and provides an explanation
(b) for its prediction. The user’s task is to accept or reject (d) the model’s
original prediction (Summer Tanager) based on the provided explanation.

Static vs. dynamic explanations. In the _static_ explanation setting, the
model provides five support samples from the predicted class, along with patch
annotations highlighting the most similar corresponding patch pairs between
the input and the five support samples (see Fig. 1(a)).

In the _dynamic_ explanation setting, the model provides the same type of
explanations. However, users can also control the model’s attention by
selecting input image patches the model should focus on. Based on the
selections, the model makes a prediction again and produces corresponding
explanations (shown in Fig. 1(b)). Note that the new prediction can be same as
the original prediction. This process enables users to explore if, when, and
how the model’s prediction changes based on their selections (e.g., users can
generate counterfactual explanations via observing the answer for “what if?”
questions). For example, Fig. 2 demonstrates how the model’s predictions
change upon human interaction. Initially, using patches that only includes the
bird’s body, the model (CHM-Corr [48]) incorrectly predicts Summer Tanager
(Step 1). However, with user-guided attention on patches that include both the
body and the beak, the model correctly predicts Cardinal (Step 2).

The key difference between static and dynamic explanations lies in the level
of interactivity and user involvement. Static explanations provide a fixed set
of supporting information to help users make a decision, while dynamic
explanations allow users to actively explore and influence the model’s
behavior, leading to a more engaging and informative decision-making process.

Study materials. Following prior works [37, 48, 17], we balance the number of
correct and incorrect model predictions. From the test set of CUB-200 [51], we
select 600 samples, consisting of 300 correctly classified and 300
misclassified by CHM-Corr [48], resulting in a random-chance accuracy of 50%
for the task. We input each image to the model to obtain the model’s
predictions and explanations.

Data collection and participants. Due to the complexity of our interface, we
decided to pilot the study with ML experts who are knowledgeable about XAI. We
recruited 18 participants, most of whom were Master’s and Ph.D. students in
ML. Each participant completed one to several submissions, where each
submission consisted of 20 decisions on whether to accept or reject the
model’s original prediction (e.g., Summer Tanager in Fig. 2). In total, we
collected data on 1400 decisions.

Table 1: User study results. We report per-user mean decision accuracy ($\mu$) and standard deviation ($\sigma$) over a study of 18 machine learning experts who generated in total of 70 submissions (each with 20 decisions). Explanation type | Static (CHM-Corr) | Dynamic (CHM-Corr++)
---|---|---
$\mu\pm\sigma$ | Overall | Overall
72.68 $\pm$ 12.36 |  73.57 $\pm$ 10.42
AI originally correct | AI originally incorrect | AI originally correct | AI originally incorrect
85.21 $\pm$ 11.82 |  60.13 $\pm$ 18.66 |  86.79 $\pm$ 13.16 |  59.39 $\pm$ 15.51
# of decisions | 283 | 277 | 443 | 397
# of submissions | 28 | 42

##  4 Results

In our study, participants in the dynamic explanation setting “used” (i.e.,
controlling the model’s attention and seeing a new prediction) the interactive
interface 1.93 times after seeing the model’s original prediction. That is,
participants in the dynamic explanation setting saw around $3\approx 1\text{
(original)}+1.93\text{ (new)}$ model predictions on average. In this section,
we explore the effect of this interactivity.

###  4.1 Interactivity did not improve decision accuracy

To our surprise, interactivity did not improve participants’ decision
accuracy. Dynamic explanations provided little to no benefit over static
explanations for participants in assessing the correctness of the model’s
original prediction. The overall decision accuracy is 72.68% with static and
73.57% with dynamic explanations (Tab. 1). Both are higher than the random-
chance accuracy (50%) but still far short of where we want to be (100%). This
result suggests that interactivity does not always benefit users, contrary to
common belief that interactivity inherently boosts user understanding and task
performance [30, 55].

###  4.2 Participants struggled to reject incorrect model predictions

Next, to understand where participants struggled most, we separately analyze
results on instances where the model’s original prediction was correct and
instances where it was incorrect (Tab. 1). We find participants’ decision
accuracy on correct instances is much higher than that on incorrect ones for
both types of explanations: 85.21% vs. 60.13% with static, 86.79% vs. 59.39%
with dynamic. This result is consistent with prior findings that users tend to
accept AI predictions as correct even when they are incorrect [19, 37, 48,
24], highlighting the need for tools that help users detect and reject AI
errors [3, 4].

###  4.3 The usefulness of interactivity depended on the interaction outcomes

Table 2: Participants’ decision accuracy (%) with dynamic explanations under
different settings.

AI model correctness w.r.t. human interaction | Acc (%)
---|---
(i) Originally correct and consistent (always correct) | 90.80
(ii) Originally correct and inconsistent (becomes incorrect) | 75.21
(iii) Originally incorrect and consistent (always incorrect) | 52.55
(iv) Originally incorrect and inconsistent (always incorrect) | 62.11
(v) Originally incorrect and inconsistent (becomes correct) | 65.43

Finally, to better understand the effect of interactivity, we break down
participants’ decision accuracy with dynamic explanations based on the
interaction outcomes (Tab. 2). Here, “consistent” refers to the model
maintaining its original prediction even after the user controlled its
attention.

When the model is originally correct (i, ii), we find that participants’
decision accuracy is higher when the model is consistent than not (90.80% vs.
75.21%). This result is in line with our expectations. When the model
maintains its prediction after attention control, participants may gain higher
confidence in the prediction and accept it as correct (see Supp. Figs. A1 and
A2).

When the model is originally incorrect (iii, iv, v), participants’ decision
accuracy is lower when the model is consistent than not (52.55% vs. 62.11
$\to$ 65.43%). Again, this result is as expected. When the model maintains its
prediction, even when it is incorrect, participants may gain higher confidence
in the prediction and accept the prediction as correct. What happens when the
model is inconsistent as shown in Supp. Fig. A4? We find that when the model’s
new predictions are always incorrect, participants’ decision accuracy is
62.11%. But when the model eventually becomes correct, participants’ decision
accuracy goes up to 65.43%. That is, the interactive interface is most helpful
when users’ attention control changes the model’s prediction from incorrect to
correct (Supp. Fig. A3). As such, understanding when users can and cannot help
the model be more accurate, and aiding users in the process, would be
important directions for future research.

##  5 Discussion

We assume two leading hypotheses for why dynamic explanations do not surpass
static explanations in improving human decision accuracy. First, regarding the
nature of the task, in most instances, AI attention is already sufficient, as
the birds are well-centered and clearly visible. Changing the task domain, for
example, to include complex scenes where AI struggles to focus on the correct
pixels, would likely enhance the effectiveness of CHM-Corr++. Second, we
mentioned in Sec. 4.3 that CHM-Corr++ is especially helpful when the base CHM-
Corr model can classify correctly. Yet, this base classifier has shortcomings
(see Supp. A2) and inherently makes CHM-Corr++ ineffective in many cases
(e.g., Supp. Figs. A2 & A4). We hope our open-source tool and investigation of
dynamic explanations stimulates further research towards enabling effective
human-AI interaction in computer vision.

## Acknowledgments

We are grateful for the participation of volunteers who spent their time and
efforts in our human studies. We also thank the anonymous reviewers of XAI4CV
workshop for their helpful feedback. We also thank Travis Thompson, Pooyan
Rahmanzadehgervi, and Tin Nguyen from Auburn University for their helpful
feedback on our early results. AN is supported by NaphCare Foundations, Adobe
gifts, and NSF grant no. 2145767.

## References

  * Abdul et al. [2018] Ashraf Abdul, Jo Vermeulen, Danding Wang, Brian Y. Lim, and Mohan Kankanhalli.  Trends and trajectories for explainable, accountable and intelligible systems: An HCI research agenda.  In _Proceedings of the 2018 CHI Conference on Human Factors in Computing Systems_ , page 1–18, New York, NY, USA, 2018. Association for Computing Machinery.
  * Abid et al. [2019] Abubakar Abid, Ali Abdalla, Ali Abid, Dawood Khan, Abdulrahman Alfozan, and James Zou.  Gradio: Hassle-free sharing and testing of ml models in the wild.  _arXiv preprint arXiv:1906.02569_ , 2019.
  * Adebayo [2022] Julius Adebayo.  _Towards Effective Tools for Debugging Machine Learning Models_.  PhD thesis, Massachusetts Institute of Technology, 2022.
  * Adebayo et al. [2020] Julius Adebayo, Michael Muelly, Ilaria Liccardi, and Been Kim.  Debugging tests for model explanations.  In _Proceedings of the 34th International Conference on Neural Information Processing Systems_ , pages 700–712, 2020.
  * Arous et al. [2020] Ines Arous, Jie Yang, Mourad Khayati, and Philippe Cudré-Mauroux.  OpenCrowd: A human-AI collaborative approach for finding social influencers via open-ended answers aggregation.  In _Proceedings of The Web Conference 2020_ , page 1851–1862, New York, NY, USA, 2020. Association for Computing Machinery.
  * Ashktorab et al. [2020] Zahra Ashktorab, Q. Vera Liao, Casey Dugan, James Johnson, Qian Pan, Wei Zhang, Sadhana Kumaravel, and Murray Campbell.  Human-AI collaboration in a cooperative game setting: Measuring social perception and outcomes.  _Proc. ACM Hum.-Comput. Interact._ , 4(CSCW2), 2020.
  * Bansal et al. [2019] Gagan Bansal, Besmira Nushi, Ece Kamar, Walter S. Lasecki, Daniel S. Weld, and Eric Horvitz.  Beyond accuracy: The role of mental models in human-AI team performance.  In _AAAI Conference on Human Computation and Crowdsourcing (HCOMP)_ , 2019.
  * Bansal et al. [2021] Gagan Bansal, Tongshuang Wu, Joyce Zhou, Raymond Fok, Besmira Nushi, Ece Kamar, Marco Tulio Ribeiro, and Daniel Weld.  Does the Whole Exceed Its Parts? The Effect of AI Explanations on Complementary Team Performance.  In _Proceedings of the 2021 CHI Conference on Human Factors in Computing Systems_ , New York, NY, USA, 2021. Association for Computing Machinery.
  * Bansal et al. [2020] Naman Bansal, Chirag Agarwal, and Anh Nguyen.  SAM: The sensitivity of attribution methods to hyperparameters.  In _Proceedings of the ieee/cvf conference on computer vision and pattern recognition_ , pages 8673–8683, 2020.
  * Bäuerle et al. [2022] Alex Bäuerle, Ángel Alexander Cabrera, Fred Hohman, Megan Maher, David Koski, Xavier Suau, Titus Barik, and Dominik Moritz.  Symphony: Composing interactive interfaces for machine learning.  In _Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems_ , New York, NY, USA, 2022. Association for Computing Machinery.
  * Boggust et al. [2022] Angie Boggust, Benjamin Hoover, Arvind Satyanarayan, and Hendrik Strobelt.  Shared Interest: Measuring Human-AI Alignment to Identify Recurring Patterns in Model Behavior.  In _Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems_ , New York, NY, USA, 2022. Association for Computing Machinery.
  * Cabrera et al. [2023] Ángel Alexander Cabrera, Marco Tulio Ribeiro, Bongshin Lee, Robert Deline, Adam Perer, and Steven M. Drucker.  What did my AI learn? how data scientists make sense of model behavior.  _ACM Trans. Comput.-Hum. Interact._ , 30(1), 2023.
  * Cai et al. [2019] Carrie J. Cai, Samantha Winter, David Steiner, Lauren Wilcox, and Michael Terry.  “Hello AI”’: Uncovering the onboarding needs of medical practitioners for human-AI collaborative decision-making.  _Proc. ACM Hum.-Comput. Interact._ , 3(CSCW), 2019.
  * Chen et al. [2019] Chaofan Chen, Oscar Li, Daniel Tao, Alina Barnett, Cynthia Rudin, and Jonathan K Su.  This looks like that: Deep learning for interpretable image recognition.  In _Neural Information Processing Systems (NeurIPS)_ , 2019.
  * Chen et al. [2022] Peijie Chen, Qi Li, Saad Biaz, Trung Bui, and Anh Nguyen.  gscorecam: What objects is clip looking at?  In _Proceedings of the Asian Conference on Computer Vision_ , pages 1959–1975, 2022.
  * Cheng et al. [2019] Hao-Fei Cheng, Ruotong Wang, Zheng Zhang, Fiona O’connell, Terrance Gray, F Maxwell Harper, and Haiyi Zhu.  Explaining decision-making algorithms through UI: Strategies to help non-expert stakeholders.  In _Proceedings of the 2019 chi conference on human factors in computing systems_ , pages 1–12, 2019.
  * Colin et al. [2022] Julien Colin, Thomas Fel, Rémi Cadène, and Thomas Serre.  What I cannot predict, I do not understand: A human-centered evaluation framework for explainability methods.  _Advances in Neural Information Processing Systems_ , 35:2832–2845, 2022.
  * Donnelly et al. [2022] Jon Donnelly, Alina Jade Barnett, and Chaofan Chen.  Deformable ProtoPNet: An interpretable image classifier using deformable prototypes.  In _IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)_ , 2022.
  * Fok and Weld [2023] Raymond Fok and Daniel S Weld.  In search of verifiability: Explanations rarely enable complementary performance in AI-advised decision making.  _arXiv preprint arXiv:2305.07722_ , 2023.
  * Ford and Keane [2022] Courtney Ford and Mark T Keane.  Explaining classifications to non experts: An XAI user study of post hoc explanations for a classifier when people lack expertise.  _arXiv preprint arXiv:2212.09342_ , 2022.
  * Goyal et al. [2019] Yash Goyal, Ziyan Wu, Jan Ernst, Dhruv Batra, Devi Parikh, and Stefan Lee.  Counterfactual visual explanations.  In _Proceedings of the 36th International Conference on Machine Learning_ , pages 2376–2384. PMLR, 2019.
  * Hohman et al. [2019] Fred Hohman, Andrew Head, Rich Caruana, Robert DeLine, and Steven M Drucker.  Gamut: A design probe to understand how data scientists understand machine learning models.  In _Proceedings of the 2019 CHI conference on human factors in computing systems_ , pages 1–13, 2019.
  * Kahng et al. [2017] Minsuk Kahng, Pierre Yves Andrews, Aditya Kalro, and Duen Horng Chau.  ActiVis: Visual exploration of industry-scale deep neural network models.  _IEEE Transactions on Visualization and Computer Graphics_ , 24:88–97, 2017.
  * Kim et al. [2022] Sunnie S. Y. Kim, Nicole Meister, Vikram V. Ramaswamy, Ruth Fong, and Olga Russakovsky.  HIVE: Evaluating the Human Interpretability of Visual Explanations.  In _European Conference on Computer Vision_ , pages 280–298. Springer, 2022.
  * Kim et al. [2023] Sunnie S. Y. Kim, Elizabeth Anne Watkins, Olga Russakovsky, Ruth Fong, and Andrés Monroy-Hernández.  “Help Me Help the AI”’: Understanding How Explainability Can Support Human-AI Interaction.  In _Proceedings of the 2023 CHI Conference on Human Factors in Computing Systems_ , New York, NY, USA, 2023. Association for Computing Machinery.
  * Koh et al. [2020] Pang Wei Koh, Thao Nguyen, Yew Siang Tang, Stephen Mussmann, Emma Pierson, Been Kim, and Percy Liang.  Concept bottleneck models.  In _International Conference on Machine Learning (ICML)_ , 2020.
  * Krishna et al. [2022] Ranjay Krishna, Donsuk Lee, Li Fei-Fei, and Michael S. Bernstein.  Socially situated artificial intelligence enables learning from human interaction.  _Proceedings of the National Academy of Sciences_ , 119(39):e2115730119, 2022.
  * Kulesza et al. [2015] Todd Kulesza, Margaret Burnett, Weng-Keen Wong, and Simone Stumpf.  Principles of explanatory debugging to personalize interactive machine learning.  In _Proceedings of the 20th International Conference on Intelligent User Interfaces_ , page 126–137, New York, NY, USA, 2015. Association for Computing Machinery.
  * Lai et al. [2022] Vivian Lai, Samuel Carton, Rajat Bhatnagar, Q. Vera Liao, Yunfeng Zhang, and Chenhao Tan.  Human-AI collaboration via conditional delegation: A case study of content moderation.  In _Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems_ , New York, NY, USA, 2022. Association for Computing Machinery.
  * Lakkaraju et al. [2022] Himabindu Lakkaraju, Dylan Slack, Yuxin Chen, Chenhao Tan, and Sameer Singh.  Rethinking explainability as a dialogue: A practitioner’s perspective.  _arXiv preprint arXiv:2202.01875_ , 2022.
  * Li et al. [2021] Liangzhi Li, Bowen Wang, Manisha Verma, Yuta Nakashima, Ryo Kawasaki, and Hajime Nagahara.  Scouter: Slot attention-based classifier for explainable image recognition.  In _IEEE International Conference on Computer Vision (ICCV)_ , 2021.
  * Liu et al. [2021] Han Liu, Vivian Lai, and Chenhao Tan.  Understanding the effect of out-of-distribution examples and interactive explanations on human-AI decision making.  _Proceedings of the ACM on Human-Computer Interaction_ , 5(CSCW2):1–45, 2021.
  * Miller [2019] Tim Miller.  Explanation in artificial intelligence: Insights from the social sciences.  _Artificial Intelligence_ , 267:1–38, 2019.
  * Mindlin et al. [2024] Dimitry Mindlin, Fabian Beer, Leonie Nora Sieger, Stefan Heindorf, Philipp Cimiano, Elena Esposito, and Axel-Cyrille Ngonga-Ngomo.  Beyond one-shot explanations: A systematic literature review of dialogue-based xai approaches.  2024\.
  * Nauta et al. [2021] Meike Nauta, Ron van Bree, and Christin Seifert.  Neural prototype trees for interpretable fine-grained image recognition.  In _IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)_ , 2021.
  * Nguyen et al. [2018] An T. Nguyen, Aditya Kharosekar, Saumyaa Krishnan, Siddhesh Krishnan, Elizabeth Tate, Byron C. Wallace, and Matthew Lease.  Believe it or not: Designing a human-ai partnership for mixed-initiative fact-checking.  In _Proceedings of the 31st Annual ACM Symposium on User Interface Software and Technology_ , page 189–199, New York, NY, USA, 2018. Association for Computing Machinery.
  * Nguyen et al. [2021] Giang Nguyen, Daeyoung Kim, and Anh Nguyen.  The effectiveness of feature attribution methods and its correlation with automatic evaluation scores.  _Advances in Neural Information Processing Systems_ , 34:26422–26436, 2021.
  * Nguyen et al. [2023] Giang Nguyen, Valerie Chen, and Anh Nguyen.  AdvisingNets: Learning to distinguish correct and wrong classifications via nearest-neighbor explanations.  _arXiv preprint arXiv:2308.13651_ , 2023.
  * O’Neill et al. [2022] Thomas O’Neill, Nathan McNeese, Amy Barron, and Beau Schelble.  Human–autonomy teaming: A review and analysis of the empirical literature.  _Human Factors_ , 64(5):904–938, 2022.  PMID: 33092417.
  * Pillai et al. [2022] Vipin Pillai, Soroush Abbasi Koohpayegani, Ashley Ouligian, Dennis Fong, and Hamed Pirsiavash.  Consistent explanations by contrastive learning.  In _IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)_ , 2022.
  * Ramaswamy et al. [2022] Vikram V. Ramaswamy, Sunnie S. Y. Kim, Nicole Meister, Ruth Fong, and Olga Russakovsky.  ELUDE: Generating interpretable explanations via a decomposition into labelled and unlabelled features, 2022.
  * Shen [2024] Hua Shen.  Towards useful AI interpretability for humans via interactive ai explanations.  2024\.
  * Shitole et al. [2021] Vivswan Shitole, Fuxin Li, Minsuk Kahng, Prasad Tadepalli, and Alan Fern.  One explanation is not enough: structured attention graphs for image classification.  _Advances in Neural Information Processing Systems_ , 34:11352–11363, 2021.
  * Singh et al. [2024] Chandan Singh, Jeevana Priya Inala, Michel Galley, Rich Caruana, and Jianfeng Gao.  Rethinking interpretability in the era of large language models.  _arXiv preprint arXiv:2402.01761_ , 2024.
  * Slack et al. [2023] Dylan Slack, Satyapriya Krishna, Himabindu Lakkaraju, and Sameer Singh.  Explaining machine learning models with interactive natural language conversations using TalkToModel.  _Nature Machine Intelligence_ , 2023.
  * Sokol and Flach [2020] Kacper Sokol and Peter Flach.  One explanation does not fit all: The promise of interactive explanations for machine learning transparency.  _KI-Künstliche Intelligenz_ , 34(2):235–250, 2020.
  * Sun and Sundar [2022] Yuan Sun and S Shyam Sundar.  Exploring the effects of interactive dialogue in improving user control for explainable online symptom checkers.  In _CHI Conference on Human Factors in Computing Systems Extended Abstracts_ , pages 1–7, 2022.
  * Taesiri et al. [2022] Mohammad Reza Taesiri, Giang Nguyen, and Anh Nguyen.  Visual correspondence-based explanations improve ai robustness and human-AI team accuracy.  _Advances in Neural Information Processing Systems_ , 35:34287–34301, 2022.
  * Vandenhende et al. [2022] Simon Vandenhende, Dhruv Mahajan, Filip Radenovic, and Deepti Ghadiyaram.  Making heads or tails: Towards semantically consistent visual counterfactuals.  In _ECCV 2022_ , 2022.
  * Vaswani et al. [2017] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin.  Attention is all you need.  _Advances in neural information processing systems_ , 30, 2017.
  * Wah et al. [2011] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie.  The Caltech-UCSD Birds-200-2011 Dataset.  2011\.
  * Wang et al. [2019] Dakuo Wang, Justin D. Weisz, Michael Muller, Parikshit Ram, Werner Geyer, Casey Dugan, Yla Tausczik, Horst Samulowitz, and Alexander Gray.  Human-AI collaboration in data science: Exploring data scientists’ perceptions of automated ai.  _Proc. ACM Hum.-Comput. Interact._ , 3(CSCW), 2019.
  * Wang et al. [2020] Zijie J. Wang, Robert Turko, Omar Shaikh, Haekyu Park, Nilaksh Das, Fred Hohman, Minsuk Kahng, and Duen Horng Chau.  CNN Explainer: Learning Convolutional Neural Networks with Interactive Visualization.  _IEEE Transactions on Visualization and Computer Graphics (TVCG)_ , 2020.
  * Yuksekgonul et al. [2023] Mert Yuksekgonul, Maggie Wang, and James Zou.  Post-hoc concept bottleneck models.  In _The Eleventh International Conference on Learning Representations_ , 2023.
  * Zhang et al. [2023] Tong Zhang, X Jessie Yang, and Boyang Li.  May I Ask a Follow-up Question? Understanding the Benefits of Conversations in Neural Network Explainability.  _arXiv preprint arXiv:2309.13965_ , 2023.
  * Zhou et al. [2023] Joyce Zhou, Elena Glassman, and Daniel S Weld.  An interactive UI to support sensemaking over collections of parallel texts.  _arXiv preprint arXiv:2303.06264_ , 2023.

Supplemental Materials

##  A1 The significance t-test for comparing two groups

With data collected from the human study, we compute the per-user average
accuracy over our controlled, balanced image sets (i.e., the ratio of samples
where AI correctly classified and misclassified is approx. 50/50) and report
in Table 1. Yet, we find that dynamic explanations (CHM-Corr++ users score
73.57%), which one might naturally assume to be superior, do not show a
significant improvement over static ones (CHM-Corr users score 72.68%) in
helping users making more accurate decisions.

The findings, with a t-statistic of -0.321 and a p-value of 0.749, indicate
that the average accuracy levels for users exposed to both types of
explanations are not significantly different. This challenges the common
belief that dynamic, interactive content inherently boosts user comprehension
or performance [30, 55].

##  A2 The shortcomings of CHM-Corr classifier

For some samples, AI fails to classify the input image correctly regardless of
how the attention is directed towards the image (see Fig. A4). This indicates
that improving attention alone does not suffice for classifiers to accurately
classify these samples, suggesting the need for insights into developing new
models that focus on more than just improving attention mechanisms. Moreover,
the underlying nature of the classifier contributes to this issue. Given that
the classifier employs a k-Nearest Neighbors (kNN) algorithm to retrieve a set
of candidate samples, there is a possibility that the ground-truth class may
not appear within the candidate pool. Consequently, no matter how the CHM-Corr
model re-ranks these candidates, it may never correctly identify the top-1
class.

##  A3 How users interact with explanations

(a) Static explanation for Bobolink.

(b) Human-prompt, correspondence-based explanation for Bobolink.

Figure A1: Both dynamic and static explanations enable human users to verify
that the AI is predicting the top-1 label correctly.

(a) Static explanation for Rufous Hummingbird.

(b) Human-prompt, corr-based explanation for Anna Hummingbird.

Figure A2: Human intervention changes the top-1 label from Rufous Hummingbird
$\to$ Anna Hummingbird that makes users more likely to reject the original,
correct label.

(a) Static explanation for Indigo Bunting.

(b) Human-prompt, correspondence-based explanation for Lazuli Bunting.

Figure A3: AI initially makes the wrong classification Indigo Bunting on the
input image. Human intervention changes the top-1 label from Indigo Bunting
$\to$ Lazuli Bunting, a more similar-looking class, encouraging users to
reject the original, predicted label. Figure A4: A sample that is
unclassifiable for the classifier CHM-Corr. The ground-truth label is Chipping
Sparrow. Initially, AI makes a wrong classification of Baird Sparrow. With
user-guided attention, the top-1 label evolves from Baird Sparrow $\to$ Clay-
colored Sparrow $\to$ Vesper Sparrow $\to$ Savannah Sparrow but none of them
matches the groundtruth, making users unable to make decisions given the
explanations.


# Comparison of Time-Frequency Representations for Environmental Sound
Classification using Convolutional Neural Networks

Muhammad Huzaifah M. Huzaifah<EMAIL_ADDRESS>is with the Arts and
Creativity Lab, IDMI and NUS Graduate School for Integrative Sciences and
Engineering (NGS) at the National University of Singapore (NUS).

###### Abstract

Recent successful applications of convolutional neural networks (CNNs) to
audio classification and speech recognition have motivated the search for
better input representations for more efficient training. Visual displays of
an audio signal, through various time-frequency representations such as
spectrograms offer a rich representation of the temporal and spectral
structure of the original signal. In this letter, we compare various popular
signal processing methods to obtain this representation, such as short-time
Fourier transform (STFT) with linear and Mel scales, constant-Q transform
(CQT) and continuous Wavelet transform (CWT), and assess their impact on the
classification performance of two environmental sound datasets using CNNs.
This study supports the hypothesis that time-frequency representations are
valuable in learning useful features for sound classification. Moreover, the
actual transformation used is shown to impact the classification accuracy,
with Mel-scaled STFT outperforming the other discussed methods slightly and
baseline MFCC features to a large degree. Additionally, we observe that the
optimal window size during transformation is dependent on the characteristics
of the audio signal and architecturally, 2D convolution yielded better results
in most cases compared to 1D.

###### Index Terms:

signal processing, environmental sound classification, convolutional neural
networks, deep learning.

##  I Introduction

While not receiving as much attention by the scientific community as speech
processing tasks, environmental sound recognition nonetheless contributes to
important applications in surveillance [1], robotics [2] and home automation
[3] among others. In comparison to standard speech, environmental sounds are
often more chaotic and noise-like, without the underlying phonetic structure
that has been successfully modeled by traditional machine learning methods
like the hidden Markov model (HMM). Recent work in this field has shown two
distinctive developments: the utilization of deep neural networks (DNNs) in
particular the convolutional neural network (CNN) as a classifier and feature
extractor, and the use of the time-frequency representation of an audio
signal, known as the spectrogram, as input.

CNN-based models were first adopted for speech recognition systems by Abdel-
Hamid et al. [4] for the TIMIT phone recognition task. This model was later
improved architecturally in [5], with added consideration to kernel size,
pooling, network size and regularization, while other large-scale speech tasks
were also carried out in [6][7][8] using CNNs. More recently, Piczak [9] and
Salamon [10] showed that a basic CNN could generally outperform existing
methods for environmental sound classification provided sufficient data.

To achieve desirable results, the classifier has to be paired with an
appropriate input representation. Conventional choices were largely hand-
crafted features such as Mel-frequency cepstral coefficients (MFCCs) or
Perceptual Linear Prediction (PLP) coefficients that were previously state-of-
the-art when used with Gaussian mixture model (GMM)-based HMMs. However, such
cepstral features became less popular with deep learning algorithms as it was
no longer essential for feature maps to be sufficiently de-correlated
[11][12]. Conversely, the strength of CNNs lie with its ability to learn
localized patterns through weight-sharing and pooling [13] \- patterns present
in the spectro-temporal features of spectrograms.

In the domain of environmental sound it has been noted that time-frequency
representations are especially useful as learning features
[14][15][16][17][18] due to the non-stationary and dynamic nature of the
sounds. To extract these spectro-temporal features, a range of signal
processing techniques have been proposed. A survey on environmental sound
recognition by Chachada and Kuo [19] covers several methods, including sparse-
representation-based techniques such as matching pursuit, power-spectrum-based
techniques to obtain variants of the spectrogram, and several wavelet-based
approaches. Another comparative study [20] investigated the performance of
methods such as short-time Fourier transform (STFT), fast Wavelet transform
(FWT) and continuous Wavelet transform (CWT) against stationary features like
the aforementioned MFCC and PLP. The authors classified the extracted features
using conventional machine learning techniques, including GMM-HMM, support
vector machines (SVMs) and shallow artificial neural nets.

This letter builds upon previous comparative studies by focusing on the
specifics of a CNN model as opposed to more traditional classifiers. We
investigate four common approaches to obtain the time-frequency
representation, namely the short-time Fourier transform (STFT) with both
linear and Mel scales, the constant-Q transform (CQT) and the continuous
Wavelet transform (CWT), while addressing additional considerations like
window size. The impact of the different approaches is evaluated in comparison
to baseline MFCC features on two publicly available environmental sound
datasets (ESC-50, UrbanSound8K) through the classification performance of
several CNN variants.

##  II Experimental Methodology

###  II-A Datasets

The ESC-50 dataset [21] comprises of 2000 short (5 second) environmental
recording split equally among 50 classes. Classes were derived from 5 major
groups: animals, natural soundscapes and water sounds, human non-speech
sounds, interior/domestic sounds, and exterior/urban noises. The small number
of samples coupled with a relatively large number of classes made this quite a
demanding dataset for traditional classification methods. Previous work by
Piczak [9] showed that using a deep learning approach through CNNs markedly
improved classification performance, yielding an accuracy of 64.5$\%$. A
recent paper [22] further improved this result to 74.2$\%$ using a deeper pre-
trained network.

UrbanSound8K [23] is a collection of 8732 short (4 seconds or less) audio
clips taken from field recordings. The dataset is divided into 10 distinct
classes of urban sounds: air conditioner, car horn, children playing, dog
barking, drilling, engine idling, gun shot, jackhammer, siren and street
music. Unlike ESC-50, the classes were not completely balanced, with the car
horn, gun shot and siren sounds having fewer examples. The current sate-of-
the-art on this dataset [10] achieved a mean classification accuracy of
79.0$\%$.

###  II-B Pre-processing

Proper pre-processing of the raw data was a major focus to make comparisons
between the different transformations as fair as possible. Four main
frequency-time representations were extracted in addition to MFCCs:  a)
linear-scaled STFT spectrogram  b) Mel-scaled STFT spectrogram  c) CQT
spectrogram  d) CWT scalogram  e) MFCC cepstrogram.

Firstly, all audio clips were standardized by padding/clipping to a 4 second
duration on both datasets and resampled at 22050 Hz. Unlike [9] and [10],
whole clips were used for the subsequent transformations, including periods of
silence and without additional augmentation. For STFT [24], the discrete
Fourier transform with a sliding Hann window $w[n]$ was applied to overlapping
segments of the signal, given by

$X[n,k]=\sum\limits_{m=0}^{L-1}x[m].w[n-m].e^{-i\frac{2\pi k}{N}m}$ (1)

Varying the window length $L$ results in a trade-off between frequency and
time resolution. Both wideband ($L=2048$) and narrowband ($L=512$) transforms
were used to probe this effect. Hop size was fixed at $L/2$ in both cases.

Spectrograms are defined as the squared magnitude of the STFT, giving the
power of the sound for a particular frequency and time in the third dimension.
The values were converted to a logarithmic scale (decibels) then normalized to
[-1,1] generating a single-channel greyscale image (Fig.1). The frequency bins
were either spaced linearly or mapped onto the Mel scale with 512 or 128 Mel
bands for wideband and narrowband respectively.

The same general procedure was applied to the other transforms. The CQT [25]
is a bank of filters corresponding to tonal spacing where each filter is
equivalent to a subdivision of an octave, with central frequencies given by
$f_{k}={(2^{\frac{1}{b}})}^{k}.f_{min}$. Here $f_{k}$ denotes the frequency of
the $k^{th}$ spectral component and $b$ the number of filters per octave. As
the name suggests, the $Q$ value, which is the ratio of central frequency to
bandwidth, should be constant

$Q=\frac{f_{k}}{\Delta
f_{k}}=\frac{f_{k}}{f_{k+1}-f_{k}}={(2^{\frac{1}{b}}-1)}^{-1}$ (2)

Like the STFT, wideband ($k=1024,b=128$) and narrowband ($k=256,b=32$)
versions of the CQT coefficients were extracted using

$X[n,k]=\frac{1}{N[K]}.\sum\limits_{m=0}^{N[K]-1}x[n].W[k,n].e^{-i2\pi\frac{nQ}{N[k]}}$
(3)

Instead of decomposing a signal into sinusoids like the FT, the CWT uses a
combination of basis functions that are located in both real and Fourier space
i.e. frequency domain. Here the CWT was specified with 256 frequency bins and
a Morlet mother function $\Psi_{(a,b)}$ that has been used in previous audio
recognition studies [14][20]

$F(a,b)=<f,\Psi_{(a,b)}>=\int_{-\infty}^{+\infty}\\!f(x).\Psi_{(a,b)}^{*}\,\mathrm{d}x$
(4)

The CWT analogue of the spectrogram was attained by computing the squared
value of the resultant Wavelet coefficients [26]. Since the CWT allows for
arbitrary time-frequency resolution limited only by sampling rate, only one
transformation was carried out corresponding to narrowband dimensions.

Finally, MFCCs were obtained using the standard procedure and arranged as a
cepstrogram. The coefficients were also normalized to [-1,1] but were not log-
scaled.

To keep the number of input feature maps (area of spectrogram) identical, the
images were further downscaled to 37$\times$50 pixels for CWT, MFCC and all
narrowband spectrograms, and 154$\times$12 pixels for wideband spectrograms,
resulting in 1850 and 1848 input parameters respectively. Downscaling was done
with PIL111http://pillow.readthedocs.io/en/4.0.x/handbook/overview.html using
Lanczos resampling for optimal results. The added effect of the resizing was a
significant speed up in training times without sacrificing much accuracy.

Audio processing was mostly carried out using librosa [27] with the exception
of CWT for which pyWavelets [28] was used.

Figure 1: Examples of time-frequency spectrogram-like representations used as
input extracted from the same ESC-50 sample (Handsaw 5-253094-c). Left, from
far left: wideband linear-STFT, Mel-STFT, CQT. Right, clockwise from top
right: narrowband Mel-STFT, CWT, MFCC, CQT, linear-STFT.

###  II-C Network Architecture and Evaluation

Shallower and deeper variations of a CNN were implemented, informed by popular
image recognition models and the CNNs in [9][10]. The overall architecture is
illustrated in Fig.2.

Figure 2: Network architecture of the deeper (Conv-5) and shallower (Conv-3)
CNN models. 3$\times$3 and M$\times$3 sized filters were used in the
convolutional layers. While containing more layers, Conv-5 had fewer number of
parameters in each layer compared to Conv-3’s single convolutional layer.

Two types of convolutional filters were considered, a 3$\times$3 square filter
and a M$\times$3 rectangular filter, spanning all M frequency bins, that
essentially forces a one-dimensional convolution over time. As opposed to
natural images where both axes contain spatial information, the two are
nonsymmetric in a spectrogram. The invariant property may hold over time as a
translation in a spectrogram image but it was not immediately evident whether
pitch invariance will hold over the full frequency spectrum. For instance [10]
used a small filter, [9] used one spanning just short of all the frequency
bins while [29] implemented both types to varying success. Our results show
that its performance is partly effected by the scale or transformation used.

The convolutional layers were interspersed with rectified linear unit (ReLu)
and max pooling layers with stride sizes equal to the pooling dimensions. The
Conv-3 employed more aggressive max pooling compared to the Conv-5. Dropout
[30] was utilized during training after the first convolutional and fully-
connected layers, in addition to L2-regularization on all weight layers, to
reduce overfitting .

Training was performed using Adam optimization [31] with a batch size of 100,
and cross-entropy for the loss function. Both datasets came prearranged into
non-overlapping folds, and all models were evaluated using 5-fold (ESC-50) and
10-fold (UrbanSound8K) cross validation with a single fold held out as a test
set for each round of validation while training with the remainder. Models
were trained for 200 epochs for ESC-50 and 100 epochs for UrbanSound8K. The
order of samples in the training and test sets were randomly shuffled after
each training epoch. The reported results are median values of the test
classification accuracy from the best training epoch across 4 separate cross
validation runs for ESC-50 and 2 separate runs for UrbanSound8K. All network
parameters were kept constant for each fold and run although the weights were
randomly initialized each time following a truncated normal distribution. The
network was implemented in Python with Tensorflow [32].

##  III Results

TABLE I: Median and median absolute deviation of accuracies ($\%$) for ESC-50
and UrbanSound8K

Linear-STFT Mel-STFT CQT CWT MFCC $wideband$ $narrowband$ $wideband$
$narrowband$ $wideband$ $narrowband$ ESC-50 Conv-5: M$\times$3 44.50$\pm$2.00
46.62$\pm$2.25 46.25$\pm$2.00 48.00$\pm$1.63 42.00$\pm$2.37 42.62$\pm$1.50
38.25$\pm$1.50 30.50$\pm$1.50 3$\times$3 49.25$\pm$0.75 50.00$\pm$1.88
50.87$\pm$2.50 53.75$\pm$1.75 46.87$\pm$1.13 48.62$\pm$2.00 40.50$\pm$2.13
36.62$\pm$2.13 Conv-3: M$\times$3 52.12$\pm$1.12 55.12$\pm$1.88 56.37$\pm$1.63
56.25$\pm$1.75 54.37$\pm$2.25 53.50$\pm$1.87 46.50$\pm$1.63 35.25$\pm$2.75
3$\times$3 55.00$\pm$1.37 53.00$\pm$1.62 54.00$\pm$1.25 55.00$\pm$1.63
51.75$\pm$1.25 51.62$\pm$2.25 46.62$\pm$1.87 35.00$\pm$0.75 UrbanSound8K
Conv-5: M$\times$3 61.19$\pm$4.81 63.44$\pm$3.39 62.22$\pm$5.19 64.97$\pm$3.69
62.87$\pm$3.25 63.12$\pm$3.25 56.90$\pm$2.10 59.23$\pm$3.24 3$\times$3
67.94$\pm$4.22 62.83$\pm$4.73 69.59$\pm$4.19 65.31$\pm$2.19 69.25$\pm$4.69
64.33$\pm$3.60 61.56$\pm$1.80 57.15$\pm$1.81 Conv-3: M$\times$3 68.81$\pm$4.50
66.72$\pm$2.72 70.69$\pm$4.06 68.29$\pm$3.00 70.94$\pm$4.06 67.06$\pm$3.12
64.00$\pm$2.17 64.87$\pm$2.17 3$\times$3 70.94$\pm$2.94 68.19$\pm$3.25
74.66$\pm$3.39 71.25$\pm$1.85 73.03$\pm$3.56 68.31$\pm$2.35 64.75$\pm$1.44
62.81$\pm$4.03

###  III-A Impact of time-frequency representation

Median classification accuracy and their corresponding median absolute
deviations222Median was utilized as a statistical measure as opposed to mean
for its robust property especially against outliers. Deviations were chiefly
the result of the cross-validation protocol with each fold being a distinct
test set, but also came from other stochastic factors such as the random
initialization of weights and batching during optimization. For this reason,
the whole k-fold cross validation process was repeated more than once. for all
experimental cases are presented in Table 1. It was immediately evident that
classification performance with spectral representations as input outperformed
traditional MFCC features. Other than the models with rectangular filters on
the UrbanSound8K dataset for which MFCCs returned a better accuracy than CWT,
this was consistent throughout. In fact time-frequency representations
bettered MFCCs by a relatively wide margin, up to 15-20$\%$ in some cases.
Even so, the confusion matrices in Fig.3 indicates that similar sets of
classes were misclassified using MFCC and narrowband spectrogram features,
albeit at a greater degree for the former. This suggests that the features
provided by both transformations were closely related although spectral
features were ultimately more discriminatory.

Figure 3: Confusion matrices for the best performing Conv-3 model with
3$\times$3 filter on UrbanSound8K with different inputs: wideband (top left)
and narrowband (top right) Mel-STFT spectrogram, MFCC cepstrogram (left). The
wideband confusion matrix displays a similar distribution across classes as
its analogue in [9] and [10].

Among the spectral transformations under consideration, it was observed that
linear-STFT, Mel-STFT and CQT performed comparably on both datasets. On the
other hand, CWT results were lower and closer to MFCC, especially for
UrbanSound8K. The top performers for each model variation (indicated in bold
print) were determined by means of an ANOVA and post-hoc Tukey test333There
were multiple top performers when the null hypothesis could not be rejected
between pairs of transformations. Significance value used was 0.05..

###  III-B Effect of CNN architecture and filter size

Overall, the shallower Conv-3 model tended to yield better accuracies than
Conv-5 regardless of input. A probable explanation is the diminishing returns
of the deeper model due to significant overfitting. While it simplified the
experimental methodology, using whole audio clips as input inevitably resulted
in fewer training examples with less variation, impairing generalizability of
the models. This can be seen when comparing the training and test curves
(Fig.4) that tended to be closer together on Conv-3 than Conv-5.

Figure 4: ESC-50 training (solid line) and test (dashed line) accuracy over
epochs using Conv-5 (left) and Conv-3 (right) models with a narrowband Mel-
STFT spectrogram as input.

Further, 2D convolution generally gave better results than 1D with the notable
anomaly of Conv-3 for ESC-50. Again, this could be partly attributed to
overfitting of the bigger M$\times$3 filters as illustrated in Fig.4, although
it cannot be discounted that some invariant properties of the frequencies were
captured by the smaller filter. Theoretically, Mel-STFT and especially CQT was
expected to be more tolerant to pitch invariance, the former being based on a
log-based perceptual scale of pitches and the latter preserving harmonic
structure despite changes to the fundamental frequency. This may have been the
case seeing the accuracy gains moving from M$\times$3 to 3$\times$3 filters,
although other transforms also displayed similar improvements. We posit that
CQT may be even more beneficial for music analysis where timbre signatures are
more evident in the instrumentation as compared to environmental sounds.

###  III-C Wideband vs Narrowband

The benefit of wideband against narrowband transforms were not consistent
across both datasets. This may be indicative of a disparity in the types of
environmental sounds present in both datasets. More interestingly perhaps,
comparing the confusion matrices reveals that each specializes in
discriminating certain classes of sound. The wideband Mel-STFT fared poorly
for short temporal sounds like “drilling” or “jackhammer” and for droning
sounds like “air conditioner” but excelled at classes with high frequency
variations such as “children playing”. For narrowband, having better temporal
resolution but poorer frequency resolution, the inverse was true.

##  IV Conclusion

The main objective of this paper was to perform a comparative study between
different forms of commonly used time-frequency representations and evaluate
their impact on the CNN classification performance of environmental sound
data. It was shown that Mel-STFT spectrograms were consistently good
performers across the variations tested, although Linear-STFT and CQT also did
well on some models. Generally all time-frequency representations produced
better accuracies than baseline MFCC features, corroborating previous studies.
The effectiveness of using a wide or narrow window during the transformation,
if applicable, was determined to be class dependent. Further insight into the
audio characteristics of the datasets would help in determining which
variation would be more advantageous. Finally, we considered capability of
both 2D and 1D convolution over time by changing the filter size. 2D
convolution seemed to work better for most cases, with the exception of the
shallower model on the ESC-50 dataset. Nonetheless, the best approach may
instead lie in between, such as by using a variable-sized filter, to properly
trade-off between invariance to pitch and better discriminative power.

## Acknowledgment

The author would like to thank Haifa Beji and Lonce Wyse for their input and
feedback.

## References

  * [1] R. Radhakrishnan, A. Divakaran, and A. Smaragdis, “Audio analysis for surveillance applications,” in _Applications of Signal Processing to Audio and Acoustics, 2005. IEEE Workshop on_. IEEE, 2005, pp. 158–161.
  * [2] N. Yamakawa, T. Takahashi, T. Kitahara, T. Ogata, and H. Okuno, “Environmental sound recognition for robot audition using matching-pursuit,” _Modern Approaches in Applied Intelligence_ , pp. 1–10, 2011.
  * [3] J.-C. Wang, H.-P. Lee, J.-F. Wang, and C.-B. Lin, “Robust environmental sound recognition for home automation,” _IEEE transactions on automation science and engineering_ , vol. 5, no. 1, pp. 25–31, 2008.
  * [4] O. Abdel-Hamid, A.-r. Mohamed, H. Jiang, L. Deng, G. Penn, and D. Yu, “Convolutional neural networks for speech recognition,” _IEEE/ACM Transactions on audio, speech, and language processing_ , vol. 22, no. 10, pp. 1533–1545, 2014.
  * [5] L. Deng, O. Abdel-Hamid, and D. Yu, “A deep convolutional neural network using heterogeneous pooling for trading acoustic invariance with phonetic confusion,” in _Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on_. IEEE, 2013, pp. 6669–6673.
  * [6] T. N. Sainath, B. Kingsbury, G. Saon, H. Soltau, A.-r. Mohamed, G. Dahl, and B. Ramabhadran, “Deep convolutional neural networks for large-scale speech tasks,” _Neural Networks_ , vol. 64, pp. 39–48, 2015.
  * [7] T. N. Sainath, A.-r. Mohamed, B. Kingsbury, and B. Ramabhadran, “Deep convolutional neural networks for lvcsr,” in _Acoustics, speech and signal processing (ICASSP), 2013 IEEE international conference on_. IEEE, 2013, pp. 8614–8618.
  * [8] H. Lee, P. Pham, Y. Largman, and A. Y. Ng, “Unsupervised feature learning for audio classification using convolutional deep belief networks,” in _Advances in neural information processing systems_ , 2009, pp. 1096–1104.
  * [9] K. J. Piczak, “Environmental sound classification with convolutional neural networks,” in _Machine Learning for Signal Processing (MLSP), 2015 IEEE 25th International Workshop on_. IEEE, 2015, pp. 1–6.
  * [10] J. Salamon and J. P. Bello, “Deep convolutional neural networks and data augmentation for environmental sound classification,” _IEEE Signal Processing Letters_ , vol. 24, no. 3, pp. 279–283, 2017.
  * [11] L. Deng, J. Li, J.-T. Huang, K. Yao, D. Yu, F. Seide, M. Seltzer, G. Zweig, X. He, J. Williams _et al._ , “Recent advances in deep learning for speech research at microsoft,” in _Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on_. IEEE, 2013, pp. 8604–8608.
  * [12] L. Deng, G. Hinton, and B. Kingsbury, “New types of deep neural network learning for speech recognition and related applications: An overview,” in _Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on_. IEEE, 2013, pp. 8599–8603.
  * [13] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” _Proceedings of the IEEE_ , vol. 86, no. 11, pp. 2278–2324, 1998.
  * [14] M. C. Orr, D. S. Pham, B. Lithgow, and R. Mahony, “Speech perception based algorithm for the separation of overlapping speech signal,” in _Intelligent Information Systems Conference, The Seventh Australian and New Zealand 2001_. IEEE, 2001, pp. 341–344.
  * [15] B. Ghoraani and S. Krishnan, “Time–frequency matrix feature extraction and classification of environmental audio signals,” _IEEE transactions on audio, speech, and language processing_ , vol. 19, no. 7, pp. 2197–2209, 2011\.
  * [16] P. Khunarsal, C. Lursinsap, and T. Raicharoen, “Very short time environmental sound classification based on spectrogram pattern matching,” _Information Sciences_ , vol. 243, pp. 57–74, 2013.
  * [17] S. Chu, S. Narayanan, and C.-C. J. Kuo, “Environmental sound recognition with time–frequency audio features,” _IEEE Transactions on Audio, Speech, and Language Processing_ , vol. 17, no. 6, pp. 1142–1158, 2009.
  * [18] J. Dennis, H. D. Tran, and H. Li, “Spectrogram image feature for sound event classification in mismatched conditions,” _IEEE Signal Processing Letters_ , vol. 18, no. 2, pp. 130–133, 2011.
  * [19] S. Chachada and C.-C. J. Kuo, “Environmental sound recognition: A survey,” in _Signal and Information Processing Association Annual Summit and Conference (APSIPA), 2013 Asia-Pacific_. IEEE, 2013, pp. 1–9.
  * [20] M. Cowling and R. Sitte, “Comparison of techniques for environmental sound recognition,” _Pattern recognition letters_ , vol. 24, no. 15, pp. 2895–2907, 2003.
  * [21] K. J. Piczak, “Esc: Dataset for environmental sound classification,” in _Proceedings of the 23rd ACM international conference on Multimedia_. ACM, 2015, pp. 1015–1018.
  * [22] Y. Aytar, C. Vondrick, and A. Torralba, “Soundnet: Learning sound representations from unlabeled video,” in _Advances in Neural Information Processing Systems_ , 2016, pp. 892–900.
  * [23] J. Salamon, C. Jacoby, and J. P. Bello, “A dataset and taxonomy for urban sound research,” in _Proceedings of the 22nd ACM international conference on Multimedia_. ACM, 2014, pp. 1041–1044.
  * [24] J. B. Allen and L. R. Rabiner, “A unified approach to short-time-fourier analysis and synthesis,” _Proceedings of the IEEE_ , vol. 65, no. 11, November 1977.
  * [25] J. C. Brown, “Calculation of a constant q spectral transform,” _The Journal of the Acoustical Society of America_ , 1991.
  * [26] O. Rioul and M. Vetterli, “Wavelets and signal processing,” _IEEE signal processing magazine_ , vol. 8, no. 4, pp. 14–38, 1991.
  * [27] B. McFee, M. McVicar, C. Raffel, D. Liang, O. Nieto, J. Moore, D. Ellis, D. Repetto, P. Viktorin, and J. F. Santos, “Librosa: v0.5.0,” 2017. [Online]. Available: http://doi.org/10.5281/zenodo.293021
  * [28] F. Wasilewski, “Pywavelets: Discrete wavelet transform in python,” 2010. [Online]. Available: http://www.pybytes.com/pywavelets
  * [29] N. Anand and P. Verma, “Convoluted feelings convolutional and recurrent nets for detecting emotion from audio data,” in _Technical Report_. Stanford University, 2015.
  * [30] N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting.” _Journal of Machine Learning Research_ , vol. 15, no. 1, pp. 1929–1958, 2014\.
  * [31] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” _arXiv preprint arXiv:1412.6980_ , 2014.
  * [32] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin _et al._ , “Tensorflow: Large-scale machine learning on heterogeneous distributed systems,” _arXiv preprint arXiv:1603.04467_ , 2016.