A Degradation-Aware Small Target Face Detection Training Method and System

By using a dual-branch training framework with shared weights and degradation awareness technology, the problems of domain difference and alignment inconsistency in small target face detection are solved, improving the detection performance in long-distance, low-resolution scenes and achieving efficient detection results.

CN123052803APending Publication Date: 2026-11-06SHENZHEN MAGIC INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611556073.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-09
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing technologies for small target face detection suffer from problems such as domain difference between training samples and real long-distance low-resolution images, poor cross-scale alignment, global feature alignment affected by foreground and background imbalance, inconsistent prediction box coordinate systems, and unstable model performance during inference, which lead to a decline in detection performance.

Method used

A shared-weight bi-branch training framework is adopted, which generates degraded images through parameterized composite degradation operators. Combined with constrained degradation conditionalization of reachable targets, instance-level foreground alignment and coordinate normalization for consistent localization, bi-branch detection supervision, and zero-degradation anchoring, the performance of small target face detection is improved.

Benefits of technology

Without increasing inference overhead, it significantly improves the performance of small target face detection in long-distance, low-resolution scenes, reduces false negatives and false positives, improves discriminativeness and localization accuracy, and ensures detection accuracy on regular images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123052803A_ABST
    Figure CN123052803A_ABST
Patent Text Reader

Abstract

This application discloses a degradation-aware small-target face detection training method and system. The method includes: constructing a teacher branch and a student branch that share the weights of a backbone network and a detection head. The teacher branch receives a clear image, and the student branch receives a degradation image generated by a composite degradation operator. The degradation parameters are encoded as a degradation condition vector. Using the degradation condition vector as a condition, a constrained channel-wise conditional affine transformation is applied to the features of the teacher branch with the stopping gradient to obtain an alignment target. The alignment target is used to supervise the student features after transformation by the student-side predictor. The feature alignment loss is calculated only in the foreground region determined by the real face bounding box. Classification loss and bounding box regression loss are applied to the two branches respectively, and the localization consistency loss of the normalized prediction box is calculated. The system is jointly trained with a total loss including the two-branch detection loss, feature alignment loss, localization consistency loss, and zero degradation anchoring loss. During the inference phase, only the backbone network and the detection head are retained for a single forward inference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology in computer vision and deep learning, specifically to a method and system for training small target face detection using degradation perception. Background Technology

[0002] Face detection is a fundamental prerequisite for systems such as face recognition, video surveillance, and intelligent security. In real-world deployments involving long-distance monitoring and wide-angle scenes, faces occupy very few pixels in an image, constituting small-target faces. After multiple downsampling operations, convolutional neural networks suffer significant loss of discriminative features for small-target faces, leading to a marked increase in false negatives and false positives for existing detectors on small targets, resulting in a substantial decline in overall performance.

[0003] Existing technologies for training small-target face detection suffer from the following shortcomings: First, there is a domain difference between the small-target samples used for training and real-world, low-resolution long-distance images. Second, existing cross-scale alignment targets clean features of large targets, which are unreachable and can easily lead to ineffective alignment or collapse of large-target features. Third, global feature alignment is affected by foreground-background imbalance and the inconsistency of the coordinate systems of the two branch prediction boxes, resulting in insufficient supervision of face targets. Fourth, if a freely trainable transfer module is introduced for alignment, and its output can be arbitrarily rewritten, the target may collapse towards the student's current features, making the alignment loss easily minimized without providing effective supervision; simply stopping the gradient on the teacher's features is insufficient to avoid this problem. Fifth, if training only uses the detection loss of the degenerate branch to drive shared weights, the model's performance on full-resolution or conventional-sized images faced by inference lacks anchoring, posing a risk of neglecting one aspect for another.

[0004] Therefore, designing a degradation-aware small target face detection training scheme that closely approximates real degradation, provides achievable alignment targets for small targets, and focuses supervision on the face foreground, thereby effectively improving the performance of small target face detection in long-distance, low-resolution scenes, is an urgent technical problem to be solved. Summary of the Invention

[0005] To address the aforementioned deficiencies in existing technologies, this invention provides a degradation-aware small target face detection training method and system. By employing a shared weight bi-branch training framework, constrained degradation conditional reachability targets, instance-level foreground alignment and coordinate normalization for consistent localization, bi-branch detection supervision, and zero-degradation anchoring in synergy, the performance of small target face detection in long-distance, low-resolution scenes is improved without increasing inference overhead.

[0006] In a first aspect, embodiments of this application provide a degradation-aware small target face detection training method, comprising the following steps: Obtain an initial face detection model, which includes a backbone network and a detection head; A teacher branch and a student branch are constructed that share the weights of the backbone network and the detection head. The teacher branch is used to receive clear images, and the student branch is used to receive degraded images. The degraded images are generated by applying a combination of degradation, including downsampling, blurring, noise, and compression, to the clear images using a parameterized composite degradation operator. The parameters of the composite degradation operator are encoded as a degradation condition vector. Using the degradation condition vector as a condition, a constrained channel-wise conditional affine transformation is applied to the teacher branch features of the stopping gradient to obtain an alignment target reachable under degradation conditions; a student-side predictor transformation is applied to the student branch features to obtain the transformed student features; the transformed student features are supervised by the alignment target, and the feature alignment loss is calculated, wherein the feature alignment loss is calculated only on the foreground region determined based on the real face bounding box; Classification loss and bounding box regression loss are applied to the teacher branch and the student branch respectively to obtain the dual-branch detection loss; localization consistency loss is calculated based on the predicted bounding boxes of the two branches after normalization according to their respective image sizes. The backbone network, the detector head, the conditional affine transformation, and the student-side predictor are jointly trained using the total training loss. The total training loss includes the bi-branch detection loss, the feature alignment loss, the localization consistency loss, and the zero-degenerate anchoring loss. The zero-degenerate anchoring loss is used to constrain the conditional affine transformation to tend towards the identity transformation when the degradation parameter tends to zero. During the inference phase, only the backbone network and the detection head are retained, and a single forward inference is performed on the input image to obtain the face detection result.

[0007] Preferably, the parameterized composite degradation operator concatenates the downsampling, the blurring, the noise, and the compression in a preset order, and selectively superimposes atmospheric scattering degradation; The parameters of the composite degradation operator include at least one of the following: downsampling scale, fuzzy kernel, noise intensity, compression quality factor, and atmospheric scattering coefficient; the degradation parameters are encoded into a degradation condition vector through an embedding layer; the degradation intensity monotonically increases with training epochs.

[0008] Preferably, the scaling parameter of the constrained channel-by-channel conditional affine transformation is parameterized using identity centralization, and the scaling parameter is the sum of the reference value and the conditional offset. The gradient stopping process is used to keep the teacher branch feature values ​​unchanged during forward propagation and to prevent the gradient from being passed upstream of the teacher branch feature during backward propagation. The student-side predictor is a pointwise convolution, used to perform a linear transformation on the student branch features channel by channel to obtain the transformed student features.

[0009] Preferably, the feature alignment loss is calculated only on the foreground region determined based on the real face bounding box, including: A foreground mask is generated based on the real face bounding box. The foreground mask is used to mark the spatial positions belonging to the face foreground on the feature grid. For each spatial position marked by the foreground mask, the cosine distance between the transformed student feature and the alignment target is calculated. The cosine distance of each spatial position marked by the foreground mask is averaged to obtain the feature alignment loss. Alternatively, perform instance alignment extraction processing on the real face bounding box to obtain student instance features and alignment target instance features for each instance; for each instance, calculate the cosine distance between the student instance features and the alignment target instance features; average the cosine distances of each instance to obtain the feature alignment loss.

[0010] Preferably, the normalization is to divide the horizontal coordinate component of the prediction box by the width of the image and the vertical coordinate component of the prediction box by the height of the image. The localization consistency loss is the sum of the L2 distance between the normalized predicted boxes of the two branches and the intersection-union ratio minus one; the localization consistency loss is only calculated for anchor boxes in the shared anchor boxes of the two branches that are assigned as positive samples by the ground truth boxes, before non-maximum suppression.

[0011] Preferably, before performing joint training on the backbone network, the detector head, the conditional affine transformation, and the student-side predictor using the total training loss, the method further includes: The student branch features are subjected to feature restoration processing, which is performed by the feature restoration head to obtain restored features; Calculate the feature restoration consistency loss, which is the average L2 distance between the restored feature and the teacher branch feature of the stopping gradient over the foreground region; The total training loss also includes the feature restoration consistency loss; wherein the feature restoration head is removed during the inference phase.

[0012] Preferably, the total training loss is a weighted sum of the bi-branch detection loss, the feature alignment loss, the localization consistency loss, the feature restoration consistency loss, and the zero-degenerate anchoring loss; The zero-degradation anchoring loss is the sum of the squared norm of the difference between the scaling parameter and the baseline value, averaged on samples where the degradation parameter tends to zero, and the squared norm of the translation parameter.

[0013] Preferably, the degradation intensity is a scheduling value that monotonically increases with each training round; The parameter components of the composite degradation operator are determined according to the monotonic function of the degradation intensity, or according to the distribution sampling with the degradation intensity as a parameter.

[0014] Preferably, in the inference phase, only the backbone network and the detection head are retained, and a single forward inference is performed on the input image to obtain the face detection result, including: Remove the parameterized composite degradation operator, the conditional affine transformation, the student-side predictor, and the feature restoration head; The backbone network and the detection head constitute an inference network, and the structure of the inference network is consistent with the structure of the basic face detector. Perform a single forward inference process on the input image to obtain the face detection result; The basic face detector can be any one of a single-stage, two-stage, or anchor-free detector.

[0015] In a second aspect, embodiments of this application provide a degradation-aware small target face detection training system for implementing the method described in any one of the first aspects, comprising: The model initialization module is used to obtain an initial face detection model, which includes a backbone network and a detection head; The degraded sample generation module is used to construct a parameterized composite degradation operator, generate a degraded image, and encode the degradation parameters into a degradation condition vector; The feature alignment module is used to apply a constrained channel-wise conditional affine transformation to the teacher branch features of the stopping gradient with the degradation condition vector as a condition to obtain the alignment target, and to apply a student-side predictor transformation to the student branch features to calculate the feature alignment loss in the foreground region. The detection supervision module is used to apply classification loss and bounding box regression loss to the teacher branch and the student branch respectively, and to calculate the localization consistency loss. The joint training module is used to perform joint training on the backbone network, detector head, conditional affine transformation and student-side predictor with a total training loss including bi-branch detection loss, feature alignment loss, localization consistency loss and zero-degenerate anchoring loss. The inference module is used to remove the training-specific modules during the inference phase, retaining only the backbone network and the detection head, and performing a single forward inference on the input image to obtain the face detection result.

[0016] Compared with the solutions of the prior art, the present invention has at least the following beneficial technical effects: (1) By using degradation modeling, the training samples are made closer to real long-distance low-resolution imaging: the training images are synthesized by parametric composite degradation of downsampling, blurring, noise, compression (and optional atmospheric scattering), and the degradation intensity is gradually increased according to the course, which reduces the domain difference between training and deployment, improves the generalization ability of real scenes, and significantly reduces the false detection and false detection of small target faces under deployment conditions such as long-distance monitoring and wide-angle large scenes; (2) By combining the constrained degenerate conditional reachability target, student-side predictor, zero-degenerate anchoring and stopping gradient, the alignment ineffectiveness caused by target unreachability is alleviated, and the alignment idleness caused by the collapse of the alignment target to student features is avoided: the conditional affine only scales and translates the teacher features channel by channel according to the degenerate condition, without changing the spatial structure and cannot fit the student features out of thin air; the zero-degenerate anchoring ensures that the alignment target degenerates into the clear feature itself when there is no degeneracy, so that cross-scale alignment is effective under various degeneracy intensities. (3) By using instance-level foreground alignment, supervision is focused on the face and background interference is suppressed. Alignment loss is calculated only on the foreground mask determined by the real face bounding box or on an instance-by-instance basis, avoiding background-dominated gradients and improving the discriminability and localization accuracy of small target faces. (4) After normalizing the two branches' prediction boxes to a unified coordinate system through coordinate normalization and positioning consistency, the consistency of the two branches' predictions is supervised by the combination of normalized L2 and IoU consistency, and the calculation is performed on the positive samples of the shared anchor boxes of the two branches, naturally establishing an anchor-by-anchor correspondence and avoiding noise supervision. (5) By applying the detection loss to both the teacher branch and the student branch, the performance of both the regular and large targets is anchored while improving the performance of the small target. This mitigates the risk of performance drift caused by only driving the shared weight with the degenerate branch and ensures that the detection accuracy on the full-resolution image during the inference period does not decrease. (6) By removing all training-specific modules such as degenerate operators, conditional affine transformations, student-side predictors and feature restoration heads during the inference stage, the training gains are deposited in the backbone network. The inference structure remains unchanged and there is no additional computational overhead, making it easy to plug and play on existing detection systems and upgrade them at low cost.

[0017] (7) By carrying the core mechanism in the form of a removable sub-network and supporting multiple degradation combinations, multiple condition transformation forms, and multiple basic detectors and detection objects, a structural technical solution is formed, which has a wide range of applications and is easy to promote and apply.

[0018] In summary, this invention employs a shared-weight bi-branch training framework, integrating degradation-aware sample generation, constrained degradation conditional reachability targets, instance-level foreground alignment, coordinate normalization for localization consistency, bi-branch detection supervision, and zero-degradation anchoring into a single training loop. Furthermore, it removes all training-specific modules during the inference phase, significantly improving the performance of small-target face detection in long-distance, low-resolution scenes without increasing inference overhead. This invention demonstrates good engineering feasibility and widespread application value. Attached Figure Description

[0019] Exemplary embodiments of the present invention can be more fully understood by referring to the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain the present invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0020] Figure 1 A flowchart illustrating a degradation-aware small target face detection training method provided as an exemplary embodiment of this application; Figure 2 A schematic diagram of the structure of a small target face detection training system with degradation perception provided in an exemplary embodiment of this application; Figure 3 A schematic diagram of an electronic device provided for an exemplary embodiment of this application; Figure 4 This is a schematic diagram of a computer-readable medium provided for an exemplary embodiment of this application. Detailed Implementation

[0021] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0022] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0023] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0024] This embodiment uses an SSD-structured face detection model as the base detector (this invention is not limited to SSD, but is also applicable to other single-stage, two-stage, or anchor-free detectors). See also Figure 1 , Figure 1 This is a schematic diagram of the overall process of the small target face detection training method in this embodiment of the invention. During the training phase, two forward branches sharing the same backbone and detection head weights are constructed: the teacher branch inputs the original clear image I_HR, and the student branch inputs the degraded image I_LR generated by the degradation operator; and additionally, a degradation conditional constrained transform G, a student-side predictor P (and an optional feature restoration head R) are introduced. Specifically, the method provided in this application embodiment includes the following steps: S110, Obtain an initial face detection model, wherein the initial face detection model includes a backbone network and a detection head; Specifically, using existing open-source methods, an SSD face detection model is trained based on classification loss and bounding box regression loss to obtain an initial model M0, which serves as the initialization for subsequent two-branch shared weights. This model has poor robustness to small target faces, serving as the starting point for subsequent fine-tuning. This embodiment uses mature, general detection pre-training results as a starting point; subsequent two-branch fine-tuning only requires targeted adaptation of the shared weights, resulting in more stable training, faster convergence, and ensuring that the network structure remains consistent with the basic detector during the inference phase.

[0025] In a preferred embodiment, the base detector can be generalized from SSD to other single-stage, two-stage, or anchor-free detectors, and the detection object can be generalized from faces to general small targets; all of these can be adapted to this training framework.

[0026] S120, construct a teacher branch and a student branch that share the weights of the backbone network and the detection head. The teacher branch is used to receive the clear image, and the student branch is used to receive the degraded image. The degraded image is generated by applying a combination of degradation, including downsampling, blurring, noise and compression, to the clear image using a parameterized composite degradation operator. The parameters of the composite degradation operator are encoded as a degradation condition vector. Specifically, this embodiment of the invention provides a schematic diagram of the architecture of the shared weight dual-branch, composite degradation operator, constrained degradation conditional reachability target, and student-side predictor during the training phase. (The diagram shows the original training image.) A parameterized composite degradation operator D is applied to (width w, height h) to generate a degraded image. It can be expressed according to formula (1): (1); in, It is a parameterized composite degradation operator used to sequentially apply various degradation operations such as downsampling, blurring, noise, and compression to a clear input image to generate a low-quality image with a corresponding degree of degradation. For the set of degradation parameters, the degradation steps are combined in series in an adjustable order: the downsampling step is based on the scale. Bilinear downsampling (or random selection of nearest neighbor, bicubic) yields ; Fuzzy links are based on random fuzzy kernels (Gaussian, defocus, or motion blur) convolution to simulate defocus and motion; Gaussian and Poisson noise (intensity) are superimposed in the noise stage. ), simulating low-light long-focus sensor noise; the compression stage uses quality factor Lossy compression using JPEG (or video encoding / decoding) introduces compression distortion. Optionally, an atmospheric scattering stage is superimposed, applying fogging or atmospheric degradation based on the scattering coefficient to adapt to long-distance outdoor scenes. It should be noted that the atmospheric scattering coefficient and the translation parameter of the conditional affine described later are two different physical quantities. To avoid confusion, the atmospheric scattering coefficient is denoted as [insert denoting here]. .

[0027] Degenerate parameters Encoded as a degenerate condition vector by an embedding layer, it is expressed according to formula (2): (2); in, The degeneracy condition vector is a fixed-length feature vector obtained by normalizing and encoding degeneracy parameters of different dimensions, which is used to generate channel-wise conditional affine parameters. For embedding or coding layers (acting on parameters), combined with parameterized composite degradation operators acting on the image. Different functions: The dimensions of each component are different ( For downsampling scale, For fuzzy kernel, For noise intensity, To compress the quality factor, (Atmospheric scattering coefficient). First, normalize the scalar components to a uniform interval, and then represent the fuzzy kernel using its descriptor (kernel type encoding, kernel size, motion fuzz direction, or Gaussian). After concatenation, the vectors are mapped to a fixed-length vector through a lightweight layer. This is used for subsequent generation of channel-wise affine parameters; As a learnable module, it is jointly trained with the backbone; the embedding layer adopts a lightweight structure of one normalization layer and one fully connected layer to map the degradation parameters of different dimensions into fixed-length feature vectors.

[0028] The process of regressive course scheduling is as follows: Let the number of training rounds be... Define degradation intensity Follow Monotonic enhancement. It is a one-dimensional scalar of the difficulty of degradation in the curriculum. It is the set of degradation parameters actually applied to a certain image: Each component is The monotonic function can be written as a deterministic expression. or random (in the) Upsampling of the parameter distribution to increase diversity. Increase Reduce (faces become smaller), increase blur kernel size, Enlarge reduce, Increase the intensity (if fogging is enabled) to gradually adapt the model to stronger degradation from easy to difficult, thus stabilizing convergence. The consideration for this step is that a single intensity of degradation samples can only cover a subset of the real deployment distribution. By monotonically increasing the degradation intensity according to the course, the model first learns regular detection and then gradually adapts to increasingly stronger small target degradation. This avoids early difficulty leading to convergence failure and ensures that it eventually covers the strongly degraded ends of long distances and low resolutions.

[0029] In a preferred embodiment, to reduce the geometric or scale difference between the small face in the full-resolution image and the whole-image downsampling, as an alternative embodiment, degradation and small-scale resampling can be applied in situ to a local area of ​​the image or face to generate a degradation sample while maintaining the full-resolution frame, and the aforementioned layering and alignment can then be performed on the full-resolution frame; at this time, both branch frames are the same. The student frame should be arranged according to Normalization, rather than according to Normalization.

[0030] In a preferred embodiment, the composition, order, parameter distribution, and randomization strategy of the degradation operator D can be combined in different ways, and further alignment can be performed only on the recoverable frequency band in the frequency domain; the constrained transformation can take different forms such as channel-wise conditional affine transformation, FiLM, low-rank modulation, or constrained convolution, and the student-side predictor can take 1×1 convolution, lightweight MLP, or attention structure.

[0031] S130, using the degradation condition vector as a condition, apply a constrained channel-wise conditional affine transformation to the teacher branch features of the stopping gradient to obtain an alignment target reachable under degradation conditions; apply a student-side predictor transformation to the student branch features to obtain transformed student features; supervise the transformed student features with the alignment target and calculate the feature alignment loss, which is calculated only on the foreground region determined based on the real face bounding box. Specifically, firstly, feature layers of the same size are matched: , Input the shared weight network separately. Because... The sample has been downsampled, selecting the teacher branch with deeper connections. Feature layers obtain feature maps The students' branches are relatively shallow. Feature layers obtain feature maps This ensures that the two spaces have the same size, thus allowing for a positional correspondence to be established at the same spatial resolution. , When the number of channels is different, constrained transformation is used. With student-side predictor Alignment can be performed after unifying to the same channel dimension; alternatively, layers with similar depth and consistent channels can be selected to reduce semantic level mismatch.

[0032] Then, with the degenerate condition vector Generate channel-wise affine parameters via lightweight mapping , By applying a constrained conditional affine transformation to the teacher features that have stopped gradients (stopping gradient processing means keeping the teacher branch feature values ​​unchanged during forward propagation and preventing the gradient from being propagated to the upstream network of the teacher branch feature during back propagation, thus avoiding the strong teacher features being pulled down by the alignment loss), the alignment target achievable under this degradation condition is obtained. According to formula (3): (3); in, To stop gradient operations: during forward propagation With the value remaining unchanged, the gradient does not flow back through this path during backpropagation, meaning the alignment loss will not be affected. Update the parameters of its upstream shared backbone to ensure that the strong features of the teacher branches are not negatively dragged down by the alignment loss. The operation is a channel-by-channel broadcast operation, meaning that the scaling and translation parameters are broadcast along the spatial dimension of the feature map and then multiplied and added to the teacher feature map channel by channel and pixel by pixel. This affine transformation only scales and translates the teacher features channel by channel according to the degradation condition, without changing its spatial structure, and cannot fit student features out of thin air, thus avoiding the alignment target collapsing towards the student from a mechanism perspective. Preferably, the scaling parameters are parameterized using identity centralization, i.e. This makes the transformation tend to be identical when there is no degradation, which becomes the natural default.

[0033] Specifically, the lightweight mapping process is as follows: Input Lightweight (For example, after adding a hidden layer and nonlinearity) the data is linearly mapped to twice the channel dimension and then split to obtain the scaled original value and the translated original value. The scaled original value is then added to the reference value after scaling. The original quantity is translated. After broadcasting along the spatial dimension, it acts channel-by-channel on the teacher features of the stopping gradient. A lightweight student-side predictor is also included. (Typically a 1×1 convolution), with Supervise student features after predictor transformation The predictor is placed on the student side with gradients, and the alignment target is placed on the teacher side with stopped gradients, which conforms to the asymmetric configuration that avoids representation collapse.

[0034] This embodiment employs a zero-degradation anchoring constraint: when degradation approaches zero ( →0) constraint →1、 →0, making → To ensure that reachable targets degenerate into clear features without degradation, the anchoring loss is expressed by formula (4): (4); in, To achieve zero-degeneracy anchoring loss, this constraint is used to ensure that as the degradation parameter approaches zero, the conditional affine transformation approaches the identity transformation, guaranteeing that the aligned target remains consistent with the original sharp features in non-degenerate scenarios. The L2 distance between the scaled vector and the all-one vector is squared (penalizing scaling deviation by 1). The L2 norm squared of the translation vector (penalizing translation deviation from 0). To obtain the expectation on samples where the degradation parameter tends to zero: sample θ in the neighborhood of zero or very weak degradation, and calculate the expectation on these θ. The average is calculated after applying the aforementioned penalties. This constraint only applies when... → Forced identity at interval 0, not at strongly degenerate locations. Strongly degenerate regions still allow nontrivial channel-by-channel compensation.

[0035] In a preferred embodiment, the constrained transformation can take different forms such as channel-wise conditional affine transformation, FiLM, low-rank modulation, or constrained convolution, and the student-side predictor can take the form of 1×1 convolution, lightweight MLP, or attention structure; furthermore, alignment can be performed only on the recoverable frequency band in the frequency domain.

[0036] In a preferred embodiment, instance-by-instance comparative learning can replace or supplement position-by-position alignment, that is, clear large instances of the same face and degenerate small instances are positive pairs, while different faces and backgrounds are negative pairs, thereby improving feature discriminativeness.

[0037] S140, apply classification loss and bounding box regression loss to the teacher branch and the student branch respectively to obtain the dual-branch detection loss; calculate the localization consistency loss based on the predicted bounding boxes of the two branches after normalization according to their respective image sizes. Specifically, the definitions of each loss are as follows. The classification loss (using binary cross-entropy or Focal for single-class faces, and softmax cross-entropy plus hard example mining for multi-class faces) is expressed by formula (5): (5); in, For classification loss, a binary cross-entropy form is used to supervise the classification accuracy of whether the target within the anchor box is a face or the background; The number of samples (anchor boxes or candidate boxes) participating in the classification loss. For sample index, For the first The truth labels of each anchor box (1 represents a positive sample, 0 represents a negative sample). For the model to the first Each anchor box predicts the probability that it is a face. Let be the natural logarithm. The bounding box regression loss is expressed by formula (6): (6); in, The bounding box regression loss uses the L1 distance form to supervise the coordinate regression accuracy between the predicted box and the ground truth box. Let be the predicted bounding box regression value for a positive sample anchor box. The regression target for the ground truth bounding box corresponding to this anchor box (and) (Four-dimensional targets using the same encoding method) To predict the L1 distance between the target four-dimensional regressor and the target. The detection loss applies to both the teacher and student branches, as expressed by formula (7): (7); Among them, superscript The term "branch" (teacher or student) refers to calculating the sum of the classification loss and bounding box regression loss for each branch and then adding them together. This allows the shared weights to improve detection capabilities for small targets while maintaining their ability to detect full-resolution or standard-sized images. In this embodiment, the teacher branch provides detection supervision on clear images, anchoring the shared weights' ability to discriminate between standard and large targets; the student branch provides detection supervision on degraded images, driving the shared weights to learn small target discrimination features. Together, they prevent performance drift on full-resolution images during inference.

[0038] Instance-level foreground feature alignment loss is employed: only the foreground mask generated from the ground truth face bounding box is aligned. Above, student features transformed by the predictor Alignment Reachable Target The cosine distance (or L2 term can be added to take into account the amplitude) is expressed by formula (8): (8); in, The face foreground mask generated from the ground truth face bounding boxes (i.e., the set of spatial locations p on the aligned feature grid that fall within the real face region). Foreground position number For the transformed student features in position The feature vector at that location, To align the target in position The target vector at the given location, cos(·,·) is the cosine similarity between the two vectors. Calculation is performed only on the foreground to ensure the supervision focuses on the face and suppresses the background. To avoid the smallest face not occupying an effective grid on a coarse feature grid (|M| degenerates to 0), sufficiently fine layers should be used, soft masks should be employed, or the calculation should be performed instance-by-instance after face instance alignment (RoIAlign). Specifically, the foreground mask is generated by mapping the real face bounding box to the feature grid according to the feature map stride. A binary hard mask or a Gaussian soft mask can be used to avoid the background region dominating the alignment loss.

[0039] Coordinate normalization localization consistency loss: On the same set of anchor boxes shared by the two branches, before non-maximum suppression (NMS), it is calculated only for anchor boxes assigned as positive samples according to the ground truth (thus naturally establishing the anchor-by-anchor correspondence between the two branch prediction boxes, avoiding noise supervision at student missed activation points). The two branch prediction boxes are first normalized to a unified coordinate system according to their respective image sizes, as expressed by formula (9): (9); in, The teacher branch is the predicted bounding box in its image pixel coordinate system. The prediction box for the student branch. The original image width and height, The student image width and height (full image global downsampling example, student image scale) (obtained by downsampling). The positioning consistency loss is expressed by formula (10): (10); in, The squared L2 distance between two normalized four-dimensional bounding box vectors. For intersection, union, and comparison, for The loss directly optimizes the overlap and shape, making up for the insufficiency of L2 only penalizing coordinate distance.

[0040] Optional feature restoration consistency loss: The feature restoration head R is removed during the inference period and positioned as an information retention item, prompting the degenerate feature to retain sufficient discriminative information to restore the clear feature, rather than being equivalent to the clear feature point by point; it is also calculated only on the foreground M to avoid background dominance, and is expressed by formula (11): (11); Specifically, This is a feature restoration consistency loss used to supervise the consistency between student branch restoration features and teacher branch clear features; To stop the gradient processing of the teacher branch feature at spatial location p, the gradient is not propagated upstream of the teacher feature during backpropagation. To calculate and average the loss value across all spatial locations covered by the foreground mask M, we focus only on the feature restoration effect of the face region.

[0041] In a preferred embodiment, the anchor frame scale and positive and negative sample allocation strategy can be jointly adjusted at the minimum degradation scale, and the false detections caused by cross-scale alignment can be compensated to further improve the recall rate of small targets.

[0042] S150, perform joint training on the backbone network, the detector head, the conditional affine transformation, and the student-side predictor with the total training loss. The total training loss includes the bi-branch detection loss, the feature alignment loss, the localization consistency loss, and the zero-degenerate anchoring loss. The zero-degenerate anchoring loss is used to constrain the conditional affine transformation to tend towards the identity transformation when the degradation parameter tends to zero. Specifically, in this embodiment of the invention, the total training loss is expressed by formula (12): (12); in, to The weighting factor ( (When the value is 0, it represents an embodiment without the recovery head). Total loss. The shared weight network, constrained transformation G, student-side predictor P (and optional restorer R) are jointly fine-tuned to obtain the final detection model; in a preferred embodiment, to The possible values ​​for are: , , , It can be adjusted based on the dataset and detection baseline.

[0043] S160, during the inference phase, only the backbone network and the detection head are retained, and a single forward inference is performed on the input image to obtain the face detection result.

[0044] Specifically, during the inference phase, the degradation operator D, constrained transformation G, student-side predictor P, and restoration head R are removed, along with all branches and losses used only for training. Only the trained backbone network and detection head are used for a single forward inference on the input image. At this point, the network structure and computational cost are completely identical to the original SSD detector, without introducing any additional inference overhead. It can be used to replace model weights on existing detection systems for a plug-and-play upgrade.

[0045] In summary, this embodiment uses a shared weight dual-branch training framework to integrate degradation-aware sample generation, constrained degradation conditional reachability targets, instance-level foreground alignment, coordinate normalization and localization consistency, dual-branch detection supervision, and zero-degradation anchoring into a single training loop. Furthermore, all training-specific modules are removed during the inference phase, thereby improving the performance of small target face detection without increasing inference overhead.

[0046] Based on the same inventive concept as the above-described method embodiments, a degradation-aware small target face detection training system 20 is provided. See also Figure 2 , Figure 2 A degradation-aware small target face detection training system 20 is disclosed, comprising: a model initialization module 210, a degradation sample generation module 220, a feature alignment module 230, a detection supervision module 240, a joint training module 250, and an inference module 260. Each module in the system corresponds one-to-one with each step in the above method embodiment. The model initialization module 210, corresponding to step S110, is used to obtain an initial face detection model, which includes a backbone network and a detection head; The degraded sample generation module 220, corresponding to step S120, is used to construct a parameterized composite degradation operator, generate a degraded image, and encode the degradation parameters into a degradation condition vector; The feature alignment module 230, corresponding to step S130, is used to apply a constrained channel-wise conditional affine transformation to the teacher branch features of the stopping gradient with the degradation condition vector as a condition to obtain the alignment target, and to apply a student-side predictor transformation to the student branch features to calculate the feature alignment loss in the foreground region; it is also used to perform feature restoration processing on the student branch features and calculate the feature restoration consistency loss.

[0047] The detection supervision module 240, corresponding to step S140, is used to apply classification loss and bounding box regression loss to the teacher branch and the student branch respectively, and to calculate the localization consistency loss. The joint training module 250, corresponding to step S150, is used to perform joint training on the backbone network, the detector head, the conditional affine transformation and the student-side predictor with a total training loss including bi-branch detection loss, feature alignment loss, localization consistency loss and zero-degenerate anchoring loss. The inference module 260, corresponding to step S160, is used to remove the training-specific module during the inference stage, retaining only the backbone network and the detection head, and performing a single forward inference on the input image to obtain the face detection result.

[0048] It should be noted that the division of labor and naming of the modules and their sub-modules described in this embodiment are merely illustrative examples. Those skilled in the art can merge multiple modules into one module or split one module into multiple sub-modules with finer functions according to the actual system architecture. These adjustments do not affect the substance of the technical solution of this invention and should be considered as falling within the protection scope of this invention.

[0049] In summary, the system provided in this embodiment is based on the same inventive concept as the method embodiment described above. The six modules in the system correspond one-to-one with the six steps in the method embodiment described above. It can carry the core mechanism in the form of a removable sub-network and has good engineering feasibility.

[0050] Please refer to Figure 3 This illustrates a schematic diagram of an electronic device provided by some embodiments of this application. For example... Figure 3 As shown, the electronic device 30 includes a processor 300, a memory 301, a bus 302, and a communication interface 303. The processor 300, communication interface 303, and memory 301 are connected via the bus 302. The memory 301 stores a computer program that can run on the processor 300. When the processor 300 runs the computer program, it executes the method described above in this application. This electronic device can be any device with face detection capabilities, such as a model training server, an embedded detection device, an edge box, or a security terminal. Since the device internally implements the degradation-aware small target face detection training method by running the aforementioned computer program, and the method adopts a mechanism of shared weight dual-branch and removal of training-specific modules during inference, the network structure and computational load of this electronic device during the inference phase are consistent with the basic detector, without introducing additional inference overhead.

[0051] The memory 301 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 303 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.

[0052] Bus 302 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 301 is used to store programs. After receiving an execution instruction, the processor 300 executes the program. The methods disclosed in any of the foregoing embodiments of this application can be applied to the processor 300, or implemented by the processor 300.

[0053] The processor 300 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 300 or by instructions in software form. The processor 300 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 301. The processor 300 reads the information in memory 301 and, in conjunction with its hardware, completes the steps of the above method.

[0054] It should be noted that the electronic device provided in this embodiment is based on the same inventive concept as the method embodiment described above, and its specific implementation process and technical effects can be referred to the corresponding descriptions in the foregoing method embodiments. This electronic device can be deployed in security environments such as long-distance monitoring and wide-angle large-scene applications to achieve real-time detection of small target faces.

[0055] This application also provides a computer-readable medium corresponding to the method provided in the foregoing embodiments. Please refer to... Figure 4 The computer-readable storage medium shown is an optical disc 40, on which a computer program (i.e., a program product) is stored, which, when run by a processor, performs the aforementioned method.

[0056] The computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. In a specific application scenario, the computer-readable storage medium can be built into a conference terminal or mobile terminal as part of the firmware; or it can be installed on the target device as a standalone software product through download or physical distribution, enabling devices that originally only had basic fingerprint collection capabilities to acquire the degradation-aware small target face detection function described in this invention after loading and executing the computer program on the storage medium.

[0057] The computer-readable storage medium provided in the above embodiments of this application and the method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.

[0058] This embodiment provides a computer program product, which includes a computer program. When executed by a processor, the computer program implements the degradation-aware small target face detection training method as described in any of the above embodiments.

[0059] This computer program product can be deployed on a model training server to provide small target face detection capabilities to multiple detection terminals in the form of a service; it can also be packaged as a software development kit (SDK) for third-party detection systems to integrate and call, so that applications integrating the SDK can obtain the degradation perception small target face detection function of this invention without increasing additional inference overhead or modifying the existing detection process.

[0060] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0061] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0062] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0063] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0064] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application.

Claims

1. A method for training a small target face detection, characterized in that, Includes the following steps: Obtain an initial face detection model, which includes a backbone network and a detection head; A teacher branch and a student branch are constructed that share the weights of the backbone network and the detection head. The teacher branch is used to receive clear images, and the student branch is used to receive degraded images. The degraded images are generated by applying a combination of degradation, including downsampling, blurring, noise, and compression, to the clear images using a parameterized composite degradation operator. The parameters of the composite degradation operator are encoded as a degradation condition vector. Using the degradation condition vector as a condition, a constrained channel-wise conditional affine transformation is applied to the teacher branch features of the stopping gradient to obtain an alignment target reachable under degradation conditions; a student-side predictor transformation is applied to the student branch features to obtain the transformed student features; the transformed student features are supervised by the alignment target, and the feature alignment loss is calculated, wherein the feature alignment loss is calculated only on the foreground region determined based on the real face bounding box; Classification loss and bounding box regression loss are applied to the teacher branch and the student branch respectively to obtain the dual-branch detection loss; localization consistency loss is calculated based on the predicted bounding boxes of the two branches after normalization according to their respective image sizes. The backbone network, the detector head, the conditional affine transformation, and the student-side predictor are jointly trained using the total training loss. The total training loss includes the bi-branch detection loss, the feature alignment loss, the localization consistency loss, and the zero-degenerate anchoring loss. The zero-degenerate anchoring loss is used to constrain the conditional affine transformation to tend towards the identity transformation when the degradation parameter tends to zero. During the inference phase, only the backbone network and the detection head are retained, and a single forward inference is performed on the input image to obtain the face detection result.

2. The method according to claim 1, characterized in that, The parameterized composite degradation operator concatenates the downsampling, the blurring, the noise, and the compression in a preset order, and selectively superimposes atmospheric scattering degradation. The parameters of the composite degradation operator include at least one of the following: downsampling scale, fuzzy kernel, noise intensity, compression quality factor, and atmospheric scattering coefficient; the degradation parameters are encoded into a degradation condition vector through an embedding layer; the degradation intensity monotonically increases with training epochs.

3. The method according to claim 1, characterized in that, The scaling parameter of the constrained channel-wise conditional affine transformation is parameterized using identity centralization, and the scaling parameter is the sum of the reference value and the conditional offset. The gradient stopping process is used to keep the teacher branch feature values ​​unchanged during forward propagation and to prevent the gradient from being passed upstream of the teacher branch feature during backward propagation. The student-side predictor is a pointwise convolution, used to perform a linear transformation on the student branch features channel by channel to obtain the transformed student features.

4. The method according to claim 1, characterized in that, The feature alignment loss is calculated only on the foreground region determined based on the real face bounding box, including: A foreground mask is generated based on the real face bounding box. The foreground mask is used to mark the spatial positions belonging to the face foreground on the feature grid. For each spatial position marked by the foreground mask, the cosine distance between the transformed student feature and the alignment target is calculated. The cosine distance of each spatial position marked by the foreground mask is averaged to obtain the feature alignment loss. Alternatively, perform instance alignment extraction processing on the real face bounding box to obtain student instance features and alignment target instance features for each instance; for each instance, calculate the cosine distance between the student instance features and the alignment target instance features; average the cosine distances of each instance to obtain the feature alignment loss.

5. The method according to claim 1, characterized in that, The normalization is achieved by dividing the horizontal coordinate component of the prediction box by the width of the image and the vertical coordinate component of the prediction box by the height of the image. The localization consistency loss is the sum of the squared L2 distance between the two branches of the normalized predicted boxes and one minus the intersection-union ratio; the localization consistency loss is only calculated for anchor boxes in the shared anchor boxes of the two branches that are assigned as positive samples by the ground truth boxes, before non-maximum suppression.

6. The method according to claim 1, characterized in that, Before performing joint training on the backbone network, the detector head, the conditional affine transformation, and the student-side predictor using the total training loss, the method further includes: The student branch features are subjected to feature restoration processing, which is performed by the feature restoration head to obtain restored features; Calculate the feature restoration consistency loss, which is the average L2 distance between the restored feature and the teacher branch feature of the stopping gradient over the foreground region; The total training loss also includes the feature restoration consistency loss; wherein the feature restoration head is removed during the inference phase.

7. The method according to claim 6, characterized in that, The total training loss is a weighted sum of the bi-branch detection loss, the feature alignment loss, the localization consistency loss, the feature restoration consistency loss, and the zero-degenerate anchoring loss. The zero-degradation anchoring loss is the sum of the squared norm of the difference between the scaling parameter and the baseline value, averaged on samples where the degradation parameter tends to zero, and the squared norm of the translation parameter.

8. The method according to claim 1, characterized in that, The degradation intensity is a scheduling value that monotonically increases with each training round; The parameter components of the composite degradation operator are determined according to the monotonic function of the degradation intensity, or according to the distribution sampling with the degradation intensity as a parameter.

9. The method according to claim 6, characterized in that, In the inference phase, only the backbone network and the detection head are retained, and a single forward inference is performed on the input image to obtain the face detection result, including: Remove the parameterized composite degradation operator, the conditional affine transformation, the student-side predictor, and the feature restoration head; The backbone network and the detection head constitute an inference network, and the structure of the inference network is consistent with the structure of the basic face detector. Perform a single forward inference process on the input image to obtain the face detection result; The basic face detector can be any one of a single-stage, two-stage, or anchor-free detector.

10. A small-target face detection training system with degradation perception, characterized in that, For implementing the method of any one of claims 1 to 9, comprising: The model initialization module is used to obtain an initial face detection model, which includes a backbone network and a detection head; The degraded sample generation module is used to construct a parameterized composite degradation operator, generate a degraded image, and encode the degradation parameters into a degradation condition vector; The feature alignment module is used to apply a constrained channel-wise conditional affine transformation to the teacher branch features of the stopping gradient with the degradation condition vector as a condition to obtain the alignment target, and to apply a student-side predictor transformation to the student branch features to calculate the feature alignment loss in the foreground region. The detection supervision module is used to apply classification loss and bounding box regression loss to the teacher branch and the student branch respectively, and to calculate the localization consistency loss. The joint training module is used to perform joint training on the backbone network, detector head, conditional affine transformation and student-side predictor with a total training loss including bi-branch detection loss, feature alignment loss, localization consistency loss and zero-degenerate anchoring loss. The inference module is used to remove the training-specific modules during the inference phase, retaining only the backbone network and the detection head, and performing a single forward inference on the input image to obtain the face detection result.