<?xml version="1.0" encoding="utf-8"?>
<journal>
<title>Biannual Journal Monadi for Cyberspace Security (AFTA)</title>
<title_fa>امنیت فضای تولید و تبادل اطلاعات (منادی)</title_fa>
<short_title>منادی</short_title>
<subject>Engineering &amp; Technology</subject>
<web_url>http://monadi.isc.org.ir</web_url>
<journal_hbi_system_id>1</journal_hbi_system_id>
<journal_hbi_system_user>admin</journal_hbi_system_user>
<journal_id_issn>2476-3047</journal_id_issn>
<journal_id_issn_online>2476-3047</journal_id_issn_online>
<journal_id_pii>8</journal_id_pii>
<journal_id_doi>7</journal_id_doi>
<journal_id_iranmedex></journal_id_iranmedex>
<journal_id_magiran></journal_id_magiran>
<journal_id_sid>14</journal_id_sid>
<journal_id_nlai>8888</journal_id_nlai>
<journal_id_science>13</journal_id_science>
<language>fa</language>
<pubdate>
	<type>jalali</type>
	<year>1404</year>
	<month>12</month>
	<day>1</day>
</pubdate>
<pubdate>
	<type>gregorian</type>
	<year>2026</year>
	<month>3</month>
	<day>1</day>
</pubdate>
<volume>14</volume>
<number>2</number>
<publish_type>online</publish_type>
<publish_edition>1</publish_edition>
<article_type>fulltext</article_type>
<articleset>
	<article>


	<language>fa</language>
	<article_id_doi></article_id_doi>
	<title_fa>روشی نوین در آموزش مدل‌های مبتنی بر انرژی به منظور تصفیه کارآمدتر تصاویر خصمانه</title_fa>
	<title>A novel method for training energy-based models for eﬀicient purification of adversarial images</title>
	<subject_fa>رمز و امنیت اطلاعات</subject_fa>
	<subject>Cryptology and Information Security</subject>
	<content_type_fa>پژوهشی</content_type_fa>
	<content_type> Research Article</content_type>
	<abstract_fa>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br&gt;
&lt;span dir=&quot;RTL&quot; lang=&quot;AR-SA&quot; style=&quot;font-size:11.0pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span arial=&quot;&quot; style=&quot;font-family:&quot;&gt;کاربردهای یادگیری عمیق به&#8204;سرعت در حال گسترش هستند. با این حال، در حوزه&#8204;های حساسی مانند امنیت و سلامت، حملات خصمانه - که در آن اغتشاشات جزئی در ورودی، باعث افت شدید عملکرد مدل می&#8204;شوند - همچنان مانعی جدی برای پذیرش این کاربردها هستند. مدل&#8204;های مولد با توانایی یادگیری توزیع داده&#8204;ها، گزینه&#8204;هایی امیدوارکننده برای بازیابی تصویر اصلی از روی نمونه&#8204;های خصمانه در طی فرآیندی به نام تصفیه هستند. در این مقاله روندی جدید برای تصفیه پیشنهاد می&#8204;دهیم که در آن مدل مبتنی بر انرژی &lt;em&gt;M&lt;sub&gt;p&lt;/sub&gt;&lt;/em&gt;، پیش از طبقه&#8204;بند&amp;nbsp;&lt;em&gt;M&lt;/em&gt; به&#8204;کار می&#8204;رود. برخلاف رویکردهای قبلی و برای اولین بار، &lt;em&gt;M&lt;sub&gt;p&lt;/sub&gt;&lt;/em&gt;&amp;nbsp;به&#8204;گونه&#8204;ای آموزش می&#8204;بیند که به نمونه&#8204;های خصمانه &lt;em&gt;M&lt;/em&gt;&amp;nbsp;(نمونه&#8204;های منفی در آموزش )، انرژی بالا (احتمال پایین) اختصاص دهد. بر اساس نتایج، روش ما در برابر نمونه&#8204;های خصمانه، دقت مقاوم بالاتری نسبت به مدل تصفیه&#8204;ی استاندارد&amp;nbsp;&lt;em&gt;M&lt;sub&gt;p&lt;/sub&gt;&lt;/em&gt; داشته و بهبودهایی به میزان %12.3، %22.87 و %12.30 روی&amp;nbsp; پایگاه&#8204;های داده MNIST، FashionMNIST و CIFAR10 تحت AutoAttack&amp;nbsp;(L&lt;sub&gt;&amp;infin;&lt;/sub&gt;) نشان داده است. همچنین با وجود سادگی فرآیند آموزش، روش ما روی پایگاه داده CIFAR10 نسبت به یک مدل پیشرفته مبتنی بر انرژی، بهبودی معادل %3 در دقت مقاوم نشان می&#8204;دهد. افزون&#8204;بر این، یک حمله&#8204;ی وفقی نیز طراحی کرده&#8204;ایم که دفاع ما را هدف قرار می&#8204;دهد و نشان می&#8204;دهیم&amp;nbsp;&lt;em&gt;M&lt;sub&gt;p&lt;/sub&gt;&lt;/em&gt; همچنان قادر به خنثی&#8204;سازی آن است.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</abstract_fa>
	<abstract>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;The applications of deep learning are rapidly expanding, and neural networks have demonstrated remarkable performance across a wide range of tasks, including computer vision, natural language processing, autonomous driving, and others. However, deploying these networks in safety- and security-critical applications still faces serious challenges. In general, these challenges fall within the domain of &lt;i&gt;trustworthy machine learning&lt;/i&gt;. Trustworthiness challenges can be categorized into several classes. In this paper, we focus on one of the most critical issues, adversarial attacks, and propose a defensive method to mitigate them.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;Adversarial attacks involve the addition of carefully crafted, extremely small perturbations that are imperceptible to humans, yet cause classifiers to misclassify inputs at test time. These attacks are particularly dangerous because the adversary does not require access to the training data, and they can significantly degrade the performance of state-of-the-art classifiers, in some cases reducing accuracy to near zero.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;To counter these attacks, various defense strategies have been proposed, which can generally be divided into certified and empirical defenses. Certified defenses provide mathematical guarantees that the predicted label remains unchanged under bounded perturbations. In contrast, empirical defenses do not offer formal guarantees and instead rely on heuristic or practical techniques to mitigate attacks. Despite the lack of provable guarantees, empirical defenses are more numerous and often demonstrate stronger robustness in practice. This category includes methods such as input transformation, architectural modification, training procedure modification, and the use of auxiliary models.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;In input transformation&amp;ndash;based defenses, an adversarial image is first denoised by a defense mechanism, and the purified image is then passed to the classifier for prediction. Generative models, due to their strong capability to capture the underlying data distribution, are well-suited for image purification. They can map adversarial examples back toward the true data manifold, thereby removing adversarial noise. Consequently, most generative-model-based defenses are categorized under input transformation&amp;ndash;based defense methods.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;A class of generative models known as energy-based models (EBMs) can be employed as effective tools for purifying adversarial images. Although these models do not allow for exact computation of the probability of an individual input, they enable comparison between the relative likelihoods of different inputs. This property makes it possible to identify a trajectory along which the input can be iteratively modified so as to increase its likelihood under the model.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;When the input to an energy-based model is pure noise, maximizing its likelihood corresponds to generating a realistic image. Ideally, when the input is an adversarial example, increasing its likelihood is equivalent to removing adversarial perturbations and reconstructing a clean image from the adversarial one. It is expected that such a purified image will then be correctly classified by the classifier.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;Achieving effective denoising requires proper training of the energy-based model. Various methods have been proposed for training such models, one of which is contrastive divergence. In this approach, the training process starts from a random distribution, and at each iteration, a batch of real data samples and a batch of fake (model-generated) samples are selected. The model is then trained to increase the probability (decrease the energy) assigned to real data while decreasing the probability (increasing energy) assigned to fake data. Since the total probability mass of the distribution must remain constant, these increases and decreases must be balanced. After several effective training iterations, the model learns an accurate approximation of the true data distribution. As a result, it becomes capable to both generate samples from this distribution and remove adversarial perturbations from adversarial images.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;In practice, contrastive divergence in its standard form is not a suitable training strategy for an energy-based model intended for adversarial denoising. The reason is that each purification step requires computing the gradient between an adversarial image and its corresponding clean image. However, since adversarial examples are extremely close to clean images, the resulting gradient is very small. Consequently, the purification process becomes slow and ineffective, failing to achieve sufficient denoising within a reasonable number of steps or time.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;In the method proposed in this paper, adversarial examples generated by a classifier using AutoAttack (one of the most powerful and widely applicable adversarial attacks) are incorporated into the set of fake samples during training. As a result, the energy-based model learns to identify these adversarial examples as low-probability samples and becomes more familiar with the structure of adversarial perturbations. This enhanced exposure enables the model to remove adversarial noise more effectively during the purification phase, leading to improved defensive performance. Under this formulation, the gradient of the probability distribution between clean and adversarial images becomes larger, allowing the purification process to proceed more efficiently and effectively.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;Several factors can influence the quality of the purification process, including the proportion of adversarial samples included in the fake batch and the number of purification steps. In addition to robust accuracy, the impact of these factors on clean accuracy must also be carefully evaluated, as prior studies have shown that these two metrics often exhibit a trade-off: improving one may lead to degradation in the other.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;According to empirical findings, increasing the proportion of adversarial examples in the fake batch, as well as increasing the number of purification steps, has a positive effect on improving robust accuracy. As expected, increasing the number of purification steps requires injecting more noise into the image during the purification process, which in turn leads to a reduction in clean accuracy. However, experimental results indicate that this reduction is smaller compared to standard training of the energy-based model without adversarial examples. This observation suggests that the proposed training strategy not only improves robust accuracy but also preserves higher clean accuracy relative to conventional energy-based model training.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;Experimental results demonstrate that our approach achieves significantly higher accuracy against adversarial examples compared to a standardly trained purification model. Specifically, under the AutoAttack infinity norm benchmark, our method improves robust accuracy by 12.31%, 22.87%, and 12.30% on the MNIST, FashionMNIST, and CIFAR-10 datasets, respectively. Moreover, despite employing a simpler training procedure, our approach surpasses a state-of-the-art energy-based model on CIFAR-10 by 3% in terms of robust accuracy.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;In this paper, in addition to the proposed defense method, an adaptive attack targeting energy-based model is also introduced. The core idea of this attack is that both the purification process in an energy-based model and the attack process against a classifier operate by introducing perturbations. If these perturbations are aligned, a successful attack can be achieved.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;In this scenario, the applied perturbation simultaneously increases the likelihood of the image under the energy-based model while strengthening the attack against the classifier. As a result, the attacked image is assigned a high probability by the energy-based model rather than being identified as a low-probability sample. Consequently, the model no longer attempts to purify the image.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;To achieve this, the perturbation used by the energy-based model during purification is explicitly incorporated into the attack process. In the proposed adaptive attack, one attack step is first performed, followed by one purification step using the energy-based model. The perturbation applied during purification is then scaled by a predefined coefficient and added to the perturbation computed by the classifier for the subsequent attack step. The next attack iteration is then carried out accordingly.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;By injecting the purification perturbation into the attack, the resulting image is assigned a high likelihood by the energy-based model, effectively disabling further purification. Repeating this process over multiple iterations results in a strong and effective adaptive attack.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;According to prior studies, adversarial examples generated against robust architectures, i.e., models equipped with defense mechanisms, exhibit an interesting property known as &lt;b&gt;Perceptually Aligned Gradient&lt;/b&gt;. Under this property, adversarial images tend to visually resemble the target class specified by the attacker. This characteristic was examined and confirmed for the adversarial examples produced by the proposed adaptive attack.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-size:11.0pt&quot;&gt;&lt;span style=&quot;line-height:107%&quot;&gt;&lt;span calibri=&quot;&quot; style=&quot;font-family:&quot;&gt;In the presented attack method, no explicit constraint is imposed on the magnitude of the added perturbation, which allows the resulting adversarial examples to reduce the classifier&amp;rsquo;s robust accuracy to nearly zero. However, since each dataset defines a permissible perturbation budget, constraining the perturbation to a standard bound enables the defense method to fully neutralize the attack.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</abstract>
	<keyword_fa>قابلیت اعتماد, حملات خصمانه, مدل‌های مبتنی بر انرژی, تصفیه تصاویر خصمانه, گرادیان قابل درک ترازشده</keyword_fa>
	<keyword>Trustworthiness, Adversarial Attacks, Energy Based Models, Adversarial Purification, Perceptually Aligned Gradient</keyword>
	<start_page>82</start_page>
	<end_page>97</end_page>
	<web_url>http://monadi.isc.org.ir/browse.php?a_code=A-10-407-14&amp;slc_lang=fa&amp;sid=1</web_url>


<author_list>
	<author>
	<first_name>Reza</first_name>
	<middle_name></middle_name>
	<last_name>Hajimohammadi Tabriz</last_name>
	<suffix></suffix>
	<first_name_fa>رضا</first_name_fa>
	<middle_name_fa></middle_name_fa>
	<last_name_fa>حاجی محمدی تبریز</last_name_fa>
	<suffix_fa></suffix_fa>
	<email>reza_hajimohammadi@ee.sharif.edu</email>
	<code>10031947532846002115</code>
	<orcid>10031947532846002115</orcid>
	<coreauthor>No</coreauthor>
	<affiliation>Department of Electrical Engineering, Sharif University of Technology, Tehran, Iran</affiliation>
	<affiliation_fa>دانشکده برق، دانشگاه صنعتی شریف، تهران، ایران</affiliation_fa>
	 </author>


	<author>
	<first_name>Sajjad</first_name>
	<middle_name></middle_name>
	<last_name>Amini</last_name>
	<suffix></suffix>
	<first_name_fa>سجاد</first_name_fa>
	<middle_name_fa></middle_name_fa>
	<last_name_fa>امینی</last_name_fa>
	<suffix_fa></suffix_fa>
	<email>s_amini@sharif.edu</email>
	<code>10031947532846002116</code>
	<orcid>10031947532846002116</orcid>
	<coreauthor>Yes
</coreauthor>
	<affiliation>Electronics Research Institute, Sharif University of Technology, Tehran, Iran</affiliation>
	<affiliation_fa>پژوهشکده الکترونیک، دانشگاه صنعتی شریف، تهران، ایران</affiliation_fa>
	 </author>


	<author>
	<first_name>Reza</first_name>
	<middle_name></middle_name>
	<last_name>Kazemi</last_name>
	<suffix></suffix>
	<first_name_fa>رضا</first_name_fa>
	<middle_name_fa></middle_name_fa>
	<last_name_fa>کاظمی</last_name_fa>
	<suffix_fa></suffix_fa>
	<email>reza.kazemi@sharif.edu</email>
	<code>10031947532846002117</code>
	<orcid>10031947532846002117</orcid>
	<coreauthor>No</coreauthor>
	<affiliation>Electronics Research Institute, Sharif University of Technology, Tehran, Iran</affiliation>
	<affiliation_fa>پژوهشکده الکترونیک، دانشگاه صنعتی شریف، تهران، ایران</affiliation_fa>
	 </author>


</author_list>


	</article>
</articleset>
</journal>
