PurposeWorkers' unsafe behavior is the main cause of construction safety accidents, thereby highlighting the critical importance of behavior-based management. To compensate for the limitations of computer vision in tackling knowledge-intensive issues, semantic-based methods have gained increasing attention in the field of construction safety management. Knowledge graph provides an efficient and visualized method for the identification of various unsafe behaviors.Design/methodology/approachThis study proposes an unsafe behavior identification framework by integrating computer vision and knowledge graph–based reasoning. An enhanced ontology model anchors our framework, with image features from YOLOv5, COCO Panoptic Segmentation and DeepSORT integrated into the graph database, culminating in a structured knowledge graph. An inference module is also developed, enabling automated the extraction of unsafe behavior knowledge through rule-based reasoning.FindingsA case application is implemented to demonstrate the feasibility and effectiveness of the proposed method. Results show that the method can identify various unsafe behaviors from images of construction sites and provide mitigation recommendations for safety managers by automated reasoning, thus supporting on-site safety management and safety education.Originality/valueExisting studies focus on spatial relationships, often neglecting the diversified spatiotemporal information in images. Besides, previous research in construction safety only partially automated knowledge graph construction and reasoning processes. In contrast, this study constructs an enhanced knowledge graph integrating static and dynamic data, coupled with an inference module for fully automated knowledge-based unsafe behavior identification. It can help managers grasp the workers’ behavior dynamics and timely implement measures to correct violations.