<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Web Framework For Improving Deepfake Images ⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Oleh Pitsun</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>West Ukrainian National University</institution>
          ,
          <addr-line>11 Lvivska st., Ternopil, 46001</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2026</year>
      </pub-date>
      <abstract>
        <p>Improving the quality of deepfake images is an important condition for their effective detection, since artifacts, noise, and blur can hide key signs of forgery. Optimizing visual quality allows you to preserve critical textural and structural features, which increases the accuracy of detection algorithms. OpenForensics was chosen as the dataset. The training sample was divided into training, testing, and validation samples. The sample size is 500 images In this paper, a web framework is proposed to improve the quality of images of human faces with the ability to generate dataset parameters, which allows for a universal approach to forming training parameters. Improving image quality will help to better detect deepfake images. The accuracy of improving image quality using neural networks is 91%.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Deepfake</kwd>
        <kwd>image</kwd>
        <kwd>quality improvement</kwd>
        <kwd>CNN 1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1. Introduction</p>
      <p>The aim of the research is to develop, implement and evaluate the effectiveness of a framework
that allows you to improve the quality of deepfake images through adaptive reconstruction of
structural and textural characteristics using convolutional neural networks.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Problem statements</title>
      <p>To develop a comprehensive system, the following tasks must be implemented:
- develop the main framework modules for generating dataset parameters and improving image
quality;</p>
      <p>- develop and implement a convolutional network architecture with recurrent connections to
improve the quality of deepfake images;</p>
      <p>- conduct research and analyze the results by metrics.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Literature review</title>
      <p>The influence of scientists on the development and analysis of image quality enhancement
technologies using neural networks is fundamental and multifaceted. Thanks to scientific research,
this field has rapidly evolved from simple filtering methods to complex deep architectures capable of
restoring images with extreme accuracy. In work [1], to achieve the goal of the study, a dataset of
1063 ultrasound images was created by artificially degrading the quality of the original high-quality
images. The images were evaluated by doctors, and the obtained scores were averaged to form labels.
After data cleaning, 478 images were selected for training and testing models. To build a quality
assessment system, a deep convolutional neural network and a residual network were used, and a
transfer learning strategy was also applied, which allowed to improve learning under conditions of
limited data volume. The test results demonstrated that the proposed CNN approach is effective and
suitable for quantitative assessment of the quality of ultrasound images.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref1">2</xref>
        ], a new algorithm for assessing the quality of screen images is proposed, which, instead of
using all patches, selects only those that are closest to subjective assessments, which increases the
accuracy of the model compared to traditional CNN approaches at the patch level. In [
        <xref ref-type="bibr" rid="ref2">3</xref>
        ], a new
architecture Distortion-Aware CNN (DACNN) is proposed for blind image quality assessment, which
effectively predicts the quality of both synthetically and authentically distorted images, thanks to
the distortion type recognition module, adaptive fusion of their features and an accurate quality
prediction module, which is confirmed by experiments on eight different databases. In [
        <xref ref-type="bibr" rid="ref3">4</xref>
        ], the
PW360IQA model is proposed - a multi-channel convolutional neural network with perceptual
weighting for assessing the quality of 360-degree images, which takes into account the properties of
human vision, viewing trajectories and the probability of distortions, providing high accuracy with
reduced computational complexity compared to current approaches. In [
        <xref ref-type="bibr" rid="ref4">5</xref>
        ], the Image Quality
Transformer (IQT) model is presented, which combines a CNN backbone with a transformer
architecture for full-reference image quality assessment, providing high accuracy on standard and
generative datasets, and showing the best results at the NTIRE 2021 competition. In [
        <xref ref-type="bibr" rid="ref5">6</xref>
        ], the TRIQ
architecture is proposed, which combines a convolutional neural network with a lightweight
transformer encoder and adaptive position coding for image quality assessment, demonstrating high
results on public datasets. In [
        <xref ref-type="bibr" rid="ref6">7</xref>
        ], an improved deep convolutional neural network (D-CNN)
architecture for deepfake detection is presented, which effectively processes inter-frame differences,
demonstrates high accuracy (up to 99.33%) on seven different datasets, and provides good
generalization by training on images from different sources.
      </p>
      <p>
        The study [
        <xref ref-type="bibr" rid="ref7">8</xref>
        ] presents an overview of modern deepfake detection methods based on deep
learning, with a focus on video, image, audio and multi-format recognition, where the most common
approach remains the use of convolutional neural networks, and the main focus of most works is on
increasing accuracy.
      </p>
      <p>
        The paper [
        <xref ref-type="bibr" rid="ref8">9</xref>
        ] proposes an efficient CNN model for detecting deepfake videos, which combines
manual feature distillation, target region extraction, augmentation and frame ensemble, which
provides high accuracy with reduced model complexity and demonstrates competitive results on the
DFDC and Celeb-DF v2 datasets. The paper [
        <xref ref-type="bibr" rid="ref9">10</xref>
        ] reviews modern technologies for creating and
detecting deepfake videos, in particular with facial manipulation in videos, and proposes a
generalized approach to their detection using machine learning and computer vision, using current
tools and large datasets such as DFDC. The performance of using GPUs is considered in the paper
[
        <xref ref-type="bibr" rid="ref10">11</xref>
        ].
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Dataset</title>
      <p>
        The datasets selected are OpenForensics [
        <xref ref-type="bibr" rid="ref11">12</xref>
        ] https://zenodo.org/records/5528418#.YpdlS2hBzDd .
This dataset contains real and fake images with a high level of processing complexity. This dataset
is designed with multi-face annotations specifically for face forgery detection. The dataset size is
more than 5000 images of 256 x 256 pixels. An example of the dataset is shown in Figure 1.
      </p>
      <sec id="sec-4-1">
        <title>a) Real</title>
      </sec>
      <sec id="sec-4-2">
        <title>b) Fake</title>
        <p>The training sample was divided into training, testing, and validation samples. The sample size is
500 images.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Formation of dataset parameters</title>
      <p>One of the key aspects is the process of generating a dataset, so our task was to develop an approach
for generating this dataset, for example images.</p>
      <p>We use the JSON format as a way to store parameters and transfer data over the Internet via a
separate API. JSON is a common format for transferring data over the network between individual
servers.</p>
      <p>The main page consists of a block displaying all studies (i.e. datasets) and a button for creating a
new dataset (Figure 2).
The main elements are:
- Path to the folder with images;
- Image height;
- Image width;
- Image type;
- Crop;
- Single image selection;</p>
      <p>The path to the image provides the ability to enter the URL to the folder with files or to the archive
with files</p>
      <p>The height and width of the images is an important aspect, which is one of the key when choosing
the architecture of the neural network, so bringing all the images in the sample to the same format
allows classification without errors and exceptions.</p>
      <p>The "Crop" operation is often used when it is necessary to divide a large image into smaller
portions according to the requirements of the neural network architecture and the capabilities of the
execution environment (computer, cloud storage).</p>
      <p>The software module is implemented using the PHP programming language and the Laravel
framework/</p>
      <p>The module is based on the use of the MVC pattern, which allows you to clearly separate the
controller, model and view of the project.</p>
      <p>A feature of this project is the presence of the FaceDetector class, which is responsible for
processing and highlighting faces in the image, for example, for the task of searching for deepfakes</p>
      <p>The config.get method has been developed, which allows you to get specific parameter values.
This approach also simplifies the process of training a neural network and retraining by different
scientists, since in this case the training sample will be of the same type, which simplifies the setup
process.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Framework</title>
      <p>Web-based frameworks are structured software platforms that provide a set of tools, libraries, and
templates to facilitate the development of web applications. They define a standard approach to
building applications, reduce the amount of routine code, and facilitate rapid and unified creation of
functionality. The structure of the modules of a web-based deepfake detection framework is shown
in Figure 4.</p>
      <p>Input image processing module is responsible for processing the input image, including specifying
the path to the image folder and other parameters.</p>
      <p>Determining input image parameters is intended for determining and storing the input image
parameters in the database.</p>
      <p>Architecture and CNN model storage module is intended for storing the convolutional neural
network architecture configuration files and the models themselves in the form of files. Then you
can use ready-made models for a specific type of task.</p>
      <p>Dataset parameter generation module is implemented as a web page with fields for specifying
dataset parameters, implemented using the Laravel framework.</p>
      <p>Automatic image quality improvement module is responsible for directly improving the quality
of images using convolutional neural networks.</p>
      <p>Face detection module is intended for highlighting faces in images, which allows you to select
only the necessary area in the image and reduce the number of calculations.</p>
      <p>Thanks to frameworks, web development becomes more productive, safer and organized, which
makes them an integral part of modern software engineering.</p>
    </sec>
    <sec id="sec-7">
      <title>7. Formation of poor-quality images</title>
      <p>To generate possible poor-quality images, blurring, shadow correction, and salt-and-pepper noise
algorithms were used. An example of a noisy image is shown in Figure 5.
Noise is a key tool in improving the robustness of computer vision models. Different types of noise
affect different aspects of an image geometry, color, brightness, or texture. Noise analysis and
modeling allow us to assess the robustness of algorithms, improve the quality of preprocessing, and
build more adaptive systems.</p>
    </sec>
    <sec id="sec-8">
      <title>8. Convolutional neural network architecture</title>
      <p>Image enhancement is one of the key tasks in computer vision, covering detail restoration, noise
removal, resolution enhancement, and artifact correction.</p>
      <p>Convolutional neural networks (CNNs) have proven to be a powerful tool for solving these tasks
due to their ability to automatically extract and generalize relevant spatial features. Over the past
decade, a number of architectures have been proposed that are specifically adapted to processing
low-quality or corrupted images, including autoencoders, U-Nets, Residual Networks, GAN-based
solutions, etc. Convolutional neural networks fundamentally differ from traditional (classical) image
processing algorithms in terms of their approach to data analysis, flexibility, learning ability, and
adaptation to complex tasks. Traditional algorithms require manual tuning of filters and features
(e.g., edge detectors, gradient histograms, color histograms, etc.), while CNNs learn to extract
relevant features from data by training on a large number of images.</p>
      <p>The proposed architecture of the convolutional neural network is shown in Figure 6.
Total params: 134,067
Trainable params: 134,067
Non-trainable params: 0</p>
      <p>The image sample is divided into two parts: test and training. A feature of Unet networks and
convolutional networks in general is the presence of repeated blocks. Therefore, we will present
them as a set of operations:
 
= {〈 〉; 〈 〉; 〈 〉; 〈
〉}
where 〈C〉-set of convolution functions
〈B〉-batch normalization operation;
〈A〉-set of activation functions
〈Add〉-set of layers of the recurrent block
Let us consider in more detail the key blocks separately:
Convolution block</p>
      <p>Formally, the convolution process can be represented as follows:
 2
∑</p>
      <p>2
 =− 2  =− 2
  , × ℎ =</p>
      <p>∑  ( −  ,  −  )∙ ℎ( ,  )
GELU allows small negative values when the input is less than zero, providing a richer gradient for
backpropagation.
(1)
(2)
(3)
where  2 is half the filter height,  2 is half the filter length, x is the pixel column position, y is the
pixel row position,   , is the input image, h is the convolution kernel.</p>
      <p>GELU Activation Function
Formula for finding the activation function;
 ( )= 0.5 (1 + 
ℎ (√ ( + 0.044715 3)))

2</p>
    </sec>
    <sec id="sec-9">
      <title>9. Experiments</title>
      <p>The performance assessment of convolutional neural networks (CNN), particularly in classification
tasks, is based on quantitative metrics that reflect the accuracy of the model's decision-making.</p>
      <p>Training parameters:
Number of epochs: 45
steps_per_epoch=3
Accuracy
The Accuracy metric is the basic metric for balanced classes.</p>
      <p>Accuracy =</p>
      <p>TP + TN
TP + TN + FP + FN
(4)
where TP is true positive, TN is true negative, FP is false positive, FN is false negative.</p>
      <p>Accuracy is one of the simplest and most commonly used metrics for evaluating the quality of a
classification model. It shows what proportion of predictions the model made were correct. The value
of Accuracy ranges from 0 to 1 (or from 0% to 100%). The network performance estimates based on
the loss criterion are shown in Figure 8.</p>
      <p>
        An important element for integrating deep learning methods into cloud services is the use of
MlOps [
        <xref ref-type="bibr" rid="ref12">13</xref>
        ] practices, an example of the structure of a Terraform configuration file is shown in Figure
9.
      </p>
      <p>Loss is a key metric in the training process of neural networks, measuring how much the model's
predictions differ from the true labels (correct answers). Unlike metrics such as accuracy or precision,
which are used to evaluate the finished model, loss is used during training to update the network's
weights.</p>
    </sec>
    <sec id="sec-10">
      <title>Conclusions</title>
      <p>Based on the analytical approach and principles of developing software modules based on web
systems, the main framework modules have been developed to generate dataset parameters and
improve image quality.</p>
      <p>Artificially noisy images have been generated for experiments. A convolutional network
architecture with recurrent connections has been implemented to improve the quality of deepfake
images.</p>
      <p>The accuracy of improving image quality using a neural network is 91%.</p>
    </sec>
    <sec id="sec-11">
      <title>Declaration on Generative AI</title>
      <p>The authors have not employed any Generative AI tools.
based medical ultrasound image quality assessment." Complexity 2021, no. 1 (2021): 9938367.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Jiang</surname>
            , Xuhao, Liquan Shen, Guorui Feng,
            <given-names>Liangwei</given-names>
          </string-name>
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>and Ping</given-names>
          </string-name>
          <string-name>
            <surname>An</surname>
          </string-name>
          .
          <article-title>"An optimized CNN-based quality assessment model for screen content image."</article-title>
          <source>Signal Processing: Image Communication</source>
          <volume>94</volume>
          (
          <year>2021</year>
          ):
          <fpage>116181</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Pan</surname>
          </string-name>
          et al.,
          <article-title>"DACNN: Blind Image Quality Assessment via a Distortion-Aware Convolutional Neural Network," in IEEE Transactions on Circuits and Systems for Video Technology</article-title>
          , vol.
          <volume>32</volume>
          , no.
          <issue>11</issue>
          , pp.
          <fpage>7518</fpage>
          -
          <lpage>7531</lpage>
          , Nov.
          <year>2022</year>
          , doi: 10.1109/TCSVT.
          <year>2022</year>
          .
          <volume>3188991</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Sendjasni</surname>
          </string-name>
          , Abderrezzaq, and
          <string-name>
            <surname>Mohamed-Chaker Larabi</surname>
          </string-name>
          .
          <year>2023</year>
          .
          <article-title>"PW-360IQA: PerceptuallyWeighted Multichannel CNN for Blind 360-Degree Image Quality Assessment" Sensors 23, no. 9: 4242</article-title>
          . https://doi.org/10.3390/s23094242
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Cheon</surname>
          </string-name>
          , Manri,
          <string-name>
            <surname>Sung-Jun</surname>
            <given-names>Yoon</given-names>
          </string-name>
          , Byungyeon Kang, and
          <string-name>
            <given-names>Junwoo</given-names>
            <surname>Lee</surname>
          </string-name>
          .
          <article-title>"Perceptual image quality assessment with transformers."</article-title>
          <source>In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition</source>
          , pp.
          <fpage>433</fpage>
          -
          <lpage>442</lpage>
          .
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>You</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Korhonen</surname>
          </string-name>
          ,
          <article-title>"Transformer For Image Quality Assessment,"</article-title>
          <source>2021 IEEE International Conference on Image Processing (ICIP)</source>
          , Anchorage,
          <string-name>
            <surname>AK</surname>
          </string-name>
          , USA,
          <year>2021</year>
          , pp.
          <fpage>1389</fpage>
          -
          <lpage>1393</lpage>
          , doi: 10.1109/ICIP42928.
          <year>2021</year>
          .
          <volume>9506075</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Patel</surname>
          </string-name>
          et al.,
          <article-title>"An Improved Dense CNN Architecture for Deepfake Image Detection,"</article-title>
          <source>in IEEE Access</source>
          , vol.
          <volume>11</volume>
          , pp.
          <fpage>22081</fpage>
          -
          <lpage>22095</lpage>
          ,
          <year>2023</year>
          , doi: 10.1109/ACCESS.
          <year>2023</year>
          .
          <volume>3251417</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Heidari</surname>
            , Arash, Nima Jafari Navimipour, Hasan Dag, and
            <given-names>Mehmet</given-names>
          </string-name>
          <string-name>
            <surname>Unal</surname>
          </string-name>
          .
          <article-title>"Deepfake detection using deep learning methods: A systematic and comprehensive review."</article-title>
          <source>Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery</source>
          <volume>14</volume>
          , no.
          <issue>2</issue>
          (
          <year>2024</year>
          ):
          <fpage>e1520</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Tran</surname>
          </string-name>
          ,
          <string-name>
            <surname>Van-Nhan</surname>
          </string-name>
          ,
          <string-name>
            <surname>Suk-Hwan</surname>
            <given-names>Lee</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hoanh-Su Le</surname>
          </string-name>
          , and
          <string-name>
            <surname>Ki-Ryong Kwon</surname>
          </string-name>
          .
          <year>2021</year>
          .
          <article-title>"High Performance DeepFake Video Detection on CNN-Based with Attention Target-Specific Regions and Manual Distillation Extraction"</article-title>
          <source>Applied Sciences</source>
          <volume>11</volume>
          , no.
          <volume>16</volume>
          : 7678. https://doi.org/10.3390/app11167678
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Pitsun</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Poperechna</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Savanets</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Melnyk</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Halunka</surname>
            ,
            <given-names>B. Comparative</given-names>
          </string-name>
          <article-title>Analysis of CNN Architecture for Emotion Classification on Human Faces</article-title>
          .
          <source>Ceur Workshop Proceedings</source>
          ,
          <year>2024</year>
          ,
          <volume>3716</volume>
          , pp.
          <fpage>46</fpage>
          <lpage>55</lpage>
          https://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>3716</volume>
          /paper4.pdf
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>O.</given-names>
            <surname>Berezsky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Pitsun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Dubchak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Liashchynskyi</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Liashchynskyi</surname>
          </string-name>
          ,
          <article-title>"GPU-based biomedical image processing," 2018 XIV-th International Conference on Perspective Technologies and Methods in MEMS Design (MEMSTECH), Lviv</article-title>
          , Ukraine,
          <year>2018</year>
          , pp.
          <fpage>96</fpage>
          -
          <lpage>99</lpage>
          , doi: 10.1109/MEMSTECH.
          <year>2018</year>
          .
          <volume>8365710</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Le</surname>
          </string-name>
          , Trung- -face Forgery Detection and Segmentation In-thehttps://doi.org/10.5281/zenodo.5528418.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Berezsky</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pitsun</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Melnyk</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          , ...
          <string-name>
            <surname>Derysh</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liashchynskyi</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Application Of MLOps Practices For Biomedical Image</surname>
          </string-name>
          Classification - Ceur
          <source>Workshop Proceedings</source>
          ,
          <year>2022</year>
          ,
          <volume>3302</volume>
          , pp.
          <fpage>69</fpage>
          <lpage>77</lpage>
          https://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>3302</volume>
          /short3.pdf
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>