Frame processing method and device based on regional weighted online knowledge distillation, storage medium and computer program product

By employing a frame processing method based on region-weighted online knowledge distillation and utilizing collaborative distillation techniques of teacher and student networks, the unstable image quality caused by parameter fixation and network dependence in video enhancement technology is solved, achieving adaptive high-quality video enhancement effects.

CN123160352APending Publication Date: 2026-11-24MIGU VIDEO TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611357210.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-02
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing video enhancement technologies suffer from recurring enhancement defects due to parameter fixation in real-time deployment scenarios and image quality jitter due to dependence on remote networks. In particular, the system reliability and image quality stability are low in weak network environments or high-concurrency scenarios such as large-scale events.

Method used

A frame processing method based on region-weighted online knowledge distillation is adopted. Through collaborative distillation of teacher and student networks, spatial weight maps and channel importance coefficients are generated using feature difference maps. Region-weighted distillation loss and gradient modulation are then applied to achieve adaptive enhancement of the student network.

Benefits of technology

Completely eliminating reliance on edge and cloud networks improves system reliability and image quality stability, avoids repeated accumulation of errors in the same scene, and enhances the adaptive correction capability of image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160352A_ABST
    Figure CN123160352A_ABST
Patent Text Reader

Abstract

This application provides a frame processing method, apparatus, storage medium, and computer program product based on region-weighted online knowledge distillation. The method includes: after the teacher network generates high-quality enhancement results of keyframes, determining the feature difference maps of each layer of the student network and the teacher network on the keyframes; detecting high-difference regions by performing spatial statistical analysis on the feature difference maps, and generating a spatial weight map based on the high-difference regions and their corresponding feature difference values; generating channel importance coefficients by performing channel statistical analysis on the feature difference maps; constructing region-weighted distillation losses for shallow and deep features respectively based on the spatial weight map, and weighting and combining the region-weighted distillation losses to obtain an online distillation loss; performing channel-selective modulation on the gradients of the parameters of each layer of the student network based on the channel importance coefficients to obtain modulated gradients; and updating the student network using the online distillation loss and the modulated gradients to obtain an updated student network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to electronic application technology, and more particularly to a frame processing method and apparatus, storage medium, and computer program product based on region-weighted online knowledge distillation. Background Technology

[0002] Current video enhancement technologies face two main structural bottlenecks in real-time deployment scenarios. First, parameters are fixed after training, meaning enhancement defects exposed early in the same event will repeatedly reappear later. Second, while offloading computation to remote locations alleviates local computing power pressure, it introduces strong network dependency. In weak network environments or high-concurrency scenarios like large-scale events, edge node queuing latency and request timeouts directly translate into image quality jitter and enhancement failure. This leads to low image quality stability and low system reliability. Summary of the Invention

[0003] This application provides a frame processing method and apparatus, storage medium, and computer program product based on region-weighted online knowledge distillation.

[0004] The technical solution of this application is implemented as follows: Firstly, this application proposes a frame processing method based on region-weighted online knowledge distillation, the method comprising: After the teacher network generates high-quality enhancement results for the keyframes, feature difference maps of each layer of the student network and the teacher network on the keyframes are determined. High-difference regions are detected by performing spatial statistical analysis on the feature difference map, and a spatial weight map is generated based on the high-difference regions and their corresponding feature difference values. Channel importance coefficients are generated by performing channel statistical analysis on the feature difference map; Based on the spatial weight map, region-weighted distillation losses are constructed for shallow features and deep features respectively, and the region-weighted distillation losses are combined in a weighted manner to obtain the online distillation loss; Based on the channel importance coefficient, the gradients of the parameters of each layer of the student network are selectively modulated by channels to obtain the modulated gradients. The student network is updated using the online distillation loss and the modulated gradient to obtain the updated student network; the updated student network is used to enhance the second input frame after the keyframe.

[0005] Optionally, before the teacher network generates high-quality augmented results for the keyframes, the method further includes: The first input frame is enhanced using a student network to obtain the first enhancement result and intermediate optical flow information; The first quality score data of the first input frame is determined using the first enhancement result, and the first scene complexity data of the first input frame is determined using the first enhancement result and the intermediate optical flow information. Based on the first quality score data and the first scene complexity data, determine the comprehensive score data of the first input frame; If the comprehensive score data is greater than the score threshold and the frame interval between the first input frame and the previous key frame meets the sampling interval, the first input frame is determined as a key frame.

[0006] Optionally, after the teacher network generates high-quality augmentation results for the keyframes and before determining the feature difference maps of each layer of the student network and the teacher network on the keyframes, the method further includes: Based on the frame identifier of the keyframe, the second enhancement result obtained by the student network enhancing the keyframe is obtained from the keyframe context cache, and the third enhancement result is obtained based on the current student network enhancing the keyframe; the frame identifier includes one or more of the following fields: frame number, timestamp, keyframe flag, keyframe cache location; The consistency between the second enhancement result and the third enhancement result is verified; The determination of the feature difference maps of each layer of the student network and the teacher network on the keyframe includes: If the consistency verification passes, the feature difference maps of each layer of the student network and the teacher network on the keyframe are determined.

[0007] Optionally, after updating the student network using the online distillation loss and the modulated gradient to obtain the updated student network, the method further includes: The student network is used to further enhance the second input frame, and the second scene complexity data of the second input frame is obtained. Until the similarity between the second scene complexity data and the third scene complexity data of the key frame is greater than the similarity threshold, the second quality score data of the second input frame is obtained. Based on the second quality score data and the third quality score data of the key frame, the distillation effect data is determined; Based on the distillation effect data, teaching adjustment strategies were determined.

[0008] Optionally, determining the teaching adjustment strategy based on the distillation effect data includes: If a significant positive effect is determined based on the distillation effect data, the teaching adjustment strategy is determined to be sparse sampling interval; If the effect is determined to be insignificant based on the distillation effect data, the teaching adjustment strategy is to adjust the weight of the regional weighted distillation loss. If a negative effect is determined based on the distillation effect data, the student network parameters are rolled back to their state before the update.

[0009] Optionally, the step of detecting high-difference regions by performing spatial statistical analysis on the feature difference map includes: Based on the feature difference map, determine the spatial mean and spatial standard deviation; A spatial threshold is determined based on the spatial mean and the spatial standard deviation; Based on the comparison results between the feature difference map and the spatial threshold, it is detected whether each spatial location is a high difference region.

[0010] Optionally, after detecting high-discrepancy regions by performing spatial statistical analysis on the feature difference map, the method further includes: Determine the coverage rate for areas with high disparities; When the coverage of high-discrepancy areas exceeds the first threshold, shorten the keyframe interval; If the coverage of high-discrepancy areas is lower than the second threshold, the weight of the corresponding layer in distillation loss is reduced; the first threshold is greater than the second threshold.

[0011] Secondly, this application proposes a frame processing apparatus based on region-weighted online knowledge distillation, the apparatus comprising: a processor, a memory, and a communication bus; the processor implements the above-mentioned frame processing method based on region-weighted online knowledge distillation when executing the running program stored in the memory.

[0012] Thirdly, this application proposes a storage medium on which a computer program is stored, which, when executed by a processor, implements the above-described frame processing method based on region-weighted online knowledge distillation.

[0013] Fourthly, this application proposes a computer program product, including a computer program that, when executed by a processor, implements the aforementioned frame processing method based on region-weighted online knowledge distillation.

[0014] The embodiments of this application have the following beneficial effects: by completing online collaborative distillation between teachers and students locally, the dependence on edge and / or cloud networks is completely eliminated, thus eliminating the risk of image quality jitter caused by weak network offloading delay and concurrent queuing, thereby improving system reliability; at the same time, targeted distillation of high-difference areas based on spatial weight graph and gradient selective modulation combined with channel importance coefficients enable the student network to continuously absorb high-quality knowledge from the teacher network during deployment, adaptively correct enhancement deviation frame by frame, avoid repeated accumulation of errors in the same scene, and thus improve image quality stability. Attached Figure Description

[0015] Figure 1 A flowchart illustrating a frame processing method based on region-weighted online knowledge distillation, provided in this application embodiment; Figure 2 A schematic diagram illustrating an exemplary keyframe selection process provided in this application embodiment; Figure 3 A schematic diagram of an exemplary network architecture for a No-Reference Quality Assessment (NR-QA) network provided for embodiments of this application; Figure 4 This is an exemplary schematic diagram illustrating frame consistency verification between a teacher network and a student network, provided as an embodiment of this application. Figure 5 This application provides an exemplary method for video enhancement using dual-model collaborative online knowledge distillation for live video streams. Figure 6 A schematic diagram of the structure of a frame processing device based on region-weighted online knowledge distillation provided in this application embodiment. Figure 1 ; Figure 7 A schematic diagram of the structure of a frame processing device based on region-weighted online knowledge distillation provided in this application embodiment. Figure 2 . Detailed Implementation

[0016] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0018] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. It is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. It should also be noted that the terms "first, second, third" used in the embodiments of this application are merely for distinguishing similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0019] This application provides a frame processing method based on region-weighted online knowledge distillation, such as... Figure 1 As shown, the method may include: S101. After the teacher network generates high-quality enhancement results for keyframes, determine the feature difference maps of each layer of the student network and the teacher network on the keyframes.

[0020] The frame processing method based on region-weighted online knowledge distillation proposed in this application can be applied to video enhancement scenarios such as live broadcasts of sports events, cloud gaming image quality enhancement, real-time video conferencing enhancement, and online optimization of autonomous driving perception models.

[0021] It should be noted that this application maintains two parallel inference paths. On the real-time path, the S-Net (student network) processes all video frames in video enhancement scenarios such as live streaming with the highest priority, outputting real-time enhancement results (i.e., enhanced frames). On the asynchronous path, the adaptive keyframe selector selects one keyframe every 15-30 frames (here, 15-30 frames is an exemplary sampling interval, and the specific interval can be set according to actual conditions) and sends it to the T-Net (teacher network) for high-quality enhancement. After the T-Net is completed, the feature difference map is compared with the output of the T-Net and the S-Net, and the online distillation engine fine-tunes the parameters of the last few layers of the S-Net accordingly. The entire teaching loop is completed entirely on the local graphics processing unit (GPU) and does not rely on network transmission.

[0022] In one embodiment, T-Net is designed to produce the highest possible quality augmentation results within a reasonable timeframe, without being subject to hard constraints on real-time performance. The core parameters of T-Net can be found in Table 1.

[0023] Table 1

[0024] It's important to note that T-Net is structurally an enhanced version of S-Net. Both share the same basic architectural paradigm, including feature extraction, motion estimation, motion compensation, and fusion reconstruction network structures. However, T-Net uses larger and deeper versions of each module. This structural homology is a prerequisite for effective knowledge distillation; feature-level distillation between two structurally similar models is more effective than distillation between structurally heterogeneous models.

[0025] In one embodiment, the design goal of S-Net is to maximize the enhanced quality under real-time constraints, and its core design parameters can be found in Table 2.

[0026] Table 2

[0027] In one embodiment, the correspondence between T-Net and S-Net at the feature level can be found in Table 3, and this correspondence is used for hierarchical distillation.

[0028] Table 3

[0029] It should be noted that, since the number of channels in the corresponding layers of the teacher network and the student network is different (the student network has 48 channels, while the teacher network has 128 channels), before online knowledge distillation, a learnable linear projection layer can be used to map the 48-channel features of S-Net to the 128-channel space, and then the difference between the features of the corresponding layers of T-Net can be calculated.

[0030] In one embodiment, after T-Net completes high-quality enhancement of keyframe t_{key}, the Feature Discrepancy Map (FDM) of each layer of T-Net and S-Net on the keyframe is calculated online. Specifically, the feature difference value at spatial location P in frame t_{key} can be calculated, and the feature difference values ​​at each spatial location P in frame t_{key} are used to form the FDM. The calculation of the feature difference value at spatial location P in frame t_{key} is shown in formula (1).

[0031] (1) in, Let be the feature difference value at spatial location P in frame t_{key}. For S-Net l Feature map of the layer For T-Net l Feature map of the layer Let S be the linear projection matrix from the S-Net to the T-Net feature space. Let L2 be the channel dimension.

[0032] It should be noted that the thermal distribution of FDM visually demonstrates which spatial regions show the greatest difference between S-Net and T-Net in terms of feature representation. These regions are the key teaching difficulties that distillation needs to focus on.

[0033] Before the teacher network generates high-quality augmentation results for keyframes, keyframe selection is performed. The selection objective is to choose frames that S-Net is most likely to handle poorly, because T-Net has limited corrective value for frames that S-Net already handles well, while it has the greatest corrective value for frames that S-Net is prone to failing. See details... Figure 2 ,include: 1. The first input frame is enhanced using a student network to obtain the first enhancement result and intermediate optical flow information.

[0034] In one embodiment, S-Net completes the enhanced inference of the input frame t and outputs the enhanced frame I_S(t) (the first enhancement result) and the intermediate optical flow information OF_S(tt-1).

[0035] 2. Use the first enhancement result to determine the first quality score data of the first input frame, and use the first enhancement result and intermediate optical flow information to determine the first scene complexity data of the first input frame.

[0036] In one embodiment, the first quality score data is a no-reference quality score, output by a lightweight NR-QA network, ranging from 0 to 100.

[0037] In one embodiment, the NR-QA network is designed to deliver a quality score that is highly correlated with the Mean Opinion Score (MOS) under an inference latency constraint of <1ms.

[0038] In one embodiment, the NR-QA network architecture can adopt a simplified three-layer convolutional architecture, as exemplified by [example not provided]. Figure 3 The input is the enhanced frame I_S(t) after 2× super-resolution, which is passed through three layers of 3×3 convolutions (channel number 32→64→128, stride=2, including batch normalization (BN) and LeakyRectified Linear Unit (LeakyReLU)). Then, a 128-dimensional feature vector f_qa is extracted by global average pooling. After passing through a fully connected layer and sigmoid activation, the output quality coefficients s∈[0,1] are generated and finally mapped to the first quality score data Q_SNet(t) of 0–100, which is used to quantitatively evaluate the image quality level of the enhanced frame. The total number of parameters in the NR-QA network architecture is about 0.15M, and the single-frame inference latency is <0.8ms (T4GPU, FP16).

[0039] In one embodiment, the NR-QA network implicitly extracts the following quality-related features from the enhanced frame I_S(t) through three layers of progressively downsampling convolutions: block artifacts, blur, texture fidelity, and Gibbs artifacts caused by oversharpening.

[0040] In one embodiment, the NR-QA network can be trained offline using a sports event video augmentation dataset. The training labels are derived from a combination of the following three signals: 1. Network Reference Score: Using the T-Net augmentation results as a reference, the full-reference Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index Measure (SSIM) of the S-Net output are calculated and mapped to a reference score of 0-100; 2. Human Subjective Quality Assignment (MOS): 2000 frames of sports event augmentation samples are subject to subjective human quality scoring, mapped to 0-100; 3. Distortion Type Coverage: The training set includes common augmentation failure types seen in live sports broadcasts, such as motion blur, compression artifacts, compression block artifacts, over-sharpening artifacts, and excessive texture smoothing.

[0041] In one embodiment, the NR-QA network shares the Compute Unified Device Architecture Stream (CUDA Stream) with S-Net. It is executed in series immediately after S-Net completes the enhancement of each frame. The enhanced frame I_S(t) output by S-Net is directly used as the input to the NR-QA network, requiring no additional CPU-GPU data transfer. This tightly coupled integrated design increases the total latency of NR-QA scoring by <0.8ms.

[0042] In one embodiment, the first scene complexity data is calculated by a Scene Complexity Index (SCI) estimator, ranging from 0 to 1.

[0043] In one embodiment, The first scene complexity data of the quantized enhanced frame t is weighted and fused by three orthogonal complexity sub-indices, see formula (2).

[0044] (2) Among them, weight =0.4, =0.3, =0.3, which can be determined through grid search optimization. As an indicator of speed of motion, As an indicator of sports diversity, This is a texture richness index.

[0045] In one embodiment, The maximum displacement in the measurement scene can be calculated using formula (3).

[0046] (3) in, This represents the motion vector at position p output by the S-Net optical flow network. The overall range of the feature region. =64 is the normalization threshold. When the maximum displacement... When it reaches 64 pixels, =1.0. The motion vector calculation directly reuses the forward optical flow already calculated by the S-Net optical flow network during the enhancement process. .

[0047] In one embodiment, To measure the degree of disorder in motion directions in a scene, when multiple objects move in different directions, S-Net's unified motion compensation strategy struggles to accurately align all regions simultaneously. The calculation formula can be found in formula (4).

[0048] (4) in, Let be the set of motion directions of each pixel, where and They are pixels ( x,y The running vector values ​​in the horizontal and vertical directions. The information entropy of the motion direction histogram (36 bins, each b∈10°) This represents the maximum possible entropy when the motion direction is uniformly distributed. This is true when all pixels move in the same direction. ≈ 0, ≈0; When objects in the scene move in different directions, near , →1.

[0049] In one embodiment, The higher the high-frequency texture density within a frame, the richer the texture (such as grass details, jersey textures, and spectator patterns), the more difficult it is for the small-capacity feature extraction backbone of S-Net to fully preserve details. The calculation formula can be found in formula (5).

[0050] (5) in, Enhanced S-Net frames Spatial gradient at position p (computed using the Sobel operator, 3×3 kernel). and The frames are in the horizontal x and vertical y gradient of direction =50 is the gradient strength normalization threshold. Use Truncation is used to prevent a very small number of pixels with extremely high gradients (such as strong edges or subtitle text) from dominating the texture score of the entire frame.

[0051] 3. Based on the first quality score data and the first scene complexity data, determine the comprehensive score data of the first input frame.

[0052] In one embodiment, the first quality score data and the first scene complexity data can be input into the comprehensive score formula to output the comprehensive score data of the first input frame. The comprehensive score formula can be found in formula (6).

[0053] (6) in, This is the comprehensive score data for frame t. The first quality score data of frame t after S-Net enhancement (output by a lightweight NR-QA network, range 0-100). is the first scene complexity data for frame t, calculated by the SCI estimator, ranging from 0 to 1; =0.6 is the weight of the quality item; =0.4 represents the weight of the motion complexity term. The specific value of the above weight can be set according to the actual situation, and this application embodiment does not impose a specific limitation.

[0054] 4. If the comprehensive score data is greater than the score threshold and the frame interval between the first input frame and the previous key frame meets the sampling interval, the first input frame is determined as the key frame.

[0055] In one embodiment, the scoring threshold is determined based on the number of keyframes to be processed in the keyframe processing queue and the upper limit of the processing queue's capacity; the sampling interval is determined based on the historical output quality scoring data of the student network.

[0056] It should be noted that the scoring threshold is not a fixed value, but is dynamically adjusted according to the current load of the keyframe processing queue to ensure that T-Net is not oversubscribed. The specific scoring threshold can be determined by formula (7).

[0057] (7) in, =0.3, =0.7 is the dynamic range of the threshold. The specific value of the dynamic range of the threshold can be set according to the actual situation. This application embodiment does not make specific limitations. This represents the number of frames currently waiting in the T-Net keyframe processing queue. =3 is the maximum queue capacity. When T-Net is idle ( When T-Net = 0), the threshold is reduced to 0.3, allowing even frames of acceptable quality to be selected, thus fully utilizing T-Net's idle computing power; when T-Net is busy ( When the threshold is ≥3), the threshold is raised to 0.7, and only frames of very poor quality or very complex frames will be sent into the queue to avoid the distillation delay caused by the backlog of T-Net processing.

[0058] It should be noted that the sampling interval is not a fixed value, but is dynamically adjusted according to the current learning saturation level of the S-Net. The specific sampling interval... The determination of can be found in formula (8).

[0059] (8) in, For maximum sampling density (used when S-Net image quality is poor and frequent teaching is needed), 10 frames can be used. For the minimum sampling density (used when S-Net image quality is good, and occasionally for teaching), 40 frames can be used. The sliding window average of the S-Net output quality over the most recent 100 frames (determined by historical output quality score data). and The quality range normalization parameter (empirical values ​​can be 60 and 90 respectively) is an example value. The specific values ​​can be adjusted according to the actual situation. This application does not impose specific limitations on the embodiments.

[0060] Understandably, the above adaptive strategy can ensure that T-Net provides intensive training (once every 10 frames) during the initial deployment phase (cold start, poor image quality), helping S-Net to improve rapidly; and T-Net provides sparse training (once every 40 frames) during the steady-state phase (good image quality), maintaining the S-Net level while saving GPU resources.

[0061] It's important to note that in the asynchronous dual-model architecture of online distillation, there's a core system-level technical challenge: how to ensure that the high-quality augmentation results of T-Net are precisely aligned in time and content with the feature representations of S-Net on the same keyframe. Since the processing latency of T-Net is much greater than the frame interval of S-Net, when T-Net completes the keyframe... During processing, S-Net has advanced about 5-6 frames. If explicit frame alignment is not performed, the distilled signal (including high-quality augmentation results) will come from temporally misaligned frame pairs, resulting in a systematic bias in the online learning direction.

[0062] After the teacher network generates high-quality augmented results for keyframes, frame consistency verification is performed between the teacher and student networks. Only if the consistency verification passes is the feature difference map of each layer in the keyframe determined between the student and teacher networks. For details on the frame consistency verification between the teacher and student networks, please refer to [link to documentation]. Figure 4 ,include: 1. The second enhancement result obtained by the student network enhancing the key frame based on the key frame is obtained from the key frame context cache, and the third enhancement result is obtained by enhancing the key frame based on the current student network. The frame identifier includes one or more of the following fields: frame number, timestamp, key frame flag, and key frame cache location.

[0063] 2. Verify the consistency between the second and third enhancement results.

[0064] In one embodiment, the asynchronous dual-model frame-level precise alignment mechanism may include: a unified keyframe identification system based on timestamps, a keyframe context cache, and a self-checking mechanism for frame alignment correctness.

[0065] In one embodiment, the system assigns a globally unique frame identifier (FID) to each input frame as the primary key for frame alignment between the two models, as detailed in formula (9).

[0066] (9) in, Represents a monotonically increasing frame sequence number (which can be a 64-bit unsigned integer) since system startup, used for O(1) cache index lookup; High-precision timestamps are derived from the timestamps of video frames extracted after the live stream is decapsulated and used to calculate inter-frame time difference, T-Net processing latency, and buffering. A Boolean flag indicating whether the frame has been selected as a quality keyframe; The definition of is: when When =true, a cache slot ID (0-9) is allocated, pointing to the cache location where the S-Net features of the keyframe are stored. This field is empty when it is not a keyframe.

[0067] It should be noted that FID allocation occurs on the S-Net's real-time inference path, and FID flows along the following three paths with frame data: S-Net Real-Time Path: FID is attached to the input frame and output features of S-Net and written to the Key-Frame Context Buffer (KFCB). T-Net asynchronous path: FID is attached to the key frame data packet pushed to T-Net, and T-Net processes it and sends it back as is; Distillation update path: FID is used as the cache lookup key to retrieve the corresponding S-Net feature for FDM calculation.

[0068] In one embodiment, the KFCB is the core data structure of the frame alignment mechanism, a fixed-capacity circular buffer that stores the complete inference context of the S-Net at each selected keyframe. The cache entry structure for each KFCB slot can be seen in Table 4.

[0069] Table 4

[0070] It should be noted that under normal operating conditions, KFCB follows First-In-First-Out (FIFO) semantics, meaning the slot written earliest is consumed first. However, with the abnormally increased processing latency of modern T-Net (T-Net inference time > 300ms), the cache may be filled with new keyframes. In this case, a strategy of overwriting the oldest READY slot is adopted to ensure that new keyframes are always cached.

[0071] In one embodiment, the system has a built-in self-checking mechanism for frame alignment correctness. After T-Net completes the keyframe processing, a lightweight frame content consistency check is performed. The specific consistency check can be found in formula (10).

[0072] (10) in, For the consistency check results, S-Net enhanced frames stored in KFCB , The augmented frame is obtained by re-running S-Net on the same original frame for the "current" student network. Here, the "current" student network is the student network in the current iteration when the teacher network produces high-quality augmented results for the keyframes.

[0073] In one embodiment, the consistency verification result can be compared with a preset threshold. If the consistency verification result is greater than or equal to the preset threshold, the consistency verification is considered successful; if the consistency verification result is less than the preset threshold, the consistency verification is considered unsuccessful.

[0074] In one exemplary embodiment, the preset threshold can be 0.98, and the specific value can be selected according to the actual situation. This application embodiment does not make specific limitations.

[0075] Furthermore, in the event that the consistency verification fails, an attenuation factor is introduced into the online distillation loss. The attenuation factor is used to reduce the distillation weight of the keyframe.

[0076] It should be noted that, if If SSIM < 0.98 (SSIM is below the threshold), it indicates that the S-Net parameters have changed significantly between the two inferences. In this case, some of the differences in FDM come from the changes in S-Net parameters rather than the difference in model capabilities. The system will introduce an SSIM attenuation factor exp(-(1-Check)·5) into the distillation loss to reduce the distillation weight of the frame and avoid noisy distillation signals caused by outdated features.

[0077] It should be noted that this self-checking mechanism provides a mathematically verifiable guarantee for the correctness of frame alignment, ensuring that the source frame pairs of each distillation signal are strictly consistent in content.

[0078] S102. High-difference regions are detected by performing spatial statistical analysis on the feature difference map, and a spatial weight map is generated based on the high-difference regions and their corresponding feature difference values.

[0079] It should be noted that before using FDM for distillation supervision, the system first performs spatial statistical analysis on FDM to identify spatial regions where the difference between S-Net and T-Net is significant: High-Discrepancy Regions (HDRs). HDRs are key areas for distillation supervision because they mark the weakest link in S-Net's capabilities in the current frame.

[0080] In this embodiment, the spatial mean and spatial standard deviation are determined based on the feature difference map; a spatial threshold is determined based on the spatial mean and spatial standard deviation; and the spatial location is detected as a high-difference region based on the comparison between the feature difference map and the spatial threshold.

[0081] In one embodiment, spatial mean The determination of the spatial standard deviation can be found in formula (11). The determination can be based on formula (12) first, then generate a binary HDR mask, and then compare the feature difference map with the spatial threshold. The process of detecting whether each spatial location is a high-difference region can be found in formulas (13) and (14).

[0082] (11) in, It is in formula (1) .

[0083] (12) (13) (14) in, This is the HDR threshold coefficient. The value can be 1.5 (i.e., regions where the FDM value exceeds 1.5 times the standard deviation of the mean are marked as high-difference regions). Formula (13) describes the comparison result matrix of the l-th layer. Let Hl be a binary matrix of dimension Hl×Wl, where each element takes the value 0 or 1, where 1 represents the HDR region and 0 represents the non-HDR region. Formula (14) describes the detection process of the P-space location in the l-th layer. This is the comparison result of the spatial location of the l-th layer P.

[0084] Furthermore, after detecting high-difference regions by performing spatial statistical analysis on the feature difference map, the coverage of high-difference regions is also determined; if the coverage of high-difference regions is higher than a first threshold, the keyframe interval is shortened; if the coverage of high-difference regions is lower than a second threshold, the weight of the corresponding layer in the distillation loss is reduced; the first threshold is greater than the second threshold.

[0085] In one embodiment, HRD coverage represents the area percentage of each HDR layer, which can be specifically calculated according to formula (15).

[0086] (15) in, This represents the HDR coverage of layer l.

[0087] In one embodiment, if the coverage of high-discrepancy regions exceeds a first threshold, it indicates a systematic deviation between the overall feature representation of S-Net and T-Net at that layer. In this case, not only is region-weighted distillation performed, but more intensive instruction is also triggered, such as reducing N{key}, where N{key} represents the keyframe interval (i.e., how many frames are between two adjacent keyframes). Reducing N{key} means shortening the keyframe interval and increasing the number of keyframes, thereby increasing the frequency of teacher network participation in supervision.

[0088] In one embodiment, the first threshold can be set to 0.5, meaning that more than half of the regions are HDR. The specific value of the first threshold can be selected according to the actual situation, and this application embodiment does not make specific limitations.

[0089] In one embodiment, when the coverage of high-difference regions is below a second threshold, S-Net is close to the level of T-Net at that layer. In this case, the weight of the corresponding layer in the distillation loss is reduced, and the distillation computing power is concentrated on other layers with larger differences.

[0090] In one embodiment, the second threshold can be set to 0.05, meaning that the HDR area is extremely small. The specific value of the second threshold can be selected according to the actual situation, and this application embodiment does not make specific limitations.

[0091] In one embodiment, if the coverage of high-discrepancy areas is between a first threshold and a second threshold, it is considered to be within the normal range, and the subsequent regionally weighted online distillation strategy can be considered effective.

[0092] It should be noted that the traditional pixel-wise uniformly weighted distillation loss assigns the same weight to regions that S-Net has processed well and regions that S-Net has processed poorly. This results in the distillation signal being diluted by a large number of already learned pixels, reducing the teaching efficiency per unit gradient step. This application proposes an FDM-guided region-weighted distillation loss, which assigns adaptive weights at each spatial location of the distillation loss based on the FDM value at that location, enabling S-Net to obtain the strongest learning signal in the weakest regions.

[0093] In one embodiment, for the first l For each spatial location p in the layer, construct spatial weights. For details, please refer to formula (16).

[0094] (16) in, The HDR weighted intensity can be set to a value of 2.0. The specific value can be selected according to the actual situation, and this application embodiment does not impose specific limitations.

[0095] It should be noted that, in This indicates that the student network and the teacher network have no difference in feature representation at all spatial locations in this layer, allowing The value is 1.

[0096] It should be noted that the design meaning of formula (16) is: non-HDR region =0: =1.0, maintaining the baseline distillation intensity; within the HDR region Linear growth from 1.0 to a maximum of 1.0+ =3.0, with higher weights for locations showing greater differences. The region with the worst S-Net quality receives three times the distillation signal intensity of the normal region. Subsequent deep distillation also uses the same weighting method.

[0097] S103. Generate channel importance coefficients by performing channel statistical analysis on the feature difference map.

[0098] It should be noted that, in addition to the spatial dimension, the efficiency of the distilled signal can be further optimized along the channel dimension. The statistical distribution of FDM along the channel dimension reflects which feature channels of S-Net have the greatest difference from their corresponding channels of T-Net. Channels with large differences should receive stronger gradient update signals, while channels with small differences should be protected.

[0099] In one embodiment, the channel importance coefficient can be calculated by first applying the first... l FDM of the layer (size) The channel difference vector is obtained by averaging along the spatial dimension. See formula (17); then, channel differences are converted into channel importance coefficients through softmax normalization. For details, please refer to formula (18).

[0100] (17) in, This represents the feature difference value at spatial location p in the l-th layer and c-th channel. Let Hl be the set of all spatial locations in the l-th layer, totaling Hl × Wl pixels. Defined as a length of real vector , The c-th element is calculated by the right side of formula (17). =0.5 is the temperature coefficient. Lower temperatures make the distribution sharper, and only a few channels with the largest differences receive significant weight. The specific value can be selected according to the actual situation. This application does not impose specific limitations on the embodiments.

[0101] (18) Among them, multiplied by It is to make The mean is 1, meaning that on average, the channel weights neither amplify nor diminish the gradient, but only redistribute it. Meaning is a length of real vector , The c-th element is calculated by the right side of formula (18).

[0102] S104. Based on the spatial weight map, construct region-weighted distillation losses for shallow features and deep features respectively, and then combine the region-weighted distillation losses to obtain the online distillation loss.

[0103] In one embodiment, the online distillation loss is divided into shallow distillation and deep distillation. Shallow distillation is used for low-frequency structure alignment, where the shallow layer (residual blocks 1-2 of S-Net, corresponding to residual blocks 1-2 and 4-5 of T-Net) captures the low-frequency structure information of the image, such as scene layout, object contours, and large-scale motion trends. The definition of shallow distillation loss can be found in formula (19). Deep distillation is used for high-frequency detail alignment, where the deep layer (residual block 3 of S-Net, fusion layer, and reconstruction layer, corresponding to residual blocks 7-8 of T-Net, fusion layer, and reconstruction layer) captures high-frequency detail information, such as texture, edges, and small-scale motion. The definition of deep distillation loss can be found in formula (20).

[0104] (19) in ={1,2} is a shallow set. For the first l All spatial locations of the layer. For the feature map of the l-th layer of the student network at position p, please refer to formula (1). For the feature map of the l-th layer of the teacher network at position p, please refer to formula (1). .

[0105] It should be noted that formula (19) uses the L1 norm because low-frequency structure alignment focuses more on "overall matching of large-scale structures" rather than "penalty for individual large error pixels". L1 has a higher tolerance for large errors than L2 and is more suitable for low-frequency distillation.

[0106] (20) in ={3,fusion,recon} For gradient consistency weights, The value can be 0.3, specifically... The value can be selected according to the actual situation, and the embodiments of this application do not impose specific limitations.

[0107] It should be noted that deep distillation adds constraints to the gradient domain, ensuring that S-Net not only learns the pixel-level features of T-Net, but also the structural gradient distribution patterns of its edges and textures.

[0108] In one embodiment, based on the spatial weight map, region-weighted distillation losses are constructed for shallow features and deep features respectively, that is, the spatial weight map is used to... Weighted to obtain the weighted result Using spatial weight graphs to Weighted to obtain the weighted result Specifically, it can be weighted per spatial location.

[0109] In one embodiment, the regionally weighted distillation losses are weighted and combined to obtain the online distillation loss. The process can be found in formula (21).

[0110] (twenty one) in, For weight parameters, The value can be 0.35. , The value can be 0.65, specifically... and The value of can be selected according to the actual situation, and this application embodiment does not impose specific limitations. Deep layers have higher weights than shallow layers because the weakness of S-Net lies mainly in high-frequency detail reconstruction rather than low-frequency structural understanding.

[0111] S105. Based on the channel importance coefficient, channel-selective modulation is performed on the gradients of the parameters of each layer of the student network to obtain the modulated gradients.

[0112] It should be noted that during the backpropagation phase, the gradient of the parameters of the l-th layer of S-Net is modulated channel by channel importance coefficient. This modulation applies after gradient calculation and before parameter update. The effect is that the parameter update step size for feature channels that differ significantly from T-Net is amplified, accelerating S-Net's convergence with T-Net on these channels; while the parameter update step size for feature channels that are already close to T-Net is reduced, protecting the learned effective feature representations from accidental perturbation.

[0113] S106. The student network is updated using the online distillation loss and the modulated gradient to obtain the updated student network; the updated student network is used to enhance the second input frame after the keyframe.

[0114] It should be noted that the orthogonality between channel-selective propagation and spatial region weighting is as follows: spatial weighting acts on the pixel-wise weights of the forward loss calculation, while channel-selective propagation acts on the channel-wise modulation of the backward gradient propagation. The two complement each other in the spatial and channel dimensions, and together they achieve the accurate delivery of the distilled signal.

[0115] In one embodiment, backpropagation is performed based on online distillation loss to calculate the original gradients of the parameters of each layer of the student network. The original gradients are multiplied by the channel importance coefficient of the corresponding layer to complete channel selective modulation. The modulated gradients are used to update the parameters of the student network to obtain the updated student network.

[0116] In one embodiment, online distillation only fine-tunes the parameters of the last K layers of S-Net (K=3, corresponding to residual block 3, the fusion layer, and the reconstruction layer), while the shallow layer parameters of residual blocks 1-2 remain unchanged. This design is based on the following considerations: 1. Shallow feature extraction has high task generality and has already converged sufficiently in offline training, resulting in low marginal returns for online fine-tuning; 2. Fine-tuning only the last K layers significantly reduces the number of parameters updated and the computation time for each distillation; 3. It reduces the risk of catastrophic forgetting, as shallow general features are locked and will not degrade due to distillation signals specific to a particular scenario.

[0117] Specifically, the update of student network parameters can be found in formula (22).

[0118] (twenty two) in: For online learning rate, For the parameter subset of the last K layers of S-Net, For losses during online distillation, Let be the set of parameters of the student network at frame t, i.e., the set of parameters before the update. This is the set of parameters for the student network at frame t+1, i.e., the updated set of parameters. Each keyframe distillation performs only one gradient update step.

[0119] In one embodiment, the online learning rate follows an exponential decay strategy, starting from an initial value. =5×10^{-6} gradually decays to ,in Greater than 1.

[0120] in This represents the cumulative number of distillation updates since deployment. This decay strategy ensures rapid learning in the early stages, quickly bridging the gap between S-Net and T-Net through a high learning rate, and then fine-tuning in the later stages to reduce the learning rate and maintain a stable high level.

[0121] Furthermore, since the parameters of S-Net have been updated on this frame, the effect of distillation cannot be directly compared on the same keyframe. However, it can be indirectly verified on subsequent similar scene frames. This involves finding subsequent frames t_{similar} with similar SCI values ​​to the keyframe t_{key} and comparing the changes in S-Net quality scores before and after distillation. This scheme is simply called Similar-Scene Pair Verification (SSPV). In other words, after performing online knowledge distillation on the student network to obtain the updated student network, distillation quality verification is also performed. For details, please refer to [link to relevant documentation]. Figure 4 ,include: 1. Continue to use the student network to enhance the second input frame and obtain the second scene complexity data of the second input frame.

[0122] 2. Until the similarity between the second scene complexity data and the third scene complexity data of the keyframe is greater than the similarity threshold, the second quality score data of the second input frame is obtained.

[0123] 3. Based on the second quality score data and the third quality score data of the keyframes, determine the distillation effect data.

[0124] 4. Determine teaching adjustment strategies based on distillation effect data.

[0125] In one embodiment, step 1: Record before distillation update of keyframe t_{key} (Third Quality Score Data) and (Third scenario complexity data), perform distillation update, update Step 2: Find matching frames, i.e., search for the criteria in subsequent live streams: ,in, A value of 0.05 can be used, representing a 5% tolerance. Step 3: Collect quality scores, which involves recording the scores for the first 5 matching frames (or all matching frames within 10 seconds). Step 4: Calculate the distillation effect For details, please refer to formula (23). Step 5: Determine the distillation effect. The determination logic can be found in Table 5.

[0126] (twenty three) Table 5

[0127] It should be noted that the above is used for execution. The threshold for judgment can be adjusted according to the actual situation, and this application embodiment does not impose specific limitations.

[0128] In one embodiment, if a significant positive effect is determined based on distillation effect data, the teaching adjustment strategy is determined to be sparse sampling interval.

[0129] In one embodiment, the sampling interval can be sparsed by adjusting the sampling density. The adjustment can be found in formula (24).

[0130] (twenty four) in, For formula (8) based on baseline sampling rate , The scaling factor for the distillation effect can be obtained by referring to formula (25).

[0131] (25) In one embodiment, if the effect is determined to be insignificant based on distillation effect data, the teaching adjustment strategy is determined to be to adjust the weight of the weighted distillation loss in the region.

[0132] It should be noted that the "teaching focus" differs for different scene types. The main bottleneck in high-motion scenes (such as fast counter-attacks in football matches) lies in low-frequency structure alignment (global structure for motion compensation), while the main bottleneck in high-texture scenes (such as details of jerseys and grass in close-up shots) lies in high-frequency detail reconstruction (texture fidelity). The system adaptively adjusts the shallow / deep distillation weights based on the SCI component distribution of the keyframes, as detailed in formulas (26) and (27).

[0133] (26) (27) In one embodiment, normalization is then performed. This means: for high-motion scenarios ( Larger: The shallow distillation weight is increased from a maximum of 0.35 to 0.45, strengthening the teaching of moving structures, specifically for high-texture scenes. Large): The weight of deep distillation is increased from 0.65 to a maximum of 0.72, enhancing the teaching of texture details.

[0134] It should be noted that the values ​​involved in formulas (26) and (27) can be selected according to the actual situation, and the embodiments of this application do not impose specific limitations.

[0135] In one embodiment, if a negative effect is determined based on distillation effect data, the student network parameters are rolled back to their state before the update.

[0136] It's important to note that in some cases, distillation updates may cause S-Net's quality to deteriorate in specific scenes, a phenomenon known as localized catastrophic forgetting in online distillation. Triggering conditions typically include: significant differences between the scene features of the current keyframe and recent teaching frames, such as a sudden switch from a football match to a close-up studio shot; and the appearance of isolated anomalous regions with extremely high differences in the current frame's FDM, such as lens blemishes or transition effects. Differences in how T-Net and S-Net handle such non-semantic information do not necessarily indicate a difference in model capability.

[0137] In one embodiment, the mathematical expression of the rollback mechanism can be: the system maintains a safety checkpoint for the parameters of the last K layers of the S-Net, saving a snapshot of the current parameters before each distillation update. If a checkpoint is detected after the update... If the value is less than -0.3, the system immediately rolls back to the parameter state of the last safety checkpoint. Simultaneously, the online learning rate is reduced by 50% to decrease the aggressiveness of subsequent distillation updates. The next keyframe selection is temporarily skipped, and the system waits for S-Net to run stably for at least 50 frames under the current parameters before recording the rollback event in the log for offline analysis of distillation stability.

[0138] In one embodiment, the online learning rate can also be... To achieve adaptive adjustment, an instantaneous adjustment based on the distillation effect can be added on the basis of the aforementioned exponential decay scheduling, as detailed in formula (28).

[0139] (28) in, The adjusted learning rate, This is an instantaneous adjustment factor, and its acquisition process can be found in formula (29).

[0140] (29) Understandably, by completing online collaborative distillation between teachers and students locally, the reliance on edge and / or cloud networks is completely eliminated, thus removing the risk of image quality jitter caused by weak network offloading delays and concurrent queuing, thereby improving system reliability. At the same time, targeted distillation of high-disparity regions based on spatial weight graphs and gradient selective modulation combined with channel importance coefficients enable the student network to continuously absorb high-quality knowledge from the teacher network during deployment, adaptively correcting enhancement deviations frame by frame, avoiding repeated accumulation of errors in the same scene, and thus improving image quality stability.

[0141] Based on the above embodiments, this application proposes a video enhancement method for live video streams using dual-model collaborative online knowledge distillation. (See also...) Figure 5 The input is a sequence of raw 1080p / 25fps live video frames. First, an adaptive keyframe selector determines the keyframe t_key based on a sparse frequency of selecting one frame every 15–30 frames using a joint score Score(t). This keyframe is then fed into a high-priority asynchronous teaching path (CUDA Stream priority 1), where a T-Net teacher network with more than 15M parameters performs 2× super-resolution interpolation to generate high-quality augmented results for the keyframe. Simultaneously, the system extracts the corresponding layer features of S-Net on this keyframe online and compares them layer-by-layer with the T-Net features to calculate the feature difference map FDM_l(t_key). The online knowledge distillation engine calculates the online distillation loss L_OD based on this feature difference map and performs a single-step gradient update only on the parameters of the last K layers of S-Net, completing the parameter update after channel-selective modulation. The S-Net is written back to the student network asynchronously, and this update process does not block the main live streaming link. At the same time, all original frames (including keyframes and subsequent ordinary frames) enter the low-priority real-time inference path (CUDA Stream priority-1), and the lightweight S-Net student network with less than 1M parameters performs frame-by-frame 2× super-resolution interpolation to output enhanced frames in real time with low computational overhead. Finally, the system enhances the original 1080p / 25fps video stream into a continuous enhanced 4K / 50fps video stream in real time without interrupting the live stream.

[0142] This application provides a frame processing apparatus 1 based on region-weighted online knowledge distillation. For example... Figure 6 As shown, the device 1 includes: The determining unit 10 is used to determine the feature difference map of each layer of the student network and the teacher network on the key frame after the teacher network generates a high-quality enhancement result of the key frame; Detection unit 11 is used to detect high-difference regions by performing spatial statistical analysis on the feature difference map; The generation unit 12 is used to generate a spatial weight map based on the high difference region and the corresponding feature difference value; and to generate channel importance coefficients by performing channel statistical analysis on the feature difference map; Construction unit 13 is used to construct region-weighted distillation losses for shallow features and deep features respectively based on the spatial weight map, and to weight and combine the region-weighted distillation losses to obtain online distillation loss; The modulation unit 14 is used to perform channel-selective modulation on the gradient of the parameters of each layer of the student network based on the channel importance coefficient, so as to obtain the modulated gradient. The update unit 15 is used to update the student network using the online distillation loss and the modulated gradient to obtain the updated student network; the updated student network is used to enhance the second input frame after the keyframe.

[0143] Optionally, the device further includes: an enhancement unit; The enhancement unit is used to enhance the first input frame using the student network to obtain a first enhancement result and intermediate optical flow information; The determining unit 10 is further configured to determine the first quality score data of the first input frame using the first enhancement result, and determine the first scene complexity data of the first input frame using the first enhancement result and the intermediate optical flow information; determine the comprehensive score data of the first input frame based on the first quality score data and the first scene complexity data; and determine the first input frame as a key frame when the comprehensive score data is greater than the score threshold and the frame interval between the first input frame and the previous key frame meets the sampling interval.

[0144] Optionally, the device further includes: an acquisition unit and a verification unit; The acquisition unit is used to obtain the second enhancement result obtained by the student network enhancing the key frame from the key frame context cache based on the frame identifier of the key frame. The frame identifier includes one or more of the following fields: frame number, timestamp, key frame flag, and key frame cache location. The enhancement unit is further configured to enhance the keyframe based on the current student network to obtain a third enhancement result; The verification unit is used to verify the consistency between the second enhancement result and the third enhancement result. The determining unit 10 is further configured to determine the feature difference map of each layer of the student network and the teacher network on the keyframe if the consistency verification passes.

[0145] Optionally, the enhancement unit is further configured to continue enhancing the second input frame using the student network; The acquisition unit is further configured to acquire second scene complexity data of the second input frame; until the similarity between the second scene complexity data and the third scene complexity data of the key frame is detected to be greater than the similarity threshold, the second quality score data of the second input frame is acquired. The determining unit 10 is further configured to determine distillation effect data based on the second quality score data and the third quality score data of the key frame; and to determine a teaching adjustment strategy based on the distillation effect data.

[0146] Optionally, the determining unit 10 is further configured to: determine the teaching adjustment strategy as sparse sampling interval if a significant positive effect is determined based on the distillation effect data; determine the teaching adjustment strategy as adjusting the weight of the region-weighted distillation loss if the effect is not significant based on the distillation effect data; and roll back to the student network parameters before the update if a negative effect is determined based on the distillation effect data.

[0147] Optionally, the determining unit 10 is further configured to determine the spatial mean and spatial standard deviation based on the feature difference map; and to determine a spatial threshold based on the spatial mean and the spatial standard deviation. The detection unit 11 is also used to detect whether each spatial location is a high-difference region based on the comparison result between the feature difference map and the spatial threshold.

[0148] Optionally, the device further includes: an adjustment unit; The determining unit 10 is also used to determine the coverage of high-difference areas; The adjustment unit is used to shorten the keyframe interval when the coverage of high-difference regions is higher than a first threshold; and to reduce the weight of the corresponding layer in the distillation loss when the coverage of high-difference regions is lower than a second threshold; wherein the first threshold is greater than the second threshold.

[0149] This application provides a frame processing device based on region-weighted online knowledge distillation. After the teacher network generates high-quality enhancement results for keyframes, it determines the feature difference maps of each layer of the student network and the teacher network on the keyframes. It then detects high-difference regions by performing spatial statistical analysis on the feature difference maps and generates a spatial weight map based on these regions and their corresponding feature difference values. Next, it generates channel importance coefficients by performing channel statistical analysis on the feature difference maps. Based on the spatial weight map, it constructs region-weighted distillation losses for shallow and deep features respectively, and then weights and combines these losses to obtain an online distillation loss. Based on the channel importance coefficients, it performs channel-selective modulation on the gradients of the parameters of each layer of the student network to obtain modulated gradients. Finally, it updates the student network using the online distillation loss and the modulated gradients to obtain an updated student network. The updated student network is then used to enhance the second input frame after the keyframe. Therefore, the frame processing device based on region-weighted online knowledge distillation proposed in this embodiment completely eliminates the dependence on edge and / or cloud networks by completing teacher-student online collaborative distillation locally. This eliminates the risk of image quality jitter caused by weak network offloading delay and concurrent queuing, thereby improving system reliability. At the same time, it performs targeted distillation on high-difference regions based on spatial weight graphs and performs gradient selective modulation in combination with channel importance coefficients. This allows the student network to continuously absorb high-quality knowledge from the teacher network during deployment, adaptively correcting enhancement deviations frame by frame, avoiding repeated accumulation of errors in the same scene, and thus improving image quality stability.

[0150] Figure 7 This is a schematic diagram of the composition structure of a frame processing device 1 based on region-weighted online knowledge distillation provided in an embodiment of this application. In practical applications, based on the same disclosed concept of the above embodiments, such as... Figure 7As shown, the frame processing device 1 based on region-weighted online knowledge distillation in this embodiment includes: a processor 16, a memory 17, and a communication bus 18.

[0151] In a specific embodiment, the aforementioned determining unit 10, detecting unit 11, generating unit 12, constructing unit 13, modulating unit 14, updating unit 15, enhancing unit, acquiring unit, verifying unit, and adjusting unit can be implemented by a processor 16 located on the frame processing device 1 based on region-weighted online knowledge distillation. The processor 16 can be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a CPU, a controller, a microcontroller, or a microprocessor. It is understood that for different devices, the electronic device used to implement the above-mentioned processor functions can also be other types; this embodiment does not specifically limit this.

[0152] In this embodiment, the communication bus 18 is used to establish a connection between the processor 16 and the memory 17; when the processor 16 executes the running program stored in the memory 17, it implements the following frame processing method based on region-weighted online knowledge distillation: After the teacher network generates high-quality enhancement results for the keyframe, feature difference maps of each layer of the student network and the teacher network on the keyframe are determined. High-difference regions are detected by spatial statistical analysis of the feature difference maps, and a spatial weight map is generated based on the high-difference regions and their corresponding feature difference values. Channel importance coefficients are generated by channel statistical analysis of the feature difference maps. Based on the spatial weight map, region-weighted distillation losses are constructed for shallow and deep features respectively, and the region-weighted distillation losses are weighted and combined to obtain an online distillation loss. Based on the channel importance coefficients, channel-selective modulation is applied to the gradients of the parameters of each layer of the student network to obtain modulated gradients. The student network is updated using the online distillation loss and the modulated gradients to obtain an updated student network. The updated student network is used to enhance the second input frame after the keyframe.

[0153] Furthermore, the processor 16 is also configured to enhance the first input frame using the student network to obtain a first enhancement result and intermediate optical flow information; determine a first quality score data of the first input frame using the first enhancement result, and determine a first scene complexity data of the first input frame using the first enhancement result and the intermediate optical flow information; determine a comprehensive score data of the first input frame based on the first quality score data and the first scene complexity data; and determine the first input frame as a key frame when the comprehensive score data is greater than a score threshold and the frame interval between the first input frame and the previous key frame meets the sampling interval.

[0154] Furthermore, the processor 16 is also configured to obtain a second enhancement result obtained by the student network enhancing the key frame from the key frame context cache based on the frame identifier of the key frame, and to obtain a third enhancement result by enhancing the key frame based on the current student network; the frame identifier includes one or more of the following fields: frame number, timestamp, key frame flag, key frame cache position; to perform consistency verification on the second enhancement result and the third enhancement result; and, if the consistency verification passes, to determine the feature difference map of each layer of the student network and the teacher network on the key frame.

[0155] Furthermore, the processor 16 is also configured to continue to enhance the second input frame using the student network and obtain the second scene complexity data of the second input frame; until the similarity between the second scene complexity data and the third scene complexity data of the key frame is detected to be greater than a similarity threshold, obtain the second quality score data of the second input frame; determine the distillation effect data based on the second quality score data and the third quality score data of the key frame; and determine the teaching adjustment strategy based on the distillation effect data.

[0156] Furthermore, the processor 16 is also configured to determine the teaching adjustment strategy as sparse sampling interval when a significant positive effect is determined based on the distillation effect data; to determine the teaching adjustment strategy as adjusting the weight of the region-weighted distillation loss when the effect is not significant based on the distillation effect data; and to roll back to the student network parameters before the update when a negative effect is determined based on the distillation effect data.

[0157] Furthermore, the processor 16 is also configured to determine the spatial mean and spatial standard deviation based on the feature difference map; determine a spatial threshold based on the spatial mean and spatial standard deviation; and detect whether each spatial location is a high-difference region based on the comparison result between the feature difference map and the spatial threshold.

[0158] Furthermore, the processor 16 is also used to determine the coverage of high-difference regions; shorten the keyframe interval when the coverage of high-difference regions is higher than a first threshold; reduce the weight of the corresponding layer in the distillation loss when the coverage of high-difference regions is lower than a second threshold; the first threshold is greater than the second threshold.

[0159] This application provides a storage medium storing a computer program thereon. The computer-readable storage medium stores one or more programs, which can be executed by one or more processors and applied in a frame processing apparatus based on region-weighted online knowledge distillation. The computer program implements the frame processing method based on region-weighted online knowledge distillation as described above.

[0160] Based on the above embodiments, this application provides a computer program product, including a computer program that can be executed by one or more processors, the computer program implementing the frame processing method based on region-weighted online knowledge distillation as described above.

[0161] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0162] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause an image display device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this disclosure.

[0163] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.

Claims

1. A frame processing method based on region-weighted online knowledge distillation, characterized in that, The method includes: After the teacher network generates high-quality enhancement results for the keyframes, feature difference maps of each layer of the student network and the teacher network on the keyframes are determined. High-difference regions are detected by performing spatial statistical analysis on the feature difference map, and a spatial weight map is generated based on the high-difference regions and their corresponding feature difference values. Channel importance coefficients are generated by performing channel statistical analysis on the feature difference map; Based on the spatial weight map, region-weighted distillation losses are constructed for shallow features and deep features respectively, and the region-weighted distillation losses are combined in a weighted manner to obtain the online distillation loss; Based on the channel importance coefficient, the gradients of the parameters of each layer of the student network are selectively modulated by channels to obtain the modulated gradients. The student network is updated using the online distillation loss and the modulated gradient to obtain the updated student network; the updated student network is used to enhance the second input frame after the keyframe.

2. The method according to claim 1, characterized in that, Before the teacher network generates high-quality augmented results for keyframes, the method further includes: The first input frame is enhanced using a student network to obtain the first enhancement result and intermediate optical flow information; The first quality score data of the first input frame is determined using the first enhancement result, and the first scene complexity data of the first input frame is determined using the first enhancement result and the intermediate optical flow information. Based on the first quality score data and the first scene complexity data, determine the comprehensive score data of the first input frame; If the comprehensive score data is greater than the score threshold and the frame interval between the first input frame and the previous key frame meets the sampling interval, the first input frame is determined as a key frame.

3. The method according to claim 1, characterized in that, After the teacher network generates high-quality augmentation results for the keyframes, and before determining the feature difference maps of each layer of the student network and the teacher network on the keyframes, the method further includes: Based on the frame identifier of the keyframe, the second enhancement result obtained by the student network enhancing the keyframe is obtained from the keyframe context cache, and the third enhancement result is obtained based on the current student network enhancing the keyframe; the frame identifier includes one or more of the following fields: frame number, timestamp, keyframe flag, keyframe cache location; The consistency between the second enhancement result and the third enhancement result is verified; The determination of the feature difference maps of each layer of the student network and the teacher network on the keyframe includes: If the consistency verification passes, the feature difference maps of each layer of the student network and the teacher network on the keyframe are determined.

4. The method according to claim 1, characterized in that, After updating the student network using the online distillation loss and the modulated gradient to obtain the updated student network, the method further includes: The student network is used to further enhance the second input frame, and the second scene complexity data of the second input frame is obtained. Until the similarity between the second scene complexity data and the third scene complexity data of the key frame is greater than the similarity threshold, the second quality score data of the second input frame is obtained. Based on the second quality score data and the third quality score data of the key frame, the distillation effect data is determined; Based on the distillation effect data, teaching adjustment strategies were determined.

5. The method according to claim 4, characterized in that, The process of determining teaching adjustment strategies based on the distillation effect data includes: If a significant positive effect is determined based on the distillation effect data, the teaching adjustment strategy is determined to be sparse sampling interval; If the effect is determined to be insignificant based on the distillation effect data, the teaching adjustment strategy is to adjust the weight of the regional weighted distillation loss. If a negative effect is determined based on the distillation effect data, the student network parameters are rolled back to their state before the update.

6. The method according to claim 1, characterized in that, The step of detecting high-discrepancy regions by performing spatial statistical analysis on the feature difference map includes: Based on the feature difference map, determine the spatial mean and spatial standard deviation; A spatial threshold is determined based on the spatial mean and the spatial standard deviation; Based on the comparison results between the feature difference map and the spatial threshold, it is detected whether each spatial location is a high difference region.

7. The method according to claim 6, characterized in that, After detecting high-discrepancy regions by performing spatial statistical analysis on the feature difference map, the method further includes: Determine the coverage rate for areas with high disparities; When the coverage of high-discrepancy areas exceeds the first threshold, shorten the keyframe interval; If the coverage of high-discrepancy areas is lower than the second threshold, the weight of the corresponding layer in distillation loss is reduced; the first threshold is greater than the second threshold.

8. A frame processing apparatus based on region-weighted online knowledge distillation, characterized in that, The device includes: a processor, a memory, and a communication bus; when the processor executes the running program stored in the memory, it implements the method as described in any one of claims 1-7.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method as described in any one of claims 1 to 7.