A construction site safety monitoring model non-inductive adaptation method, system and device
Patent Information
- Application Number
- CN202511309320.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2045-12-03
AI Technical Summary
此外,现有的迁移学习、领域自适应和传统知识蒸馏等技术,亦存在样本需求多、难以有效解决视角几何差异以及在视角差异较大时易产生知识冲突等固有缺陷,导致模型难以同时应对几何畸变和尺度变化等复杂的视角泛化问题
[0017]综上所述,本申请所能实现的有益效果:通过引入创新的元知识蒸馏机制,使得轻量级安监模型能够在部署至全新工地现场时,无需耗费大量成本重新标注数据和进行训练,便能无感知地调整其内部处理逻辑以精准识别目标,从而兼顾模型的泛化能力与部署经济性,显著提升了工程安全管理的智能化水平。
Smart Images

Figure CN121305286B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of visual technology, and more particularly to a method, system and equipment for seamless adaptation of construction site safety monitoring models. Background Technology
[0002] With the rapid development of the construction industry and increasingly stringent safety requirements, construction site safety monitoring has become a crucial link in ensuring the safety of construction workers' lives and property. In recent years, deep learning-based target detection technology has been widely used in the field of construction site safety monitoring. By automatically identifying and analyzing personal protective equipment such as safety helmets and reflective vests, it has effectively improved the efficiency and accuracy of traditional manual inspections.
[0003] Against this backdrop, existing construction site safety monitoring models are mainly divided into two categories: general-purpose model training and scenario-customized model training. General-purpose models aim to achieve universal application by training a single model with mixed data from multiple scenarios; while scenario-customized models are trained specifically for particular camera views or environments in order to pursue higher accuracy and reliability.
[0004] However, existing technologies have revealed numerous shortcomings in practical applications. While general-purpose models attempt to cover multiple scenarios, their performance is often poor and their generalization ability is limited when faced with special perspectives such as shape distortion caused by ultra-wide-angle cameras, missed detection of small targets under distant cameras, and failure to recognize reflective vests in close-up shots by law enforcement recorders. On the other hand, while scene-customized models can improve detection accuracy in specific scenarios, they bring high annotation costs and deployment expenses. The introduction of new projects or new cameras requires a large amount of data annotation and model training. For example, the average annotation time for safety ropes can reach one minute per image, which seriously restricts their large-scale promotion. In addition, existing techniques such as transfer learning, domain adaptation, and traditional knowledge distillation also have inherent defects such as high sample requirements, difficulty in effectively solving geometric differences in perspectives, and easy knowledge conflicts when there are large differences in perspectives. This makes it difficult for models to cope with complex perspective generalization problems such as geometric distortion and scale changes. Therefore, how to achieve seamless adaptation of construction site safety monitoring models to different on-site environments and visual conditions, while avoiding high annotation costs and model training costs, is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] In order to at least overcome the above-mentioned shortcomings in the prior art, the purpose of this application is to provide a method, system and equipment for seamless adaptation of construction site safety monitoring models to solve the above problems.
[0006] Firstly, this application provides a method for seamless adaptation of a construction site safety monitoring model, comprising the following steps: Based on the original images of the construction site, preprocessed images are obtained through a preprocessing process; Based on the preprocessed image, a multi-teacher model library is obtained through a pre-trained deep convolutional neural network model library; Based on the preprocessed image, an initial student network is obtained through a pre-trained lightweight neural network model; Based on the output of the multi-teacher model library and the intermediate features of the student network, the student network is fine-tuned through a meta-knowledge distillation mechanism to obtain the fine-tuned student network. Based on the finely tuned student network, it is deployed to a new construction site to identify safety monitoring targets in real-time images of the construction site and obtain detection results.
[0007] In one possible implementation, the preprocessing procedure includes: The original images of the construction site are acquired in real time using image acquisition equipment. Based on the preset calibration image and the original image, distortion parameters are estimated using a nonlinear algorithm to obtain the intrinsic and extrinsic parameters of the digital camera used for image acquisition. Based on the intrinsic and extrinsic parameters of the digital camera, and using an image remapping algorithm, the original image data is subjected to real-time geometric distortion correction to obtain a geometrically distorted image. Based on the image after geometric distortion correction, illumination normalization is performed using an adaptive histogram equalization algorithm to obtain an image after illumination intensity adjustment. Based on the image after adjusting the illumination intensity, scale normalization is performed using the image pyramid algorithm to obtain a standardized image frame, which serves as the preprocessed image.
[0008] In one possible implementation, the multi-teacher model library includes at least three pre-trained deep convolutional neural network models; The pre-trained deep convolutional neural network models include: a geometric distortion teacher model, a long-distance target recognition teacher model, and a close-range special material feature enhancement teacher model; The teacher model is obtained by pre-training based on the YOLOv7 architecture.
[0009] In one possible implementation, the geometric distortion teacher model is obtained by training based on preset calibration images from the same construction site; wherein: The training dataset for the geometric distortion teacher model is obtained by using images of people and equipment with significant geometric distortion captured by a real wide-angle lens at the same construction site, as well as images synthesized by simulating distortion of preset calibration images. Based on the distortion-perceived loss function, constraints on the distortion correction consistency of the geometric distortion teacher model are obtained; Based on images with resolutions higher than a set threshold, a teacher model for distant target recognition is obtained by cropping and enlarging these images, and then densely annotating distant targets within them; wherein: Based on high-resolution images of the construction site, dense annotations are performed on workers operating at a distance to obtain a training dataset for a teacher model for long-distance target recognition. Based on the loss function for small target detection, the ability to capture target context information at different resolutions is obtained; Based on the unique materials at the construction site, a near-field enhanced teacher model of the special material features was obtained by analyzing reflection characteristic images under different lighting conditions; wherein: The training dataset for the close-range special material feature enhancement teacher model is obtained by taking images of personal protective equipment with special materials under strong direct light, backlight, shadow, and low illumination conditions. Based on the attention mechanism, the reflective properties of special materials under different lighting conditions are obtained.
[0010] In one possible implementation, the student network uses MobileNetV3, a lightweight convolutional neural network, as its backbone network. The student network includes a viewpoint feature extraction branch, a semantically invariant feature extraction branch, a feature fusion and decoupling module, and a multi-task prediction head; wherein: The viewpoint feature extraction branch is configured to obtain visual features from the first three feature extraction layers of the backbone network MobileNetV3 based on the preprocessed image. The semantically invariant feature extraction branch is configured to obtain target semantic features from the feature extraction layers following the backbone network MobileNetV3 based on the preprocessed image. The feature fusion and decoupling module is configured to: obtain view-related factors by fusing the output features of the view feature extraction branch and the semantically invariant feature extraction branch, and decoupling them during the fusion process; The multi-task prediction head is configured to: obtain the predicted target class probability through two parallel branches based on view-related factors, one branch obtaining the predicted target bounding box offset and scale factor; obtain the target class classification based on the predicted target class probability; and obtain the target bounding box regression based on the predicted target bounding box offset and scale factor. The feature fusion and decoupling module includes a two-layer convolutional neural network and a normalization layer. The normalization layer performs channel-level scaling and offset on the fused features based on the adaptation parameters generated by the meta-knowledge distillation mechanism, thereby decoupling and obtaining viewpoint-related factors.
[0011] In one possible implementation, the meta-knowledge distillation mechanism includes: Based on the preprocessed image, it is input into the multi-teacher model library for meta-knowledge extraction and fusion to obtain high-level features of each teacher model. Based on the high-level features, it is then encoded and fused to obtain a global meta-knowledge vector. Based on the global meta-knowledge vector, dynamic adaptation is performed to obtain the adaptation parameters of the meta-knowledge distillation mechanism. Based on the adaptation parameters, the forward computation process of the feature fusion and decoupling module in the student network is adjusted. Based on the predicted output of the student network, the softened output of the multi-teacher model, and the adaptation parameters, joint optimization is performed to make the predicted output of the student network closer to the softened output of the multi-teacher model, thus obtaining a fine-tuned student network.
[0012] In one possible implementation, the meta-knowledge distillation mechanism includes meta-knowledge extraction and fusion, wherein the meta-knowledge extraction and fusion includes: Based on the preprocessed image, a set of high-level feature maps output by the final convolutional layer of each teacher model is obtained through each teacher model; Based on the set of high-level feature maps, each feature map is encoded by a shared meta-knowledge encoder to obtain a fixed-length vector, which serves as the primary meta-knowledge vector for each teacher model. Based on the primary meta-knowledge vector, a global meta-knowledge vector is obtained through an attention-based fusion module; The meta-knowledge encoder includes a global average pooling layer and a two-layer perceptron.
[0013] In one possible implementation, the meta-knowledge distillation mechanism further includes dynamic adaptation and joint optimization; The dynamic adaptation includes: Based on the global meta-knowledge vector, a set of adaptation parameters is obtained through the adaptation parameter generator; Based on the adaptation parameters, a scaling factor is obtained for the channel attention weights of the feature fusion and decoupling module in the student network. Based on the scaling factor, the student network is dynamically adapted and adjusted, and the processing image method of the obtained student network is adjusted to the global meta-knowledge vector; The adaptation parameter generator includes a three-layer fully connected neural network. The joint optimization includes: Based on the perspective-related factors of the student network prediction and the softened labels of the multi-teacher model library, the distillation loss is obtained; Based on the distillation loss and the task loss of the student network, the joint optimization from the teacher end to the student end is obtained by gradient descent.
[0014] Secondly, this application provides a seamless adaptation system for a construction site safety monitoring model, comprising a preprocessing module with sequential electrical connections, a multi-teacher model library module, a student network initialization module, a meta-knowledge distillation mechanism adjustment module, and a real-time detection module; wherein: The preprocessing module is configured to obtain a preprocessed image based on the acquired original images of the construction site through a preprocessing process. The multi-teacher model library module is configured to obtain a multi-teacher model library based on the preprocessed image using a pre-trained deep convolutional neural network model library. The initial student network module is configured to obtain an initial student network based on the preprocessed image using a pre-trained lightweight neural network model. The meta-knowledge distillation mechanism adjustment module is configured to fine-tune the student network based on the output of the multi-teacher model library and the intermediate features of the student network through the meta-knowledge distillation mechanism to obtain the fine-tuned student network. The real-time detection module is configured to, based on the fine-tuned student network, be deployed to a new construction site to identify safety monitoring targets in real-time images of the construction site and obtain detection results.
[0015] Thirdly, this application provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any one of the methods in a construction site safety monitoring model seamless adaptation method.
[0016] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the construction site safety monitoring model seamless adaptation method.
[0017] In summary, the beneficial effects achieved by this application are as follows: by introducing an innovative meta-knowledge distillation mechanism, the lightweight safety monitoring model can be deployed to a new construction site without incurring significant costs for data re-labeling and training, and can seamlessly adjust its internal processing logic to accurately identify targets. This balances the model's generalization ability with deployment economy, and significantly improves the level of intelligence in engineering safety management. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the method steps in an embodiment of this application; Figure 2This is a schematic diagram of the method flow of an embodiment of this application; Figure 3 This is a schematic diagram of the preprocessing flow according to an embodiment of this application; Figure 4 This is a schematic diagram illustrating the interaction between the multi-teacher model library and the student network in an embodiment of this application. Figure 5 This is a schematic diagram of the student network architecture according to an embodiment of this application; Figure 6 This is a schematic diagram of the meta-knowledge distillation mechanism in an embodiment of this application; Figure 7 This is a schematic diagram illustrating the application of a slightly modified student network deployment in a construction site for safety monitoring target identification, as described in this embodiment of the application. Figure 8 This is a schematic diagram of the system structure according to an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0020] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0021] Example 1 Please refer to the following: Figure 1 and Figure 2 The above is a schematic diagram of the steps and process of a construction site safety supervision model seamless adaptation method provided in an embodiment of the present invention. Further, the construction site safety supervision model seamless adaptation method may specifically include the contents described in steps S1-S5.
[0022] Step S1: Based on the original images of the construction site, obtain preprocessed images through a preprocessing process; Step S2: Based on the preprocessed image, obtain a multi-teacher model library using a pre-trained deep convolutional neural network model library; Step S3: Based on the preprocessed image, obtain the initialized student network using a pre-trained lightweight neural network model; Step S4: Based on the output of the multi-teacher model library and the intermediate features of the student network, the student network is fine-tuned through a meta-knowledge distillation mechanism to obtain the fine-tuned student network. Step S5: Based on the finely adjusted student network, the network is deployed to a new construction site to identify safety monitoring targets in the real-time images of the construction site and obtain detection results.
[0023] In the implementation of this application embodiment, from the preprocessing of the original image, the construction of the multi-teacher model library and the initialization of the student network, to the fine-tuning of the student network through the meta-knowledge distillation mechanism, and finally the deployment of the fine-tuned student network to the actual construction site for safety supervision target recognition.
[0024] By introducing an innovative meta-knowledge distillation mechanism, the lightweight safety monitoring model can be deployed to a new construction site without incurring significant costs for data re-labeling and training. It can then seamlessly and adaptively adjust its internal processing logic to accurately identify targets, thus balancing the model's robustness, generalization ability, and deployment economy. This solves the inherent contradiction between the model's perceptual adaptability and deployment economy in existing construction site safety monitoring systems when facing complex and ever-changing perspective environments. In particular, it addresses the problems of decreased model recognition accuracy and high deployment costs caused by differences in perspective geometry, drastic changes in target scale, and the complexity of lighting environments.
[0025] In this embodiment, deep learning is primarily utilized, combining a knowledge distillation mechanism with a multi-teacher model and a lightweight student network to achieve accurate and efficient model adaptation for construction site safety monitoring. For the basic principles, please refer to [link / reference needed]. Figure 2 It can monitor the safety behavior of construction workers in real time on construction sites, such as wearing safety helmets and fastening safety belts, and monitor the safety production status in factories in industrial production to prevent accidents.
[0026] Based on the acquired raw images of the construction site, a preprocessing process is used to obtain preprocessed images. First, raw images of the construction site are acquired in real-time using an image acquisition device (such as a wide-angle camera). Since cameras may have geometric distortion, they need to be calibrated. Using a pre-set calibration image and the acquired raw images, distortion parameters are estimated based on a nonlinear algorithm to obtain the intrinsic and extrinsic parameters of the camera device. Next, based on the estimated intrinsic and extrinsic parameters, an image remapping algorithm is used to perform real-time geometric distortion correction on the raw image data, resulting in a geometrically distorted image. Then, contrast-limited adaptive histogram equalization is used to normalize the illumination of the geometrically distorted image, adjusting the image's illumination intensity. Finally, an image pyramid algorithm is used to scale the illumination-intensity-adjusted image, resulting in a standardized image frame, which serves as the preprocessed image.
[0027] Based on the preprocessed images, a multi-teacher model library is obtained using a pre-trained deep convolutional neural network (DCNN) model library. This library contains multiple pre-trained teacher models, such as a geometric distortion teacher model, a long-distance target recognition teacher model, and a close-range special material feature enhancement teacher model. These teacher models excel in specific tasks; for example, the geometric distortion teacher model effectively corrects geometric distortions in images, the long-distance target recognition teacher model identifies small targets at a distance, and the close-range special material feature enhancement teacher model enhances the features of special materials under different lighting conditions. Through these teacher models, high-level features at different levels can be extracted, improving the robustness and accuracy of the overall model.
[0028] Based on the preprocessed image, an initial student network is obtained through a pre-trained lightweight neural network model. The student network uses the lightweight MobileNetV3 as its backbone network and mainly includes a viewpoint feature extraction branch, a semantically invariant feature extraction branch, a feature fusion and decoupling module, and a multi-task prediction head.
[0029] The viewpoint feature extraction branch utilizes the first few feature extraction layers of the backbone network to extract visual features; the semantically invariant feature extraction branch utilizes subsequent feature extraction layers to extract the semantic features of the target. The feature fusion and decoupling module fuses viewpoint features and semantic features, and decouples them through channel-level scaling and offsetting to finally obtain viewpoint-related factors.
[0030] The multi-task prediction head includes two parallel branches: one for target category classification and the other for target bounding box regression.
[0031] Based on the output of the multi-teacher model library and the intermediate features of the student network, the student network is fine-tuned using a meta-knowledge distillation mechanism to obtain the fine-tuned student network. Specifically, firstly, the preprocessed image is input into the multi-teacher model library to extract the high-level features of each teacher model, and then fused into a global meta-knowledge vector through a meta-knowledge encoder and attention mechanism. Next, adaptation parameters are generated based on the global meta-knowledge vector to adjust the channel attention weights of the feature fusion and decoupling modules in the student network, making its image processing method more similar to that of the multi-teacher model. Finally, through joint optimization, combining distillation loss and task loss, the predicted output of the student network is ensured to be close to the softened output of the multi-teacher model, thus obtaining the fine-tuned student network.
[0032] The finely tuned student network was deployed to the new construction site to identify safety monitoring targets in real-time images acquired from the site and obtain detection results. The student network can process images collected on-site in real time, identify safety monitoring targets such as safety helmets and safety belts, and generate detection results. In this way, the safety status of the construction site can be monitored in real time, potential safety hazards can be detected and warned of in a timely manner, and the level of safety management at the construction site can be improved.
[0033] Through the above steps, this invention provides an efficient, accurate, and robust method for seamless adaptation of construction site safety monitoring models, which can automatically adapt to different construction site environments without requiring extensive retraining, thus significantly improving the level of intelligence in engineering safety management.
[0034] Example 2 Based on Example 1, please refer to the following: Figures 2 to 7 This is Embodiment 2 of a seamless adaptation method for a construction site safety monitoring model provided by the present invention. Further, the seamless adaptation method for a construction site safety monitoring model may specifically include the following: Step S1: Based on the original images of the construction site, obtain preprocessed images through a preprocessing process; Step S2: Based on the preprocessed image, obtain a multi-teacher model library using a pre-trained deep convolutional neural network model library; Step S3: Based on the preprocessed image, obtain the initialized student network using a pre-trained lightweight neural network model; Step S4: Based on the output of the multi-teacher model library and the intermediate features of the student network, the student network is fine-tuned through a meta-knowledge distillation mechanism to obtain the fine-tuned student network. Step S5: Based on the finely adjusted student network, the network is deployed to a new construction site to identify safety monitoring targets in the real-time images of the construction site and obtain detection results.
[0035] This embodiment aims to verify the performance of the seamless adaptation method for construction site safety monitoring proposed in this invention in a real construction site environment. The experiment was conducted on a typical large construction site, which includes multi-view cameras (wide-angle lenses, telephoto lenses), complex lighting conditions (sunlight, shadows, nighttime LED lighting), and diverse safety monitoring targets (wearing / not wearing safety helmets, reflective vests, safety belts, and aerial work platforms).
[0036] In one possible implementation, the preprocessing procedure includes: The original images of the construction site are acquired in real time using image acquisition equipment. Based on the preset calibration image and the original image, distortion parameters are estimated using a nonlinear algorithm to obtain the intrinsic and extrinsic parameters of the digital camera used for image acquisition. Based on the intrinsic and extrinsic parameters of the digital camera, and using an image remapping algorithm, the original image data is subjected to real-time geometric distortion correction to obtain a geometrically distorted image. Based on the image after geometric distortion correction, illumination normalization is performed using contrast-limited adaptive histogram equalization to obtain an image after illumination intensity adjustment. Based on the image after adjusting the illumination intensity, scale normalization is performed using the image pyramid algorithm to obtain a standardized image frame, which serves as the preprocessed image.
[0037] When implementing the embodiments of this application, please refer to the preprocessing process in step S1. Figure 3 This is a schematic diagram of the preprocessing process of a construction site safety monitoring model seamless adaptation method provided in an embodiment of the present invention. The main purpose is to convert the original image data from different camera perspectives, different lighting conditions and different target scales into preprocessed images with unified features and which have also eliminated external interference.
[0038] First, multiple image acquisition devices are installed at the construction site to acquire raw image data of the site in real time. These image acquisition devices utilize CMOS image sensors to ensure efficient data transmission; industrial digital cameras are specifically used.
[0039] Industrial digital cameras are video acquisition devices specifically designed for industrial environments. Their core function is to record stable images over extended periods in complex industrial environments, directly storing image data on a hard drive. They are primarily used in industrial inspection and automated production. Common resolution ranges include: low-end models with 300,000 pixels (640x480), suitable for basic monitoring; mid-range models with 400,000-1.3 million pixels (e.g., 1280x960), meeting routine inspection needs; and high-end models with 5 million pixels and above (e.g., 2448x2048), suitable for precision inspection and high frame rate scenarios. Our industrial digital cameras feature higher resolutions while maintaining cost-effectiveness, opting for mid-range models, such as 1920x1080 pixels, supporting a frame rate of 30 frames per second, and using a gigabit Ethernet interface for high-speed data transmission to ensure the integrity and timeliness of real-time monitoring data.
[0040] The unprocessed raw image dataset at this point retains all visual information of the construction site (safety monitoring targets, environmental interference, equipment distortion), providing raw material for subsequent preprocessing. However, it has obvious problems, such as barrel distortion at the edges of wide-angle lens images (stretching of human body proportions), small targets in telephoto lens images (faraway workers only occupy 16×16 pixels), and large differences in image illumination at different times (we currently use grayscale intensity, so each pixel value ranges from 0 to 255, which may result in pixel values close to 255 in areas of strong midday light and close to 0 in areas of low nighttime illumination).
[0041] Next, geometric distortion correction is performed, mainly including two steps: parameter estimation and image remapping. Based on the preset calibration image and the acquired original image data, a nonlinear algorithm is used to estimate the distortion parameters. The preset calibration image is a standard object with a high-contrast black and white checkerboard pattern, and its physical dimensions and pattern spacing have been calibrated using precision measuring tools.
[0042] Then, using the Brown-Conrady model and the Levenberg-Marquardt method, the actual imaging position of the checkerboard calibration map in the original image is compared with the ideal distortion-free position to calculate the camera's intrinsic and extrinsic parameters. These camera intrinsic and extrinsic parameters are not image data, but numerical parameters describing the camera's characteristics. The nonlinear algorithm employed is based on the Brown-Conrady model, which comprehensively describes the radial and tangential distortion of the camera and can estimate the intrinsic and extrinsic parameters of the digital camera used for image acquisition. The intrinsic parameters include focal length, principal point coordinates, and radial and tangential distortion coefficients. The extrinsic parameters include the rotation matrix R and translation vector T, describing the camera's pose in the world coordinate system. The Levenberg-Marquardt method is used to fit the data and solve the least squares problem. By minimizing the reprojection error of the checkerboard corner points, the calculated parameters are made to coincide as closely as possible with the actual imaging positions, converging to sub-pixel accuracy. This yields high-precision camera parameters, providing a data benchmark for subsequent calibration.
[0043] Then, based on the obtained intrinsic and extrinsic parameters of the digital camera, the original image data can be corrected for geometric distortion in real time using an image remapping algorithm to obtain the image after geometric distortion correction.
[0044] The image remapping algorithm is implemented by establishing an inverse mapping relationship between the corrected image and the original image. For each pixel (u', v') in the corrected image, its corresponding coordinates (u, v) in the original image are first deduced using the estimated intrinsic and extrinsic parameters.
[0045] Since (u,v) is usually not an integer coordinate and the calculated value is a floating point, we use bilinear interpolation or bicubic interpolation to obtain the pixel value from the neighboring pixels of the original image. We take the gray values of the four integer pixels around the floating point coordinate and calculate the pixel value at that position by weighting the distance. For example, if the values of the four surrounding pixels are 200, 210, 220, and 230, the weighted result is 215.
[0046] Repeat the above operation for all pixels of the corrected image to finally eliminate edge distortion (such as restoring the barrel stretch at the edge of a wide-angle lens to the normal proportion of a person, and straight edges no longer being curved). After geometric distortion correction, the resolution of the image remains unchanged at 1920×1080, thus ensuring the smoothness and sharpness of the corrected image to avoid introducing jagged edges or blurring, and ensuring the visual quality of the image after resizing.
[0047] We can directly use existing graphics processing units (GPUs) for distortion correction. To meet real-time requirements, this process is implemented through GPU parallel computing. With existing GPU technology, 1920x1080 pixels can be completed in a few milliseconds.
[0048] Subsequently, based on the geometrically distorted image, illumination normalization is performed using contrast-limited adaptive histogram equalization to obtain an image with adjusted illumination intensity. The contrast-limited adaptive histogram equalization involves dividing the image into multiple non-overlapping regions and performing histogram equalization independently within each region. This is achieved by calculating the local histogram of each small region and limiting its distribution within a preset contrast limit parameter.
[0049] For example, we first divide the image into blocks, dividing the 1920×1080 image into an 8×8 grid (64 regions in total), with each region having a size of 135×240 pixels (1080÷8=135, 1920÷8=240). Perform local histogram calculation for each region, calculate the grayscale histogram separately, and count the number of pixels at each grayscale level (0-255). For example, there are 500 pixels with a grayscale of 100. Then, based on the histogram of each region and the preset contrast limit, the part exceeding the contrast limit threshold is cropped to avoid excessive amplification of noise, and the cropped pixel values are evenly distributed to other gray levels. Finally, based on the adjusted histogram, equalization mapping maps the original gray value of each pixel to a new gray value, making the gray distribution of each region more uniform. For example, the pixel value in the dark area is increased from 50 to 100, and the pixel value in the overexposed area is reduced from 240 to 200. At the same time, we also use bilinear interpolation for the boundary pixels of adjacent regions to avoid block effects, avoid abrupt changes in brightness between regions, and make the boundaries smooth.
[0050] Finally, the output image after adjusting the illumination intensity remains unchanged at 1920×1080, with pixel values ranging from 0 to 255. However, the overall illumination distribution is more uniform. For example, a face under backlight transforms from a dark patch into a recognizable detail, and reflective clothing under strong light is no longer a blank white blur. This eliminates the interference of illumination on target features and effectively avoids the over-enhancing noise that may be caused by global histogram equalization. Especially in scenes with uneven image brightness distribution, this eliminates local areas that are too dark or too bright caused by uneven illumination, such as backlight, shadows, or direct strong light, making the image brightness distribution more uniform and thus improving the robustness of subsequent feature extraction.
[0051] Finally, based on the image adjusted according to the illumination intensity, scale normalization is performed using the image pyramid algorithm to obtain a standardized image frame.
[0052] Even after adjusting the lighting intensity, the image is still 1920×1080. At this point, the target scale varies greatly depending on the camera and distance. For example, a worker nearby might occupy 500×500 pixels, while a worker far away might only occupy 10×10 pixels.
[0053] The image pyramid algorithm reduces the image size by continuously performing Gaussian filtering (using a 5x5 Gaussian kernel with a standard deviation of 1.0) and downsampling operations, thereby generating a series of image layers with different resolutions.
[0054] Based on the image pyramid algorithm, the image is first subjected to a 5×5 Gaussian filter. The pixel values of the 5×5 region surrounding each pixel are weighted and averaged using Gaussian weights to smooth the image and avoid scaling jagged edges. Then, the image is uniformly scaled to 640×640 pixels through resampling. Regardless of the original size, the final output is 640×640.
[0055] If the original image is 1920×1080 and larger than 640×640, it will be scaled down proportionally while keeping the aspect ratio unchanged to avoid stretching the target. Then, the missing pixels will be filled by interpolation. If the original image is smaller than 640×640, such as a partial cropped image, it will be scaled up proportionally and the new pixels will be generated by interpolation. This scaling down the worker in the foreground from 500×500 pixels to 150×150 pixels, and the worker in the distance from 20×20 pixels to 50×50 pixels, ensures that the same type of target, such as a safety helmet, occupies a basically consistent pixel area in the image across different scenes.
[0056] The image is resampled to a uniform 640x640 pixel baseline size, which unifies the differences in the pixel area occupied by the target in the image under different distances or different camera focal lengths, providing a consistent input for the stable recognition of the subsequent neural network model. The standardized image frame output at this time is the preprocessed image, with a fixed dimension of 640×640 and a pixel value of 0-255. It has three major characteristics: no distortion, uniform illumination, and uniform scale, and can be directly input into the subsequent neural network model.
[0057] In this embodiment, ten industrial digital cameras were deployed, configured exactly as described in step S1 above, to continuously collect raw image data of the construction site 24 hours a day. The raw image data collected daily is converted into standardized image frames through the preprocessing described in this invention. For example, for a person image captured by a wide-angle camera with obvious barrel distortion in the edge region, after distortion parameter estimation and geometric distortion correction, the proportions and pose of the person are restored, and the straight lines at the image edges are corrected. Then, contrast-limited adaptive histogram equalization successfully equalizes the brightness of areas that are locally too dark under backlight conditions or overexposed under direct strong light, making the target features more visually prominent. Finally, all images are uniformly scaled to 640x640 pixels.
[0058] In one possible implementation, the multi-teacher model library includes at least three pre-trained deep convolutional neural network models; The pre-trained deep convolutional neural network models include: a geometric distortion teacher model, a long-distance target recognition teacher model, and a close-range special material feature enhancement teacher model; The teacher model is obtained by pre-training based on the YOLOv7 architecture.
[0059] In one possible implementation, the geometric distortion teacher model is obtained by training based on preset calibration images from the same construction site; wherein: The training dataset for the geometric distortion teacher model is obtained by using images of people and equipment with significant geometric distortion captured by a real wide-angle lens at the same construction site, as well as images synthesized by simulating distortion of preset calibration images. Based on the distortion-perceived loss function, constraints on the distortion correction consistency of the geometric distortion teacher model are obtained; Based on images with resolutions higher than a set threshold, a teacher model for distant target recognition is obtained by cropping and enlarging these images, and then densely annotating distant targets within them; wherein: Based on high-resolution images of the construction site, dense annotations are performed on workers operating at a distance to obtain a training dataset for a teacher model for long-distance target recognition. Based on the loss function for small target detection, the ability to capture target context information at different resolutions is obtained; Based on the unique materials at the construction site, a near-field enhanced teacher model of the special material features was obtained by analyzing reflection characteristic images under different lighting conditions; wherein: The training dataset for the close-range special material feature enhancement teacher model is obtained by taking images of personal protective equipment with special materials under strong direct light, backlight, shadow, and low illumination conditions. Based on the attention mechanism, the reflective properties of special materials under different lighting conditions are obtained.
[0060] In the implementation of this application embodiment, in step S2, please refer to... Figure 4 This diagram illustrates the interaction between a multi-teacher model library and a student network in a seamless adaptation method for a construction site safety monitoring model provided in this embodiment of the invention. The multi-teacher model library comprises at least three pre-trained deep convolutional neural network models: a geometric distortion teacher model, a long-distance target recognition teacher model, and a close-range special material feature enhancement teacher model. These teacher models are all built on the YOLOv7 architecture and initialized using a backbone network pre-trained on the ImageNet large-scale image dataset to ensure powerful feature extraction capabilities and basic visual understanding abilities.
[0061] The geometric distortion teacher model was obtained by training on different distorted versions of images from the same construction site. Its training dataset includes not only real-world images of people and equipment with significant barrel or pincushion geometric distortion, but also images synthesized by simulating barrel and pincushion distortion in standard distortion-free images using image processing techniques.
[0062] The input real distortion image is a 1920×1080 construction site image with barrel and pincushion distortion captured by a wide-angle lens. After preprocessing, it becomes 640×640. The target bounding box is marked, that is, the target is distorted and its ideal distortion-free position is marked.
[0063] Synthesized distorted images are generated from standard, distortion-free construction site images, such as frontal images of people or equipment, by simulating barrel and pincushion distortions to create distorted 640×640 images, which are then labeled with ideal bounding boxes.
[0064] The training dataset contains images with varying degrees of distortion and different scenes, ensuring that the model can learn data patterns that identify the essential features of the target regardless of whether it is distorted.
[0065] The model input is a preprocessed image of 640×640, and features are extracted through the backbone network of YOLOv7.
[0066] The low-level extraction of edge and color features corresponds to the details of the image and is sensitive to distortion.
[0067] The model extracts target contours and category features at higher levels. By constraining the distortion-aware loss function, it adds a boundary box consistency loss before and after distortion to the traditional loss. The model will adjust the feature weights. For example, it will reduce the weight of features that are easily affected by distortion, such as the proportion of human limbs, and increase the weight of features that are not easily affected by distortion, such as the arc of the top of the helmet.
[0068] In the final output high-level feature map (10×10×512), the channel response of the anti-distortion features is stronger, such as the higher pixel value of the arc channel of the safety helmet.
[0069] In the early stages of training, the model has a large prediction error for distorted targets, and may misidentify a distorted worker's head as equipment, with the bounding box offset by 10 pixels. As training progresses, the prediction data is gradually optimized, the category probability becomes more accurate, the bounding box is closer to the real position, and the offset is reduced from 10 pixels to less than 1 pixel. Ultimately, it can identify targets with high accuracy even if the image is distorted.
[0070] This mechanism enables the model to learn a unified feature representation that is robust to target distortion, and can stably locate and classify targets even when there are severe geometric deformations in the image, thus enhancing its robustness to target distortion.
[0071] The distant target recognition teacher model is obtained by cropping and enlarging images with resolutions higher than a set threshold, and then densely annotating distant targets in those images.
[0072] The long-range target recognition teacher model employs a feature pyramid network architecture, combined with a path aggregation network to enhance multi-scale feature fusion capabilities, particularly for capturing contextual information of small targets. Its training dataset consists of high-resolution construction site monitoring images; the raw image data is used directly here, where long-range workers occupy a pixel area less than a preset pixel in the image—for example, a long-range worker is currently only 16x16 pixels—and these are used as high-density annotations.
[0073] To effectively handle high-resolution images and improve small object detection performance, random cropping and multi-scale training strategies are employed in the training dataset. During training, the model utilizes a loss function optimized for small object detection: Gaussian Wasserstein distance loss. This loss better measures the geometric similarity between predicted and ground truth bounding boxes, showing particular advantage when the overlap of small object bounding boxes is low. Simultaneously, a copy-paste data augmentation strategy is incorporated, artificially increasing the density and diversity of small objects in the training set by copying and pasting small object instances to random locations in other images.
[0074] We used a high-resolution construction site image (1920×1080). Distant targets, such as a worker 200 meters away, only occupy a 16×16 pixel area. Through cropping and enlarging, we extracted the region containing these small targets, enlarging it to 640×640 pixels, making each small target 100×100 pixels. Then, we performed dense annotation (each small target was labeled with a bounding box). Simultaneously, we used copy-paste enhancement, copying the small targets into the background of other images to increase their number. This increased the pixel proportion of small targets in the training data, allowing the model to learn the detailed features of these small targets more clearly, such as the glare from a worker's safety helmet.
[0075] The model employs a feature pyramid + path aggregation network to fuse feature maps of different resolutions, such as 10×10 high-level features, 20×20 mid-level features, and 40×40 low-level features. Low-level features preserve details of small targets, such as the edges of 16×16 targets, while high-level features provide category context, such as whether a small target belongs to a worker. In the fused 10×10 feature map, the feature channels of small targets, such as small semicircles and arcs, are enhanced.
[0076] Model Training and Data Variation: From Multi-Scale Feature Fusion to Small Target Prediction Optimization In the initial training phase, the model exhibits a high false negative rate for small targets. By employing Gaussian Wasserstein distance loss to more accurately measure the difference between the predicted and ground truth bounding boxes for small targets, the false negative rate decreases after training, and the bounding box error for small targets diminishes. This enhances the model's ability to capture target contextual information at different resolutions, thereby significantly reducing the false negative rate for distant small targets.
[0077] The aforementioned close-range special material feature enhancement teacher model is trained on images of the reflective characteristics of special materials at construction sites, such as reflective vests and safety helmets, under different lighting conditions, and obtained through visual feature modeling. Its training dataset specifically includes close-range images of personal protective equipment taken under various complex lighting conditions, including direct sunlight, backlighting, shadows, and low illumination. To ensure data diversity, the direction, intensity, and spectral composition of the light source are systematically changed during data acquisition.
[0078] Images of special material targets, such as safety helmets and reflective vests, taken at close range, cover different lighting conditions, including direct sunlight, backlighting, shadows, and nighttime. For example, the pixel values of reflective vests under strong light and in shadow are labeled with target categories and bounding boxes. The training data includes pixel variations of the same material under different lighting conditions, ensuring the model learns the essential characteristics of the material, rather than pixel differences caused by lighting.
[0079] The near-field special material feature enhancement teacher model integrates attention mechanisms, such as the convolutional block attention module (CBAM), into its backbone network. This module includes a channel attention module (CAM) and a spatial attention module (SAM).
[0080] The channel attention module extracts channel information from the feature map through global average pooling and max pooling operations, and generates channel attention weights using a multilayer perceptron. It scores the 512 channels of the feature map, increasing the weight of material-related channels, such as the high reflectivity channel of reflective vests and the plastic texture channel of safety helmets, while decreasing the weight of lighting interference channels, such as the white saturation channel under strong light.
[0081] The spatial attention module generates spatial attention weights by performing average pooling and max pooling operations along the channel dimensions of the feature map. It scores the 10×10 spatial locations of the feature map, increasing the weight of material regions, such as the top of a helmet and the cuffs of reflective clothing, while decreasing the weight of background regions, such as the sky and the ground. In the final high-level feature map, the signals of material features are stronger; for example, the pixel value difference of the reflective texture channel in reflective clothing is less than a set threshold under strong light and shadow.
[0082] These attention mechanisms enable the model to adaptively focus on channels and spatial regions that are crucial for material identification and suppress interference from changes in lighting. For example, even if reflective clothing exhibits high reflectivity under strong light or its brightness decreases in shadow, the model can still accurately identify relevant security targets by modeling the material texture, shape, and local reflection features.
[0083] In one possible implementation, the student network uses MobileNetV3, a lightweight convolutional neural network, as its backbone network.
[0084] The student network includes a viewpoint feature extraction branch, a semantically invariant feature extraction branch, a feature fusion and decoupling module, and a multi-task prediction head; wherein: The viewpoint feature extraction branch is configured to obtain visual features from the first three feature extraction layers of the backbone network MobileNetV3 based on the preprocessed image. The semantically invariant feature extraction branch is configured to obtain target semantic features from the feature extraction layers following the backbone network MobileNetV3 based on the preprocessed image. The feature fusion and decoupling module is configured to: obtain view-related factors by fusing the output features of the view feature extraction branch and the semantically invariant feature extraction branch, and decoupling them during the fusion process; The multi-task prediction head is configured to: obtain the predicted target class probability through two parallel branches based on view-related factors, one branch obtaining the predicted target bounding box offset and scale factor; obtain the target class classification based on the predicted target class probability; and obtain the target bounding box regression based on the predicted target bounding box offset and scale factor. The feature fusion and decoupling module includes a two-layer convolutional neural network and a normalization layer. The normalization layer performs channel-level scaling and offset on the fused features based on the adaptation parameters generated by the meta-knowledge distillation mechanism, thereby decoupling and obtaining viewpoint-related factors.
[0085] In the implementation of this application embodiment, in step S3, please refer to... Figure 5 This diagram illustrates the student network architecture of a seamless adaptation method for a construction site safety monitoring model provided in this embodiment of the invention. Based on the preprocessed image, the student network is obtained through a pre-trained lightweight neural network model. The student network uses MobileNetV3 as its backbone network, which features a small number of parameters and high computational efficiency to meet the deployment requirements of edge devices at construction sites. The student network includes a viewpoint feature extraction branch, a semantically invariant feature extraction branch, a feature fusion and decoupling module, and a multi-task prediction head.
[0086] The viewpoint feature extraction branch is configured to capture viewpoint-related visual features from the preprocessed image. This branch consists of the first three feature extraction layers of the MobileNetV3 backbone network, which are mainly responsible for extracting edge, color, texture, and shape information from the low to mid layers.
[0087] The first three feature extraction layers of MobileNetV3 are used, each layer extracting features by using depthwise separable convolutions to reduce computation. The first layer extracts 320×320×15 features from the preprocessed 640×640×3 layer, halving the resolution and increasing the number of channels from 3 to 15, extracting low-level features such as edges and colors. The second layer extracts 160×160×25 features from 320×320×15, halving the resolution again and increasing the number of channels to 25, extracting simple texture features such as straight lines and curves. Finally, the third layer extracts 80×80×40 features from 160×160×25, halving the resolution again and increasing the number of channels to 40, extracting local shape features of the target, such as the semicircle of a safety helmet.
[0088] The output data is then a viewpoint feature map (here, the size is 80×80×40), which contains low-level features that are sensitive to viewpoint / distortion (such as the edge changes of the same object under different viewpoints). This information is highly sensitive to the geometric distortion and viewpoint changes of the image. For example, the proportions and local features of a person at the edge of a wide-angle lens will visually differ significantly from those of a person in the center of the frame.
[0089] The semantically invariant feature extraction branch is configured to extract target semantic features that are highly robust to changes in viewpoint. This branch consists of subsequent feature extraction layers of the MobileNetV3 backbone network, which are responsible for extracting high-level abstract semantic information, such as a person wearing a safety helmet.
[0090] Using the later feature extraction layers of MobileNetV3, we continue to improve the feature abstraction through depthwise separable convolutions. Then, the fourth layer of the MobileNetV3 backbone network extracts 40×40×80 from 80×80×40, halving the resolution and increasing the number of channels to 80, to extract target part features, such as a worker's head and body. Then, the fifth layer extracts 20×20×120 from 40×40×80, halving the resolution and increasing the number of channels to 120, to extract target category features, such as a worker wearing a safety helmet. Finally, the sixth layer extracts 10×10×200 from 20×20×120, halving the resolution and increasing the number of channels to 200, to extract global semantic features, such as a worker in a construction site scene.
[0091] Finally, a semantically invariant feature map (10×10×200 pixels in this case) is output, containing high-level features that are insensitive to viewpoint / lighting. For example, the semantic features of wearing a helmet remain unchanged regardless of the viewpoint. These features are relatively unaffected by minor changes in camera viewpoint; for instance, the distinctive shape and color combination of a helmet and reflective vest should be reliably identifiable regardless of the viewpoint.
[0092] The feature fusion and decoupling module is configured to fuse the output features of the viewpoint feature extraction branch and the semantically invariant feature extraction branch, and decouple viewpoint-related factors during the fusion process. This module employs a two-layer convolutional neural network and a one-layer normalization layer.
[0093] First, the feature maps from both branches are adjusted to the same resolution through upsampling or downsampling, and the number of channels is adjusted through 1x1 convolution to unify the resolution and the number of channels. Upsampling enlarges the semantic feature map from 10×10×200 to 80×80×200, matching the resolution of the viewpoint feature map; 1x1 convolution adjusts the number of channels in the viewpoint feature map from 80×80×40 to 200, matching the number of channels in the semantic feature map.
[0094] Then, the first layer of convolutional neural network performs initial channel-level concatenation and feature interaction fusion, and the second layer of convolutional neural network further extracts the fused features. The two 80×80×200 feature maps are concatenated by channel to obtain an 80×80×400 fused feature map. Then, two layers of convolution are used to compress the number of channels, compressing the 80×80×400 fused feature map to 80×80×200 and then to 80×80×100, extracting the more core fused features.
[0095] The normalization layer dynamically generates adaptation parameters based on the meta-knowledge distillation mechanism, scaling and shifting the fused features at the channel level to decouple view-related factors. Using default parameters initially, which will be dynamically adjusted in subsequent distillations, the normalization layer performs channel-level scaling and shifting on the 80×80×100 feature map, separating view-related features from semantic core features. The output is a decoupled fused feature map of 80×80×100, containing unified features of view adaptation and semantic core, providing a foundation for subsequent predictions.
[0096] Normalization involves two independent linear transformations, where the undetermined parameters are no longer learned in a fixed manner, but are dynamically generated externally by a meta-knowledge distillation mechanism. This allows the model to flexibly adjust the mean and variance of features based on the characteristics of the current input image, adapting to different perspectives and environments.
[0097] The multi-task prediction head, connected to the output of the feature fusion and decoupling module, is configured to perform target category classification and target bounding box regression. The prediction head includes two parallel branches: one branch performs target category classification, consisting of convolutional layers and a sigmoid activation function, used to predict the target category probability for each preset anchor box. The convolutional layers extract the decoupled fused feature map (80×80×100) into a size of 80×80×the number of categories. For example, if the number of categories is 4, it is divided into four categories: wearing a helmet, not wearing a helmet, wearing a reflective vest, and not wearing a reflective vest. Then, the sigmoid activation function converts the feature values into category probabilities, for example, between 0 and 1, such as the probability of wearing a helmet at a certain location. This generates a probability vector for each anchor box for preset categories such as helmet wearing, reflective vest wearing, and seatbelt use. The other branch performs target bounding box regression, consisting of 1x1 convolutional layers, used to predict the bounding box offset and scale factor for each preset anchor box, so as to adjust the preset anchor boxes to match the position and size of the actual target bounding boxes.
[0098] The initial prediction results of the student network are the class probabilities (80×80×number of classes) and bounding box offsets. At this point, the prediction accuracy is definitely lower than that of the teacher model, so subsequent distillation and fine-tuning are required.
[0099] In one possible implementation, the meta-knowledge distillation mechanism includes: Based on the preprocessed image, it is input into the multi-teacher model library for meta-knowledge extraction and fusion to obtain the high-level features of each teacher model. Based on the high-level features, it is then encoded and fused to obtain the global meta-knowledge vector.
[0100] Based on the global meta-knowledge vector, dynamic adaptation is performed to obtain the adaptation parameters of the meta-knowledge distillation mechanism. Based on the adaptation parameters, the forward computation process of the feature fusion and decoupling module in the student network is adjusted.
[0101] Based on the predicted output of the student network, the softened output of the multi-teacher model, and the adaptation parameters, joint optimization is performed to make the predicted output of the student network closer to the softened output of the multi-teacher model, thus obtaining a fine-tuned student network.
[0102] In one possible implementation, the meta-knowledge distillation mechanism includes meta-knowledge extraction and fusion, wherein the meta-knowledge extraction and fusion includes: Based on the preprocessed image, a set of high-level feature maps output by the final convolutional layer of each teacher model is obtained through each teacher model; Based on the set of high-level feature maps, each feature map is encoded by a shared meta-knowledge encoder to obtain a fixed-length vector, which serves as the primary meta-knowledge vector for each teacher model. Based on the primary meta-knowledge vector, a global meta-knowledge vector is obtained through an attention-based fusion module; The meta-knowledge encoder includes a global average pooling layer and a two-layer perceptron.
[0103] In one possible implementation, the meta-knowledge distillation mechanism further includes dynamic adaptation and joint optimization; The dynamic adaptation includes: Based on the global meta-knowledge vector, a set of adaptation parameters is obtained through the adaptation parameter generator; Based on the adaptation parameters, a scaling factor is obtained for the channel attention weights of the feature fusion and decoupling module in the student network. Based on the scaling factor, the student network is dynamically adapted and adjusted, and the processing image method of the obtained student network is adjusted to the global meta-knowledge vector; The adaptation parameter generator includes a three-layer fully connected neural network. The joint optimization includes: Based on the perspective-related factors of the student network prediction and the softened labels of the multi-teacher model library, the distillation loss is obtained; Based on the distillation loss and the task loss of the student network, the joint optimization from the teacher end to the student end is obtained by gradient descent.
[0104] In the implementation of this application embodiment, in step S4, please refer to... Figure 6 This is a schematic diagram of the meta-knowledge distillation mechanism of a seamless adaptation method for a construction site safety supervision model provided in an embodiment of the present invention. The core of this meta-knowledge distillation mechanism lies in using the comprehensive knowledge of a multi-teacher model to dynamically guide the student network, enabling it to adaptively adjust its internal processing logic when faced with inputs from different perspectives and environments. The meta-knowledge distillation mechanism includes: First, perform the meta-knowledge extraction and fusion steps.
[0105] The preprocessed image is simultaneously input into each teacher model in the multi-teacher model library to extract the high-level feature map set output by the final convolutional layer of each teacher model. , where k represents the number of teacher models.
[0106] These feature maps represent the teacher model's deep understanding of the input image, for example: The characteristic diagram of the geometrically distorted teacher is denoted as It focuses on anti-distortion features, such as the corrected target contour.
[0107] The feature map of the distant target teacher is denoted as It focuses on details of small targets, such as the texture of a worker's safety helmet in the distance.
[0108] The characteristic image of a teacher with special materials is denoted as It focuses on the essential characteristics of the material, such as the reflective texture of reflective clothing.
[0109] The dimension of the feature map is unified as B This is the batch size. It is the number of feature channels. It refers to resolution.
[0110] Then, each feature map is encoded using a shared meta-knowledge encoder, compressing it into a fixed-length vector, namely the teacher's primary meta-knowledge vector. .
[0111] The meta-knowledge encoder is a lightweight network module that shares parameters across all teacher models to ensure consistency in the encoding method. It consists of a global average pooling layer and a two-layer perceptron.
[0112] The global average pooling layer reduces the dimension of the feature map output by each teacher model from... The spatial dimension of each feature map is compressed to 1, while the channel dimension is retained, and then it is converted to... This effectively captures global information at the channel level.
[0113] The first layer of the perceptron comprises 1024 neurons and employs the ReLU activation function to enhance nonlinear expression. The second layer comprises 256 neurons and employs a linear activation function, outputting a fixed-length vector with a dimension of 256. This process is repeated for each teacher's feature map, abstracting and summarizing the high-level knowledge of the teacher's model to obtain each teacher's primary meta-knowledge vector. .
[0114] Then, we now have k 256-dimensional primary meta-knowledge vectors of the teachers. Each vector represents a teacher's perspective. We need to fuse them into a single global meta-knowledge vector. We don't want to simply average them, because the importance of each teacher varies across different input images. Therefore, we employ an attention-based weighted fusion mechanism. An attention-based fusion module combines these primary meta-knowledge vectors to generate a unified, comprehensive global meta-knowledge vector. .
[0115] First, calculate the attention weights for each teacher vector. This indicates the importance of the teacher's knowledge in the current input image, denoted as:
[0116] here It is a learnable attention weight vector with the same dimensions as the primary meta-knowledge vector, such as 256 dimensions. yes Transpose of; It is the primary meta-knowledge vector of the i-th teacher model. This is the primary meta-knowledge vector of the j-th teacher model. The denominator is the sum of the exponents of the corresponding terms of all teacher models, used to normalize the weights and ensure that the sum of all weights is 1. .
[0117] Then, a weighted sum is performed to obtain the final global meta-knowledge vector, represented as:
[0118] The final output is a 256-dimensional vector V_meta. It is no longer the knowledge of a single teacher, but rather a consensus or guiding signal most relevant to the current input image, incorporating insights from multiple experts. Thus, we obtain a global meta-knowledge vector—an abstract guiding vector containing the core expertise of the multi-teacher model, relatively independent of specific tasks and scenarios. The vector has a dimension of 256. This vector can abstractly represent the complexity category of the current input image, such as whether the image is more inclined towards geometric distortion, or includes a large number of small objects, or has complex lighting conditions.
[0119] Then, dynamic adaptation is performed based on the global meta-knowledge vector. It dynamically generates a set of parameters to adjust the behavior of specific components within the student network in real time, making their processing methods more suited to solving the challenges faced by the current image. The global meta-knowledge vector Input into an adaptation parameter generator.
[0120] The adaptation parameter generator is a structure composed of a small three-layer fully connected neural network with an input dimension of 256 and a hidden layer dimension of 512. The activation function is ReLU. The output dimension matches the number of channel attention weights in the feature fusion and decoupling module of the student network. Its output dimension is equal to the number of channel attention weights in the feature fusion and decoupling module of the student network, i.e., the number of channels C.
[0121] The generator outputs a set of adaptation parameters. These parameters correspond to specific layers in the feature fusion and decoupling module of the student network. These adaptation parameters Used to scale the channel attention weights within the feature fusion and decoupling module of the student network.
[0122] During the forward propagation of the student network, this module includes a channel attention mechanism whose original channel weights are generated through an internal fully connected neural network. The dynamically generated adaptation parameters... The internal computation of the feature fusion and decoupling module is temporarily adjusted by using the channel attention weights relative to the channel attention output, as follows:
[0123] in, It is a multi-channel feature map input to the feature fusion and decoupling module; It is the Sigmoid activation function; It is a channel-level scaling factor output by the adaptation parameter generator, and its dimension is consistent with the number of channels in the feature map; It is a feature map that has been dynamically adjusted.
[0124] This mechanism transforms the way student networks process images from a static, unchanging process into a dynamically fine-tuned one, based on the global meta-knowledge vector generated after the current input image is interpreted by a multi-teacher model. For example, when the input image is one with significant wide-angle distortion, the global meta-knowledge vector will be biased towards the knowledge of the geometric distortion teacher model through an attention mechanism, thereby generating... This will guide the student network to focus more on overcoming the impact of geometric deformation on feature representation, possibly by compensating for it by enhancing the extraction accuracy of edge and shape features. Conversely, for an image containing many small distant targets, the global meta-knowledge vector will favor the teacher model for distant target recognition, guiding the student network to enhance its sensitivity to detailed features, possibly by improving the response of specific channels to highlight information about small targets while suppressing background noise.
[0125] Finally, joint optimization is performed. Guided by meta-knowledge, the loss function is optimized while all parameters of the student network and the meta-knowledge distillation mechanism itself are updated to make the output of the student network as close as possible to the teacher group and to complete the target detection task well.
[0126] The dynamically adapted student network processes the same batch of input images and ultimately outputs prediction results, including class probabilities. and bounding box coordinates.
[0127] The distillation loss between the student network's predictions and the softened labels from the multi-teacher model library is calculated, while also incorporating the student network's own task loss. The distillation loss is calculated using Kl divergence, with the goal of making the student network's output probability distribution approximate the average output probability distribution of the multi-teacher model library after softening with a temperature parameter (T=2.0).
[0128] The softening operation is achieved by dividing the teacher model's Logits by the temperature parameter T and then applying the softmax function. This aims to smooth the teacher model's prediction distribution, enabling it to provide richer information about inter-class relationships. The student network's own task loss includes FocalLoss for object detection to address the foreground-background class imbalance problem, especially in construction site scenarios where safety targets (such as workers not wearing safety helmets) typically belong to a minority of classes.
[0129] The parameters of the entire meta-knowledge distillation framework (including the meta-knowledge encoder, fusion module, and adaptation parameter generator) are optimized end-to-end using gradient descent, along with the parameters of the student network backbone. The AdamW optimizer and a cosine annealing learning rate scheduling strategy can be employed to ensure rapid convergence in the early stages of training and maintain stability in later stages, avoiding getting trapped in local optima. The optimization goal is to enable the student network to learn how to dynamically adjust itself under the guidance of global meta-knowledge vectors, mimicking the comprehensive decision-making ability of the teacher group, thereby effectively adapting to diverse construction site visual scenarios without additional human intervention.
[0130] Finally, after training and convergence through the aforementioned mechanism, this invention yields a fine-tuned student network. This network not only possesses lightweight and high computational efficiency, but more importantly, it internalizes multi-domain professional knowledge transmitted through meta-knowledge. Therefore, when deployed to a new construction site, this fine-tuned student network can leverage its dynamic adaptation capabilities to automatically adjust its internal processing logic based on the characteristics of the real-time input images. This process requires no additional model training or data annotation, yet it demonstrates excellent generalization performance and high-precision safety monitoring target recognition capabilities, thereby achieving seamless adaptation of the construction site safety monitoring model. This method significantly reduces the deployment and maintenance costs of the construction site safety monitoring system, greatly enhances the system's flexibility and scalability, and provides solid technical support for smart construction site construction.
[0131] In the embodiments of this application, please refer to the following: Figure 7 This diagram illustrates the application of a finely tuned student network deployed at a construction site for safety monitoring target recognition, as provided in an embodiment of the present invention, using a method for seamless adaptation of a construction site safety monitoring model. The diagram shows the preprocessed 640x640 pixel images, obtained from raw image data captured by ten industrial digital cameras at the construction site, inputted into the trained, finely tuned student network. The meta-knowledge distillation mechanism within this student network dynamically adjusts the channel attention weights of its feature fusion and decoupling modules based on the characteristics of the current image, outputting the identified safety monitoring target. For example, when the input image primarily comes from a telephoto camera and includes small workers occupying only a few tens of pixels in the distance, the global meta-knowledge vector... The knowledge of the teacher model, which is biased towards distant target recognition, prompts the student network to pay more attention to subtle textures and contour information during feature extraction, and to increase the weights of corresponding feature channels. When the image comes from a close-up area with complex lighting, such as a worker's reflective vest producing strong reflections under a searchlight, This will guide students to activate their knowledge of the teacher model by activating the characteristics of special materials at close range, enabling them to accurately identify the reflective properties of special materials under extreme lighting conditions.
[0132] Example 3 This is the third embodiment of the present invention. Based on embodiments 1 and 2, please refer to the following references. Figure 8 This is a schematic diagram of a seamless adaptation system for a construction site safety supervision model provided in an embodiment of the present invention. The system includes a preprocessing module with sequential electrical connections, a multi-teacher model library module, a student network initialization module, a meta-knowledge distillation mechanism adjustment module, and a real-time detection module; wherein: The preprocessing module is configured to obtain a preprocessed image based on the acquired original images of the construction site through a preprocessing process. The multi-teacher model library module is configured to obtain a multi-teacher model library based on the preprocessed image using a pre-trained deep convolutional neural network model library. The initial student network module is configured to obtain an initial student network based on the preprocessed image using a pre-trained lightweight neural network model. The meta-knowledge distillation mechanism adjustment module is configured to fine-tune the student network based on the output of the multi-teacher model library and the intermediate features of the student network through the meta-knowledge distillation mechanism to obtain the fine-tuned student network. The real-time detection module is configured to, based on the fine-tuned student network, be deployed to a new construction site to identify safety monitoring targets in real-time images of the construction site and obtain detection results.
[0133] In the implementation of the embodiments of this application, the proposed preprocessing module solves the problem of poor recognition effect caused by image distortion and uneven illumination in traditional methods through real-time geometric distortion correction, illumination normalization and scale normalization, realizes the rapid generation of high-quality images and improves the accuracy of subsequent processing.
[0134] The proposed multi-teacher model library module, by integrating multiple pre-trained deep convolutional neural network models, solves the problem of insufficient adaptability of a single model in complex construction site environments, and achieves comprehensive coverage of different tasks, such as geometric distortion correction, long-distance target recognition, and special material feature enhancement, thereby improving the robustness and generalization ability of the system.
[0135] The proposed initialization student network module, by using MobileNetV3 as the backbone network, solves the problem of running complex models on resource-constrained devices, achieving efficient and real-time target detection while maintaining high recognition accuracy.
[0136] The proposed meta-knowledge distillation mechanism adjustment module solves the problem of the need for extensive retraining of student networks to adapt to new environments through dynamic adaptation and joint optimization. It enables efficient transfer of knowledge from multi-teacher models to student networks, significantly improving the model's adaptability and inference speed.
[0137] The proposed real-time detection module, by deploying a finely tuned student network to the new construction site, solves the problems of slow response and high false alarm rate in real-time monitoring, realizes real-time and accurate safety monitoring of the construction site, timely detects and warns of potential safety hazards, and improves the safety management level of the construction site.
[0138] Example 4 The fourth embodiment of the present invention differs from the previous embodiments in that: Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or units, or they may be electrical, mechanical, or other forms of connection.
[0140] The units described as separate components may or may not be physically separate. As will be apparent to those skilled in the art, the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0141] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0142] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a grid device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0143] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for seamless adaptation of a construction site safety monitoring model, characterized in that, Includes the following steps: Based on the original images of the construction site, preprocessed images are obtained through a preprocessing process; Based on the preprocessed image, a multi-teacher model library is obtained through a pre-trained deep convolutional neural network model library; Based on the preprocessed image, an initial student network is obtained through a pre-trained lightweight neural network model; Based on the output of the multi-teacher model library and the intermediate features of the student network, the student network is fine-tuned through a meta-knowledge distillation mechanism to obtain the fine-tuned student network. Based on the finely tuned student network, safety monitoring targets in real-time images of the construction site are identified to obtain detection results; The meta-knowledge distillation mechanism includes: Based on the preprocessed image, it is input into the multi-teacher model library for meta-knowledge extraction and fusion to obtain high-level features of each teacher model. Based on the high-level features, it is then encoded and fused to obtain a global meta-knowledge vector. Based on the global meta-knowledge vector, dynamic adaptation is performed to obtain the adaptation parameters of the meta-knowledge distillation mechanism. Based on the adaptation parameters, the forward computation process of the feature fusion and decoupling module in the student network is adjusted. Based on the predicted output of the student network and the softened output of the multi-teacher model, as well as the adaptation parameters, joint optimization is performed to obtain a fine-tuned student network; the meta-knowledge distillation mechanism includes meta-knowledge extraction and fusion, which includes: Based on the preprocessed image, a set of high-level feature maps output by the final convolutional layer of each teacher model is obtained through each teacher model; Based on the set of high-level feature maps, each feature map is encoded by a meta-knowledge encoder to obtain a fixed-length vector, which serves as the primary meta-knowledge vector for each teacher model. Based on the primary meta-knowledge vector, a global meta-knowledge vector is obtained using an attention-based fusion module. The meta-knowledge encoder includes a global average pooling layer and a two-layer perceptron. The meta-knowledge distillation mechanism also includes dynamic adaptation and joint optimization; The dynamic adaptation includes: Based on the global meta-knowledge vector, a set of adaptation parameters is obtained through the adaptation parameter generator; Based on the adaptation parameters, a scaling factor is obtained for the channel attention weights of the feature fusion and decoupling module in the student network. Based on the scaling factor, the processing method of the student network is adjusted to the global meta-knowledge vector; The adaptation parameter generator includes a three-layer fully connected neural network. The joint optimization includes: Based on the perspective-related factors of the student network prediction and the softened labels of the multi-teacher model library, the distillation loss is obtained; Based on the distillation loss and the task loss of the student network, the joint optimization from the teacher end to the student end is obtained by gradient descent.
2. The seamless adaptation method for construction site safety monitoring models according to claim 1, characterized in that, The preprocessing procedure includes: The original images of the construction site are acquired in real time using image acquisition equipment. Based on the preset calibration image and the original image, distortion parameters are estimated using a nonlinear algorithm to obtain the intrinsic and extrinsic parameters of the digital camera used in the image acquisition device. Based on the intrinsic and extrinsic parameters of the digital camera, and using an image remapping algorithm, the original image is subjected to real-time geometric distortion correction to obtain a geometrically distorted image. Based on the image after geometric distortion correction, illumination normalization is performed using an adaptive histogram equalization algorithm to obtain an image after illumination intensity adjustment. Based on the image after adjusting the illumination intensity, scale normalization is performed using the image pyramid algorithm to obtain a standardized image frame, which serves as the preprocessed image.
3. The seamless adaptation method for construction site safety monitoring models according to claim 1, characterized in that, The multi-teacher model library includes at least three pre-trained deep convolutional neural network models; The pre-trained deep convolutional neural network models include: a geometric distortion teacher model, a long-distance target recognition teacher model, and a close-range special material feature enhancement teacher model; The teacher model is obtained by pre-training based on the YOLOv7 architecture.
4. The seamless adaptation method for the construction site safety monitoring model according to claim 3, characterized in that, The geometric distortion teacher model is obtained by training based on preset calibration images from the same construction site; wherein: The training dataset for the geometric distortion teacher model is obtained by using images of people and equipment with significant geometric distortion captured by a real wide-angle lens at the same construction site, as well as images synthesized by simulating distortion of preset calibration images. Based on the distortion-perceived loss function, constraints on the distortion correction consistency of the geometric distortion teacher model are obtained; Based on images with resolutions higher than a set threshold, a teacher model for distant target recognition is obtained by cropping and enlarging these images and densely annotating distant targets within them; wherein: Based on high-resolution images of the construction site, dense annotations are performed on workers operating at a distance to obtain a training dataset for a teacher model for long-distance target recognition. Based on the loss function for small target detection, the ability to capture target context information at different resolutions is obtained; Based on the unique materials at the construction site, a near-field enhanced teacher model of the special material features was obtained by analyzing reflection characteristic images under different lighting conditions; wherein: The training dataset for the close-range special material feature enhancement teacher model is obtained based on images of personal protective equipment with special materials taken under strong direct light, backlight, shadow, and low illumination conditions. Based on the attention mechanism, the reflective properties of special materials under different lighting conditions are obtained.
5. The seamless adaptation method for construction site safety monitoring models according to claim 1, characterized in that, The student network uses MobileNetV3, a lightweight convolutional neural network, as its backbone network. The student network includes a viewpoint feature extraction branch, a semantically invariant feature extraction branch, a feature fusion and decoupling module, and a multi-task prediction head; wherein: The viewpoint feature extraction branch is configured to obtain visual features from the first three feature extraction layers of the backbone network MobileNetV3 based on the preprocessed image. The semantically invariant feature extraction branch is configured to obtain target semantic features from the feature extraction layers following the backbone network MobileNetV3 based on the preprocessed image. The feature fusion and decoupling module is configured to: obtain view-related factors by fusing the output features of the view feature extraction branch and the semantically invariant feature extraction branch, and decoupling them during the fusion process; The multi-task prediction head is configured to: obtain the predicted target class probability through two parallel branches based on view-related factors, one branch obtaining the predicted target bounding box offset and scale factor; obtain the target class classification based on the predicted target class probability; and obtain the target bounding box regression based on the predicted target bounding box offset and scale factor. The feature fusion and decoupling module includes a two-layer convolutional neural network and a normalization layer. The normalization layer performs channel-level scaling and offset on the fused features based on the adaptation parameters generated by the meta-knowledge distillation mechanism, thereby decoupling and obtaining viewpoint-related factors.
6. A seamless adaptation system for a construction site safety monitoring model, characterized in that, It includes a preprocessing module for sequential electrical connections, a multi-teacher model library module, a student network initialization module, a meta-knowledge distillation mechanism adjustment module, and a real-time detection module; among which: The preprocessing module is configured to obtain a preprocessed image based on the acquired original images of the construction site through a preprocessing process. The multi-teacher model library module is configured to obtain a multi-teacher model library based on the preprocessed image using a pre-trained deep convolutional neural network model library. The initial student network module is configured to obtain an initial student network based on the preprocessed image using a pre-trained lightweight neural network model. The meta-knowledge distillation mechanism adjustment module is configured to fine-tune the student network based on the output of the multi-teacher model library and the intermediate features of the student network through the meta-knowledge distillation mechanism to obtain the fine-tuned student network. The real-time detection module is configured to identify safety monitoring targets in real-time images of the construction site based on the fine-tuned student network, and obtain detection results. The meta-knowledge distillation mechanism includes: Based on the preprocessed image, it is input into the multi-teacher model library for meta-knowledge extraction and fusion to obtain high-level features of each teacher model. Based on the high-level features, it is then encoded and fused to obtain a global meta-knowledge vector. Based on the global meta-knowledge vector, dynamic adaptation is performed to obtain the adaptation parameters of the meta-knowledge distillation mechanism. Based on the adaptation parameters, the forward computation process of the feature fusion and decoupling module in the student network is adjusted. Based on the predicted output of the student network, the softened output of the multi-teacher model, and the adaptation parameters, joint optimization is performed to obtain the fine-tuned student network. The meta-knowledge distillation mechanism includes meta-knowledge extraction and fusion, wherein the meta-knowledge extraction and fusion includes: Based on the preprocessed image, a set of high-level feature maps output by the final convolutional layer of each teacher model is obtained through each teacher model; Based on the set of high-level feature maps, each feature map is encoded by a meta-knowledge encoder to obtain a fixed-length vector, which serves as the primary meta-knowledge vector for each teacher model. Based on the primary meta-knowledge vector, a global meta-knowledge vector is obtained using an attention-based fusion module. The meta-knowledge encoder includes a global average pooling layer and a two-layer perceptron. The meta-knowledge distillation mechanism also includes dynamic adaptation and joint optimization; The dynamic adaptation includes: Based on the global meta-knowledge vector, a set of adaptation parameters is obtained through the adaptation parameter generator; Based on the adaptation parameters, a scaling factor is obtained for the channel attention weights of the feature fusion and decoupling module in the student network. Based on the scaling factor, the processing method of the student network is adjusted to the global meta-knowledge vector; The adaptation parameter generator includes a three-layer fully connected neural network. The joint optimization includes: Based on the perspective-related factors of the student network prediction and the softened labels of the multi-teacher model library, the distillation loss is obtained; Based on the distillation loss and the task loss of the student network, the joint optimization from the teacher end to the student end is obtained by gradient descent.
7. A computer system device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Road construction safety inspection method and system based on unmanned aerial vehicle field
CN119989108A