1. Introduction
The main goal of fuzzy systems is to define and control sophisticated processes by incorporating and taking advantage of human knowledge and experience. Nowadays, fuzzy logics are widely used in industry for various applications ranging from cameras to cement kilns, trains, and vacuum cleaners [
1]. Furthermore, deblurring techniques have versatile applications and they are either performed in spatial [
2] or frequency domains [
3,
4,
5]. Hosseinzadeh [
6] modeled the electron beam (EB) measurement process with a linear motion blur and evaluated three of the well-established deblurring techniques for EB restoration. In this study [
6], Hosseinzadeh used a Weiner inverse filter and blind Richardson-Lucy deconvolutions to restore the EB distribution and correct the measurements through deblurring. A simple motion blur is formulated in Equation (1).
where in the spatial domain,
,
,
, and
are the ground truth signal (EB distribution) of length
, degraded signal (measurement from probe), point spread function (PSF) of length
, and noise respectively. Their frequency domains are represented by uppercase letters
, and
. In the case of electron beam measurements, the ground truth signal is the distribution of EB and the degraded signal is the measurement acquired from the probe. The electron absorption of a slit or wire probe of size
is modeled with a PSF kernel [
6].
Linear motion blur point spread function has two distinct characteristics of motion direction and length (
) [
7]. The PSF is known for having harmonically spaced vanishing magnitudes in the frequency domain due to its limited length in the spatial domain [
8]. There are several approaches to estimate
such as log power spectrum, cepstrum, bispectrum, and pitch detection algorithms. In image deblurring jargon, it is assumed that the frequency spectrum of
is smooth and does not contain vanishing frequencies, hence any vanishing frequencies in
are associated to
[
9,
10]. However, this assumption usually does not hold for EB measurements, especially where the
is in the same order of
. This similarity makes it complicated to distinguish between
and
and therefore compromises the deblurring process by an incorrect detection of null frequencies. Such an erroneous deblurring process is likely to produce an incorrect but convincing result, notably when
and
have remarkable cross-correlation. This ambiguity is likely to happen in EB measurements, because: (a)
and
are usually in the same order of magnitude and they have relatively high cross-correlation; and (b) the
can be inconsistent. In Reference [
6], a prior knowledge of
is used to estimate the position of null frequency of
from the spectrum analysis of
. Hosseinzadeh limited the spectrum of
to ±15% of the nominal
by applying a window to its log-power spectrum, thereby ignoring vanishing frequencies outside of this interval. This algorithm is available in Reference [
11]. This strategy relies on knowing the
. Therefore, it is a good approach when it is known accurately. There are a few limitations with this method due to the varying nature of
during the calibration and measurement process. As a result, the beam’s vanishing frequency (or its harmonics) can be located within the applied window and cause a false detection. Furthermore, if the inaccuracy of
is more than 15%, the null frequency of
is ignored by the window resulting in an erroneous restoration. In addition, any inaccuracy of more than ±15% cannot be compensated.
One solution to effectively address this uncertainty is to use fuzzy systems. Fuzzy inference systems are widely used to address instrumental uncertainties. A comprehensive review and explanation of fuzzy inference systems are provided in Reference [
12].
It is known that a wrong estimation of
can lead to drastic noise-like errors in the restorations [
13]. Furthermore, utilizing deblurring techniques for industrial purposes requires real-time, reliable, and unsupervised methods. To satisfy these requirements, this article proposes a Wiener filter that is monitored by a fuzzy inference system. A Wiener filter is selected due to its simplicity, real-time execution, and superior performance in the restoration of linear motion blur [
6]. The fuzzy inference system deals with the uncertainty of the deconvolution by monitoring the entire restoration process. This FIS is comprised of three crisp inputs that included the PSF length or probe size (
) deviation, attenuation of the vanishing frequencies, and deconvolution residue.
However, probe size deviation is an optional input, which is based on a previous rough knowledge of
. If
is roughly known, it serves as a reference point from which the PSF length deviation is calculated. Therefore, unlike Reference [
6], prior knowledge of
does not limit the inaccuracy compensation to ±15%. It is demonstrated in Reference [
6] that the spatial domain of
has a sharper transition compared to the EB distribution (
). This is due to the semi-Gaussian distribution of
compared to
. Therefore, vanishing frequencies of
are expected to have higher attenuation or lower magnitude compared to
. Hence, the normalized magnitude of the detected null frequencies in
are the second crisp input to the fuzzy inference systems. The last input of the system is the quantified deblurring artifacts that are introduced during the restoration of
from
. The restored beam distributions are denoted as (
). These residual artifacts are inevitable and they increase as the
deviates from its mathematical definition. Extraction of residues from
is explained in section II. The output of the fuzzy system (
) is defuzzified to represent the quality of the restorations. This output is generated based on the definition of the fuzzy rules that are explained in the next section.
The rest of this paper is arranged as follows:
Section 2 illustrates the details of FIS implementation. This includes specifying the crisp inputs and fuzzifying them, defining the membership functions, and formulating the fuzzy sets. The section continues by identifying the fuzzy rules and making an inference to generate the output.
Section 3 presents the practical results of the proposed method and the ability of the system to distinguish the correct deblurring results. The values of membership functions parameters are provided and a comparison is made between implementing the fuzzy system with and without the knowledge of probe size (
).
2. Modeling and Implementation
As mentioned, when there is similarity between and it is difficult to discriminate between their null frequencies just by looking at . This introduces an uncertainty and makes it hard to decide which null frequency belongs to the probe () because null frequencies can belong to either beam () or probe (). To address the uncertainty of unsupervised detection, all the null frequencies in are identified and only the first two nulls with lowest frequencies are extracted while avoiding the harmonics. This implies that a maximum of two null frequencies () are to be extracted from . There are three possibilities based on the extracted number of null frequencies: (a) If no null frequency is detected due to , then motion blur effect is negligible and deconvolution is not necessary; (b) if a single null frequency is detected as a result of , then the deconvolution can progress without involving the fuzzy system as the null frequency belongs to ; (c) in case two null frequencies are extracted (, two deconvolutions are performed where each of the deconvolutions are performed by adjusting their corresponding (). This is done because both and could be belonging to of different sizes.
The FIS is defined with three merits to grade the deblurrings. Deblurrings are performed by two individual Weiner filters that use and resulting in and respectively. The fuzzy system produces a single crisp output deconvolution grade () for each restoration. The restoration process that produces a higher is then chosen as the correct process with its corresponding being the correct probe size (). A single layer (non-hierarchal) fuzzy inference system of three inputs and a single output is designed to evaluate the overall deblurring process. These inputs are: PSF length deviation, null frequency magnitude, and residue, and the deconvolution grade is the only output. These inputs and the output are explained in detail as follows.
2.1. PSF Length Deviation
As mentioned,
and
are extracted to accurately adjust the
during the restoration process. By having rough prior knowledge of the probe size (
) and the estimated sizes (
) from
, we can define PSF length deviation as the distance between the expected and the estimations (
). This definition converges to zero if the estimation is close to the prior knowledge, whereas it increases if
is deviated from
. Two fuzzy sets (
&
) with membership functions of
and
are defined to account for the probe inaccuracy and assign a degree of membership to each
based on its deviation from
. Membership functions are defined by polynomial-Z (zmf) and polynomial-S (smf). The
fuzzy set definition and its membership function is formulated in Equation (2). A thorough evaluation of fuzzy membership functions are provided in Reference [
14].
where
and
are the membership function parameters that are found heuristically through analysis of several measurements.
2.2. Null Frequency Magnitude
The second input of the fuzzy system is the magnitude of the extracted null frequencies. This is extracted from the normalized log-power spectrum of
and has a dynamic range of 0 to 1 dB, demonstrated in
Figure 1.
As explained,
is most likely to have rapid spatial transitions compared to
. This implies that
is likely to have the nulls with higher attenuation in
(nulls with lower magnitude). As a result, two fuzzy sets (
&
) with membership functions of
and
are defined to assign a higher membership value to the nulls with more attenuation (or lower magnitude), whereas a lower degree of membership is assigned to less attenuated (higher magnitude) nulls. Membership functions are defined with zmf and sfm.
is formulated in Equation (3), where
is the normalized frequency spectrum of the degraded signal
and
and
are the membership function parameters.
membership function definition is similar to
as they are both defined by smf.
2.3. Deconvolution Artifact Residues
Deconvolutions are performed using the Wiener inverse filtering process in Equation (4).
where in the frequency domain,
is the restored ground truth signal and
is the signal-to-noise ratio. After the deconvolutions,
has shorter lengths in spatial domain compared to
. We first normalized
and both of the restorations (
) between
,
is then shifted so its minimum is matched with the minimums of each
in the spatial domain to obtain
. Finally, every restoration residue (
) is quantified as in Equation (5).
The deconvolution process using both of the extracted PSFs and their corresponding residues are showed in
Figure 2. The deconvolution was performed with a Wiener inverse filter, where
is formulated in Equation (6).
Two fuzzy sets ( and ) are defined with membership functions of and using zmf and smf respectively, where the overall shape of the functions is determined by and . These functions are designed to assign a higher degree of membership to the that produces a smaller number of residues after restoration.
2.4. Deconvolution Grade
All the combinations of the aforementioned inputs are used to form eight if–then rule statements with different weights. These statements, with their corresponding weights, are provided in
Table 1. Fuzzy AND operator is then used for the implication of the fuzzy consequences.
Rule weight is added to scale the consequences and account for the certainty of the rules. The consequence is the restoration quality with two fuzzy sets
and membership functions of
and
respectively defined by smf and zmf. Aggregations of the rules are performed by using a Zadeh T-norm and defuzzifications are carried out by mean of maximum (MoM) method [
15]. The resulting crisp values are the deconvolution grades
. Therefore, there is a grade
for each deconvolution. In other words, for each
that is deblurred by its corresponding
, there is an overall grade of restoration
. According to the definition of the consequence membership functions, a greater value of
represents a better restoration and, on the contrary, a lower value of
represents a possible erroneous process, (
is ranging from 0 to 1). With this proposed system, if by mistake
is used instead of
in the formation of the
(Equation (6)), then the resulting
will be lower. Overall,
and
are used comparatively to determine and select the best restoration between
and
that are emerged from restoring a degraded sample (
). This proposed system and its overall restoration processes are demonstrated in
Figure 3.
4. Conclusions and Discussion
The algorithm showed superior performance when a rough prior knowledge of was provided for the fuzzy inference system. The was greater than 0.5 thereby clearly identifying and segregating the correct deconvolution process. The algorithm was also tested without including the PSF knowledge, in which case was in the interval of 0.1 to 0.5, which was enough to confidently separate the correct deconvolution process.
Figure 6 depicted a special case where
had a null frequency at
= 120 kHz with a normalized magnitude of 0.09 dB, whereas,
null was at
= 170 kHz with a magnitude of 0.02 dB and had four times higher attenuation. Although
had a magnitude that was in its favor, the PSF deviation of 0.51 was not, yet the PSF deviation outweighed its low magnitude and the correct restoration was successfully distinguished with 14% separation in the deconvolution grades (
= 0.14). This high attenuation of
was most likely due to it being closer to the second harmonic of
and, therefore, it experienced further attenuation. Nevertheless, owing to the FIS implementation, the correct restoration process was identified. All the possible rules were considered for the implementation of this FIS and its tuning was performed heuristically by an expert. However, clustering algorithms could be used for FIS with multiple inputs and membership functions to determine the optimum number of rules. Furthermore, adaptive FISs can be used to automate the tuning and learning process of the FIS in a more complicated and complex scenario.