Medical staff protection article detection method and system based on improved VFNET
Patent Information
- Application Number
- CN202611194048.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-07
- Publication Date
- 2026-10-27
AI Technical Summary
首先,医疗场景中的光照环境极其复杂多变,手术室内强烈的无影灯照射与周边阴影区域形成强烈对比,ICU病房中的监护设备指示灯光与自然光交织,急诊科的应急照明系统造成局部过曝或欠曝,传统的图像预处理技术往往采用全局统一的调整策略,无法应对这种局部光照剧烈变化的复杂情况,导致防护用品在不同光照区域的可见性差异巨大
本发明有效解决了医疗场景中普遍存在的光照不均匀问题,使得防护用品在强光照射、阴影遮蔽、混合光源等各种光照条件下都能被准确识别,大幅降低了因光照变化导致的漏检和误检现象。同时,本发明在处理防护用品间复杂遮挡关系方面,能够准确区分合理的防护用品叠戴与错误的重复检测,有效避免了传统方法中频繁出现的过度抑制问题,确保了多层防护配置下每个防护用品都能被正确识别。本发明对不同尺度防护用品的识别能力得到全面提升,无论是微小的护目镜、中等尺寸的口罩还是大面积的防护服,都能实现精确定位和分类,解决了以往小目标易丢失、大目标定位不准的技术瓶颈。本发明能够适应不同医疗科室的特殊环境要求,从手术室的无菌环境到急诊科的快节奏场景,从ICU的密集监护到门诊的常规检查,都能保持稳定可靠的检测性能。
Smart Images

Figure CN122990619A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and more specifically, to a method and system for detecting medical protective equipment based on an improved VFNET. Background Technology
[0002] Current technologies face several challenges in the detection of protective equipment (PE) for medical personnel. First, the lighting environment in medical settings is extremely complex and variable. The intense illumination from operating room lights contrasts sharply with surrounding shadows; indicator lights on monitoring equipment in ICU wards intermingle with natural light; and emergency lighting systems in emergency departments cause localized overexposure or underexposure. Traditional image preprocessing techniques often employ globally uniform adjustment strategies, which are inadequate to handle such complex situations with drastic localized lighting changes, resulting in significant differences in the visibility of PE in different lighting areas. Second, the occlusion relationships between PE items in medical settings are intricate. During medical procedures, N95 masks may be partially obscured by face shields, double gloves may overlap, and protective suits and aprons may be worn in overlapping layers. Existing object detection algorithms generally lack a deep understanding and modeling ability for these specific domain occlusion patterns, often misjudging reasonable occlusion as detection redundancy. Meanwhile, the scale differences between different types of protective equipment are significant, ranging from small goggles to large protective suits. Existing multi-scale detection frameworks suffer from an imbalance in semantic information transfer during feature extraction and fusion, making it difficult to simultaneously guarantee the detection accuracy of small targets and the localization accuracy of large targets. Furthermore, traditional non-maximum suppression strategies employ simple fixed thresholds, failing to distinguish the spatial relationships between different categories of protective equipment and frequently resulting in false suppression, such as incorrectly classifying and deleting items worn in the same location but belonging to different protection levels as duplicates. Existing detection algorithms lack deep perception and adaptation mechanisms for the specificities of medical scenarios, failing to fully utilize contextual information and prior knowledge within the medical environment. When faced with real-world scenarios such as rapid movement of medical personnel, dynamic occlusion of protective equipment, and rapid changes in lighting, their detection stability and accuracy struggle to meet the stringent requirements of practical applications.
[0003] In view of this, the present invention proposes a testing method and system for medical personnel protective equipment based on an improved VFNET to solve the above problems. Summary of the Invention
[0004] To overcome the aforementioned deficiencies of the prior art and to achieve the above objectives, the present invention provides the following technical solution: a method for detecting medical protective equipment based on an improved VFNET, comprising: The medical scene image to be detected is acquired, and adaptive illumination-contrast joint correction processing is performed on the medical scene image. The illumination non-uniformity is determined based on the pixel distribution variance of the local region, and a local gain coefficient is generated based on the illumination non-uniformity to adjust the local contrast, thereby obtaining the corrected image. The corrected image is input into the backbone network of the improved VFNET detection network. Multi-stage feature maps are extracted through the medical scene perception dual-path attention module in the backbone network. The medical scene perception dual-path attention module extracts channel features and local occlusion context features in parallel, and modulates the channel features based on the local occlusion context features to generate occlusion-scale joint weights. The occlusion-scale joint weights are fused with the original channel features to obtain the attention-enhanced feature map. The multi-stage attention-enhanced feature maps are input into the cross-scale bidirectional feature compensation module to perform top-down semantic transfer and bottom-up detail compensation. Before splicing feature maps of different scales, feature alignment is performed based on the semantic deviation between adjacent scale feature maps to generate a multi-scale aligned fusion feature map. The multi-scale aligned and fused feature map is input into the detection head. The multi-scale aligned and fused feature map is adaptively compressed through the context-aware multi-granularity pooling module. Based on the classification and regression branch, the predicted bounding box, category confidence and category label of the protective equipment are output. Adaptive nonmaximum suppression processing based on inter-class occlusion perception is performed on the predicted bounding boxes. The category-spatial overlap between adjacent predicted bounding boxes is calculated. If the category-spatial overlap indicates that adjacent predicted bounding boxes belong to different protective equipment categories and the spatial intersection-union ratio is greater than a preset threshold, the adjacent predicted bounding boxes are retained. If they belong to the same protective equipment category and the spatial intersection-union ratio is greater than a dynamic suppression threshold, the predicted bounding boxes with lower confidence are attenuated and suppressed according to the category confidence, and the final protective equipment detection result is output.
[0005] A testing system for medical protective equipment based on an improved VFNET is provided to implement the aforementioned testing method for medical protective equipment based on an improved VFNET, including: The image preprocessing module is used to acquire the medical scene image to be detected, perform adaptive illumination-contrast joint correction processing on the medical scene image, determine the illumination non-uniformity based on the pixel distribution variance of the local region, and generate a local gain coefficient based on the illumination non-uniformity to adjust the local contrast and obtain the corrected image. The backbone feature extraction module is used to input the corrected image into the backbone network of the improved VFNET detection network. Multi-stage feature maps are extracted through the medical scene perception dual-path attention module in the backbone network. The medical scene perception dual-path attention module extracts channel features and local occlusion context features in parallel, and modulates the channel features based on the local occlusion context features to generate occlusion-scale joint weights. The occlusion-scale joint weights are fused with the original channel features to obtain the attention-enhanced feature map. The cross-scale feature fusion module is used to input multi-stage attention-enhanced feature maps into the cross-scale bidirectional feature compensation module, perform top-down semantic transfer and bottom-up detail compensation, and perform feature alignment operation based on the semantic deviation between adjacent scale feature maps before splicing feature maps of different scales to generate multi-scale aligned fused feature maps. The detection head module is used to input multi-scale aligned and fused feature maps into the detection head. The context-aware multi-granularity pooling module performs adaptive feature compression on the multi-scale aligned and fused feature maps, and outputs the predicted bounding box, category confidence and category label of the protective equipment based on the classification and regression branch. The post-processing module performs adaptive non-maximum suppression processing for inter-class occlusion perception on the predicted bounding boxes. It calculates the category-spatial overlap between adjacent predicted bounding boxes. If the category-spatial overlap indicates that adjacent predicted bounding boxes belong to different protective equipment categories and the spatial intersection-union ratio is greater than a preset threshold, then the adjacent predicted bounding boxes are retained. If they belong to the same protective equipment category and the spatial intersection-union ratio is greater than a dynamic suppression threshold, then the predicted bounding boxes with lower confidence are attenuated and suppressed according to the category confidence, and the final protective equipment detection result is output. The storage module is used to store the model parameters, configuration parameters, and detection result data of the improved VFNET detection network. The processor is used to coordinate and control the operation of the above modules.
[0006] The technical effects and advantages of this invention, based on an improved VFNET-based method and system for testing medical protective equipment, are as follows: This invention effectively solves the problem of uneven lighting commonly found in medical settings, enabling accurate identification of protective equipment under various lighting conditions, including strong light, shadow, and mixed light sources, significantly reducing missed and false detections caused by changes in lighting. Furthermore, in handling complex occlusion relationships between protective equipment, this invention accurately distinguishes between reasonable overlapping and erroneous repeated detection, effectively avoiding the over-suppression problem frequently encountered in traditional methods, ensuring that each piece of protective equipment in a multi-layered protective configuration is correctly identified. This invention comprehensively improves the identification capability of protective equipment of different scales, achieving precise positioning and classification of items ranging from tiny goggles and medium-sized masks to large protective suits, overcoming the technical bottlenecks of easily losing small targets and inaccurately locating large targets. This invention can adapt to the specific environmental requirements of different medical departments, maintaining stable and reliable detection performance from the sterile environment of the operating room to the fast-paced scenes of the emergency department, from intensive monitoring in the ICU to routine outpatient examinations. Attached Figure Description
[0007] Figure 1 This is a schematic diagram of the detection method for medical protective equipment based on the improved VFNET of the present invention; Figure 2 This is a schematic diagram of the medical personnel protective equipment detection system based on the improved VFNET of the present invention. Detailed Implementation
[0008] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0009] Please see Figure 1 The present invention proposes a testing method for medical protective equipment based on an improved VFNET, comprising the following steps: Step 1: Acquire the medical scene image to be detected, perform adaptive illumination-contrast joint correction processing on the medical scene image, determine the illumination non-uniformity based on the pixel distribution variance of the local region, and generate a local gain coefficient based on the illumination non-uniformity to adjust the local contrast, thereby obtaining the corrected image. Step 2: Input the corrected image into the backbone network of the improved VFNET detection network. Extract multi-stage feature maps through the medical scene perception dual-path attention module in the backbone network. The medical scene perception dual-path attention module extracts channel features and local occlusion context features in parallel. Based on the local occlusion context features, the channel features are modulated to generate occlusion-scale joint weights. The occlusion-scale joint weights are fused with the original channel features to obtain the attention-enhanced feature map. Step 3: Input the multi-stage attention-enhanced feature map into the cross-scale bidirectional feature compensation module, perform top-down semantic transfer and bottom-up detail compensation, and perform feature alignment operation based on the semantic deviation between adjacent scale feature maps before stitching feature maps of different scales to generate multi-scale aligned fused feature maps. Step 4: Input the multi-scale aligned fused feature map into the detection head, perform adaptive feature compression on the multi-scale aligned fused feature map through the context-aware multi-granularity pooling module, and output the predicted bounding box, category confidence and category label of the protective equipment based on the classification regression branch. Step 5: Perform adaptive non-maximum suppression processing for inter-class occlusion perception on the predicted bounding boxes, calculate the category-spatial overlap between adjacent predicted bounding boxes. If the category-spatial overlap indicates that adjacent predicted bounding boxes belong to different protective equipment categories and the spatial intersection-union ratio is greater than a preset threshold, then the adjacent predicted bounding boxes are retained. If they belong to the same protective equipment category and the spatial intersection-union ratio is greater than the dynamic suppression threshold, then the predicted bounding boxes with lower confidence are attenuated and suppressed according to the category confidence, and the final protective equipment detection result is output.
[0010] In this embodiment of the invention, the present invention acquires medical scene images to be detected and performs adaptive illumination-contrast joint correction based on the local region pixel distribution variance. It extracts channel features and local occlusion context features in parallel through a dual-path attention module for medical scene perception and generates occlusion-scale joint weights. In a cross-scale bidirectional feature compensation module, feature alignment is performed based on semantic bias. Adaptive feature compression is performed through a context-aware multi-granularity pooling module. Finally, adaptive non-maximum suppression processing based on inter-class occlusion perception is used to output the final detection result. This effectively overcomes the technical problems of existing medical scene protective equipment detection schemes, such as poor adaptability to uneven illumination and contrast changes, inability to effectively handle complex occlusion situations in medical scenes, and the inability of non-maximum suppression based on fixed thresholds to adapt to the occlusion characteristics of different types of protective equipment. Thus, it achieves the technical effect of adaptive preprocessing of medical scene images, improving feature expression capabilities under occlusion conditions through a dual-path attention mechanism, and establishing a precise bounding box filtering strategy based on an inter-class occlusion perception mechanism, ultimately achieving high-precision intelligent detection of medical personnel protective equipment.
[0011] In a preferred embodiment of the present invention, the above-described adaptive illumination-contrast joint correction processing of medical scene images, which determines the illumination non-uniformity based on the pixel distribution variance of local regions and generates local gain coefficients to adjust local contrast based on the illumination non-uniformity to obtain a corrected image, includes: Step 1.1: Divide the medical scene image into local image blocks of a preset size, calculate the pixel mean and pixel variance of each local image block, and determine the local image block's illumination non-uniformity by the ratio of the pixel variance to the global pixel variance. Specifically, this involves receiving the medical scene image to be inspected in the medical personnel protective equipment inspection system. This image may come from a hospital surveillance camera, mobile imaging device, or medical robot vision system, and the image resolution is typically 1920×1080 pixels or higher to meet the detailed inspection requirements of protective equipment. After receiving the medical scene image, a sliding window method is used to divide the image into local image blocks of a preset size, for example, setting the local image block size to 64×64 pixels to ensure that the local illumination variation characteristics in the medical scene can be captured. For each local image block, extract the grayscale values of all pixels contained within it, and calculate the pixel mean of the local image block. The pixel mean reflects the overall brightness level of the area. Further, calculate the pixel variance of each local image block. The pixel variance reflects the dispersion of pixel grayscale values within the area; a larger variance indicates higher contrast or more drastic illumination changes in the area. Simultaneously, the global pixel variance of the entire medical scene image is calculated as a reference benchmark, representing the contrast characteristics of the overall image. The ratio of the pixel variance of each local image patch to the global pixel variance is calculated to obtain the illumination non-uniformity of that local image patch. A ratio greater than 1 indicates that the contrast of that local area is higher than the global average level, while a ratio less than 1 indicates that the contrast of that local area is lower than the global average level, providing a quantitative basis for subsequent calculation of the local gain coefficient.
[0012] Step 1.2: Based on the difference between the illumination non-uniformity and a preset baseline non-uniformity, calculate the local gain coefficient. The local gain coefficient is negatively correlated with the illumination non-uniformity. Specifically, this includes: pre-setting a baseline non-uniformity parameter, which is determined based on statistical analysis of a large number of medical scene images, for example, setting it to 1.0, representing an ideal illumination uniformity state. Calculate the difference between the illumination non-uniformity of each local image patch and the baseline non-uniformity. The difference reflects the degree to which the local area deviates from the ideal illumination state. Design a calculation function for the local gain coefficient based on the difference value. This function ensures that the local gain coefficient is negatively correlated with the illumination non-uniformity: when the illumination non-uniformity is high, a smaller local gain coefficient is calculated to suppress contrast enhancement in that area and avoid excessive enhancement leading to noise amplification; when the illumination non-uniformity is low, a larger local gain coefficient is calculated to enhance the contrast in that area and improve the visibility of details in dark or low-contrast areas. The local gain coefficient is calculated using an exponential decay function, specifically: Local gain coefficient = Reference gain value × exp(-α × (Illumination non-uniformity - Reference non-uniformity)²), where α is the decay coefficient, and the reference gain value is 1.5 to ensure that the gain adjustment is within a reasonable range. This design moderately enhances areas with uniform illumination while suppressing areas with severe illumination non-uniformity, achieving adaptive contrast adjustment.
[0013] Step 1.3 involves scaling the pixel values of each pixel in a local image block using a local gain coefficient, performing truncation and limiting on the scaled pixel values, and then fusing the processed local image blocks to obtain a corrected image. Specifically, this includes: obtaining the corresponding local gain coefficient for each local image block, and scaling the pixel values of all pixels in that local image block one by one. The scaling formula is: scaled pixel value = original pixel value × local gain coefficient. This operation achieves adaptive contrast adjustment based on local illumination characteristics. Since scaling may cause pixel values to exceed the normal dynamic range [0, 255], truncation and limiting are performed: pixel values less than 0 are set to 0, and pixel values greater than 255 are set to 255, ensuring all pixel values are within the effective range. To avoid obvious transition marks between adjacent local image blocks, Gaussian weighted smoothing is used during the local image block fusion process: for pixels located near the boundary of a local image block, the distance from the block center is calculated, and fusion weights are assigned based on the distance. The boundary pixels are then weighted and averaged using the processing results of multiple adjacent local image blocks to achieve a smooth transition. All processed local image patches are stitched and fused according to their original spatial positions to generate a complete corrected image. This corrected image has a balanced illumination distribution and enhanced local contrast, providing high-quality input for subsequent inspection of protective equipment.
[0014] In a preferred embodiment of the present invention, the above-mentioned medical scene perception dual-path attention module in the backbone network extracts multi-stage feature maps. The medical scene perception dual-path attention module extracts channel features and local occlusion context features in parallel, and modulates the channel features based on the local occlusion context features to generate occlusion-scale joint weights. The occlusion-scale joint weights are then fused with the original channel features to obtain an attention-enhanced feature map, including: Step 2.1 involves performing global average pooling and fully connected mapping on the input features through the first branch of the medical scene perception dual-path attention module to extract channel feature weights. Specifically, this includes improving the VFNET detection network's backbone network to adopt the ResNet-50 architecture and embedding the medical scene perception dual-path attention module at multiple stages of the backbone network, specifically inserting the attention module at the end of stages 2, 3, 4, and 5 of the ResNet-50. When the input feature map of a certain stage enters the medical scene perception dual-path attention module, the dimension of this feature map is C×H×W, where C is the number of channels, H is the feature map height, and W is the feature map width. The first branch first performs global average pooling on the input features, specifically calculating the average value of each channel in the spatial dimension, compressing the C×H×W feature map into a C×1×1 channel description vector. This vector aggregates the feature response intensity of each channel in the global spatial range. Then, the C×1×1 channel description vector is input into a two-layer fully connected network for nonlinear mapping: the first fully connected layer reduces the number of channels from C to C / r (r is the dimensionality reduction ratio, set to 16), using ReLU activation function; the second fully connected layer restores the number of channels from C / r to C, using Sigmoid activation function, ensuring that the output channel feature weights are between 0 and 1. The resulting C-dimensional vector is the channel feature weight, which reflects the importance of different channel features for the detection of protective equipment; important channels receive higher weights, and less important channels receive lower weights.
[0015] Step 2.2: Through the second branch of the dual-path attention module for medical scene perception, parallel convolution operations are performed on the input features using a multi-scale dilated convolution kernel group to capture local occlusion context features under different receptive fields. These local occlusion context features are then concatenated and dimensionality reduced to generate an occlusion perception vector. Specifically, the second branch is specifically designed to capture the local occlusion features of protective equipment in medical scenes, employing a multi-scale dilated convolution kernel group to achieve parallel feature extraction across different receptive fields. Specifically, the second branch contains three parallel dilated convolution branches, each with a 3×3 kernel size, but with dilation rates set to 2, 4, and 8, respectively, corresponding to receptive field sizes of 5×5, 9×9, and 17×17. Three dilated convolutional branches simultaneously receive the input feature map and perform convolution operations respectively: the branch with a dilation rate of 2 captures small-scale local occlusion features, suitable for detecting local occlusion of small-scale protective equipment such as masks and goggles; the branch with a dilation rate of 4 captures medium-scale occlusion context, suitable for detecting occlusion relationships in the torso of protective clothing; and the branch with a dilation rate of 8 captures large-scale occlusion context, suitable for detecting mutual occlusion in multi-person scenes. The number of output channels of each dilated convolutional branch is set to C / 3, ensuring that the total number of channels of the output features of the three branches is C. The output features of the three parallel branches are concatenated along the channel dimension to obtain a C×H×W multi-scale occlusion feature map. To extract compact occlusion description information, a global average pooling operation is performed on the concatenated feature map to obtain a C×1×1 channel description vector. Further, a 1×1 convolution layer is used for channel dimensionality reduction, reducing the number of channels from C to C / r (r=16), and the ReLU activation function is applied to generate a compact occlusion perception vector, which encodes local occlusion context information at different scales.
[0016] Step 2.3 involves element-wise multiplication and fusion of the channel feature weights and the occlusion perception vector to generate occlusion-scale joint weights. Specifically, this involves receiving the channel feature weights (dimensional C×1×1) from the first branch and the occlusion perception vector (dimensional C / r×1×1) from the second branch, and first performing dimension alignment. A 1×1 convolution layer is used to increase the number of channels in the occlusion perception vector from C / r to C, resulting in an occlusion modulation vector with the same dimension as the channel feature weights. Then, the channel feature weights and the occlusion modulation vector are fused element-wise using the following formula: Occlusion-scale joint weight = Channel feature weights ⊙ Occlusion modulation vector, where ⊙ represents element-wise multiplication. This fusion operation achieves interactive modulation of channel importance and occlusion context information: for channels with strong responses in the occlusion perception vector, if the channel also has a high weight in the channel feature weights, the final joint weights are further enhanced; conversely, if the occlusion perception vector has a weak response but a high channel weight, or a strong response but a low channel weight, the joint weights exhibit a moderate balancing effect. The generated occlusion-scale joint weight is a C-dimensional vector, with each element corresponding to the comprehensive importance weight of a channel. This weight takes into account both the global importance of the channel and the special role of the channel in the occlusion scene.
[0017] Step 2.4 involves element-wise multiplication of the occlusion-scale joint weights with the input features to obtain the attention-enhanced feature map. Specifically, this includes broadcasting the generated occlusion-scale joint weights (dimension C×1×1) and the original input features (dimension C×H×W) element-wise. Specifically, the occlusion-scale joint weights are broadcast and expanded spatially, ensuring that all spatially located pixels in the same channel are multiplied by the same weight coefficient. The calculation formula is: Attention-enhanced feature map [c,h,w] = Input features [c,h,w] × Occlusion-scale joint weights [c], where c represents the channel index, and h and w represent the spatial location indices. This operation achieves channel-level feature recalibration: for channels with larger joint weights, their feature responses are enhanced, which helps subsequent detection networks focus on the key protective equipment features encoded in that channel; for channels with smaller joint weights, their feature responses are suppressed, reducing interference from irrelevant background features. The resulting attention-enhanced feature map maintains the same spatial dimensions (C×H×W) as the input features, but the distribution of channel features has undergone adaptive modulation based on occlusion and scale awareness, making it more suitable for detecting protective equipment under complex occlusion conditions in medical scenarios. This attention-enhanced feature map serves as the output of the current stage of the backbone network and is passed to the next stage or the feature pyramid network for further processing.
[0018] In a preferred embodiment of the present invention, the above-mentioned input of multi-stage attention-enhanced feature maps into a cross-scale bidirectional feature compensation module performs top-down semantic transfer and bottom-up detail compensation, and before splicing feature maps of different scales, performs feature alignment operation based on the semantic deviation between adjacent scale feature maps to generate a multi-scale aligned fused feature map, including: Step 3.1: During top-down semantic transfer, the high-level attention enhancement feature map is upsampled to obtain an upsampled feature map. Based on the difference in channel dimension between the upsampled feature map and the corresponding low-level attention enhancement feature map, a spatial offset field is generated. Specifically, the backbone network outputs attention enhancement feature maps for multiple stages, denoted as {P2, P3, P4, P5}, corresponding to stages 2, 3, 4, and 5 of ResNet-50, respectively. The feature map size is halved sequentially, and the number of channels increases sequentially. In the top-down path of the cross-scale bidirectional feature compensation module, the highest-level feature map P5 is processed first. A 2x upsampling operation is performed on P5, and bilinear interpolation is used to obtain an upsampled feature map with the same spatial size as P4. To achieve semantic alignment, the semantic deviation between the upsampled feature map and P4 needs to be analyzed. Specifically, a 1×1 convolution is first used to unify the number of channels of the upsampled feature map of P5 and P4 to 256. Next, the feature differences between the two in the channel dimension are calculated: the upsampled feature map is concatenated with P4 in the channel dimension to obtain a 512-channel feature map, which is then input into a lightweight convolutional network containing two 3×3 convolutional layers, outputting a 2-channel spatial offset field. The two channels of the spatial offset field represent the pixel offsets in the x and y directions, respectively, with the numerical range restricted to [-1, 1] by the Tanh activation function and then scaled to the actual pixel offset range [-3, 3]. This spatial offset field reflects the degree of spatial misalignment between the upsampled feature map and the low-level feature map P4, providing offset guidance for subsequent deformable convolutional alignment operations.
[0019] Step 3.2 involves resampling and aligning the low-level attention enhancement feature map using a spatial offset field. The aligned low-level features are then fused with the upsampled feature map to obtain a top-down fused feature. Specifically, this includes receiving the generated spatial offset field and the low-level attention enhancement feature map P4, and performing a deformable convolution operation based on the spatial offset field. The deformable convolution resamples the feature map of P4 according to the offset indicated by the spatial offset field: for each spatial location (h, w) in P4, feature values are sampled from the (h+Δx, w+Δy) position of P4 based on the offset (Δx, Δy) of the spatial offset field at that location. Bilinear interpolation is used in the sampling process to ensure sub-pixel accuracy. After spatial resampling, a low-level feature is obtained that is spatially semantically aligned with the upsampled feature map. This alignment eliminates the spatial position deviation caused by the network's downsampling-upsampling process. The aligned low-level features are then fused with the upsampled feature map using element-wise addition: Top-down fused feature = Upsampled feature map + Aligned low-level feature. The fused features simultaneously contain rich semantic information from higher levels and precise spatial positioning information from lower levels, and spatial alignment ensures their consistency in spatial location. A 3×3 convolution is applied to the fused features for feature smoothing, resulting in the final top-down fused feature, denoted as M4. Following the same process, M4 is upsampled and processed with P3 for spatial offset field calculation, alignment, and fusion to obtain M3; then M3 is upsampled again and processed with P2 to obtain M2, completing the top-down semantic transfer process.
[0020] Step 3.3: During bottom-up detail compensation, the bottom-level top-down fusion features are downsampled to generate detail-compensated features. These details are then element-wise added to the top-down fusion features of higher levels to obtain a multi-scale aligned fusion feature map. Specifically, after completing top-down semantic transfer, multiple fusion features {M2, M3, M4, M5} are obtained, which have already incorporated high-level semantic information. To further enhance the detail representation of high-level features, a bottom-up detail compensation path is executed. Starting from the lowest-level fusion feature M2, a 2x downsampling operation is performed on M2 using a 3×3 convolution with a stride of 2, resulting in a detail-compensated feature with the same spatial size as M3. This detail-compensated feature is then element-wise added to M3: M3' = M3 + downsampled(M2), resulting in the compensated M3'. M3' retains the original semantic information while incorporating detail information from lower-level features, enhancing the detection capability for small-scale protective equipment. Following the same process, M3' is downsampled and added to M4 to obtain M4', and M4' is downsampled and added to M5 to obtain M5', completing the bottom-up detail compensation process. The final multi-scale aligned fused feature map {M2,M3',M4',M5'} (M2 remains unchanged to maintain sign consistency and is also denoted as M2') has undergone both top-down semantic transfer and bottom-up detail compensation, and feature alignment was achieved through spatial offset field before fusion. It has rich multi-scale semantic and detail information and is suitable for detecting protective equipment targets of different scales.
[0021] In a preferred embodiment of the present invention, the above-mentioned inputting the multi-scale aligned fused feature map into the detection head and performing adaptive feature compression on the multi-scale aligned fused feature map through a context-aware multi-granularity pooling module includes: Step 4.1: In the context-aware multi-granularity pooling module, parallel pooling operations are performed on the multi-scale aligned fused feature maps using max-pooling kernels of various scales to obtain multi-granularity pooled feature maps. Specifically, the detection head receives the multi-scale aligned fused feature maps {M2', M3', M4', M5'} from the cross-scale bidirectional feature compensation module. For each scale's fused feature map, before inputting it into the classification and regression branch, it first undergoes feature compression through the context-aware multi-granularity pooling module. Taking M4' as an example (the processing flow for other scale feature maps is the same), the feature map size of M4' is 256×H×W. The context-aware multi-granularity pooling module is designed with four parallel pooling branches, each employing a max-pooling kernel of different scales: the first branch uses a 1×1 pooling kernel (i.e., no pooling, preserving the original features); the second branch uses a 3×3 max-pooling kernel with a stride of 1 and a padding of 1, maintaining the feature map size unchanged; the third branch uses a 5×5 max-pooling kernel with a stride of 1 and a padding of 2; and the fourth branch uses a 7×7 max-pooling kernel with a stride of 1 and a padding of 3. The four parallel pooling branches simultaneously receive M4' as input and perform pooling operations respectively: 1×1 pooling preserves the finest-grained local features, suitable for capturing the fine edges and texture information of protective equipment; 3×3 pooling aggregates small-range neighborhood features to enhance local contextual representation; 5×5 pooling aggregates medium-range neighborhood features to capture the overall shape information of the protective equipment; and 7×7 pooling aggregates large-range neighborhood features to capture the relationship between the protective equipment and its surrounding environment. The feature maps output by the four pooling branches are all 256×H×W in size. They are then concatenated along the channel dimension to obtain a multi-granularity pooling feature map of 1024×H×W.
[0022] Step 4.2: Based on the occlusion-scale joint weights corresponding to the multi-scale aligned fusion feature maps, calculate the adaptive fusion coefficients corresponding to each granularity pooling feature map. Regions with higher occlusion weights correspond to larger-scale pooling feature maps with higher fusion coefficients. Specifically, when the dual-path attention module for medical scene perception in the backbone network generates the occlusion-scale joint weights, this weight information is saved and transmitted to the detection head. For the currently processed M4', obtain its corresponding occlusion-scale joint weights (a channel weight vector with dimensions of 256×1×1). To extract the spatial distribution information of the occlusion degree from the channel weight vector, firstly, multiply the occlusion-scale joint weights with M4' channel by channel to obtain a weighted feature map. Then, sum the weighted feature maps along the channel dimension to obtain an H×W occlusion response map. The value at each spatial location in this response map reflects the degree of occlusion at that location: a higher value indicates a stronger occlusion feature at that location, and a lower value indicates a milder occlusion. Based on the occlusion response map, an adaptive fusion coefficient calculation strategy is designed: for spatial locations with high occlusion response, more reliance should be placed on large-scale pooling features (such as 7×7 pooling), because large-scale pooling can aggregate a wider range of contextual information, which helps to infer the features of the occluded part under occlusion conditions; for spatial locations with low occlusion response, more reliance should be placed on small-scale pooling features (such as 1×1 or 3×3 pooling) to preserve fine local details. The specific calculation formula is as follows: for spatial location (h, w), its occlusion response value is denoted as R(h, w), normalized to the range [0, 1]; the fusion coefficient of 1×1 pooling... ; fusion coefficient of 3×3 pooling ; fusion coefficient of 5×5 pooling 7×7 pooling fusion coefficient Then, the four fusion coefficients are normalized to ensure that the sum of the four coefficients is 1 at each spatial location: , i∈{1,2,3,4}. The normalized fusion coefficients form four H×W coefficient graphs. It is used to guide the adaptive weighted fusion of multi-granularity pooling features.
[0023] Step 4.3: Weighted summation of the multi-granularity pooling feature maps based on the adaptive fusion coefficients, and adaptive feature compression through convolutional dimensionality reduction. Specifically, this includes: denoting the four granularity pooling feature maps as F1, F2, F3, and F4 (each feature map has a dimension of 256×H×W), and assigning corresponding adaptive fusion coefficients as follows: (Each coefficient map has a dimension of 1×H×W). Perform a spatially adaptive weighted fusion operation: fuse feature maps. ,in This indicates that the broadcast is multiplied element by element. After broadcasting along the channel dimension, multiply by F1; the same applies to other channels. Fuse feature maps. The feature map has dimensions of 256×H×W. It adaptively fuses pooling features of different granularities at different spatial locations based on the degree of occlusion: severely occluded locations primarily fuse large-scale pooling features, while lightly occluded locations primarily fuse small-scale pooling features, achieving context-aware adaptive feature representation. To further compress the feature dimension and enhance feature discriminativity, the fused feature map... A 1×1 convolution is applied to reduce the number of channels from 256 to 128, and the ReLU activation function is applied. The dimensionality-reduced feature map is used as the final output of the context-aware multi-granularity pooling module, and is then input into the classification and regression branch for subsequent bounding box prediction and class classification.
[0024] In a preferred embodiment of the present invention, the predicted bounding box, category confidence score, and category label of the protective equipment based on the classification regression branch output include: Step 4.4: In the classification and regression branch, set category-specific scale normalization parameters for different types of protective equipment. Specifically, the task of detecting protective equipment for medical personnel involves various categories of protective equipment at different scales, including: masks (small-scale targets, typically approximately 30×20 pixels), goggles (small-scale targets, typically approximately 40×30 pixels), protective caps (medium-scale targets, typically approximately 60×60 pixels), protective suits (large-scale targets, typically approximately 200×400 pixels), gloves (small-scale targets, typically approximately 25×35 pixels), etc., totaling N categories (e.g., N=10). In the design of the classification and regression branch, the classification branch and the regression branch share the first few layers of convolutional feature extraction, and then each is connected to an independent output layer. The output layer of the regression branch predicts the positional offset of the bounding box, including the center point offset (Δx, Δy) and width and height scaling (Δw, Δh). Traditional methods use a uniform scale normalization parameter for all categories, resulting in orders-of-magnitude differences in regression gradients between large-scale and small-scale targets, affecting training stability and detection accuracy. This invention sets category-specific scale normalization parameters for different types of protective equipment: first, the average size of protective equipment in each category in the training dataset is statistically analyzed, and then the average width of each category is calculated. and average height Then, design a dedicated scale normalization parameter for each category c. and This ensures that the normalized offsets for categories of different scales are within a similar numerical range. For example, the average size of the mask category is 30×20 pixels, corresponding to... , The average size of protective clothing is 200×400 pixels, corresponding to... , These category-specific scaling parameters are stored in a learnable parameter table and are called during regression loss calculation and prediction output.
[0025] Step 4.5: During bounding box regression, a scale normalization parameter is selected based on the predicted target category. The offset output by the regression branch is scale-normalized, and the final predicted bounding box coordinates are calculated in conjunction with the prior boxes. Different scale normalization parameters are used for large-scale and small-scale protective equipment categories to balance the regression gradient. Specifically, the detection network employs a prior box-based detection strategy, pre-setting multiple prior boxes with different scales and aspect ratios at each spatial location in the feature map. The classification branch outputs confidence scores for N categories for each prior box. The category probability distribution is obtained through Softmax normalization, and the category with the highest probability is selected as the predicted category label, with the corresponding probability value serving as the category confidence. The regression branch outputs four offset values for each prior box. This indicates a positional adjustment relative to the prior bounding box. When calculating the final predicted bounding box, the corresponding scale normalization parameter is first retrieved from the class-specific scale normalization parameter table based on the class label c predicted by the classification branch. and Then, the original offsets output by the regression branch are scale-normalized: the normalized width offset Normalized height offset The center point offsets Δx and Δy use uniform normalized parameters, for example, set as the width and height of the prior bounding box. This is combined with the coordinates of the prior bounding box. Calculate the final predicted bounding box coordinates: predicted center point , Predicted width Predicted height By using category-specific scale normalization parameters, large-scale protective equipment categories (such as protective clothing) can be... and It will be larger and By scaling up, the offsets of small-scale protective equipment categories (such as masks) are scaled by a smaller normalization parameter to ensure that categories of different scales have similar gradient magnitudes when calculating regression loss. This avoids large-scale targets dominating the training process, which could lead to a decrease in the detection performance of small-scale targets. Finally, the predicted bounding box coordinates, class confidence, and class label for each prior box are output and passed to the non-maximum suppression module for post-processing.
[0026] In a preferred embodiment of the present invention, the above calculation of the category-spatial overlap between adjacent predicted bounding boxes, if the category-spatial overlap indicates that the adjacent predicted bounding boxes belong to different protective equipment categories and the spatial intersection-union ratio is greater than a preset threshold, then the adjacent predicted bounding boxes are retained; if they belong to the same protective equipment category and the spatial intersection-union ratio is greater than a dynamic suppression threshold, then the predicted bounding boxes with lower confidence are attenuated and suppressed according to the category confidence, including: Step 5.1: For any two adjacent predicted bounding boxes, calculate their spatial intersection-union ratio (IU / U) and extract their class similarity matrix. Specifically, the classification regression branch outputs a large number of predicted bounding boxes (usually thousands), each containing coordinate information (x, y, w, h), a class label c, and a class confidence score s. First, all predicted bounding boxes are sorted in descending order based on class confidence, and then non-maximum suppression is performed. During processing, baseline bounding boxes are selected sequentially from highest to lowest confidence. For each baseline bounding box, all candidate bounding boxes spatially adjacent to it are found (adjacency criteria are that the distance between the center points of the two bounding boxes is less than a threshold or the bounding boxes overlap). For the baseline bounding boxes... and candidate bounding boxes Calculate the spatial intersection-union ratio (IoU) of the two pairs using the following formula: ,in This represents the area of the intersection of two bounding boxes. This represents the area of the union of two bounding boxes. The IoU value ranges from [0, 1], with a larger IoU indicating a higher degree of spatial overlap between the two bounding boxes. Simultaneously, the category labels of the two bounding boxes are extracted. and The similarity between the two items is retrieved from a pre-constructed category similarity matrix. The category similarity matrix is an N×N matrix (where N is the total number of protective equipment categories), and the matrix elements... Indicate category With category The semantic similarity matrix is defined in terms of values ranging from [0, 1]. Based on the semantic knowledge of medical protective equipment, the matrix predefines similarity as follows: similarity is 1 for items of the same category (e.g., S(mask, mask) = 1); similarity is 0 for items of completely different categories (e.g., S(mask, protective suit) = 0); and the similarity for partially related categories is a median value (e.g., S(goggles, protective cap) = 0.3, because both are head protective equipment but have different functions). The category similarity matrix allows us to determine whether two predicted bounding boxes belong to the same or similar categories of protective equipment.
[0027] Step 5.2 combines the spatial intersection-union ratio with the category similarity matrix to generate the category-spatial overlap ratio. Specifically, this includes receiving the calculated spatial intersection-union ratio. and category similarity queried from the category similarity matrix The design incorporates a comprehensive formula for calculating category-spatial overlap, integrating spatial overlap information with semantic category information. The formula for calculating category-spatial overlap is: The design logic of this formula is as follows: Category-spatial overlap is only significant when two bounding boxes both spatially overlap (large IoU) and semantically belong to the same or similar categories (large S). If two bounding boxes spatially overlap but belong to different categories (S close to 0), the category-spatial overlap is close to 0 and should not be suppressed. If two bounding boxes belong to the same category but do not spatially overlap (small IoU), the category-spatial overlap is also small and does not require suppression. The generated category-spatial overlap values range from [0, 1], providing a comprehensive basis for subsequent suppression decisions.
[0028] Step 5.3: If the category similarity matrix indicates that the two predicted bounding boxes belong to different protective equipment categories, and the spatial intersection-union ratio (IU / U) is greater than the preset occlusion tolerance threshold, it is determined as reasonable occlusion overlap between different protective equipment, and both predicted bounding boxes are retained. Specifically, this includes setting the occlusion tolerance threshold to 0.5 to determine reasonable occlusion between bounding boxes of different categories. In medical scenarios, it is common for a medical worker to wear multiple protective equipment simultaneously, such as partial spatial overlap between a mask and a protective cap, or overlap between a protective suit and gloves at the arm position. These are all reasonable occlusion situations, and no single detection result should be suppressed. The determination logic is: if the category similarity matrix indicates that the two predicted bounding boxes belong to different protective equipment categories, and the spatial intersection-union ratio (IU / U) is greater than the preset occlusion tolerance threshold, it is determined as reasonable occlusion overlap between different protective equipment, and both predicted bounding boxes are retained. This indicates that the two bounding boxes belong to different categories of protective equipment; at the same time, if the spatial intersection ratio is higher than that of the bounding boxes, it indicates that the two bounding boxes belong to different categories of protective equipment. This indicates that there is indeed a significant spatial overlap between the two. When both conditions are met, it is determined to be a reasonable overlap of different protective equipment, and the baseline bounding box is retained. and candidate bounding boxes No suppression operation is performed. This approach ensures that each piece of protective equipment can be correctly detected in scenarios where multiple protective equipment overlaps, avoiding the problem of incorrect suppression of different categories of targets caused by traditional NMS methods that rely solely on IoU thresholds.
[0029] Step 5.4: If the category similarity matrix indicates that two predicted bounding boxes belong to the same protective equipment category, and the spatial intersection-union ratio is greater than the dynamic suppression threshold, then calculate the attenuation coefficient based on the difference in their category confidence. Use the attenuation coefficient to reduce the category confidence of the predicted bounding box with the lower confidence. If the attenuated category confidence is lower than the retention threshold, then discard the predicted bounding box. Specifically, this includes: when the category similarity... When the intersection-union ratio (IUU) is zero, it indicates that the two bounding boxes belong to the same or similar protective equipment category, and it is necessary to determine whether it is a duplicate detection. The dynamic suppression threshold is not a fixed value, but is dynamically determined according to the specific situation (the calculation method of the dynamic suppression threshold is explained in detail below). When the spatial intersection-union ratio (IUU) is zero, it indicates that the two bounding boxes belong to the same or similar protective equipment category, and it is necessary to determine whether it is a duplicate detection. When the value exceeds the dynamic suppression threshold, it is determined that the two bounding boxes detect the same protective equipment target, and suppression operation needs to be performed. The suppression strategy uses a softened attenuation method instead of direct elimination: first, the category confidence of the baseline bounding box is extracted. and the class confidence of candidate bounding boxes (Because they are processed in descending order of confidence level,) ); calculate the difference in category confidence between the two. A larger difference indicates that the confidence level of the baseline bounding box is significantly higher than that of the candidate bounding box; an attenuation coefficient is designed based on the confidence level difference. ,in The temperature parameter is set to 0.5, and the attenuation coefficient ranges from (0, 1). The confidence level of the candidate bounding box is updated using attenuation. Determine the confidence level after attenuation. If the bounding box is below a preset retention threshold (e.g., 0.05), it is discarded. Otherwise, the detection is retained but the weakened confidence level is used. This softening suppression strategy is smoother than the hard threshold rejection of traditional NMS, and can retain some potentially correct detection results, reducing the risk of false suppression.
[0030] In a preferred embodiment of the present invention, the dynamic suppression threshold is dynamically determined based on the local density of the region where the predicted bounding box is located and the scale area of the bounding box; wherein, the higher the local density of the region where the predicted bounding box is located, the higher the corresponding dynamic suppression threshold; the smaller the scale area of the bounding box, the higher the corresponding dynamic suppression threshold, specifically including: Step 5.5: Calculate the local density of the region where the predicted bounding box is located, specifically including: for candidate bounding boxes... Define its location as A circular region with its center point and a radius three times the diagonal length of the bounding box is defined. Within this circular region, the number of all predicted bounding boxes (including those of different categories) is counted and denoted as the number of neighboring bounding boxes, Nn. The local density ρ = Nn / area of the circular region is calculated, reflecting the detection congestion at that location. In medical scenarios, areas where multiple people are wearing protective equipment will generate a large number of predicted bounding boxes, resulting in high local density; while isolated locations of single medical personnel will have lower local density. The logic behind the impact of local density on the dynamic suppression threshold is as follows: in high-density areas, multiple protective equipment targets are closely arranged, and there may be reasonable partial overlap between bounding boxes. In this case, the suppression threshold should be increased to avoid over-suppression; in low-density areas, bounding box overlap is more likely to be duplicate detection, and the suppression threshold should be decreased to strengthen the suppression.
[0031] Step 5.6, calculate the scale area of the bounding box, specifically including: calculating the candidate bounding box. area ,in and These represent the width and height of the bounding box, respectively. The area of the bounding box is normalized relative to the total image area to obtain the relative area. , The total area represents the image area, while the relative area reflects the scale of the bounding box. Small-scale protective equipment (such as masks and gloves) has a smaller bounding box area, while large-scale protective equipment (such as protective clothing) has a larger bounding box area. The logic behind the influence of scale area on the dynamic suppression threshold is as follows: the detection and localization error of small-scale targets is relatively large, which may produce multiple predicted bounding boxes with slight deviations in position. Therefore, the suppression threshold should be increased to tolerate a certain degree of positional deviation and avoid misclassifying reasonable detection results as duplicate detections. The detection and localization of large-scale targets are relatively accurate, and the bounding boxes of duplicate detections are usually highly overlapping. Therefore, a lower suppression threshold can be used to strictly remove duplicates.
[0032] Step 5.7, calculate the dynamic suppression threshold based on a combination of local density and scale area, specifically including: designing a formula for calculating the dynamic suppression threshold, comprehensively considering the influence of local density and scale area. The formula for calculating the dynamic suppression threshold is: ,in The baseline suppression threshold is set to 0.5; and The weighting coefficients are set to 0.2 and 0.15 respectively. The local density adjustment function is designed as follows: ,in This is a normalization constant; The adjustment function for scale area is designed as follows: ,in This is a normalization constant. The design of the adjustment function ensures that: when the local density... When it increases, Increase the dynamic inhibition threshold Increase; when the scale area When it increases, Reduce, dynamic inhibition threshold The dynamic suppression threshold, calculated in the final calculation, is adaptively adjusted for each candidate bounding box, achieving fine-grained suppression control. In adaptive non-maximum suppression processing for inter-class occlusion perception, this dynamic suppression threshold is used instead of a fixed threshold for suppression judgment, improving the adaptability and accuracy of the suppression strategy.
[0033] In a preferred embodiment of the present invention, before acquiring the medical scene image to be detected, a step of constructing a dedicated dataset for medical personnel protective equipment is included, which includes: Step 0.1: Collect original protective equipment (PE) images from multiple medical scenarios. Determine the target scale ratio based on the ratio of the minimum bounding rectangle area of the PE target in the original PE image to the total image area, and determine the target occlusion rate based on the overlap between targets. Specifically, data is collected in different medical scenarios across multiple hospitals, including emergency rooms, operating rooms, fever clinics, isolation wards, and laboratories. High-definition cameras are used to capture images of medical personnel wearing PE, ensuring scenario diversity and data representativeness. The collected original PE images have a resolution of 1920×1080 pixels, are in JPEG format, and a total of 50,000 images are collected. Each original PE image is manually labeled. Labelers select all PE targets in the image according to the labeling specifications. Labeling categories include 10 categories: masks, goggles, protective caps, protective suits, gloves, shoe covers, face shields, isolation gowns, N95 masks, and surgical masks. The labeling tool is LabelImg, and the labeling results are saved as a PASCAL VOC format XML file. Based on the labeled bounding box information, the target scale proportion of each image is calculated: First, the total area of the minimum bounding rectangle of all protective equipment targets in the image is calculated; then, the total image area (1920×1080) is calculated; the target scale proportion is defined as the total area of the minimum bounding rectangle divided by the total image area. This indicator reflects the proportion of protective equipment targets in the image; a larger ratio indicates a larger target scale or a greater number of targets. The target occlusion rate is further calculated for each pair of target bounding boxes in the image. Calculate the area of intersection between the two. If the intersection area is greater than 0, it indicates that occlusion exists; calculate the occlusion ratio. The average occlusion ratio of all occluded target pairs in the image is calculated as the target occlusion rate, which reflects the degree of occlusion between protective equipment targets in the image.
[0034] Step 0.2: Based on the target scale ratio, target occlusion rate, and local illumination non-uniformity of the original protective equipment image, calculate the scene complexity score for each original protective equipment image. Specifically, in addition to the target scale ratio and target occlusion rate, the local illumination non-uniformity of the original protective equipment image also needs to be calculated. Using the same method as above, the image is divided into 64×64 pixel local image blocks. The pixel variance of each local image block is calculated, and then the standard deviation of the pixel variances of all local image blocks is calculated as the local illumination non-uniformity. This index reflects the uniformity of illumination in the image; the larger the standard deviation, the more uneven the illumination. The scene complexity score is calculated based on the three indices using a weighted formula. The weight coefficients of the weighted formula are set to 0.3, 0.5, and 0.2, respectively. The weight allocation reflects the main impact of occlusion factors on the detection difficulty. The scene complexity score is normalized to the range [0, 10]. The higher the score, the greater the detection difficulty of the image (large target scale, severe occlusion, uneven illumination). Calculate the scene complexity score for each original protective equipment image and record the score information in the dataset metadata file.
[0035] Step 0.3: The original protective equipment images are stratified based on scene complexity scores. When dividing the dataset into training, validation, and test sets, the proportion of samples with different scene complexity scores in each subset is ensured to meet a preset consistency condition. Specifically, this includes: stratifying 50,000 original protective equipment images according to scene complexity scores, dividing the score range [0,10] into 5 intervals: [0,2) for simple scenes, (2,4) for relatively simple scenes, [4,6) for medium scenes, [6,8) for relatively complex scenes, and [8,10] for complex scenes. The number of images in each complexity interval is counted, and the proportion of each interval in the total dataset is calculated. When dividing the dataset into training, validation, and test sets, a stratified random sampling strategy was adopted: the preset dataset division ratio was 70% for training, 15% for validation, and 15% for test. For each complexity interval, images were randomly sampled in a 70%:15%:15% ratio and placed into the training, validation, and test sets respectively. This ensured that the sample proportions of each complexity interval in the training, validation, and test sets were consistent with the proportions in the total dataset, satisfying the preset consistency condition. For example, if simple scenes account for 20% of the total dataset, then the proportion of simple scenes in the training, validation, and test sets should all be close to 20%. This stratified partitioning strategy ensured the consistency of data distribution across subsets, avoiding bias in model evaluation caused by the validation or test sets favoring certain complexity scenes. After the dataset was divided, the training set was used to improve the training of the VFNET detection network, the validation set was used for hyperparameter tuning and model selection, and the test set was used for final performance evaluation.
[0036] In a preferred embodiment of the present invention, to further improve the robustness of the detection system to occlusion conditions, the method further includes the following step before inputting the corrected image into the backbone network of the improved VFNET detection network: Step 1.4: When occlusion loss of personnel nodes is detected in the medical scene image, the historical motion trajectory vector of the occluded personnel node before its loss and the physical boundary constraints of its current location are obtained. Specifically, during the continuous video frame detection process of the medical scene, a target tracking algorithm is used to track the detected medical personnel across frames, assigning a unique tracking ID to each person. When a personnel node fails to be detected or has low confidence in the current frame due to occlusion (by other personnel, medical equipment, or scene objects), it is determined that the personnel node is occluded and lost. The position sequence of the occluded personnel node within a certain period before its loss (e.g., the past 2 seconds, corresponding to 60 frames) is extracted from the historical tracking database, and the historical motion trajectory vector is calculated, including the average movement speed, main movement direction, and motion acceleration features. At the same time, the last visible position of the occluded personnel node before its loss is analyzed, and combined with the spatial layout information of the medical scene (obtained through scene map or depth estimation), the physical boundary constraints of the area where the personnel may currently be located are determined, including the boundaries of room walls, the space occupied by medical equipment, and insurmountable physical obstacles such as operating tables.
[0037] Step 1.5: Based on the maximum movement speed limit of personnel, determine the possible circular distribution area of the occluded personnel nodes at the current moment. Specifically, this includes: setting the maximum movement speed of personnel in the medical scenario to 2 meters per second (based on the personnel movement speed statistics in a normal medical operating environment), and calculating the time interval from the moment the personnel node was lost to the current moment. Based on the maximum speed and time interval, calculate the theoretically maximum distance a person could reach. The last known location of the person whose node was obscured before it was lost. With the center of the circle, Using radius , a circular region of theoretically possible locations is determined. Incorporating directional information from historical motion trajectory vectors, the circular region is ellipticized: the semi-axis along the motion direction is set as... The semi-axis in the vertical direction of motion is set as This forms an elliptical potential location distribution area that better reflects the actual movement trend. Further, by incorporating physical boundary constraints, the intersection of the elliptical region and the physically accessible region is calculated, removing inaccessible locations occupied by walls and equipment, thus obtaining the final potential location distribution area.
[0038] Step 1.6: Use the coordinates of the center point of the possible location distribution circle as the virtual location coordinates of the occluded person node, complete the occluded person node in the detection results, and add the radius variance of the possible location distribution circle as the uncertainty attribute of the virtual location coordinates to the node features. Specifically, this includes: calculating the geometric center point of the possible location distribution area, and using the coordinates of this center point... This serves as the virtual location coordinates for the occluded person node. In the detection results of the current frame, a virtual detection box is created for the occluded person node: the center point is located at... The bounding box size uses the historical average size of this person, the category label is "Personnel," and the category confidence is set to a low value (e.g., 0.6) to identify it as a virtual detection. Calculate the radius variance of the possible location distribution area. This variance reflects the degree of uncertainty of the virtual location: if the possible location area is large, the radius variance is large, and the location uncertainty is high; if the possible location area is small, the radius variance is small, and the location prediction is relatively reliable. The radius variance... As an uncertainty attribute added to the feature vector of virtual personnel nodes, this uncertainty attribute is used to adjust the contribution weight of virtual personnel nodes in subsequent protective equipment detection and correlation analysis: the detection result weight of nodes with high uncertainty is reduced to avoid inaccurate virtual positions affecting the overall detection performance.
[0039] Please see Figure 2 The embodiments of the present invention also propose a medical personnel protective equipment detection system based on an improved VFNET, comprising: The image preprocessing module is used to acquire the medical scene image to be detected, perform adaptive illumination-contrast joint correction processing on the medical scene image, determine the illumination non-uniformity based on the pixel distribution variance of the local region, and generate a local gain coefficient based on the illumination non-uniformity to adjust the local contrast and obtain the corrected image. The backbone feature extraction module is used to input the corrected image into the backbone network of the improved VFNET detection network. Multi-stage feature maps are extracted through the medical scene perception dual-path attention module in the backbone network. The medical scene perception dual-path attention module extracts channel features and local occlusion context features in parallel, and modulates the channel features based on the local occlusion context features to generate occlusion-scale joint weights. The occlusion-scale joint weights are fused with the original channel features to obtain the attention-enhanced feature map. The cross-scale feature fusion module is used to input multi-stage attention-enhanced feature maps into the cross-scale bidirectional feature compensation module, perform top-down semantic transfer and bottom-up detail compensation, and perform feature alignment operation based on the semantic deviation between adjacent scale feature maps before splicing feature maps of different scales to generate multi-scale aligned fused feature maps. The detection head module is used to input multi-scale aligned and fused feature maps into the detection head. The context-aware multi-granularity pooling module performs adaptive feature compression on the multi-scale aligned and fused feature maps, and outputs the predicted bounding box, category confidence and category label of the protective equipment based on the classification and regression branch. The post-processing module performs adaptive non-maximum suppression processing for inter-class occlusion perception on the predicted bounding boxes. It calculates the category-spatial overlap between adjacent predicted bounding boxes. If the category-spatial overlap indicates that adjacent predicted bounding boxes belong to different protective equipment categories and the spatial intersection-union ratio is greater than a preset threshold, then the adjacent predicted bounding boxes are retained. If they belong to the same protective equipment category and the spatial intersection-union ratio is greater than a dynamic suppression threshold, then the predicted bounding boxes with lower confidence are attenuated and suppressed according to the category confidence, and the final protective equipment detection result is output. The storage module is used to store the model parameters, configuration parameters, and detection result data of the improved VFNET detection network. The processor is used to coordinate and control the operation of the above modules.
[0040] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0041] It should be noted that all formulas in this manual are calculated by removing dimensions and taking their numerical values. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.
[0042] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A detection method for medical protective equipment based on an improved VFNET, characterized in that, include: Acquire a medical scene image to be detected, perform adaptive illumination-contrast joint correction processing on the medical scene image, determine the illumination non-uniformity based on the pixel distribution variance of the local region, and generate a local gain coefficient based on the illumination non-uniformity to adjust the local contrast, thereby obtaining a corrected image. The corrected image is input into the backbone network of the improved VFNET detection network. Multi-stage feature maps are extracted through the medical scene perception dual-path attention module in the backbone network. The medical scene perception dual-path attention module extracts channel features and local occlusion context features in parallel, and modulates the channel features based on the local occlusion context features to generate occlusion-scale joint weights. The occlusion-scale joint weights are fused with the original channel features to obtain the attention-enhanced feature map. The multi-stage attention-enhanced feature map is input into the cross-scale bidirectional feature compensation module to perform top-down semantic transfer and bottom-up detail compensation. Before splicing feature maps of different scales, feature alignment is performed based on the semantic deviation between adjacent scale feature maps to generate a multi-scale aligned fusion feature map. The multi-scale aligned and fused feature map is input into the detection head. The multi-scale aligned and fused feature map is adaptively compressed through the context-aware multi-granularity pooling module. Based on the classification and regression branch, the predicted bounding box, category confidence and category label of the protective equipment are output. Adaptive nonmaximum suppression processing based on inter-class occlusion perception is performed on the predicted bounding boxes. The category-spatial overlap between adjacent predicted bounding boxes is calculated. If the category-spatial overlap indicates that adjacent predicted bounding boxes belong to different protective equipment categories and the spatial intersection-union ratio is greater than a preset threshold, then the adjacent predicted bounding boxes are retained. If the protective equipment belongs to the same category and the spatial intersection-union ratio is greater than the dynamic suppression threshold, then the predicted bounding boxes with lower confidence are attenuated and suppressed according to the category confidence, and the final protective equipment detection result is output.
2. The method according to claim 1, characterized in that, The adaptive illumination-contrast joint correction processing of the medical scene image, which determines the illumination non-uniformity based on the pixel distribution variance of the local region and generates a local gain coefficient based on the illumination non-uniformity to adjust the local contrast, to obtain a corrected image, includes: The medical scene image is divided into local image blocks of a preset size. The pixel mean and pixel variance of each local image block are calculated. The ratio of the pixel variance to the global pixel variance is determined as the illumination non-uniformity of the local image block. Based on the difference between the illumination non-uniformity and the preset reference non-uniformity, a local gain coefficient is calculated, and the local gain coefficient is negatively correlated with the illumination non-uniformity. The pixel values of each pixel in the local image block are scaled using the local gain coefficient, and the scaled pixel values are truncated and limited. The processed local image blocks are then merged to obtain the corrected image.
3. The method according to claim 1, characterized in that, The process involves extracting multi-stage feature maps using a dual-path attention module for medical scene perception within the backbone network. This module extracts channel features and local occlusion context features in parallel, modulates the channel features based on the local occlusion context features to generate occlusion-scale joint weights, and fuses these weights with the original channel features to obtain an attention-enhanced feature map. This process includes: The first branch of the medical scene perception dual-path attention module performs global average pooling and fully connected mapping on the input features to extract channel feature weights. The second branch of the medical scene perception dual-path attention module performs parallel convolution operations on the input features using a multi-scale dilated convolution kernel group to capture local occlusion context features under different receptive fields, and performs channel concatenation and dimensionality reduction on the local occlusion context features to generate an occlusion perception vector. The channel feature weights are multiplied and fused with the occlusion perception vector element by element to generate the occlusion-scale joint weights; The occlusion-scale joint weights are multiplied element-wise with the input features to obtain the attention-enhanced feature map.
4. The method according to claim 1, characterized in that, The process involves inputting the multi-stage attention-enhanced feature maps into a cross-scale bidirectional feature compensation module, performing top-down semantic transfer and bottom-up detail compensation, and performing feature alignment based on the semantic deviation between adjacent scale feature maps before concatenating feature maps at different scales to generate a multi-scale aligned fused feature map. When performing top-down semantic transfer, the high-level attention enhancement feature map is upsampled to obtain an upsampled feature map. Based on the difference between the upsampled feature map and the corresponding low-level attention enhancement feature map in the channel dimension, a spatial offset field is generated. The spatial offset field is used to resample and align the low-level attention enhancement feature map in terms of spatial location. The aligned low-level features are then fused with the upsampled feature map to obtain a top-down fused feature. When performing bottom-up detail compensation, the bottom-level top-down fusion features are downsampled to generate detail compensation features. The detail compensation features are then added element-wise to the top-down fusion features of the higher levels to obtain the multi-scale aligned fusion feature map.
5. The method according to claim 4, characterized in that, The step of inputting the multi-scale aligned and fused feature map into the detection head and performing adaptive feature compression on the multi-scale aligned and fused feature map through a context-aware multi-granularity pooling module includes: In the context-aware multi-granularity pooling module, multiple max-pooling kernels of different scales are used to perform parallel pooling operations on the multi-scale aligned and fused feature map to obtain a multi-granularity pooled feature map. Based on the occlusion-scale joint weights corresponding to the multi-scale aligned fusion feature map, the adaptive fusion coefficients corresponding to each granularity pooling feature map are calculated. The multi-granularity pooling feature map is weighted and summed based on the adaptive fusion coefficients, and adaptive feature compression is completed through convolution dimensionality reduction.
6. The method according to claim 1, characterized in that, The calculation of the category-spatial overlap between adjacent predicted bounding boxes is performed. If the category-spatial overlap indicates that the adjacent predicted bounding boxes belong to different protective equipment categories and the spatial intersection-union ratio is greater than a preset threshold, then the adjacent predicted bounding boxes are retained. If the bounding boxes belong to the same category of protective equipment and their spatial intersection-union ratio is greater than the dynamic suppression threshold, then attenuation suppression is applied to the predicted bounding boxes with lower confidence levels based on the category confidence level, including: For any two adjacent predicted bounding boxes, calculate their spatial intersection-union ratio and extract the class similarity matrix of their class labels; The spatial intersection-union ratio is combined with the category similarity matrix to generate the category-spatial overlap. If the category similarity matrix indicates that the two predicted bounding boxes belong to different protective equipment categories, and the spatial intersection-union ratio is greater than the preset occlusion tolerance threshold, it is determined to be a reasonable occlusion overlap of different protective equipment, and the two predicted bounding boxes are retained. If the category similarity matrix indicates that two predicted bounding boxes belong to the same category of protective equipment, and the spatial intersection-union ratio is greater than the dynamic suppression threshold, then an attenuation coefficient is calculated based on the difference in category confidence between the two. The attenuation coefficient is used to reduce the category confidence of the predicted bounding box with lower confidence. If the attenuated category confidence is lower than the retention threshold, then the predicted bounding box is removed.
7. The method according to claim 6, characterized in that, The dynamic suppression threshold is dynamically determined based on the local density of the region where the predicted bounding box is located and the scale area of the bounding box. The higher the local density of the region where the predicted bounding box is located, the higher the corresponding dynamic suppression threshold; the smaller the scale area of the bounding box, the higher the corresponding dynamic suppression threshold.
8. The method according to claim 1, characterized in that, Before acquiring the medical scene image to be detected, the method includes a step of constructing a dedicated dataset for medical personnel protective equipment, which includes: Original protective equipment images from multiple medical scenarios are collected. The target scale ratio is determined based on the ratio of the minimum bounding rectangle area of the protective equipment target in the original protective equipment image to the total area of the image. The target occlusion rate is determined based on the overlap between targets. Based on the target scale ratio, the target occlusion rate, and the local illumination non-uniformity of the original protective equipment image, calculate the scene complexity score for each original protective equipment image. The original protective equipment images are layered based on the scene complexity score. When dividing the dataset into training set, validation set and test set, the proportion of samples with different scene complexity scores in each subset is ensured to meet the preset consistency condition.
9. The method according to claim 1, characterized in that, The predicted bounding box, category confidence, and category label of the protective equipment based on the classification regression branch output include: In the classification regression branch, category-specific scaling parameters are set for different categories of protective equipment; When performing bounding box regression, the corresponding scale normalization parameter is selected based on the predicted target category. The offset output by the regression branch is scale normalized, and the final predicted bounding box coordinates are calculated in combination with the prior box. Different scale normalization parameters are used for large-scale protective equipment categories and small-scale protective equipment categories to balance the regression gradient.
10. A detection system for medical protective equipment based on an improved VFNET, characterized in that, include: The image preprocessing module is used to acquire the medical scene image to be detected, perform adaptive illumination-contrast joint correction processing on the medical scene image, determine the illumination non-uniformity based on the pixel distribution variance of the local region, and generate a local gain coefficient based on the illumination non-uniformity to adjust the local contrast and obtain a corrected image. The backbone feature extraction module is used to input the corrected image into the backbone network of the improved VFNET detection network, extract multi-stage feature maps through the medical scene perception dual-path attention module in the backbone network, extract channel features and local occlusion context features in parallel through the medical scene perception dual-path attention module, and modulate the channel features based on the local occlusion context features to generate occlusion-scale joint weights, and fuse the occlusion-scale joint weights with the original channel features to obtain attention-enhanced feature maps; The cross-scale feature fusion module is used to input the multi-stage attention-enhanced feature map into the cross-scale bidirectional feature compensation module, perform top-down semantic transfer and bottom-up detail compensation, and perform feature alignment operation based on the semantic deviation between adjacent scale feature maps before splicing feature maps of different scales to generate a multi-scale aligned fusion feature map. The detection head module is used to input the multi-scale aligned fused feature map into the detection head, perform adaptive feature compression on the multi-scale aligned fused feature map through the context-aware multi-granularity pooling module, and output the predicted bounding box, category confidence and category label of the protective equipment based on the classification regression branch. The post-processing module is used to perform adaptive non-maximum suppression processing for inter-class occlusion perception on the predicted bounding boxes, calculate the category-spatial overlap between adjacent predicted bounding boxes, and retain the adjacent predicted bounding boxes if the category-spatial overlap indicates that the adjacent predicted bounding boxes belong to different protective equipment categories and the spatial intersection-union ratio is greater than a preset threshold. If they belong to the same category of protective equipment and the spatial intersection-union ratio is greater than the dynamic suppression threshold, then the predicted bounding boxes with lower confidence are attenuated and suppressed according to the category confidence, and the final protective equipment detection result is output. The storage module is used to store the model parameters, configuration parameters, and detection result data of the improved VFNET detection network. The processor is used to coordinate and control the operation of the above modules.