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%,并对新城市和新领域具有强适应性(例如,通过在线学习,西雅图需求的F1分数从77.6%提升至93.75%)。经过护盾功能增强后,CitySpec现已免疫大多数已知文本对抗性输入(例如,护盾功能使DeepWordBug的攻击成功率从82.73%降至0%)。我们邀请来自不同领域的18名参与者对CitySpec进行了测试。结果表明,CitySpec展现出对不同领域的强可用性和适应性,同时具备对恶意输入的鲁棒性。