An increasing number of monitoring systems have been developed in smart cities to ensure that the real-time operations of a city satisfy safety and performance requirements. However, many existing city requirements are written in English with missing, inaccurate, or ambiguous information. There is a high demand for assisting city policymakers in converting human-specified requirements to machine-understandable formal specifications for monitoring systems. To tackle this limitation, we build CitySpec, the first intelligent assistant system for requirement specification in smart cities. To create CitySpec, we first collect over 1,500 real-world city requirements across different domains (e.g., transportation and energy) from over 100 cities and extract city-specific knowledge to generate a dataset of city vocabulary with 3,061 words. We also build a translation model and enhance it through requirement synthesis and develop a novel online learning framework with shielded validation. The evaluation results on real-world city requirements show that CitySpec increases the sentence-level accuracy of requirement specification from 59.02% to 86.64%, and has strong adaptability to a new city and a new domain (e.g., the F1 score for requirements in Seattle increases from 77.6% to 93.75% with online learning). After the enhancement from the shield function, CitySpec is now immune to most known textual adversarial inputs (e.g., the attack success rate of DeepWordBug after the shield function is reduced to 0% from 82.73%). We test the CitySpec with 18 participants from different domains. CitySpec shows its strong usability and adaptability to different domains, and also its robustness to malicious inputs.
翻译:智慧城市中越来越多的监控系统被开发出来,以确保城市实时运行符合安全性和性能要求。然而,许多现有的城市需求都是用缺失、不准确或模糊的信息用英语编写的。因此,急需辅助城市政策制定者将人工规定的需求转换为能够被监控系统理解的机器可读的规范。因此,我们构建了 CitySpec,这是智慧城市中第一个需求规范的智能助手系统。为了创建 CitySpec,我们首先收集了来自100多个城市的不同领域(如交通和能源)的超过1500个真实城市需求,并提取了城市特定的知识以生成包含3061个单词的城市词汇数据集。我们还构建了一个翻译模型,并通过需求合成增强了它,开发了一种新颖的带屏蔽验证的在线学习框架。在真实世界的城市需求上进行的评估结果显示,CitySpec将需求规范的句子级准确性从59.02%提高到86.64%,并且对于新城市和新领域有很强的适应性(例如,Seattle的要求的F1分数从77.6%到93.75%)。经过屏蔽功能的增强后,CitySpec现在对大多数已知的文本对抗输入具有免疫力(例如,DeepWordBug在屏蔽功能后的攻击成功率从82.73%降至0%)。我们从不同领域的18名参与者中测试了CitySpec。CitySpec展示了它在不同领域中的强大的可用性和适应性,以及它对恶意输入的鲁棒性。