Decoding and encoding method applying mask adaptation
Mask adaptation in neural networks addresses inefficiencies in adapting to target samples by disabling unimportant neurons, improving performance and reducing costs in video coding systems.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHENZHEN TCL NEW-TECH CO LTD
- Filing Date
- 2025-01-24
- Publication Date
- 2026-07-30
AI Technical Summary
Existing neural network-based video coding systems face challenges in efficiently adapting to target samples with significant characteristic differences from training samples, leading to suboptimal performance due to unimportant parameters, high bitstream costs for weight signaling, and resource constraints in decoding.
Implement mask adaptation by deriving and applying mask information to selectively disable or reduce the influence of neurons in the neural network based on performance evaluation, eliminating the need for additional training or weight signaling.
Improves prediction accuracy and reconstruction quality on target samples while reducing computational overhead and bitstream costs, enhancing efficiency in decoding and encoding processes.
Smart Images

Figure CN2025074863_30072026_PF_FP_ABST
Abstract
Description
DECODING AND ENCODING METHOD APPLYING MASK ADAPTATIONTECHNICAL FIELD
[0001] The present disclosure generally relates to encoding and decoding technology, and in particular to a decoding method and an encoding method applying mask adaptation, a video coding apparatus, and a computer readable medium.BACKGROUND
[0002] The success of neural networks has extended to the field of video coding and has shown promising capabilities of visual representation. For example, in the development of the standardization of neural network-based video coding, neural networks have been employed for multiple machine vision tasks, e.g., pixel prediction, reference frame generation, coding artifact removal, super-resolution. These neural networks are trained offline and evaluated (e.g., rate-distortion optimization) to select the best-resulting neural network as a seemingly generalized neural network to be integrated into the conventional video compression system. However, under limited representation capabilities, neural networks may not perform well for every input sample, especially when the sample that is currently being processed (referred to as target sample) and the samples used for training (referred to as source sample) have significant characteristic differences.
[0003] In trained neural networks, there exist parameters that may not significantly contribute to the overall performance. These parameters, often referred to as unimportant or redundant parameters, could potentially be removed without causing significant impact on the network's output. For instance, when processing specific samples such as a small batch of frames or blocks, only the parameters that capture the corresponding characteristics are likely to respond. This suggests that there could be more unimportant parameters when considering these specific samples only. Temporarily removing these unimportant parameters could potentially maintain, or even improve, the network's performance when working with these specific samples. This is especially true if these removed parameters were previously having a negative impact on prediction accuracy or reconstruction quality.SUMMARY
[0004] Accordingly, the present disclosure aims to provide a decoding method and an encoding method applying mask adaptation, a video coding apparatus, and a computer readable medium.
[0005] A technical scheme adopted by the present disclosure is to provide a decoding method applying mask adaptation. The method is executed by a decoder with an AI model or functionality. The method includes: obtaining a mask information; and applying a masked topological connection or a masked weight to one or more neurons of the AI model or functionality based on the mask information.
[0006] Another technical scheme adopted by the present disclosure is to provide an encoding method applying mask adaptation. The method is executed by an encoder deployed with an AI model or functionality. The method includes: obtaining a mask information; and applying a masked topological connection or a masked weight to one or more neurons of the AI model or functionality based on the mask information.
[0007] Another technical scheme adopted by the present disclosure is to provide a video coding apparatus. The apparatus includes a processor and a memory. The memory is configured to store executable instructions that, when executed by the processor, cause the processor to perform any of the foregoing methods.
[0008] Another technical scheme adopted by the present disclosure is to provide a computer-readable medium. The computer readable medium is configured to store executable instructions that, when executed by the processor, cause the processor to perform any of the foregoing methods.BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to clearly explain the technical solutions in the embodiments of the present disclosure, the drawings used in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description are merely some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings may also be obtained based on these drawings without any creative work.
[0010] FIG. 1 shows a schematic diagram of a conventional video encoding system.
[0011] FIG. 2 shows a schematic diagram of a conventional video decoding system.
[0012] FIG. 3 shows a schematic diagram of a video encoding system implemented with a neural network according to an embodiment of the present disclosure.
[0013] FIG. 4 shows a schematic diagram of a video encoding system implemented with a neural network according to another embodiment of the present disclosure.
[0014] FIG. 5 shows a schematic diagram of a video encoding system implemented with a neural network according to yet another embodiment of the present disclosure.
[0015] FIG. 6 shows a schematic diagram of a video decoding system implemented with a neural network according to an embodiment of the present disclosure.
[0016] FIG. 7 shows a schematic diagram of a video decoding system implemented with a neural network according to another embodiment of the present disclosure.
[0017] FIG. 8 shows a schematic diagram of a video decoding system implemented with a neural network according to yet another embodiment of the present disclosure.
[0018] FIG. 9 is a flowchart of a decoding method applying mask adaptation according to an embodiment of the present disclosure.
[0019] FIG. 10 conceptually illustrates the masking operation in the video encoding process and decoding process.
[0020] FIG. 11 shows two exemplary scenarios for acquiring the masked weight.
[0021] FIG. 12 shows an example where mask adaptation is used to construct the decomposition components of a weight.
[0022] FIG. 13 shows an example where mask adaptation is used to dynamically adjust the intrinsic rank of decomposition.
[0023] FIG. 14 is a flowchart of an encoding method applying mask adaptation according to an embodiment of the present disclosure.
[0024] FIG. 15 is a schematic diagram of a video coding apparatus according to an embodiment of the present disclosure.DETAILED DESCRIPTION
[0025] The disclosure will now be described in detail with reference to the accompanying drawings and examples. Apparently, the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0026] To help understand the technical solutions proposed in the embodiments of this application, a brief introduction of video encoding and decoding system will be provided below.
[0027] As shown in FIG. 1, a video encoding system 110 may include multiple modules, such as block partitioning unit 1101, transform and quantization unit 1102, intra-frame estimation unit 1103, intra-frame prediction unit 1104, motion compensation unit 1105, motion estimation unit 1106, an inverse transformation and inverse quantization unit 1107, a filter control analysis unit 1108, a filtering unit 1109, an encoding unit 1110, an encoded image buffer unit 1111 and a subtractor 1112.
[0028] Original video signals include video frames. Each video frame is divided into blocks by a block partitioning unit 1101. For each of the video frames, the subtractor 1112 generates residual pixel information about a residual frame by subtracting the input video frame from the output of the intra-frame prediction unit 1104 or the motion compensation unit 1105. The residual pixel information obtained after intra-frame prediction or inter-frame prediction (motion compensation) , is transformed by the transformation and quantization unit 1102. The transformation includes transforming the residual pixel information from the pixel domain to a transform domain, and the resulting transform coefficients are quantized to further reduce the bit rate. The intra-frame estimation unit 1103 performs intra-frame estimation, and the intra-frame prediction unit 1104 performs intra-frame prediction on the video reconstructed blocks. Motion estimation performed by the motion estimation unit 1106 is a process of generating a motion vector that can estimate the displacement of the reconstructed video block, and then motion compensation is performed by the motion compensation unit 1105 based on the determined motion vector. After determining an intra-frame prediction mode, the intra-frame prediction unit 1104 provides selected intra-frame predicted data to the encoding unit 1110, and the motion estimation unit 1106 also sends calculated motion vector data to the encoding unit 1110. The inverse transform and inverse quantization unit 1107 reconstructs the video reconstructed blocks and reconstructs a residual block in the pixel domain, and the filtering unit 1109 is controlled by the filter analysis unit 1108 to remove the blocking artifacts in the reconstructed residual block, and the encoding unit 1110 adds the reconstructed residual block to the prediction block of the encoded image buffer unit 1111 to generate a reconstructed block. The encoding unit 1110 is used for encoding various encoding parameters and quantized transform coefficients (quantized transform coefficients) into bitstream, and outputs the bitstream of the video signals. The encoded image buffer unit 1111 is used for storing reconstructed blocks as the reference blocks for intra-frame prediction. As the video image encoding progresses, new reconstructed blocks are continuously generated, and these blocks are stored in the encoded image buffer unit 1111.
[0029] As shown in FIG. 2, a video decoding system 120 may include multiple modules such as a decoding unit 1201, an inverse transform and inverse quantization unit 1202, an intra-frame prediction unit 1203, a motion compensation unit 1204, a filtering unit 1205, a decoded image buffer unit 1206 and a post filtering unit 1207.
[0030] The input signals of video frames are encoded by the video encoding system 110 to obtain an output bitstream. The video encoding system 110 transmits the bitstream to the video decoding system 120. The video decoding system 120 receives the bitstream representing the video frames in an encoded format (i.e., in a compressed format) . In the video decoding system 120, the bitstream is processed by the decoding unit 1201 to obtain decoded transform coefficients. The inverse transform and inverse quantization unit 1202 process the transform coefficients to generate a residual block in the pixel domain. The intra-frame prediction unit 1203 is operable to generate an intra-frame prediction block for a current video decoding block based on a determined intra-frame prediction mode and data from previously decoded blocks of the current video frame or picture. The motion compensation unit 1204 determines the inter-frame prediction information for the current video decoding block and generates an inter-frame prediction block by parsing the motion vector and other associated syntax elements. Finally, the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 1202 and the corresponding prediction block generated by the intra-frame prediction unit 1203 or the motion compensation unit 1204. In order to improve video quality, the decoded video blocks are filtered through the filtering unit 1205 to remove blocking artifacts. The decoded video block is then stored in the decoded image buffer unit 1206 as the reference block for subsequent intra-prediction or motion compensation, and for video output, i.e., to reproduce and reconstruct the original video signals. The output video can be optionally further processed by a post filtering unit 1207 for more suitable or enhanced viewing experiences.
[0031] Neural networks have been applied in the video compression system to improve the compression efficiency. Recent works mainly focus on developing neural network for intra prediction, inter prediction, and loop filtering, which are integrated along with the intra-frame estimation unit 1103, intra-frame prediction unit 1104, motion estimation unit 1106, motion compensation 1105, and loop filters unit 1109 at the video encoder side, as well as intra prediction unit 1203, motion compensation unit 1204, and loop filters unit 1205 at the video decoder side.
[0032] For instance, neural network loop filter has been developed based on neural networks with / without original loop filters unit. A neural network unit 1313 may be employed to replace the loop filters unit 1109 as indicated in FIG. 3. Alternatively, a neural network unit 1413 may be sequentially connected with the loop filters unit 1109, e.g., after the loop filters unit 1109 as indicated in FIG. 4. Alternatively, a neural network unit 1513 may be combined with the loop filters unit 1109, e.g., by a selective usage with loop filters unit 1109 as indicated in FIG. 5.
[0033] Similarly, at the video decoder side, a neural network unit 1608 may be employed to replace the loop filters unit 1205 as indicated in FIG. 6. Alternatively, a neural network unit 1708 may be sequential connected with the loop filters unit 1205, e.g., after the loop filters unit 1205 as indicated in FIG. 7. Alternatively, a neural network unit 1808 may be combined with the loop filters unit 1205, e.g., selective usage with the loop filters unit 1205 as indicated in FIG. 8.
[0034] For detailed implementation of neural networks in the video encoding / decoding system, please refer to [JVET-T0088 AHG11: Convolutional neural networks-based in-loop filter] , and [JVET-T0079 AHG11: Neural Network-based In-Loop Filter] , and [JVET-X0054 AHG11: Neural Network based In-loop Filter with Adaptive Model Selection] . Neural network-based intra prediction and inter prediction can be implemented similarly.
[0035] The present disclosure aims to derive and apply mask information for a neural network to improve the prediction accuracy or reconstruction quality of this neural network on specific samples. The following sections provide introduction for several related technologies of the present disclosure, including: 1) basic information about neural network and existing neural network built for standards; 2) related model pruning technologies; and 3) current adaptation methods used in video coding. ● Neural network
[0036] A neural network (e.g., convolutional neural network, fully connected neural network, Vision Transformer neural network) is a computation graph consisting of one or multiple layers of computation. It is typically constructed in a hierarchical manner, where each neuron (also called neural node) within the neural layer extracts learned visual features or patterns of increasing complexity from the input image. For instance, convolutional neural network consists of one or more convolutional layers, where each layer applies a set of learned convolutional filters to detect various spatial features or patterns from the input data. Here, each convolutional filter represents one neuron, and it is convolved with the input image to produce a feature map that represents the presence of a specific feature or pattern. This operation is referred to as a visual feature extraction.
[0037] Specifically, a neural network can be regarded as a stack of sequential neural projection operations with a total layer number of L, which can be formulated as:
[0038] The neural projection operations can be typically formulated as: where Wl denotes parameter weight of the neural projection operator, bl denotes a neural projection bias, hl (*) denotes a non-linear activation, and αl denotes a control factor of hl (·) .
[0039] Given an input image xin , a prediction ypred of the neural network aprocess commonly called inference, is:
[0040] In the above equation, θNN denotes the weights of and it can be obtained by training on a given task or tasks (including upstream tasks or pretext tasks) and datasets D (including especially large-scale datasets or multi-modal datasets) .
[0041] For example, for current neural network-based loop filtering, the target is to output the high-quality filtered sample of the low-quality reconstructed version close to the original sample. The optimal is supposed to make the difference between the high-quality restored sample and the original input sample as minimum as possible. For instance, given training database (e.g., DIV2K in [NTIRE 2017 Challenge on Single Image Super-resolution: Dataset and Study. IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW) , pp. 126-135, 2017] , BVI-DVC in [BVI-DVC: A Training Database for Deep Video Compression. IEEE Transactions on Multimedia, 24: 3847-3858, 2021] , TVD in [Tencent Video Dataset (TVD) : A Video Dataset for Learning-based Visual Data Compression and Analysis [J] . arXiv preprint arXiv: 2105.05961, 2021] ) with paired original sample xorg (i.e., the output result of sample partition unit 1101) and its corresponding low-quality reconstructed sample xin, is expressed as: where denotes the error metric (e.g., absolute error, mean square error) . The filtered result will be
[0042] Beyond mere inference, neural networks can also serve as accessory modules and auxiliary modules. Specifically, the accessory module is referred to a supplemental module or set of modules that are not part of the main workflow of inference, but assist in the overall functioning and performance of the method (e.g., word embedding layers in image caption, which convert words into vectors) , while the auxiliary module is referred to an additional module or set of modules that perform secondary tasks to support the primary objective of the method (e.g., teacher neural network in knowledge distillation, which are used to provide additional labels during training but not used for inference) . Typically, these modules still rely on the visual feature extraction conducted by neural node. Therefore, they are included in the scope of this disclosure.
[0043] Topology of a neural network refers to the neurons in a neural network and the connections between these neurons. Information about topology may indicate the structure of neural networks and how the network processes and transmits information.
[0044] The structure of neural networks includes at least one layer, with each layer containing one or more neurons responsible for extracting features from the input data. The neural network may typically include the following types of layers: 1) projection layers, including but not limited to convolutional layer, fully connected layer, embedding layer; 2) normalization layers, including but not limited to batch normalization, instance normalization, adaptive instance normalization, group normalization, weight normalization, switchable normalization; 3) activation layers, including but not limited to Parametric Rectified Linear Unit (PReLU) .
[0045] Weight of a neuron refers to a numerical value associated with the neuron. The weight may be used to scale the signal passing through the associated neuron. The weights of a neural network refer to a set of weights that are associated with all the neurons contained in the neural network. Weights are usually learnable parameters. For example, given a set of data samples, the values of weights can be learned.
[0046] The process of training a neural network involves modifying the weights to reduce the error between the predicted output and the ground-truth output. This is typically done using a learning algorithm (e.g., backpropagation) combined with an optimization technique (e.g., gradient descent) and a loss function specific to a learning task. For example, during backpropagation, the error is calculated at the output and propagated back through the network to update the weights in a way that minimally reduces the overall error.
[0047] An update of weights refers to a set of weights that contains information about how to modify the weights (referred to as base weights) of a neural network. The weights that have been modified are often referred to as updated weights. Typically, an update of weights can directly be expressed as updated weights.
[0048] In another implementation, an update of weights can also be expressed as the difference (e.g., an increment, a multiplier) between the weights and its updated weights, and it is often referred to as a weight update.
[0049] A dead neuron refers to a neuron that cannot be activated, i.e., contributes nothing to feature extraction or output of neural network. A dead neuron consistently outputs the same value (often zero) for all inputs during training and inference.
[0050] A sparse neural network refers to a neural network in which most of its parameter weight elements are either zero or close to zero.
[0051] Based on the above-described inference paradigm, existing schemes for standards-essential neural networks mainly include 1) architecture design, 2) input design, and 3) adaptability design.
[0052] As for architecture design, these solutions explores neural network structures that align closely with a specific functionality (e.g., filtering, prediction) , including basic module design (e.g., separate convolution in [JVET-AD0156 EE1-1.1: Complexity Reduction on Neural-Network Loop Filter] , Transformer block in [JVET-AH0205 EE1-2.3: Integer implementation of HOP In-loop filter with Transformer samples and Attention samples] ) and branch design (e.g., cross-component branch in [JVET-T0094 AHG11: In-loop filtering based on neural network] , shared inference branch in [JVET-W0113 AHG11: neural network based in-loop filter] ) . The goal is to find the optimal with corresponding θ*, which can be formulated as:
[0053] As for input design, these solutions introduce additional inputs, such as image type in [JVET-AC0179 AHG11: Swin-Transformer based In-Loop Filter for Natural and Screen Contents] , quantization step in [JVET-U0115 AHG11: Neural Network-based In-Loop Filter Performance with No Desampleing Filtering stage] , rotation information in [JVET-AE0161 AHG11: Input and output rotation of model for NNVC in-loop filter] ) . The goal is to find the optimal additional input xadd for i.e.,
[0054] As for adaptability design, these solutions involve an update of weights of neural networks, as present in [JVET-AH0096 EE1-1.4: Content-adaptive loop-filter] . Typically, a given neural network gets overfitted based on the samples to be encoded at the encoder side, and then the update of weights is signaled to the decoder side for correct decoding. The goal is to find the optimal update of weights θupdate, i.e., ● Model Pruning
[0055] Model pruning is commonly used to reduce the computational burden of neural networks in resource-constrained environments. This operation removes one or more neurons (with their corresponding weights) based on one or more specific metrics. One typical use case is channel pruning in convolutional neural network, where one or more convolutional filters (or one or more groups of convolutional filters) are discarded based on a metric (e.g., L1 Norm of filter coefficients) . For example, given a base weight θNN of convolutional layer and a weight dimension dn to be pruned, the pruned weights can be expressed as: where in denotes the weight elements lie on the lattice of weight dimension dn , and denotes a subset of weight elements contained in the given slice of base weights W […, : , …] .
[0056] It should be noted that this technology is underpinned by the following two main beliefs. Firstly, it is thought essential to begin with a large, over-parameterized network, as this yields a high-performance model with strong representation and optimization capabilities. Secondly, both the pruned architecture and its weights are considered crucial for achieving an efficient final model. Consequently, most pruning techniques focus on fine-tuning the pruned model rather than training one from the ground up.
[0057] Therefore, the remaining weights after pruning are viewed as vital, as they encapsulate the primary representation and optimization features of the high-performance model. ● Adaptation methods
[0058] To enhance coding efficiency, methods have been proposed to adapt a neural network to one or more target samples. The purpose is to improve prediction accuracy on these target samples by modifying the weights of one or more parameters within neural networks. Such an idea dates back to High Efficiency Video Coding (HEVC) standard, where the filter coefficients of adaptive loop filters (ALF) are trained at the video encoder side and then signaled to the video decoder to improve the performance of the filter. Similarly, in neural network-based methods, parameter weights of neural networks can be fine-tuned targeting on new unseen samples. Up to date, four types of adaptation methods are popularly used in the field of video compression, including (i) adapter, (ii) partial finetuning, (iii) low-rank adaptation, (iv) normalization adaptation.
[0059] Adapter-based methods insert additional modules (referred to as adapter) after one or more specific original modules. One possible implementation of adapter can be a bottleneck projection with that projects the input xl into the lower-dimensional space specified by the bottleneck dimension r , followed by a nonlinear activation function and expansion that projects the output into higher-dimensional space. Typically, adapters are surrounded by a residual connection that combines their output with the one from original module, resulting in:
[0060] Note that parameter weights for original modules remain frozen during the fine-tuning process. Given a ground-truth ygt, the purpose is to find an optimal with minimum prediction error, which can be formulated as: where denotes the error function.
[0061] For more details, please refer to [Koki Tsubota, Hiroaki Akutsu, Kiyoharu Aizawa: Universal Deep Image Compression via Content-Adaptive Optimization with Adapters. IEEE Winter Conference on Applications of Computer Vision (WACV) , 2023: 2528-2537] .
[0062] Partial fine-tuning-based methods update a specific part of parameter weights, while keep the other frozen (i.e., parameter weights unchanged) . The new updated weights are used during inference instead of the base ones. Practitioners demonstrated that such fine-tuning can be done very efficiently through bias-only update while other weight of the convolution or fully connected layers remain frozen, resulting in: where are bias and they get modified during adaptation process.
[0063] Similarly, the purpose is to find an optimal with minimum prediction error as:
[0064] For more details, please refer to [Yat Hong Lam, Alireza Zare, Francesco Cricri, Jani Lainema, Miska M. Hannuksela: Efficient Adaptation of Neural Network Filter for Video Compression. ACM International Conference on Multimedia (MM) , 2020: 358-366] .
[0065] Low-rank adaptation (LoRA) -based methods inject additional trainable low-rank matrices into modules to approximate the weight updates. Specifically, given the parameter weights Wl, LoRA represents its update with a low-rank decomposition W+ΔW=W+WdownWup , where are trainable parameters and r is the rank of decomposition. The output is modified as:
[0066] Note that parameter weights for original modules (e.g., Wl) remain frozen during the fine-tuning process. Similarly, the purpose is to find an optimal with minimum prediction error as:
[0067] For more details, please refer to the PCT patent application [PCT / CN2024 / 098802] .
[0068] Normalization adaptation-based methods collect normalization statistics of target samples and use them in forward calculation of neural network during inference. Typically, this method is often applied in modules / layers that use averaged statistics (e.g., batch normalization) . In one example. the output of batch normalization is modified from to:
[0069] In the equation, μtarget and σtarget are mean and variance obtained from target samples, μavg and σavg are averaged mean and variance obtained during previous training process, and αμ and ασ are factors balancing. For details, please refer to the PCT patent application [PCT / CN2024 / 102667] .
[0070] As described above, existing adaptation approaches either require additional training process, or rely on specific modules / layers. Besides, these approaches rely on signaling weight information of neural network parameters. Each of them may present various sets of issues and limitations in terms of application in compression or decoding on a hardware platform with limited computational resources.
[0071] One potential issue is the expensive bitstream cost of parameter weight signaling. To synchronize for correct decoding, the above methods often transmit information on model weights (e.g., a weight update, updated weights) . Although existing NNR standards (ISO / IEC 15938-17: 2024) have provided promising schemes for model weight compression, this is still costly. For example, in the case of ClassD BasketBallPass with QP equal to 22, JVET-AI0111 needs an average of 10367 bits for each GoP, accounting for 3.39%of overall bitrate cost. In another example, in [Yat Hong Lam, Alireza Zare, Francesco Cricri, Jani Lainema, Miska M. Hannuksela: Efficient Adaptation of Neural Network Filter for Video Compression. ACM International Conference on Multimedia (MM) , 2020: 358-366] , it is reported that more than 5%of the bitrate is required for signalling a weight update in some low-bitrate scenarios (e.g., quantization parameter set to 37) . Therefore, it is highly appreciated to find a representation that succinctly represents the adaptation information while avoiding expensive signalling of parameter weight information.
[0072] One potential issue is the expensive fine-tuning cost. In prior arts, adaptation methods without module dependence are usually achieved by fine-tuning a pre-specified set of parameters within a given neural network. Regrettably, fine-tuning requires gradient descent-based error optimization for parameter weight updating. For instance, in [Yat Hong Lam, Alireza Zare, Francesco Cricri, Jani Lainema, Miska M. Hannuksela: Efficient Adaptation of Neural Network Filter for Video Compression. ACM International Conference on Multimedia (MM) , 2020: 358-366] it is reported that a powerful NVIDIA Tesla V100 device is required for the parameter fine-tuning. This poses an overhead challenge to some deployment scenarios with constrained resources (e.g., memory, storage) . Therefore, an adaptation method without any training process would be always preferable.
[0073] One potential issue is the lack of disabling unbeneficial feature patterns. As described above, representation bias is introduced, due to the characteristic differences between training samples and samples to be encoded. For example, as discussed in [JVET-AH0107 EE1-3.1: Deep Reference Frame Generation for Inter Prediction Enhancement] , it is difficult to generate high-quality reference frames using training samples containing little motion information. In other words, one or more feature patterns (e.g., filter, neuron) learned from training samples may not be useful to the current input of neural network (i.e., samples to be encoded) , and may even reduce prediction accuracy. An obvious and straightforward solution is to simply disable unbeneficial or inaccurate feature patterns. This allows only feature patterns that are useful for input, to be used. However, existing neural network-based video coding systems have not yet introduced this functionality.
[0074] In light of the issues mentioned earlier, there is a need to address the limitations and drawbacks of conventional weights adaptation methods. Accordingly, the present disclosure provides a mask adaptation approach, which involves deriving and applying one or more masks of neurons.
[0075] FIG. 9 is a flowchart of a decoding method applying mask adaptation according to an embodiment of the present disclosure. The method may be executed by a decoder deployed with an artificial intelligence (AI) model or functionality. As shown in FIG. 9, the method includes operations described in blocks S201 to S202.
[0076] In S201, a mask information is obtained.
[0077] The AI model or functionality can be a machine-learned model, a neural network or a set of learnable parameters. For example, a neural network may include multiple neurons. Some of these neurons do not improve the performance of the neural network on a specific sample (e.g., a set of pixel values processed with the neural network; a picture or a group of pictures) . In this case, a masking operation can be performed to remove or reduce influence of such neurons.
[0078] The mask information may serve to indicate at least one of: 1) whether a masking operation is to be performed; 2) to which neurons the masking operation is performed; 3) how to perform the masking operation; or 4) when to perform the masking operation.
[0079] In one embodiment, whether the masking operation is to be performed can be firstly determined. It can be pre-defined, indicated by a corresponding encoder, or determined by the decoder itself.
[0080] FIG. 10 shows a case where whether the masking operation should be performed as well as the related mask information is determined in the encoding process. The neural network with certain neurons masked is used to process the target sample, and the neurons that do not bring performance contribution can be masked. In this example, the mask can be applied to weights of the neurons. As shown in FIG. 10, when the value of an element in the mask is equal to 0, the weight of the corresponding neuron may be set to 0, that is, the corresponding neuron is “masked” . Relative information can be sent from the encoder to the decoder such that the decoder may perform the same masking operation to the corresponding neurons of its deployed neural network.
[0081] Alternatively, the decoder may determine whether to perform the masking operation without indication from the encoder. For example, the determination process may include: determining target samples for which the AI model or functionality is applied; and determining whether to apply a masking operation to the one or more neurons of the AI model or functionality based on performance of the AI model or functionality on the target samples with the masking operations. In other words, whether some neurons should be masked can be determined based on their corresponding effects on reconstruction quality (or prediction accuracy) under the sample (s) that is currently being processed.
[0082] For example, given a neuron and a set of target samples, whether masking the neuron (e.g., by setting weight value to 0, by adjusting topological connection) can improve the performance of neural network on the set of target samples is tested. If so, the value of mask of the neuron is derived as True; otherwise, the value is derived as False.
[0083] It should be emphasized that the above provides a value definition of the mask under a common understanding, that is, “True” represents the masking of the neuron, and “False” represents the non-masking of the neuron. Some implementations with the same logic should also be considered in the present invention, such as: the opposite masking logic (that is, “True” represents the non-masking of the neuron, and vice versa) ; enable logic (that is, “True” represents the enabling of the neuron, and “False” represents the non-enabling of the neuron) or its opposite logic.
[0084] Similarly, this specification only provides a derivation and specification method of mask information under a common understanding. Some implementations with the same logic should also be considered in the present invention, such as: obtaining non-masking information\enabling information\non-enabling information about neurons, etc.
[0085] The masking operation can be specified for each single neuron, i.e. all weight elements of a neuron (e.g., neural unit in fully connected neural network, filter in convolutional neural network, embedded matrix in Transformer model) . Alternatively or additionally, the masking operation may be specified for partial weights of neuron (s) , e.g., a slice of weights (all weight elements within a dimension e.g. within embedded matrix) . Alternatively or additionally, the masking operation may be specified for a group of neurons, e.g., a channel or filter group in convolutional neural network (e.g., all weight elements of convolutional filters from an input / output channel / a group of channels / a convolutional layer / a module) .
[0086] The performance can be indicated by gain (or error) of reconstruction quality (or prediction accuracy) . For example, it is tested that whether masking the neuron brings gains in reconstruction quality (or gains greater than a certain threshold of reconstruction quality) or reduces reconstruction errors (or errors lower than a certain threshold of reconstruction errors) .
[0087] Specifically, the performance of the AI model or functionality on the target samples may be evaluated with a full-reference metric of performance or a non-reference metric of performance.
[0088] In one implementation, the masks may be derived by a full-reference metric of performance. Specifically, the above test can be conducted to obtain one or more masks during encoding process, and then the masks are signaled. During the decoding process, the masks are received and then applied to a neural network, where the corresponding neurons for which mask value is True are masked (e.g., by setting weight value to 0, by removing topological connection) . The neural network, with selected neurons masked, is subsequently used for decoding.
[0089] In another implementation, the masks may be derived by a non-reference metric of performance. Specifically, the above test can be conducted to obtain one or more masks during encoding / decoding process, and then the masks are applied. The neural network, with selected neurons masked, is subsequently used for encoding / decoding.
[0090] It should be understood that, the foregoing process can be used not only to determine whether a masking operation should be performed, but also to determine other kinds of mask information such as “to which neurons the masking operation is performed” and “how to perform the masking operation” .
[0091] The mask information may include at least one selected from: 1) a number of masks, configured to indicate how many masks are to be used in the mask adaptation; 2) one or more layer references of mask, configured to indicate to which part of the AI model or functionality each mask corresponds; 3) one or more sizes of mask, configured to indicate how many neurons are involved in each mask; and 4) values of mask, configured to indicate value for each position of each mask.
[0092] In one embodiment as described in foregoing sections, the operation of obtaining the mask information may include: determining target samples for which the AI model or functionality is applied; determining the mask information based on performance evaluation of the AI model or functionality with different mask adaptation. That is, the mask information may be acquired by performance evaluation of the AI model or functionality with different masking configuration (and without the masking operation) .
[0093] In another embodiment, the operation of obtaining the mask information may include: receiving the mask information from a bitstream from an encoder; or obtaining the mask information from pre-configuration. In yet another embodiment, the mask information may be deduced from other relevant information.
[0094] Detailed introduction about each kind of mask information and methods for obtaining the mask information is given below.
[0095] (1) Number of masks
[0096] The number of masks refers to how many masks are to be used, indicating the number of modules / layers / groups of neurons to be involved in a mask adaptation process. Typically, the number information can be represented as an integer value.
[0097] The number of masks can be received from bitstream. The bitstream contains explicit information about number of mask (s) , including 1) data value, e.g., when number information is demultiplexed from a received bitstream, a codec decodes the number information firstly; 2) identifier, e.g., when number information is stored (especially together with other mask information) in a lookup table, a video decoder may receive a single index and obtain the number corresponding to the received index.
[0098] Alternatively, the number of masks can be deduced from relevant information. The information about number of masks can be deduced from relevant information. For example, when all layers of a neural network are involved in a mask adaptation process, the number of masks is derived as the number of layers contained in the neural network.
[0099] Alternatively, the number of masks can be derived from pre-specification, which includes: 1) a previous number, e.g., the most recently used one, and 2) a pre-set number, e.g., a default number preset in codec profile / neural network configuration.
[0100] (2) Layer reference of mask
[0101] The Layer reference of mask refers to which layer (or which module, which part of neural network) each mask refers to. For example, one mask may correspond to one module / layer / group of neurons within neural network.
[0102] The layer reference of mask can be received from bitstream. The bitstream contains explicit indications indicating 1) a specific module / layer / neuron, 3) a specific type / characteristic / functionality of modules, layers, or neurons within neural network. More details can be obtained as indicated in [PCT / CN2024 / 098802] and [PCT / CN2024 / 118847] .
[0103] In practical implementation, neuron (s) / layer (s) / module (s) with a specific type / characteristic / functionality is usually selected. For example, the layer with a kernel size greater than 1 can be selected. This allows disabling one or more filters associated with spatial features do not benefit the reconstruction (or prediction) on currently processed samples. For example, the last layer of a residual skip connection can be selected. This allows retaining specific useful components of output channels within the residual branch. For example, neurons from a specific group of neurons (especially filter / channel group within grouped convolutional layer) can be selected.
[0104] In one example, a mask corresponds to the filters within the selected group without affecting other groups.
[0105] In another example, a mask is shared among multiple groups, e.g., the first value equal to True within the mask indicates the first neuron of each neuron group is masked.
[0106] In another example, a group-wise mask is used, where a single value equal to True within the mask indicates the whole group of filters is being masked.
[0107] Alternatively, the layer reference of mask can be deduced from relevant information. The information about layer reference of mask can be deduced from relevant information e.g., when all layers of a neural network are involved in a mask adaptation process, the layer reference of mask is derived as all layer indications in neural network configuration.
[0108] Alternatively, the layer reference of mask can be derived from pre-specifications, which includes: 1) a previous reference, e.g., the most recently used one, and 2) a pre-set reference, e.g., a default reference preset in codec profile / neural network configuration.
[0109] (3) Size of mask
[0110] The size of mask refers to how many neurons within module / layer / neuron group (i.e., neural unit in hidden layer, filter in convolutional layer, embedded matrix in attention module) involved to be masked (or not) . Typically, all neurons within layer participate in mask adaptation. The size of mask can indicate the number of elements contained in a mask. In some cases, only a specific part of neurons within neural network participates in mask adaptation, while other parts remain unmodified. In some cases, only a specific part of weight of a neuron participates in mask adaptation, while other parts remain unmodified.
[0111] The size information can be represented as an integer value, or an array of integer values. Each value corresponds to one or more dimensions of neurons (e.g., size of mask equal to [N1, N2] indicates the mask involves N1 input channels and N2 output channels) . In some cases, the size information can be represented as a fraction (or an array of fractions) , indicating proportion of the number of involved neurons to all neurons within the module / layer / neuron group, e.g., a fraction 0.5 indicates that half of neurons are involved (often accompanied with indication e.g. indicating which half, indicating edge point of neuron) .
[0112] The size of mask can be received from bitstream. The bitstream contains explicit information about size of mask, including 1) data value, e.g., when size information is demultiplexed together with value (s) of masks (as described in Section) from a received bitstream, a video decoder may decode the size information firstly, and then the value information; 2) identifier, e.g., when size information is stored together with value information in a lookup table, a video decoder may receive a single index indicating both a size of mask and values for each position within lattice of mask.
[0113] Alternatively, the size of mask can be deduced from relevant information The information about size of mask can be deduced from relevant information, including 1) values of masks, 2) number of neurons.
[0114] For example, the one or more sizes of mask can be determined based on the values of mask. Once all value (s) of masks are derived followed by an indicator e.g. indicating “stop of decoding” , the number is determined as the number of elements contained in value (s) of masks. For example, if 01010000 is received and there are 8 elements, the size of mask is specified as 8.
[0115] For example, the one or more sizes of mask can be determined based on a number of neurons within a specific dimension when all neurons within the specific dimension are involved in the mask adaptation. When 1) all layers of a neural network, 2) all layers of a specific type (e.g., fully separate grouped convolution) or functionality (e.g., dilated convolution) , or 3) all neurons of a specific type or functionality within a specific layer (e.g., Query / Key / Value embedded matrices within attention layers) are involved in masking, the size of mask is equal to the number of neurons / neuron groups within the corresponding layer / neural network.
[0116] Alternatively, the size of mask can be derived from pre-specifications. The bitstream may not include any size information (e.g., a NULL indication, an empty payload) , and the video decoder may use a pre-specified number, including 1) a previous number, e.g., the most recently used one, and 2) a pre-set number, e.g., a default number preset in codec profile / neural network configuration.
[0117] (4) Value of mask
[0118] Each value in mask refers to an indicator, determining whether to mask a specific neuron or not. Typically, each value can be represented as a Boolean (using 1 bit) . Therefore, value of mask of a layer can be represented as a set of Booleans, e.g., 01010000 indicates to mask the 2nd and 4th neurons from a specific layer with total 8 neurons. In some cases, value of mask may be represented by one or more indices. Each index indicates the corresponding neuron to be masked, e.g. [2, 4] indicates to mask the 2nd and 4th neurons from a specific layer. In some cases, value of mask may be represented by one or more indices and one or more set of Booleans. Each index indicates the edge point of corresponding neuron to be masked, e.g. {2, 101} indicates to mask the 2nd and 4th neurons from a specific layer.
[0119] In one case, each value in mask is specified for a neuron (e.g., a neural unit, a convolutional filter) , where a True value indicates e.g. to set the weight value to 0; in another case, each value is specified for a partial of neuron (e.g., a dimension within convolutional filter or embedded matrix) , where a True value indicates e.g. to set the corresponding slice of weight value to 0; in another case, each value is specified for a group of neurons (e.g., convolutional filters from a input / output channel / a group of channels / a convolutional layer / a module) , where a True value indicates e.g. to set all weight values to 0.
[0120] The value of mask can be received from bitstream. The bitstream contains explicit information about values, including 1) data value, e.g., demultiplexed together with size information from a received bitstream; 2) identifier, e.g., stored together with size information in a lookup table.
[0121] Alternatively, the value of mask can be derived from pre-specifications. The bitstream may not include any value information (e.g., a NULL indication, an empty payload) , and a video decoder may use a pre-specified value, including 1) a previous value, e.g., the most recently used one, and 2) a pre-set value, e.g., a default set of values preset in codec profile / neural network configuration.
[0122] Alternatively, the value of mask can be deduced from relevant information. For example, the values of mask may be determined based on performance evaluation of the AI model or functionality with different mask adaptation. For example, the values of mask may be determined based on properties of target samples for which the AI model or functionality is applied. For example, the values of mask can be determined based on coding parameters. A detailed explanation is given below.
[0123] In a first option, the value (s) can be deduced by the performance of a model that uses the masked neuron.
[0124] In one example, given a metric of performance (e.g., prediction accuracy / reconstruction quality of model output) , the value (i.e., True or False) can be determined as the one with higher performance. For example, based on a given sample (or a representative subset of samples) , each involved neuron is one-by-one tested whether its masking can bring gain. If so, the mask value corresponding to the neuron is derived as True.
[0125] A full-reference metric can be used for derivation of values during encoding process, including e.g. Peak Signal to Noise Ratio (PSNR) , Structural Similarity Index Measure (SSIM) , Multi-Scale Structural Similarity Index Measure (MS-SSIM) ) / the smaller error (e.g., Mean Squared Error (MSE) , Mean Absolute Error (MAE) , L1 energy error. For example, an encoder derives the value of masks by calculating the PSNR between predicted samples and original samples in case of NNLF. Note that in such case, the value information should be signaled for correctly decoding.
[0126] Alternatively, a non-reference metric can be used for derivation of values during encoding / decoding process, including e.g. a specialized / learned quality indicator, or a commonly used indicator e.g. BRISQUE, NIQE, BLIINDS, DIIVINE or those described in [Zhai G, Min X. Perceptual image quality assessment: a survey [J] . Science China Information Sciences, 2020, 63: 1-52] . For example, given a specific non-reference indicator agreed to by both an encoder and a decoder, the encoder / decoder derives the value of masks by calculating the agreed metric based on e.g. predicted samples which are available to NNLF or other post-processing NNs. Note that in such case, the value information can be deduced by decoder.
[0127] In another example, the metric may further involve a joint derivation of both size (s) and value (s) . The metric can be e.g., ratio between 1) reconstruction quality or prediction accuracy and 2) bitrate cost or size of mask.
[0128] To combine the relative impact of each of these factors, one could additionally incorporate an additional Lagrange multiplier to control the importance of each of these factors in the final selection decision.
[0129] In a second option, the value information can be derived from one or more aspects of the samples (e.g., video, frame, block) being a target of the adaptation process.
[0130] In one example, the value is derived by one or more pre-defined features (e.g., colour, edge, texture) of neural network input (i.e., target samples) or neuron input (i.e., deep features generated by target samples) . In case of inputs with rich features, more features are expected to be represented, thus less neurons can be masked.
[0131] In another example, the value is derived based on the number of target samples (e.g., per CTU, per Slice or Tile, per frame, per GoP, per video sequence) . In case of larger number of target samples, more features are expected to be represented, thus less values are derived as True.
[0132] In another example, the value is derived by the video coding layer (VCL) of target samples, i.e., whether the currently processed samples come from a 1st VCL, 2nd VCL, 3rd VCL, or 4th VCL. In case of samples that come from lower VCL, they usually contain more visual information and more features are expected to be represented, thus less values are derived as True.
[0133] In a third option, the value information can also be derived from one or more aspects of conditions or environment that the video coding is implemented.
[0134] For example, the value is derived by a quantization parameter (e.g., at frame level, at slice level) . In case of NNLF, for low value of quantization parameters, thus more values are derived as True.
[0135] In one implementation, a set of values are derived jointly based on one or more above relevant aspects, e.g., for different type of target samples, values are derived separately for each quantization parameter point using different non-reference quality indicators.
[0136] In another implementation, one or more sets of masks are separately derived for each case of above relevant aspects (e.g., model performance, target sample, coding parameters) . Each time encoding / decoding, the video codec invokes the corresponding set of mask values, based on the type of the current sample to be encoded / decoded.
[0137] Moreover, the mask information obtained in S201 may further include an adaptation information. The adaptation information can be utilized to indicate at least one of: a triggering information for applying the mask adaptation; timing for applying the mask adaptation; or an indication about whether to apply the masked topological connection or to apply the masked weight to the one or more neurons of the AI model or functionality. Thus, this process may obtain information about one or more operations to apply a mask adaptation, including at least one of: 1) adaptation usage, 2) timing of applying mask adaptation, and 3) adaptation application.
[0138] The information about adaptation usage indicates whether to invoke a mask adaptation or not. It can be received from bitstream. The bitstream contains explicit information about whether to use mask adaptation or not. For example, when the video decoder receives 1) a binary indicator equal to True, 2) a bitmap indicator with "1" or "True" values, or 3) a string or type indicator equal to "sparse" , it invokes a mask adaptation process.
[0139] Alternatively, the adaptation usage information can be deduced from relevant information such as performance of model, target sample, or coding parameters.
[0140] In a first option, when a model (including a base model, a masked model obtained by a previous mask adaptation process) cannot achieve a given metric of performance on the sample that is currently being processed, the encoder / decoder may invoke a mask adaptation process.
[0141] In a second option, one or more aspects of target samples may indicate the usage of mask adaptation.
[0142] In one example, when a predefined feature of neural network input (e.g., sample) or neuron input (e.g., feature) cannot achieve a given performance metric, the encoder / decoder may invoke a mask adaptation. In one implementation, activity of sample can be used. The activity is e.g., derived as the minimum variance of each four N×N luminance sub-blocks (or its normalized version plus 1) . When the activity difference between 1) a currently processed 2N×2N CU block and 2) sample (s) being a target of the last adaptation process surpasses a specific threshold (e.g., threshold equal to 2 as suggested in [JVET-C0102 Luma delta QP adjustment based on video statistical information] ) , the encoder / decoder may invoke a mask adaptation to adapt to the flatness / texture characteristics of the current CU block.
[0143] In another example, when type of the current sample (e.g., I-frame, P-frame, B-frame) is different from the one used for the last mask adaptation process, the encoder / decoder may invoke a mask adaptation. For instance, mask adaptation may be used only for B / P frame within a GoP (e.g., under random access configuration) . When an I frame is processed using a base neural network and the next frame is a B / P frame, a mask adaptation is used based on B / P frame to derive an adapted neural network to encode / decode B and P frame.
[0144] In another example, when the coding layer (e.g., 1st coding layer, 2nd coding layer) where the current sample belongs to is different from the one used for last mask adaptation process, the encoder / decoder may invoke a mask adaptation. For instance, during encoding / decoding a GoP (e.g., under random access configuration) , mask adaptations are used based on frames from the 1st, 2nd, 3rd and 4th to derive adapted neural networks to encode / decode corresponding frames separately.
[0145] In a third option, one or more aspects of coding parameters may indicate the usage of mask adaptation.
[0146] Specifically, when the variation of quantization parameters (e.g., at frame level, at slice level) exceeds a specific QP range, the encoder / decoder may invoke a mask adaptation. For example, when the QP difference between 1) a currently processed frame and 2) frame (s) used for the last mask adaptation process, is greater than a certain threshold (e.g., deltaQP>7) , the encoder / decoder may invoke a mask adaptation to adapt to the sample characteristics at the current QP level.
[0147] The information about timing of applying mask adaptation indicates a moment of time to apply the masks, including 1) immediate adaptation and 2) scheduled adaptation.
[0148] The immediate adaptation means that once the obtained adaptation usage information equals to True, the derived masks will be applied to the corresponding neurons immediately. Such information can be obtained from, for example, indications. For example, when 1) a binary indicator is True or a bitmap indicator contains "1" , or 2) a string or type indicator is "immediate" , an immediate adaptation is used.
[0149] Note that, in one case, the binary indicator equal to False or the "0" in bitmaps indicates no adaptation; in another case, they indicate to use another specific adaptation time (e.g., a scheduled adaptation) .
[0150] The scheduled adaptation means to apply the masks to the neurons at a specific moment of time. All frames or blocks are adapted in the specified moment.
[0151] The moment can be represented as a starting frame timestamp specified in seconds, milliseconds, microseconds, or any other time units, or as a starting frame index (e.g. Picture Order Count = POC) and, optionally, number of time units or number of frames specifying the length of the window.
[0152] Alternatively, a length of time window can be determined by indicating a last frame’s timestamp or a last frame ‘sindex. If the optional indicator of window length is not specified, the window length is determined based on another indicator specifying the starting frame of the consecutive window.
[0153] The scheduled adaptation related information can be obtained from, for example, indications for a starting frame timestamp / a starting frame index / a length of time window. For example, when a non-binary number is obtained, a scheduled adaptation is used, and the obtained number is used as the value of starting frame’s timestamp / a starting frame’s index / a length of time window.
[0154] The information about adaptation application indicates how to apply a mask to a specified neuron, including a modification of 1) weights or 2) topology. Such information can be obtained from, for example, indications. For example, when 1) the binary indicator is True, 2) the string or the Type indicator is “topology" , or 3) the bitmap indicator contains "1" , a modification of topology is applied; otherwise, a modification of weight is applied. Details about modification of topology and modification of weights will be provided in subsequent sections of the present disclosure.
[0155] Furthermore, the mask information obtained in S201 may further include a target sample information. The target sample information can be utilized to indicate target samples for which the AI model or functionality and the mask adaptation is applied, i.e., the sample (s) being a target of the adaptation process.
[0156] The information can be obtained from, for example, indications, which indicate information about a video, or a specified part of the video. The indications may correspond to: 1) a set of group-of-pictures (GOP) , 2) frames of specific type (e.g., I-frames, P-frames, B-frames, or inter-frames) within a GOP or set of GOPs, 3) a single picture, 4) a subpicture of frame, 5) a slice of frame, 6) a tile of frame, or 7) a currently processing block within the video. Additionally, the target samples may further include a batch of any of the abovementioned items.
[0157] When the mask information as described above is obtained, the decoder may perform the masking operation based on the mask information.
[0158] In S202, a masked topological connection or a masked weight is applied to one or more neurons of the AI model or functionality based on the mask information.
[0159] The masking operation may include modification on topological connection or modification on weight related information (e.g., complete weight, weight component, weight update) for certain neurons.
[0160] (1) Modification on topological connection
[0161] This process disables the topological operations corresponding to the neuron whose value of mask equals True.
[0162] In one embodiment, the operation of applying the masked topological connection for one or more neurons may include: setting outputs of the one or more neurons to a pre-defined value. The pre-defined value may be, for example, zero. Note that this method directly modifies the corresponding output to all zeros (or all pre-specified values) without any modification on computational graph or weight of neuron, and it is expected to be efficient. Alternatively, the pre-defined value may be a relatively very small value compared with outputs of other neurons that are not masked. In another embodiment, the operation of applying the masked topological connection for one or more neurons may include: setting outputs of the one or more neurons to be equal to their inputs.
[0163] In another embodiment, the operation of applying the masked topological connection for one or more neurons may include: removing computation operation corresponding to the one or more neurons from computational graph of the AI model or functionality. That is, the computation operation involving masked neurons is removed from the computational graph of the neural network. During inference, any computational operations involving masked neurons will not be used. Note that, in most cases, the original computational graph of the neural network or those computational operations involving masked neurons will be preserved. After processing the target sample (s) with masked neurons, the network is typically restored to its original computational graph either by reloading the preserved graph or by re-integrating the preserved operations involving masked neurons.
[0164] (2) Modification on weight related information
[0165] This process can also be called obtaining masked weight. Specifically, the operation of determining the masked weight for one or more neurons may include: setting weight elements of the one or more neurons to a pre-defined value. The weight elements may include one of: one or more complete weights of the one or more neurons; one or more elements within a low-rank decomposed weight component for the one or more neurons; or one or more slices within a high-rank decomposed weight component for the one or more neurons. In other words, the mask determined in previous steps may be applied to a weight selected from: a weight element (e.g., the weight element of a neuron in fully connected neural networks) , a slice of weights (all weight elements within a dimension e.g. within embedded matrix) , a weight (e.g., all weight elements of a convolutional filter) , a group of weights (e.g., all weight elements of convolutional filters from a input / output channel / a group of channels / a convolutional layer / a module) .
[0166] FIG. 11 shows two exemplary scenarios for acquiring the masked weight. In the first scenario, the masked weight is a masked complete weight. The masked complete weight is: 1) not processed by any decomposition; nor 2) reconstructed by decomposition across or within dimensions. Moreover, the masked complete weight can be a masked base weight, a masked weight update (or a masked updated weight) , and so on. In the second scenario, the masked weight is a masked decomposed weight which is processed by decomposition across or within dimensions. Moreover, the masked decomposed weight can be a masked decomposed based weight, a masked decomposed weight update (or a masked decomposed updated weight) and so on.
[0167] In another implementation, mask adaptation can be applied to a pre-configured set of high-rank decomposed components. Specifically, a set of decomposed components is trained by matrix / tensor decomposition using a large value of rank of decomposition, and then pre-configured at both encoder and decoder side. It is served as super-complete dictionary (i.e., a dictionary containing a large number of redundant basis vectors) , where each slice of pre-configured decomposed components (e.g., each column of the down-projection matrix or each row of the up-projection matrix in the case of matrix decomposition) is used as a basis vector (i.e., prototype signal-atoms) . During inference, the decomposed components in use are constructed by sparse linear combinations of entries of pre-configured components.
[0168] FIG. 12 shows an example where mask adaptation is used to construct the decomposition components of a weight. In this case, mask adaptation is used to construct the decomposition components. Specifically, the mask provides the gating of the decomposition component slices (i.e., the vector basis) . By modifying the entry position of False values in mask, one or more component slices are selected to construct the decomposed component in use.
[0169] FIG. 13 shows an example where mask adaptation is used to dynamically adjust the intrinsic rank of decomposition. In this case, mask adaptation is used to dynamically adjust the intrinsic rank of decomposition (e.g. rank of low-rank adaptation) . Specifically, compared with the existing scheme where the intrinsic rank remains fixed and cannot be modified during inference (i.e., rank is pre-configured before deployment) , mask adaptation modifies the number of False values in masks to configure online the corresponding intrinsic rank for the current processed sample.
[0170] In some embodiments, after the masking operation is performed, a process of scaling may be applied to the output of layer / module with masked neurons. The process may include: applying a scaling factor to output of a layer of the AI model or functionality with masked neurons; wherein the scaling factor is determined based on a ratio of a total number of neurons within the layer to a number of neurons within the layer which are not masked. The scaling factor may be proportional to (e.g., equal to) the ratio of the total number of neurons to the non-masked neurons. For example, a scaling factor of Nvalue / (Nvalue-NTrue) can be employed, where Nbase denotes the total number of value elements contained in the mask, and NTrue denotes the total number of True values in the mask. This process recovers the statistics (e.g., mean) of layer's output with masked neurons to match those of the original output (i.e., layer output without masking any neurons) , thus reducing representation bias. In another implementation, square root of a total number of neurons within the layer to a number of neurons within the layer which are not masked, can be used as the scaling factor, so as to recovers the variance of layer's output.
[0171] According to the present disclosure, the mask information may be obtained and the masking operation for one or more neurons may be adopted. Those neurons which do not bring significant performance gain to the AI model or functionality can be masked. Thus, the computational cost of the AI model or functionality can be reduced while its performance can be improved.
[0172] It should be understood that, the masking operation (i.e., the masked topological connection or the masked weight) may be applied for inference of the AI model or functionality, or the masking operation may be applied for weight update of the AI model or functionality.
[0173] The inference involves how to use neurons (including enable or disable) based on a set of target samples. During encoding process, mask information is obtained based on sample (s) to be encoded, and then is applied to a neural network to obtain a masked neural network for encoding the sample (s) . Besides, the mask information may be signaled to decoder. During decoding process, mask information is received from bitstream, and then is applied to a neural network to obtain a masked neural network for correct decoding.
[0174] The weight update process involves how to update the weights of neurons (including update and not update) based on a set of target samples. During encoding process, mask information is obtained based on sample (s) to be encoded, and then is applied to an update of weights to obtain an updated neural network for encoding the sample (s) . Besides, the mask information may be signaled to decoder. During decoding process, mask information as well as the update of weights received from bitstream, and then is applied to a neural network to obtain an updated neural network for decoding.
[0175] For example, given an update of weights (e.g., a weight update, an updated weight) for a purpose of content adaptation on a set of samples (e.g., GoP) , a set of masks is derived for its subset (e.g., each frame within the GoP) . The set of masks is applied to obtain a masked update of weights, and then the masked update is used to obtain an updated neural network. The updated neural network is used to encode / decode the corresponding subset (e.g., frame) . Therefore, the update of weights for each subset can be represented by a corresponding set of masks and a common update shared among different subsets (i.e., shared among different sets of masks) .
[0176] Another implementation involves generating a compact update of weights. During encoding process, an update of weights is obtained, followed by mask information based on a neural network using the weight update. Subsequently, the mask is applied to the update of weights, and the masked weights from the original (full) update of weights are removed to obtain a more compact version. This improves the performance of neural network using the compact update (compared to using the original full update) while also reducing the bitrate cost for signaling update information.
[0177] The method described in foregoing sections may also be applied to a neural network with dead neuron (s) . In this case, the method may further include: acquiring a dead neuron of the AI model or functionality; and determining the dead neuron as one of the one or more neurons involved in the mask adaptation.
[0178] Specifically, dead neurons within the corresponding module / layer / neuron group may be identified. When obtaining a mask, for a dead neuron, value of the corresponding lattice position in the mask can directly be derived as True, while the above test of performance may not be conducted. For example, given a convolutional layer with 64 filters and 10 of them being empty filters, mask values corresponding to those 10 empty filters are directly derived as True, skipping the corresponding performance test (thus, only 54 performance tests are needed) .
[0179] Since identifying dead neurons is always significantly less time-consuming than conducting performance tests, this reduces the time cost of unnecessary tests and accelerates the overall mask derivation process.
[0180] When signaling a mask, for a dead neuron, value (s) of the corresponding lattice position in the mask can be not signaled, thus saving the bitrate costs. For example, given a convolutional layer with 64 filters and 10 of them being empty filters, mask values corresponding to those 10 empty filters are not signaled (thus, only 54 bits are needed, in case a set of Boolean are used) . Additionally, the use of dead neuron specification may also be signaled.
[0181] During decoding process, if dead neuron specification is used (e.g., indicated by signaling) , dead neurons within the corresponding module / layer / neuron group may be identified firstly, and then the mask is applied to those live neurons.
[0182] In a special case, the mask information may be utilized for a subsequent fine-tuning process. For example, mask adaptation is applied to a neural network based on a set of target samples. Subsequently, the weights corresponding to neurons with only values of masks equal to True (indicating no benefit of corresponding feature pattern) are fine-tuned using the target samples. This allows the neural network to convert non-beneficial feature patterns into beneficial (rather than disabling them) with fine-tuning as few parameters as possible, thus improving performance and reducing fine-tuning and bitrate costs.
[0183] The present disclosure further provides an encoding method in which mask adaptation is adopted. FIG. 14 is a flowchart of an encoding method applying mask adaptation according to an embodiment of the present disclosure. The method may be executed by an encoder deployed with an AI model or functionality. As shown in FIG. 14, the method includes operations described in S301 to S303. These operations are similar to those described with regard to FIG. 9, and details of which will not be repeated herein.
[0184] In S301, a mask information is obtained.
[0185] In S302, a masked topological connection or a masked weight is applied to one or more neurons of the AI model or functionality based on the mask information.
[0186] In one implementation, when mask information is specified at both sides, the mask information may not require to be signaled. In another implementation, when the mask information is specified at encoder side and signaled to decoder side, the method may further include the operation described in S303.
[0187] In S303, the mask information is signaled to a decoder via a bitstream.
[0188] In case mask adaptation is specified and applied at the encoder side, mask information is signaled to the decoder to derive a corresponding adapted neural network. This ensures a correct decoding of the bitstream.
[0189] The signaling may include the number of mask (s) , which can explicitly be represented as value (e.g., an integer indicating the number of mask (s) ) , or identifier (e.g., index to a lookup table storing a set of numbers) .
[0190] The signaling may include the layer reference of mask, which can explicitly be represented as one of the following: identifiers of neurons, e.g., module / layer / operation identifier, or type / functionality / characteristic identifier of module, layer or operation.
[0191] The signaling may include the size of mask, which can explicitly be represented as value (e.g., an integer indicating the size of mask) , or identifier (e.g., index to a lookup table storing a set of sizes) .
[0192] The signaling may include the value of mask. The value of mask can be either 1) explicitly represented e.g. as value (e.g., a Boolean / an array of Booleans each indicating whether to mask a corresponding neuron or not) , or identifier (e.g., index to a lookup table storing a set of values of masks) ; or 2) implicitly represented by identifier e.g. indicating performance of model (e.g., quality metric) , target sample (e.g., sample number, pre-defined feature, sample type, coding layer) , coding parameters (e.g., quantization parameter) .
[0193] The signaling may include the adaptation-related information, which further includes at least one of: usage, timing, or application information.
[0194] As for usage information, it can be 1) explicitly represented as a binary indicator or a bitmap indicator or a string or type indicator where "1" or "True " values / "sparse" indicates the usage of mask adaptation, 2) implicitly represented by identifier e.g. indicating performance of model (e.g., quality metric) , target sample (e.g., pre-defined feature, sample type, coding layer) , coding parameters (e.g., quantization parameter range, threshold of activity of CU) .
[0195] As for timing information, it can be represented as 1) a binary indicator or a bitmap indicator, 2) a string or type indicator, where "1" or "True" values / "immediate" indicates the usage of immediate adaptation. In another implementation, it can be represented as a numerical value, indicating a starting frame’s timestamp / a starting frame’s index / a length of time window of scheduled adaptation.
[0196] As for application information, it can also be represented as 1) a binary indicator or a bitmap indicator, 2) a string or type indicator, where "1" or "True " values / "topology" indicates a masked topological connection; otherwise, a masked weight is indicated.
[0197] The following sections illustrate important design elements of high-level syntax and semantics for a specification process of mask adaptation. The related syntax elements may be introduced into different locations, including 1) header of a specified syntax structure, or 2) supplemental enhancement information (SEI) message.
[0198] 1) Header of syntax structure
[0199] In one solution, information about mask adaptation may be introduced into a header of syntax structure, including Group-of-Pictures (GoP) header, picture header, slice header, video parameter set (VPS) , sequence parameter set (SPS) , picture parameter set (PPS) , adaptation parameter set (APS) .
[0200] In one implementation, the specification text for SPS header may be as shown in Table 1: Table 1: SPS rbsp syntax
[0201] In the above table, sps_nnlf_enabled_flag equal to 1 specifies that neural network filter is enabled for the CLVS. sps_nnlf_mask_present_flag equal to 1 specifies a tensor of masks is provided. sps_nnlf_mask_present_flag shall be set to 1, if sps_nnlf_mask is contained in payload of seq_parameter_set_rbsp () . sps_nnlf_mask_payload_size_minus1 plus 1 specifies the bytes of payloads containing masks of neurons. sps_nnlf_mask specifies an array of masks.
[0202] In another implementation, the specification text for SPS header may be as shown in Table 2: Table 2: SPS rbsp syntax
[0203] In the above table, sps_nnlf_metricID_present_flag equal to 1 specifies that an ID of metric is provided to derive a set of masks. sps_nnlf_metricID_present_flag shall be set to 1, if sps_nnlf_mask_metricID is contained in payload of seq_parameter_set_rbsp () . sps_nnlf_mask_metricID specifies an ID of metric to derive a set of masks.
[0204] The proposed SPS structure is typically expected to be used in cases where mask adaptation is applied to a weight of a neural network. The neural network filter should be aware of a set of masks at least before processing each GoP.
[0205] In another implementation, information about mask adaptation can be specified in nn_filter_update_data () when aps_params_type == NN_UPDATE_APS, and the syntax of mask adaptation may be specified as shown in Table 3: Table 3: APS parameters type codes and types of APS parameters
[0206] In the above table, aps_nnlf_masks specifies an array of mask elements.
[0207] In another implementation, the syntax of mask adaptation may be specified as shown in Table 4: Table 4: APS parameters type codes and types of APS parameters
[0208] In the above table, aps_nnlf_quality_metricsID specifies an ID of metric to derive a set of masks. aps_nnlf_masks_derivation () specifies a derivation process for a set of masks, involved with an ID of metric as input.
[0209] The proposed APS structure may be expected for use in cases where mask adaptation is applied to a weight update.
[0210] 2) SEI message
[0211] In one solution, a SEI structure of message is proposed, which includes information about mask adaptation. In this case, the media bitstream includes one or more media units and a SEI message related to this process.
[0212] The SEI message includes at least two independently parsable structures: 1) a first independently parsable structure comprising information to identify a standard neuron or separately provided neuron via a reference identifier; and 2) a second independently parsable structure comprising required information to derive a mask, or a list of masks, and apply it to the neuron identified by the above mentioned independently parsable structure.
[0213] The payload of the second independently parsable structure may further include information corresponding to fields of sequence parameter set.
[0214] The proposed SEI structure may be used e.g. in neural network-based post-filtering (but not in-loop filtering) or auxiliary neural networks (e.g., generating object mask information) of video coding system, or neural network-based image / video processing used in products or manufactures (e.g., device, chip) .
[0215] 3) Separate bitstream
[0216] In one solution, information about mask adaptation may be introduced into a separate bitstream. For example, the signaling may be interpreted based on the related syntax and semantics as specified in ISO / IEC 15938-17 to generate a NNR bitstream.
[0217] In one possible implementation, the mask of neurons indicating an application of mask adaptation can be introduced into nnr_model_parameter_set_header () as shown in Table 5: Table 5
[0218] In the above table, nn_mask_data () is a container or a structure containing information specifying a set of masks to be applied.
[0219] Compared with existing schemes where feature patterns (e.g., convolutional filter) learned during training are all used for inference, the present disclosure introduces a mask adaptation, where one or more masks of neurons (i.e., indicating enabling / disabling usage of corresponding feature patterns) are derived and applied during encoding / decoding process, based on their corresponding effects on reconstruction quality (or prediction accuracy) . Embodiments of the present disclosure may offer at least one of the following advantages.
[0220] Improvement of reconstruction quality. Compared with existing inference pipeline where all feature patterns are used, only beneficial feature patterns are used, while the others are disabled, thus improving reconstruction quality.
[0221] Reduction of bitrate cost. Compared with existing adaptation schemes that require signaling of neural network weights, synchronization in this invention can be represented by cheap identifier (e.g., a binary indicator using one-bit only) , thus reducing expensive bitrate cost.
[0222] Supports on flexible adaptive sparsification. Compared to training and deploying a sparse neural network (e.g., those sparsity-optimized fully connected neural network proposed in [JVET-AJ0249 EE2-2.20_2.21: Neural network-based intra prediction with DIMD mode derivation] ) , this invention deploys a non-sparse neural network (which usually has stronger representation capability for processing multi-types of complex tasks) and modify the masking entries to flexibly use neurons that contribute to the currently processed sample. This allows an on-line adaptive sparsification of neural network to any currently processed sample.
[0223] Similarly, compared to training and deploying a neural network with fixed partial convolution ratio (e.g., those proposed in [JVET-AK0106 EE1-1.1: Partial Convolution and Over-Parameterization] ) , this invention deploys a fully convolutional neural network and modify the masking entries to flexibly use convolutional filter that contribute to the currently processed sample. This allows an on-line adaptive partial convolutional process of neural network to any currently processed sample.
[0224] Acceleration of decoding process. For masked neurons, neural networks can apply efficient / low-complexity operations of these neurons, thus reducing the computational cost during inference and improving the decoding speed.
[0225] The mask adaptation is applied to LOP. 3 proposed in [JVET-AI0111 AhG11: Content-adaptive LOP3 filter] for effect validation. Experimental protocols are as follows:
[0226] In the mask adaptation process, each GoP is used as target samples of one mask adaptation procedure. During encoding process, each branch of {3-by-1→ 1-by-3} fully separated convolutional layer is used for mask adaptation. Each filter within layer is tested whether its masking will improve the PSNR of output reconstruction. If yes, masking is applied on this filter, and vice versa. After that, the masked LOP. 3 is used for encoding, and the mask information (i.e., a set of Boolean value, where True indicates to mask) is multiplexed into video stream. During decoding process, the mask information is demultiplexed from video stream, and masked LOP. 3 is obtained based on the obtained mask information. After that, the masked LOP. 3 is used for decoding.
[0227] Bjontegaard Delta (BD) -rate is used as the evaluation metric, where a negative value indicates performance gain.
[0228] All simulations have been carried out on a computing server with Intel (R) Xeon (R) Platinum 8358P CPU @2.60GHz, 2064GB RAM, and NVIDIA A10 24GB×4.
[0229] The experimental results under random access configuration over NNVC9.1 with Float and Int16 SADL files are reported in Table 6 below. As shown, the proposed method demonstrates gains in both Luma and Chroma. Table 6
[0230] Note that, the present invention is expected to be applied to various types of AI model or functionalities (e.g., convolutional neural network, fully connected neural network, Transformer neural network, graph neural network) or machine-learning models (e.g., support vector machine, decision trees, decision forests, Boltzman machine, regression model) , e.g., works raised by Joint Video Experts Team (JVET) AhG11 / AhG12, and machine tasks (e.g., machine vision tasks, natural language processing tasks, reinforcement-based decision-making tasks, generative tasks) , e.g., works raised by Joint Video Experts Team (JVET) AhG9 / AhG16.
[0231] Furthermore, this invention is expected to be beneficial for both conventional video coding frameworks and end-to-end neural network-based video coding frameworks, e.g., [ISO / IEC DIS 6048-1 Information Technology -Learning-based image coding -Core coding system] .
[0232] Moreover, it can also be used in systems designed for human consumption as well as systems for machine consumption (e.g., Video Coding for Machines (DCM) in MPEG-7 / MPEG-21, Data Coding for Machine-intelligence (DCM) in CCSA TC1 / TC10 TC28 SC29) .
[0233] In addition, this method is not only applicable to neural network formats or its specification (e.g., [ISO / IEC 15938-17 Information technology -Multimedia content description interface -Part 17: Compression of neural networks for multimedia content description and analysis -version 2] ) , but can also be used as an image / video processing or analysis method and is further widely used in common media data processing systems.
[0234] FIG. 15 conceptually illustrates an apparatus 400 with which some embodiments of the invention are implemented. The apparatus 400 may be an encoding device or a decoding device. The apparatus 400 may be a computer (e.g., a desktop computer, personal computer, tablet computer, etc. ) , phone, PDA, or any other sort of electronic device. Such an apparatus includes various types of computer readable media and interfaces for various other types of computer readable media. The apparatus 400 includes a processor 402 and a memory 404. The memory 404 is configured to store executable instructions that, when executed by the processor, cause the processor to perform any one of the foregoing decoding or encoding methods.
[0235] The processor 402 may be a single processor or a multi-core processor in different embodiments. In some embodiments, the processor may include a GPU, NPU or DSP which may offload various computations or complement the image processing provided by the processor 402.
[0236] Some embodiments include electronic components, such as microprocessors, storage and memory that store computer program instructions in a machine-readable or computer-readable medium (alternatively referred to as computer-readable storage media, machine-readable media, or machine-readable storage media) . Some examples of such computer-readable media include RAM, ROM, read-only compact discs (CD-ROM) , recordable compact discs (CD-R) , rewritable compact discs (CD-RW) , read-only digital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM) , a variety of recordable / rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc. ) , flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc. ) , magnetic and / or solid state hard drives, read-only and recordable discs, ultra density optical discs, any other optical or magnetic media, and floppy disks. The computer-readable media may store a computer program that is executable by at least one processing unit and includes sets of instructions for performing various operations. Examples of computer programs or computer code include machine code, such as is produced by a compiler, and files including higher-level code that are executed by a computer, an electronic component, or a microprocessor using an interpreter.
[0237] While the above discussion primarily refers to microprocessor or multi-core processors that execute software, some embodiments are performed by one or more integrated circuits, such as application specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs) . In some embodiments, such integrated circuits execute instructions that are stored on the circuit itself. In addition, some embodiments execute software stored in programmable logic devices (PLDs) , ROM, or RAM devices.
[0238] As used in this specification and any claims of this application, the terms “computer” , “server” , “processor” , and “memory” all refer to electronic or other technological devices. These terms exclude people or groups of people. As used in this specification and any claims of this application, the terms “computer readable medium, ” “computer readable media, ” and “machine readable medium” are entirely restricted to tangible, physical objects that store information in a form that is readable by a computer. These terms exclude any wireless signals, wired download signals, and any other ephemeral signals.
[0239] The present disclosure further provides a computer readable media which is configured to store executable instructions. When the instructions are executed by a processor, the processor may perform any one of the foregoing methods and processes. Many of the above-described features and applications are implemented as software processes that are specified as a set of instructions recorded on a computer readable storage medium (also referred to as computer readable medium) . When these instructions are executed by one or more computational or processing unit (s) (e.g., one or more processors, cores of processors, or other processing units) , they cause the processing unit (s) to perform the actions indicated in the instructions. Examples of computer readable media include, but are not limited to, CD-ROMs, flash drives, random access memory (RAM) chips, hard drives, erasable programmable read only memories (EPROMs) , electrically erasable programmable read-only memories (EEPROMs) , etc. The computer readable media does not include carrier waves and electronic signals passing wirelessly or over wired connections.
[0240] In this specification, the term “software” is meant to include firmware residing in read-only memory or applications stored in magnetic storage which can be read into memory for processing by a processor. Also, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while remaining distinct software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that together implement a software invention described here is within the scope of the invention. In some embodiments, the software programs, when installed to operate on one or more electronic systems, define one or more specific machine implementations that execute and perform the operations of the software programs.
[0241] While the disclosure has been described with reference to numerous specific details, one of ordinary skill in the art will recognize that the invention can be embodied in other specific forms without departing from the spirit of the invention. In addition, a number of the figures conceptually illustrate processes and methods. The specific operations of these processes may not be performed in the exact order shown and described. The specific operations may not be performed in one continuous series of operations, and different specific operations may be performed in different embodiments. Furthermore, the process could be implemented using several sub-processes, or as part of a larger macro process.
[0242] The foregoing is merely embodiments of the present disclosure, and is not intended to limit the scope of the disclosure. Any transformation of equivalent structure or equivalent process which uses the specification and the accompanying drawings of the present disclosure, or directly or indirectly application in other related technical fields, are likewise included within the scope of the protection of the present disclosure.
Claims
1.A decoding method applying mask adaptation, executed by a decoder deployed with an artificial intelligence (AI) model or functionality, comprising:obtaining a mask information; andapplying a masked topological connection or a masked weight to one or more neurons of the AI model or functionality based on the mask information.2.The method of claim 1, further comprising:determining target samples for which the AI model or functionality is applied;determining whether to apply a masking operation to the one or more neurons of the AI model or functionality based on performance of the AI model or functionality on the target samples with the masking operations.3.The method of claim 2,wherein the performance of the AI model or functionality on the target samples is evaluated with a full-reference metric of performance or a non-reference metric of performance.4.The method of claim 1, wherein the mask information comprises at least one selected from:a number of masks, configured to indicate how many masks are to be used in the mask adaptation;one or more layer references of mask, configured to indicate to which part of the AI model or functionality each mask corresponds;one or more sizes of mask, configured to indicate how many neurons are involved in each mask; andvalues of mask, configured to indicate value for each position of each mask.5.The method of claim 4, wherein the obtaining the mask information comprises:receiving the mask information from a bitstream from an encoder; orobtaining the mask information from pre-configuration.6.The method of claim 4, wherein the obtaining the mask information comprises:determining target samples for which the AI model or functionality is applied;determining the mask information based on performance evaluation of the AI model or functionality with different mask adaptation.7.The method of claim 4,wherein the mask information comprises the number of masks;wherein the number of masks is determined based on a number of layers of the AI model or functionality involved in the mask adaptation.8.The method of claim 4,wherein the mask information comprises the one or more layer references of mask;wherein the one or more layer references of mask are determined as all layer indications when all layers of the AI model or functionality are involved in the mask adaptation.9.The method of claim 4, wherein the mask information comprises the one or more sizes of mask;wherein the one or more sizes of mask are determined based on the values of mask; orwherein the one or more sizes of mask are determined based on a number of neurons within a specific dimension when all neurons within the specific dimension are involved in the mask adaptation.10.The method of claim 4, wherein the mask information comprises the values of mask;wherein the values of mask are determined based on performance evaluation of the AI model or functionality with different mask adaptation; orwherein the values of mask are determined based on properties of target samples for which the AI model or functionality is applied.11.The method of claim 4, wherein the mask information further comprises:an adaptation information, wherein the adaptation information is configured to indicate at least one selected from:a triggering information for applying the mask adaptation;timing for applying the mask adaptation; andan indication about whether to apply the masked topological connection or to apply the masked weight to the one or more neurons of the AI model or functionality.12.The method of claim 4, wherein the mask information further comprises:a target sample information, configured to indicate target samples for which the AI model or functionality and the mask adaptation is applied.13.The method of claim 1, wherein the applying the masked topological connection for one or more neurons comprises:setting outputs of the one or more neurons to a pre-defined value.14.The method of claim 1, wherein the applying the masked topological connection for one or more neurons comprises:setting outputs of the one or more neurons to be equal to their inputs.15.The method of claim 13, wherein the applying the masked topological connection for one or more neurons comprises:removing computation operation corresponding to the one or more neurons from computational graph of the AI model or functionality.16.The method of claim 1, wherein the determining the masked weight for one or more neurons comprises:setting weight elements of the one or more neurons to a pre-defined value;wherein the weight elements comprises one of:one or more complete weights of the one or more neurons;one or more elements within a low-rank decomposed weight component for the one or more neurons; orone or more slices within a high-rank decomposed weight component for the one or more neurons.17.The method of claim 1,wherein the masked topological connection or the masked weight is applied for inference of the AI model or functionality; orwherein the masked topological connection or the masked weight is applied for weight update of the AI model or functionality.18.The method of claim 1, further comprising:applying a scaling factor to output of a layer of the AI model or functionality with masked neurons;wherein the scaling factor is determined based on a ratio of a total number of neurons within the layer to a number of neurons within the layer which are not masked.19.The method of claim 1, further comprising:acquiring a dead neuron of the AI model or functionality; anddetermining the dead neuron as one of the one or more neurons involved in the mask adaptation.20.An encoding method applying mask adaptation, executed by an encoder deployed with an artificial intelligence (AI) model or functionality, comprising:obtaining a mask information; andapplying a masked topological connection or a masked weight to one or more neurons of the AI model or functionality based on the mask information.21.The method of claim 20, further comprising:signaling the mask information to a decoder via a bitstream.22.A video coding apparatus, comprising a processor and a memory, wherein the memory is configured to store executable instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1 to 21.23.A computer readable medium storing executable instructions that, when executed by a processor, cause the processor to perform the method of any of claims 1 to 21.