pyiqa.archs.dmm_arch

Debiased Mapping for Full-Reference Image Quality Assessment

@article{chen2025debiased,

title={Debiased mapping for full-reference image quality assessment}, author={Chen, Baoliang and Zhu, Hanwei and Zhu, Lingyu and Wang, Shanshe and Pan, Jingshan and Wang, Shiqi}, journal={IEEE Transactions on Multimedia}, year={2025}, publisher={IEEE}

}

Reference:

Module Contents

pyiqa.archs.dmm_arch.names[source]
class pyiqa.archs.dmm_arch.FeaturesExtractor(target_features=('relu3_3', 'relu4_3'), use_input_norm=False, requires_grad=False, replace_pooling=True)[source]

Bases: torch.nn.Module

VGG16 feature extractor for DMM.

Parameters:
  • target_features (tuple[str, ...]) – VGG feature names to collect.

  • use_input_norm (bool) – Whether to apply ImageNet normalization.

  • requires_grad (bool) – Whether extracted backbone parameters are trainable.

  • replace_pooling (bool) – Whether to replace max-pooling with L2 pooling.

forward(x)[source]

Extract configured feature maps from input image tensor.

replace_pooling(module: torch.nn.Module) torch.nn.Module[source]
class pyiqa.archs.dmm_arch.L2Pool2d(kernel_size: int = 3, stride: int = 2, padding=1)[source]

Bases: torch.nn.Module

Applies L2 pooling with Hann window of size 3x3 :param x: Tensor with shape (N, C, H, W)

forward(x: torch.Tensor) torch.Tensor[source]

Apply L2 pooling using a Hann filter kernel.

class pyiqa.archs.dmm_arch.DMM(reduce_dim=256, kernel_size=5, features_to_compute=('relu3_3', 'relu4_3'), criterion=torch.nn.CosineSimilarity(), use_dropout=True, **kwargs)[source]

Bases: torch.nn.Module

DMM full-reference IQA model.

Parameters:
  • reduce_dim (int) – Reserved compatibility argument.

  • kernel_size (int) – Reserved compatibility argument.

  • features_to_compute (tuple[str, ...]) – Feature names used for DMM.

  • criterion (torch.nn.Module) – Reserved compatibility argument.

  • use_dropout (bool) – Reserved compatibility argument.

  • **kwargs – Reserved compatibility arguments.

forward(Dist, Ref, as_loss=False)[source]

Compute DMM score or training loss.

Parameters:
  • Dist (torch.Tensor) – Distorted image tensor (N, 3, H, W).

  • Ref (torch.Tensor) – Reference image tensor (N, 3, H, W).

  • as_loss (bool) – If True, return mean score for optimization.

Returns:

Per-sample scores when as_loss=False, otherwise a scalar loss tensor.

Return type:

torch.Tensor

prepare_image_adt(tensor_image)[source]

Adaptively resize large images for stable patch-based scoring.