A Convolutional Neural Network for Search Term Detection

Hojjat Salehinejad, Joseph Barfett, Parham Aarabi, Shahrokh Valaee, Errol Colak, Bruce Gray, Tim DowdellarXiv 2017

TL;DR

Researchers have developed "Halo," a voice-interactive indoor navigation system for hospitals that uses a custom Convolutional Neural Network (CNN) to extract origin and destination keywords from natural language queries. By employing a dual-softmax output architecture, the model achieves a near-perfect 99.99% accuracy, vastly outperforming traditional string-matching and standard machine learning techniques.

What Problem Does This Paper Address?

Hospitals are notorious for being navigational nightmares. Their massive footprints, identical-looking corridors, and complex wing structures lead to thousands of missed appointments and significant stress for patients and visitors. While digital signs and floor paths help, they aren't available everywhere.

The authors propose a voice-user interaction (VUI) solution called Halo. The core technical challenge in such a system is "Search Term Detection": accurately identifying the user's starting point and intended destination from a spoken sentence. Traditional methods often rely on deterministic patterns or simple string matching (like Levenshtein distance), which struggle with the variability of natural speech—for example, distinguishing between "How can I get from MRI to the lab?" versus "I need to go to the lab from MRI."

Methods

The Halo system follows a pipeline: Speech $\rightarrow$ Speech-to-Text (STT) $\rightarrow$ Search-Term Detection $\rightarrow$ Data Retrieval $\rightarrow$ Text-to-Speech (TTS).

Fig. 2: Proposed model architecture.

The heart of the paper is a custom CNN designed for sentence-level classification. Key features include:

  • Word Embeddings: Input text is converted into dense vectors using pre-trained word2vec models (trained on 100 billion words from Google News), ensuring that semantically similar words are positioned close together in the vector space.
  • Multi-Scale Filters: The network uses three different filter window sizes ($K \in \{3, 4, 5\}$) to capture various $n$-gram relationships within the query.
  • Dual-Softmax Output: Unlike standard classifiers that might try to predict a single "origin-destination pair" (which leads to an exponential explosion of possible labels), this model uses two distinct softmax layers. One predicts the origin and the other predicts the destination simultaneously. This keeps the complexity growth linear relative to the number of hospital departments.
Fig. 3: Proposed convolutional neural network for search-terms detection from submitted query.

Datasets

Because no standard benchmark existed for hospital-specific navigation queries, the authors generated a custom labeled dataset:

  • Scale: 283,452 unique queries.
  • Scope: Based on 79 distinct medical departments.
  • Variety: Queries were modeled after common English patterns for asking directions, ensuring the model learned to handle different sentence structures.

Key Insights and Ideas

  • Linear vs. Exponential Complexity: The decision to use two separate softmax layers is a major efficiency win. If a hospital has $P$ departments, a single-layer model predicting pairs needs $P(P-1)$ output units. The dual-layer approach only needs $2P$ units, making it much easier to scale to massive medical complexes.
  • Beyond String Matching: The authors demonstrate why Levenshtein distance (LD) fails. LD looks for the "closest" word in a dictionary. As shown in Figure 1, while it can handle minor typos, it lacks the context to understand intent. In a query like "I want to go to Admitting from Fracture Clinic," LD might return multiple "closest" matches for the word "clinic" (e.g., MRI Clinic, Eye Clinic) without understanding which one was actually uttered.
  • CNNs for NLP: While Recurrent Neural Networks (RNNs) are often the go-to for text, this paper highlights that CNNs are excellent at capturing local dependencies and are often faster and easier to train for specific keyword detection tasks.

Key Results

The CNN model was compared against Levenshtein Distance (LD), Random Forests (RF), and Support Vector Machines (SVM) using 10-fold cross-validation.

TABLE I: Matching accuracy in detection of origin and destination pairs on test dataset by Levenshtein distance (LD), random forests (RF), support vector machine (SVM), and convolutional neural networks (CNN) on Halo dataset, after 10-fold cross-validation.
  • Accuracy: The CNN achieved a staggering 99.99% total accuracy.
  • Baselines: Traditional Levenshtein distance managed only 42.77%, largely because it couldn't reliably distinguish between origin and destination roles.
  • Machine Learning: Random Forest (with 3-gram features) performed well at 95.64%, but still fell short of the deep learning approach.

The qualitative difference is clear in Table II, where the CNN correctly identifies the specific departments while LD gets bogged down by similar-sounding terms.

TABLE II: Prediction(s) of search-terms in input query “I want to go to Admitting from Fracture Clinic” by Levenshtein distance (LD) and CNN.

Limitations and Future Work

While the results are impressive, the authors note a few areas for growth:

  • Acoustic Challenges: The current system relies on a clean transcription from the Google STT API. Future versions could benefit from models that handle ambiguous accents or noisy hospital environments more robustly.
  • Grammar: The model needs further testing on highly ungrammatical queries.
  • Architectural Exploration: The authors suggest that implementing Recurrent Neural Networks (RNNs) could be a logical next step to better handle long-term dependencies in more complex conversational queries.

Summary updated

Abstract

Pathfinding in hospitals is challenging for patients, visitors, and even employees. Many people have experienced getting lost due to lack of clear guidance, large footprint of hospitals, and confusing array of hospital wings. In this paper, we propose Halo; An indoor navigation application based on voice-user interaction to help provide directions for users without assistance of a localization system. The main challenge is accurate detection of origin and destination search terms. A custom convolutional neural network (CNN) is proposed to detect origin and destination search terms from transcription of a submitted speech query. The CNN is trained based on a set of queries tailored specifically for hospital and clinic environments. Performance of the proposed model is studied and compared with Levenshtein distance-based word matching.
BibTeX
@misc{salehinejad2017convolutional,
  author = {Hojjat Salehinejad and Joseph Barfett and Parham Aarabi and Shahrokh Valaee and Errol Colak and Bruce Gray and Tim Dowdell},
  title = {{A Convolutional Neural Network for Search Term Detection}},
  year = {2017},
  eprint = {1708.02238},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1708.02238},
}

Loading related content...

Figure