S e N s ER : Learning Cross-Building Sensor Metadata Tagger (2020)

Abstract: Sensor metadata tagging, akin to the named entity recognition task, provides key contextual information (e.g., measurement type and location) about sensors for running smart building applications. Unfortunately, sensor metadata in different buildings often follows distinct naming conventions. Therefore, learning a tagger currently requires extensive annotations on a per building basis. In this work, we propose a novel framework, SeNsER, which learns a sensor metadata tagger for a new building based on its raw metadata and some existing fully annotated building. It leverages the commonality between different buildings: At the character level, it employs bidirectional neural language models to capture the shared underlying patterns between two buildings and thus regularizes the feature learning process; At the word level, it leverages as features the k-mers existing in the fully annotated building. During inference, we further incorporate the information obtained from sources such as Wikipedia as prior knowledge. As a result, SeNsER shows promising results in extensive experiments on multiple real-world buildings.

## introduction sensor metadata tagging aims at understanding the context (e.g., sensor function and location) of a sensor from its name, which is essential to any smart building technologies @xcite . as illustrated in figure 1 , sensor metadata is typically a concatenation of esoteric abbreviations, each encoding specific information about the sensor, including what they measure/control, where they are located, how they are related to each other, etc. for example, a sensor name soda1r430 art conveys: the building name (sod), air conditioning equipment id (a1), room id (r430), and the measurement type, which is area room temperature (art). running any application would require such sensor name tagging aims to partition a sensor name into segments (shown in color) that encode key contextual information about sensors. different buildings adopt distinct vocabularies and naming conventions. contextual information; for example, to detect overcooled rooms, one needs the temperature and the target temperature set for each room. currently, learning a metadata tagger for a new building in practice requires extensive human annotations, thus remaining a bottleneck in deploying smart building techniques widely and efficiently @xcite . this is due to the fact that sensor metadata is curated by building-specific vendors, and that their naming conventions vary drastically across buildings, as shown in figure 1 . anecdotally, annotating one sensor name may cost several hundred dollars, and it takes weeks to do so for one typical building with thousands of sensing and control points. this manual approach is clearly neither economical nor scalable, and it calls for an automated solution. as there usually exist buildings that are already tagged, leveraging this information could potentially expedite the tagging process in a new building. thus, in this paper, we seek to answer the following question: can we learn a sensor metadata tagger for a new building based on its raw metadata and some existing fully annotated building(s)? our problem faces unique challenges, despite its similarity with named entity recognition (ner) @xcite . first, lacking pre-processing tools (e.g., tokenizer) for the building domain, we have only raw character sequences as input to work with (rather than "word" sequences as input), and thus state-of-the-art ner models @xcite @xcite do not apply. the choice of taggers is therefore confined to only those working at the character level. secondly, the heterogeneity of sensor names in source and target buildings hurts the performance of existing character-level taggers (e.g., char-lstm-crf in figure 2 ), resulting in unsatisfactory results. last, one building typically has "only" a few thousand sensor names, and each sensor name has fewer than two dozen characters; however, there are more than 100 types for tagging. recognizing these challenges, we propose a novel framework -senser. at the character level, together with the tagging objective function on the source building, we train bidirectional neural language models using sensor names from both source and target buildings; we expect such co-training to regularize the feature learning process for our tagger so that the model can be better applied to the target building. in addition, we propose to learn k-mer (i.e., a substring of length-k) representations of the source building and align them with those of the target building, as there exist common character patterns across buildings similar to "words" in human language. for example, "t" or "temp" would almost always appear in sensors related to temperature. these aligned k-mers complement the language model as "word"-level information, namely, what phrases look like in sensor names. moreover, during inference, because of a strong connection between raw names and entity types, we incorporate information (e.g., what an abbreviate stands for) obtained from resources such as wikipedia as prior knowledge to narrow the gap between the limited input data and a large number of target classes. in summary, our major contributions are: ## related work we review the literature from two fields, namely, sensor name tagging and named entity recognition. sensor metadata tagging. the problem of tagging sensor metadata has seen increasing interest from the smart building and sensing communities, mainly following the active learning paradigm @xcite to reduce manual labeling effort. these methods iteratively select "representative" metadata examples for a human to annotate and progressively craft custom regular expressions @xcite or construct classical learning models such as logistic regression @xcite and conditional random fields @xcite @xcite , in order to tag the sensor names. despite the promising results, all these methods rely on building-specific domain knowledge and human effort, which often do not generalize across buildings. another attempt based on transfer learning @xcite ) leverages the information from existing buildings to classify sensor measurement type only, which is a sub-problem of sensor tagging. it is primarily built upon sensory timeseries data and therefore cannot generalize to other contextual information, such as the location and relationship with others. by contrast, we aim to understand all the information in the metadata. named entity recognition (ner). our sensor metadata tagging problem can be viewed as a kind of ner task, while our tagging happens per character. most of, if not all, ner models consume words as the basic unit and detect entity boundaries as a subset of word boundaries. however, in our problem, due to the lack of pre-processing tools, the input only contains raw character sequences. such difference makes most of the recent neural ner models @xcite @xcite @xcite al., knowledge from wiki (prior for inference) z n -@xmath0. b -z o n e t e m p e ra tu re i -z … t … i -z … t … e -z … t … "word"-level complement (k-mers from source building) z n -@xmath1. n . z n --@xmath2 figure 2: neural architecture of senser. built upon char-lstm-crf, senser further equips it with three novel components for effective cross-building metadata tagging: (1) co-training of language models using both source and target buildings to guide feature learning, (2) k-mer-based "word"-level information to assist with alignment, and (3) prior knowledge obtained from external sources such as wikipedia to help inference. 2016; @xcite @xcite not directly applicable. after sifting through compatible modules from these models, the best applicable existing neural ner model becomes char-lstm-crf, as we shall describe in section 4. it performs well under the intra-building setting but poorly under our cross-building setting. our idea of introducing language models as regularization is inspired by lm-lstm-crf @xcite . lm-lstm-crf imposes a language model objective on the ner's training set as additional guidance for feature extraction. in this paper, we further propose to train the language models using both source and target buildings, so as to better generalize the features learned from the source building to the target building. ## problem formulation in this paper, we study the cross-building metadata tagging problem. the input involves two buildings: ## char-lstm-crf as mentioned earlier, the best applicable existing neural tagging model to our problem is char-lstm-crf, which was proposed as a strong baseline in @xcite . since senser builds upon char-lstm-crf, we briefly revisit this model to be self-contained. as illustrated by the top part of figure 2 , char-lstm-crf takes as input a character sequence @xmath3, x 2 , . . . , x m ), and applies bidirectional lstms to every character's embedding, obtaining f i and r i for the i-th character. then, it gets the contextualized representation z i of the i-th character by concatenating the two embedding vectors: finally, it uses a conditional random field (crf) layer @xcite to capture the label dependency, which defines the probability of generating the label sequence @xmath4, y 2 , . . . , y m ), namely, ## our senser framework as shown in figure 2 , our senser framework builds upon char-lstm-crf and further enhances it with (1) cross-building language models as regularization, (2) k-mer alignment as "word"-level complement, and (3) tailored decoding using a domain-specific dictionary as prior knowledge. ## empirical evaluation in this section, we empirically evaluate senser and compared models on real-world buildings. we first introduce the datasets and experimental settings. then, we present chunking and tagging results. finally, we present some case studies about kmer embedding and typical mistakes of our model. ## conclusions and future work in this paper, we study the problem of automated cross-building sensor metadata tagging, a key to enabling any smart building applications. capitalizing on the intuition that sensor names are created following some underlying rule, though varying across buildings, we design senser. senser builds upon char-lstm-crf and guides the sensor name feature learning using both source and target buildings, well preparing them for interpreting the metadata in the target building. we further leverage a k-mer-based matching procedure to provide "word"-level information, as well as a dictionary comprised of prior knowledge about sensor names, to boost the tagging performance. promising experimental results demonstrate the synergy among neural language models, k-mersbased alignments, and the use of prior knowledge. as future work, we plan to further collect more domain-specific text data, e.g., sensor datasheets, which helps provide more information about different naming conventions and abbreviations. we then can integrate such information into our model to make it generalize better.