Lightweight PPE detection method based on channel dependency graph pruning and aligned distillation

By pruning redundant channels using channel dependency graph pruning and distillation strategies and guiding the student model to learn the responses of key channels, the real-time performance and stability of PPE detection on edge devices under complex environments are addressed, achieving efficient and accurate detection with a lightweight model.

CN122049618APending Publication Date: 2026-05-15CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING UNIV OF POSTS & TELECOMM
Filing Date
2026-01-28
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing deep learning-based PPE detection models struggle to achieve real-time detection on edge devices with limited computing resources, and their detection stability is insufficient in complex construction environments with dense targets, frequent occlusion, and large scale differences.

Method used

A distillation strategy based on channel dependency graph pruning and channel attention guidance is adopted. By constructing a channel dependency graph, redundant channels are pruned and the student model is guided to learn the responses of key channels, thus maintaining model compactness and detection accuracy.

Benefits of technology

It significantly reduces the number of model parameters and computational load while maintaining high accuracy, improving inference speed, and ensuring stable PPE detection performance in complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122049618A_ABST
    Figure CN122049618A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer vision and deep learning, and particularly relates to a lightweight PPE detection method based on channel dependency graph pruning and alignment distillation, which comprises the following steps: acquiring a basic detection model, inputting to-be-detected PPE data into the basic detection model, and acquiring a channel response calculation channel feature set of each convolutional layer; constructing a channel dependency graph according to the channel feature set; obtaining a channel importance index of each channel of each convolutional layer according to the channel dependency graph; pruning the basic detection model according to the channel importance index to obtain a lightweight basic model; constructing a student model, taking the lightweight basic model as a teacher model, and performing distillation by adopting a distillation mechanism guided by channel attention; inputting the PPE data into the student model after distillation for detection to obtain a detection result; according to the invention, the relation between lightweight design and high-precision PPE detection is effectively balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and deep learning technology, specifically relating to a lightweight PPE detection method based on channel dependency graph pruning and alignment distillation. Background Technology

[0002] With the continuous improvement of industrial automation, modern production environments are becoming increasingly complex and dense, placing higher demands on the accuracy and real-time nature of on-site safety supervision. Automated detection of personal protective equipment (PPE), as a key component, typically needs to be deployed on edge devices with limited computing resources.

[0003] In recent years, deep learning-based target detection technology has become the mainstream solution for automatic identification of personal protective equipment (PPE). This type of method extracts multi-scale visual features through deep neural networks, demonstrating superior performance on standard datasets. However, with the increasing depth of the network structure and the stacking of computational modules, the number of model parameters and computational overhead increases significantly, leading to a high dependence on computing resources. In real-world construction environments, detection systems are mostly deployed on edge devices for real-time monitoring, and highly complex models struggle to meet the operational requirements of low-power devices. Furthermore, construction scenarios commonly present problems such as dense target density, frequent occlusion, and large scale differences. Traditional lightweight models often struggle to balance recognition speed with cross-scale feature representation capabilities, resulting in insufficient detection stability.

[0004] Therefore, how to effectively reduce model redundancy, enhance cross-scale feature extraction capabilities, and meet the real-time operation requirements of edge devices while ensuring detection accuracy has become a key issue that urgently needs to be addressed. Summary of the Invention

[0005] To address the above problems, this invention provides a lightweight PPE detection method based on channel dependency graph pruning and alignment distillation, comprising the following steps:

[0006] S1. Obtain the basic detection model, which adopts the MKD-YOLO network architecture;

[0007] S2. Input the PPE data to be detected into the basic detection model, obtain the channel response of each convolutional layer and calculate the channel feature set; the channel feature set includes the channel correlation matrix, the channel cross-layer dependency matrix and the channel attention score matrix;

[0008] S3. Construct a channel dependency graph based on the channel feature set;

[0009] S4. Based on the channel dependency graph, obtain the channel importance index for each channel of each convolutional layer;

[0010] S5. Prune the basic detection model according to the channel importance index to obtain a lightweight basic model, including: determining whether the channel importance index of each channel in each convolutional layer is less than the threshold; if so, adding it to the pruning set; pruning the channels of the basic detection model according to the pruning set.

[0011] S6. Construct a student model, using a lightweight base model as the teacher model, and employ a channel attention-guided distillation mechanism for distillation;

[0012] S7. Input the PPE data into the student model after distillation for testing and obtain the test results.

[0013] The beneficial effects of this invention are:

[0014] This invention effectively balances the relationship between lightweight design and high-precision PPE detection through a combined distillation strategy of channel dependency graph pruning mechanism and channel attention guidance, achieving significant technical improvement.

[0015] This invention achieves a technological breakthrough by significantly reducing the number of parameters and computational load while maintaining a high level of detection accuracy. This makes the lightweight PPE detection model not only more compact in structure and significantly faster inference speed, but also allows it to maintain reliable detection performance under complex backgrounds, varying target sizes, and occlusion interference in real construction environments. Attached Figure Description

[0016] Figure 1 This is a flowchart of a lightweight PPE detection method based on channel dependency graph pruning and alignment distillation according to the present invention.

[0017] Figure 2 This is a structural diagram of the basic detection model of the present invention. Detailed Implementation

[0018] 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.

[0019] To achieve lightweight models, some scholars have proposed methods such as pruning and knowledge distillation. However, most existing pruning methods assess importance based on single-layer channel statistics, failing to fully consider cross-layer dependencies between channels in convolutional layers, attention modules, and multi-scale feature fusion. Therefore, they struggle to accurately identify truly redundant channels and are prone to pruning critical channels incorrectly. Furthermore, current mainstream distillation methods typically only align feature maps or outputs at a single scale, lacking constraints on the distribution of attention within the model's channels and the consistency of cross-scale features. This makes it difficult to effectively compensate for the structural information loss caused by pruning, resulting in poor performance recovery after pruning.

[0020] To address the problems commonly found in existing personal protective equipment (PPE) target detection models in complex construction scenarios, such as structural redundancy, low inference efficiency, and significant decrease in accuracy after pruning, this invention proposes a lightweight PPE detection method based on channel dependency graph pruning and alignment distillation. This method aims to maintain detection accuracy while effectively compressing the model size and improving inference speed.

[0021] like Figure 1 As shown, the specific solutions include:

[0022] S1. Obtain the basic detection model, which adopts the MKD-YOLO network architecture.

[0023] Specifically, the basic detection model of this invention adopts the MKD-YOLO network architecture proposed in the paper "MKD-YOLO: Multi-Scale and Knowledge-Distilling YOLO for Efficient PPE Compliance Detection", the specific structure of which is as follows: Figure 2 As shown.

[0024] S2. Input the PPE data to be detected into the basic detection model, obtain the channel response of each convolutional layer and calculate the channel feature set; the channel feature set includes the channel correlation matrix, the channel cross-layer dependency matrix and the channel attention score matrix.

[0025] In some embodiments, such as Figure 2 As shown, the MKD-YOLO network architecture includes multiple independent convolutional layers, such as the five independent Conv layers shown in the Backbone and the seven independent Conv layers shown in the Neck structure. This invention performs fine-grained analysis, calculating the corresponding channel feature sets for each of these independent convolutional layers.

[0026] Specifically, the calculation process for the channel feature set of each convolutional layer includes:

[0027] S21. Calculate the channel response of the i-th channel in the l-th convolutional layer, i.e., the mean. and variance , represented as:

[0028]

[0029]

[0030] In the formula, H and W represent the height and width of the output feature map of the convolutional layer, respectively. This represents the feature value in the h-th row and w-th column of the i-th channel of the l-th convolutional layer; and These respectively characterize the central tendency and magnitude of change in channel activation.

[0031] S22. Calculate the channel correlation matrix C of the l-th convolutional layer. l ,in:

[0032]

[0033]

[0034] In the formula, C l (i,j) represents the channel correlation matrix C of the l-th convolutional layer. l The element in the i-th row and j-th column, C represents covariance; l (i,j) characterizes the strength of coupling between channels.

[0035] S23. Calculate the channel cross-layer dependency matrix D between the l-th convolutional layer and the (l+k)-th convolutional layer. l There is a cross-layer mapping relationship between the l-th convolutional layer and the (l+k)-th convolutional layer, where:

[0036]

[0037] In the formula, D l (i,j) represents the channel cross-layer dependency matrix D. l The element in the i-th row and j-th column, This represents the feature vector of the i-th channel of the l-th convolutional layer, i.e., the output feature of the i-th channel of the l-th convolutional layer. The feature vector after processing by some functions; This represents the feature vector of the j-th channel of the (l+k)-th convolutional layer that has a cross-layer mapping relationship with the l-th convolutional layer; ||·||1 represents the L1 norm; D l (i,j) describes the degree of consistency of cross-layer feature mapping.

[0038] S24. Calculate the channel attention score matrix A of the l-th convolutional layer. l ,in:

[0039]

[0040] In the formula, Represents the channel attention score matrix A l The element in the i-th row represents the function softmax() and GAP() represents global average pooling. This reflects the importance and weight of channels in the attention mechanism.

[0041] Specifically, the cross-layer mapping relationship in this invention is defined as follows: In the basic detection model, if the output features of the l-th convolutional layer are passed to its nearest subsequent convolutional layer (such as the (l+k)-th convolutional layer) as input through direct connection, lateral branching, upsampling, downsampling, or feature concatenation operations, then a cross-layer mapping relationship is determined to exist between them. This relationship emphasizes the logical connectivity of feature flow while ignoring the internal structural details of intermediate composite modules.

[0042] Specifically, in Figure 2 In the basic detection model shown, the LSPPF, C2f-EMSEC, and C2f modules in the Backbone structure do not participate in the construction of the channel dependency graph, while the remaining five independent Convs do. Similarly, in the Neck structure, only seven independent Convs participate in the construction of the channel dependency graph. Each Conv has a cross-layer mapping relationship with its nearest non-directly connected Conv.

[0043] To further clarify Figure 2The network architecture shown below will be systematically explained in the following text based on the numerical designation of each layer in the upper right corner, illustrating the cross-layer mapping relationships in the Backbone and Neck modules. In the Backbone architecture, Conv_0 and Conv_1 are directly connected, while the connections between Conv_1 and Conv_3, Conv_3 and Conv_5, and Conv_5 and Conv_7 require processing via the C2f or C2f-EMSEC module. All of these layer pairs exhibit cross-layer feature mapping relationships. In the Neck module's architecture design, multiple sets of cross-layer mapping relationships exist through operations such as direct connections, downsampling, or lateral feature transfer, including Conv_20 and Conv_23, Conv_10 and Conv_26, Conv_11 and Conv_29, Conv_23 and Conv_26, Conv_26 and Conv_29, and Conv_11 and Conv_29. At the junction of Backbone and Neck, there are also cross-layer mapping relationships between layer pairs such as Conv_1 and Conv_20, Conv_3 and Conv_10, Conv_5 and Conv_11, and Conv_7 and Conv_12.

[0044] In particular, for convergence nodes formed by concatenating multi-level features (such as Conv_29), the cross-layer mapping relationship exhibits a many-to-one complexity. Since this node integrates features from multiple upstream layers, its dependencies need to be determined one by one through recursive backtracking of all original source convolutional layers. Based on this, precise alignment of the source and target channels needs to be achieved according to the cumulative channel offset caused by each concatenation operation in the final feature map, thereby completing the quantitative calculation of dependencies.

[0045] S3. Construct a channel dependency graph based on the channel feature set.

[0046] In some embodiments, to display the structural relationships representing different channels, this invention constructs a channel dependency graph G=(V,E) with each channel of each convolutional layer as a node, where V represents the set of nodes and E represents the set of edges; wherein... ∈V represents the i-th channel of the l-th convolutional layer; Let represent the abstract edge corresponding to the i-th channel of the l-th convolutional layer, used to characterize the channel correlation between the i-th channel of the l-th convolutional layer and the j-th channel of the l-th convolutional layer, as well as the channel cross-layer dependency of the j-th channel of the (l+k)-th convolutional layer that has a cross-layer mapping relationship with it; φ() represents the relationship fusion mapping function, C l (i,j) represents the channel correlation between the i-th channel of the l-th convolutional layer and the j-th channel of the l-th convolutional layer, D l(i,j) represents the channel cross-layer dependency between the i-th channel of the l-th convolutional layer and the j-th channel of the (l+k)-th convolutional layer, which has a cross-layer mapping relationship.

[0047] Furthermore, the specific process of constructing the channel dependency graph includes: First, for each convolutional layer, each channel is abstracted as a node in the channel dependency graph, and the channel correlation C between channels within the same convolutional layer is calculated. l (i,j) are used to construct intra-layer abstract edges to represent the feature coupling relationship between channels. Simultaneously, for adjacent convolutional layers with cross-layer mapping relationships, the channel dependency strength D between each channel and its corresponding cross-layer channel is further calculated. l (i,j) represents the channel dependency relationship during cross-layer feature transmission. Finally, a unified model is constructed using a relationship fusion mapping function φ() to model the correlation between channels within the same layer and the dependency between channels across layers, generating the corresponding abstract edge weights E. l (i,j) is used to represent the same-layer and cross-layer relationships of nodes.

[0048] Specifically, channel correlation C l (i,j) is used to characterize the cooperative or redundant relationships between different channels within the same convolutional layer, determining whether a connection is established between nodes in the same layer in the channel dependency graph; the channel cross-layer dependency D l (i,j) is used to measure the functional dependency between channels of different convolutional layers that have cross-layer mapping relationships. It constrains the associations between cross-layer nodes in the channel dependency graph, thus avoiding disruption of key cross-layer feature transmission paths during subsequent pruning. The relationship fusion mapping function φ() is not a simple arithmetic operation, but a structured rule used to uniformly map intra-layer correlation and cross-layer dependency to edge weights in the graph, directly affecting node pairs in the channel dependency graph. The channel dependency graph not only reflects the importance of single-layer channels but also reveals the association between cross-layer transmission effects, feature coupling, and attention responses, thus providing necessary structural constraints for subsequent cross-layer pruning.

[0049] S4. Based on the channel dependency graph, obtain the channel importance index for each channel of each convolutional layer.

[0050] In some embodiments, obtaining the channel importance index for each channel of each convolutional layer under the constraints of the channel dependency graph includes:

[0051] Calculate the consistency index of the i-th channel of the l-th convolutional layer. , represented as:

[0052]

[0053] In the formula, This represents the output feature of the i-th channel of the l-th convolutional layer. This represents the output feature of the j-th channel of the (l+k)-th convolutional layer, which has a cross-layer mapping relationship with the l-th convolutional layer.

[0054] Calculate the composite index of the i-th channel of the l-th convolutional layer. , represented as:

[0055]

[0056] In the formula, , Let represent the mean and variance of the i-th channel in the l-th convolutional layer, respectively. This represents the sum of channel correlations in the i-th channel of the l-th convolutional layer. ω1, ω2, ω3, and ω4 represent the sum of the consistency indices of the i-th channel in the l-th convolutional layer.

[0057] Calculate the channel importance index of the i-th channel in the l-th convolutional layer. , represented as:

[0058]

[0059] In the formula, Let represent the channel attention score of the i-th channel in the l-th convolutional layer. , Let represent the sum of channel cross-layer dependencies of the i-th channel in the l-th convolutional layer, where α, β, γ, and δ represent coefficients.

[0060] S5. Prune the basic detection model according to the channel importance index to obtain a lightweight basic model, including: determining whether the channel importance index of each channel in each convolutional layer is less than a threshold; if so, adding it to the pruning set; and pruning the channels of the basic detection model according to the pruning set.

[0061] Specifically, the pruning threshold and retention ratio are dynamically adjusted based on the channel importance index, and low-contribution channels and their corresponding convolutional kernel parameters, attention weights, and cross-layer connection structures are removed simultaneously within the same convolutional layer. At the same time, relative consistency in the number of channels across different layers is maintained to mitigate gradient instability and information flow interruption caused by structural abrupt changes.

[0062] This invention re-evaluates the channels of each convolutional layer in a network based on a channel importance index, enabling the model to accurately identify redundant channels under complex dependencies and effectively avoid erroneously deleting key structures. The channel importance index is constructed by integrating multiple dimensions such as feature response strength, statistical distribution differences, cross-layer consistency, and node centrality in the channel dependency graph, which can systematically and quantitatively evaluate the contribution and influence of each channel in the model.

[0063] S6. Construct a student model, using a lightweight base model as the teacher model, and employ a channel attention-guided distillation mechanism for distillation.

[0064] Specifically, the student model maintains the same network topology as the teacher model, having the same backbone network, feature fusion path, and detection head structure, but the channel width of each convolutional layer is reduced to form a lightweight network structure with smaller parameter size and lower computational complexity.

[0065] In some embodiments, while channel pruning reduces computational complexity, it inevitably weakens the model's feature representation ability. To compensate for the loss of internal structural information caused by pruning, this invention introduces a channel attention-guided joint knowledge distillation mechanism on top of a lightweight base model.

[0066] This mechanism first guides the student model to relearn the discriminative channel responses that were weakened during pruning by aligning the channel attention distributions of the teacher and student models. Specifically, based on channel alignment, the channel attention difference between corresponding channels in the teacher and student models is calculated channel by channel. By minimizing the Euclidean distance between them, the channel weights of the student model are made consistent with those of the teacher model. The channel attention loss is then constructed as follows:

[0067]

[0068] In the formula, L att (k) represents the channel attention difference between the teacher model and the student model in the k-th channel, A s (k) represents the channel attention vector of the k-th channel in the student model, A t (k) represents the channel attention vector of the k-th channel in the teacher model; Represents the square of the L2 norm;

[0069] Meanwhile, this invention ensures that the student model maintains a similar spatial response to the teacher model in terms of texture details, boundary structure, and object contours by applying spatial consistency constraints on multi-scale feature maps. Specifically, based on channel alignment, the spatial gradient difference between corresponding channels in the teacher and student models is calculated channel by channel, prompting the student model to reproduce the response pattern of the teacher model in terms of spatial structure. The spatial structure loss is represented as follows:

[0070]

[0071] In the formula, L sp (k) represents the gradient difference between the teacher model and the student model in the feature map space of the k-th channel, ▽F s (k) represents the spatial gradient of the feature map of the k-th channel of the student model, ▽F t (k) represents the feature map spatial gradient of the kth channel of the teacher model, and ||·||1 represents the L1 norm;

[0072] Furthermore, this invention also designs a multi-scale consistency loss L ms The aim is to enhance the robustness of student models in cross-scale structural representations, expressed as:

[0073]

[0074] In the formula, F s (k) represents the feature map of the k-th channel of the student model, F t (k) represents the feature map of the k-th channel of the teacher model. This represents a multi-scale structural descriptor. Based on channel alignment, the multi-scale structural descriptor extracts the multi-scale structural descriptions of the teacher model feature map and the student model feature map in each channel, and minimizes their L1 difference to ensure that the student model can simultaneously reproduce the cross-scale structural relationship of the teacher model in both high-level semantic contours and low-level texture details.

[0075] In some embodiments, the channel attention loss, spatial structure loss, and multi-scale consistency loss are weighted to obtain the total loss L. distill Represented as:

[0076]

[0077] In the formula, y s y represents the prediction result of the student model. t λ1, λ2, λ3, and λ4 represent the prediction results of the teacher model.

[0078] Through synergistic optimization of channel attention loss, spatial structure loss, and multi-scale consistency loss, the lightweight model obtained after pruning significantly recovers its channel selectivity, spatial structure representation ability, and multi-scale feature fusion performance. The lightweight PPE detection model proposed in this invention maintains detection accuracy similar to or even comparable to the original model while significantly reducing the number of model parameters and computational complexity, thus effectively improving deployment efficiency in practical engineering scenarios. Ultimately, the obtained model can efficiently adapt to various edge devices and mobile terminals, achieving real-time, stable, and accurate detection of personal protective equipment such as safety helmets, safety belts, and reflective vests in complex construction environments, demonstrating outstanding engineering application value and broad prospects for promotion.

[0079] S7. Input the PPE data into the student model after distillation for testing and obtain the test results.

[0080] The channel dependency graph proposed in this invention can simultaneously characterize the channel activation intensity, cross-layer coupling relationships, and feature transfer structure during the fusion process of convolutional layers, attention modules, and multi-scale features. This fundamentally overcomes the limitations of traditional single-layer statistical information-based pruning methods in structural analysis, enabling pruning decisions to be made from a complete structural perspective. This significantly reduces the risk of accidental deletion of key channels, thereby improving the feature representation integrity and structural stability of the pruned model. The cross-layer synchronous pruning strategy based on the channel dependency graph ensures that the model maintains the continuity of multi-scale feature pathways during compression, allowing the lightweight base model to still possess effective feature extraction capabilities, laying a structural foundation for subsequent distillation recovery.

[0081] The channel attention-guided distillation mechanism proposed in this invention can significantly compensate for the decline in feature selection ability caused by pruning. By aligning the channel attention distributions of the teacher and student models, the student model recovers the channel selection patterns damaged during pruning, enabling the lightweight model to maintain a response structure close to that of the teacher model in terms of key feature representations such as semantic emphasis and focus on important regions. Simultaneously, the spatial consistency constraint introduced on multi-scale feature maps ensures that the student model achieves stable spatial perception capabilities at different resolutions, effectively avoiding structural degradation phenomena such as edge blurring and texture discontinuities common after pruning. This makes the model more accurate in target localization and shape discrimination, thereby further restoring detection performance.

[0082] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "setting," "connection," "fixing," "rotation," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Unless otherwise explicitly limited, those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0083] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art 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 appended claims and their equivalents.

Claims

1. A lightweight PPE detection method based on channel dependency graph pruning and aligned distillation, characterized in that, Includes the following steps: S1. Obtain the basic detection model, which adopts the MKD-YOLO network architecture; S2. Input the PPE data to be detected into the basic detection model, obtain the channel response of each convolutional layer and calculate the channel feature set; the channel feature set includes the channel correlation matrix, the channel cross-layer dependency matrix and the channel attention score matrix; S3. Construct a channel dependency graph based on the channel feature set; S4. Based on the channel dependency graph, obtain the channel importance index for each channel of each convolutional layer; S5. Prune the basic detection model according to the channel importance index to obtain a lightweight basic model, including: determining whether the channel importance index of each channel of each convolutional layer is less than the threshold; if so, add it to the pruning set. The channels of the basic detection model are pruned based on the pruning set; S6. Construct a student model, using a lightweight base model as the teacher model, and employ a channel attention-guided distillation mechanism for distillation; S7. Input the PPE data into the student model after distillation for testing and obtain the test results.

2. The lightweight PPE detection method based on channel dependency graph pruning and alignment distillation according to claim 1, characterized in that, The calculation process for the channel feature set of each convolutional layer includes: S21. Calculate the mean of the i-th channel of the l-th convolutional layer. and variance , represented as: , , In the formula, H and W represent the height and width of the output feature map of the convolutional layer, respectively. This represents the feature value in the h-th row and w-th column of the i-th channel of the l-th convolutional layer. S22. Calculate the channel correlation matrix C of the l-th convolutional layer. l ,in: , , In the formula, C l (i,j) represents the channel correlation matrix C of the l-th convolutional layer. l The element in the i-th row and j-th column, Represents covariance; S23. Calculate the channel cross-layer dependency matrix D of the l-th convolutional layer. l ,in: , In the formula, D l (i,j) represents the channel cross-layer dependency matrix D. l The element in the i-th row and j-th column, This represents the feature vector of the i-th channel in the l-th convolutional layer. Let ||·||1 represent the feature vector of the j-th channel of the (l+k)-th convolutional layer that has a cross-layer mapping relationship with the l-th convolutional layer, and ||·||1 represent the L1 norm; S24. Calculate the channel attention score matrix A of the l-th convolutional layer. l ,in: , In the formula, Represents the channel attention score matrix A l The element in the i-th row represents the function softmax() and GAP() represents global average pooling.

3. The lightweight PPE detection method based on channel dependency graph pruning and alignment distillation according to claim 1, characterized in that, Using each channel of each convolutional layer as a node, construct a channel dependency graph G=(V,E), where V represents the set of nodes and E represents the set of edges; ∈V represents the i-th channel of the l-th convolutional layer; Let represent the abstract edge corresponding to the i-th channel of the l-th convolutional layer, used to characterize the channel correlation between the i-th channel of the l-th convolutional layer and the j-th channel of the l-th convolutional layer, as well as the channel cross-layer dependency of the j-th channel of the (l+k)-th convolutional layer that has a cross-layer mapping relationship with it; φ() represents the relationship fusion mapping function, C l (i,j) represents the channel correlation between the i-th channel of the l-th convolutional layer and the j-th channel of the l-th convolutional layer, D l (i,j) represents the channel cross-layer dependency between the i-th channel of the l-th convolutional layer and the j-th channel of the (l+k)-th convolutional layer, which has a cross-layer mapping relationship.

4. The lightweight PPE detection method based on channel dependency graph pruning and alignment distillation according to claim 1, characterized in that, Obtaining the channel importance index for each channel of each convolutional layer includes: Calculate the consistency index of the i-th channel of the l-th convolutional layer. , represented as: , In the formula, This represents the output feature of the i-th channel of the l-th convolutional layer. This represents the output feature of the j-th channel of the (l+k)-th convolutional layer, which has a cross-layer mapping relationship with the l-th convolutional layer. Calculate the composite index of the i-th channel of the l-th convolutional layer. , represented as: , In the formula, , Let represent the mean and variance of the i-th channel in the l-th convolutional layer, respectively. This represents the sum of channel correlations in the i-th channel of the l-th convolutional layer. ω1, ω2, ω3, and ω4 represent the sum of the consistency indices of the i-th channel in the l-th convolutional layer. Calculate the channel importance index of the i-th channel in the l-th convolutional layer. , represented as: , In the formula, Let represent the channel attention score of the i-th channel in the l-th convolutional layer. , Let represent the sum of channel cross-layer dependencies of the i-th channel in the l-th convolutional layer, where α, β, γ, and δ represent coefficients.

5. The lightweight PPE detection method based on channel dependency graph pruning and alignment distillation according to claim 1, characterized in that, Step S6 employs a channel attention-guided distillation mechanism for distillation, including: Based on channel alignment, the channel attention difference between the teacher model and the student model is calculated channel by channel to construct the channel attention loss, which is expressed as: , In the formula, L att (k) represents the channel attention difference between the teacher model and the student model in the k-th channel, A s (k) represents the channel attention vector of the k-th channel in the student model, A t (k) represents the channel attention vector of the k-th channel in the teacher model; Represents the square of the L2 norm; Based on channel alignment, the spatial gradient difference between the feature maps of the teacher and student models is calculated channel by channel to construct the spatial structure loss, which is expressed as: , In the formula, L sp (k) represents the gradient difference between the teacher model and the student model in the feature map space of the k-th channel, ▽F s (k) represents the spatial gradient of the feature map of the k-th channel of the student model, ▽F t (k) represents the feature map spatial gradient of the kth channel of the teacher model, and ||·||1 represents the L1 norm; Based on channel alignment, the feature map scale structure difference between the teacher model and the student model is calculated channel by channel, and a multi-scale consistency loss L is constructed. ms , represented as: , In the formula, F s (k) represents the feature map of the k-th channel of the student model, F t (k) represents the feature map of the k-th channel of the teacher model. Represents a multi-scale structure description operator; The channel attention loss, spatial structure loss, and cross-scale loss are weighted and combined, and the combined result is used for training and optimization.

6. The lightweight PPE detection method based on channel dependency graph pruning and alignment distillation according to claim 5, characterized in that, We weight the channel attention loss, spatial structure loss, and multi-scale consistency loss to obtain the total loss L. distill Represented as: , In the formula, y s y represents the prediction result of the student model. t λ1, λ2, λ3, and λ4 represent the prediction results of the teacher model.

7. The lightweight PPE detection method based on channel dependency graph pruning and alignment distillation according to claim 1, characterized in that, The student model maintains the same network topology as the teacher model, but the channel width of each convolutional layer is reduced to form a lightweight network structure with smaller parameter size and lower computational complexity.