Self-Organized Maps and High-Frequency Image Detail for MRI Image Enhancement

Magnetic resonance imaging (MRI) is a medical technology that uses powerful magnets, radio waves, and a computer to produce images of the body’s internal organs. The patient should be quiet and motionless during the scanning period, as unavoidable movements, such as breathing and heart rate, cause motion artifacts in the image, which cause contrast instability and low-resolution MRI images. Imaging in the clinical setting is performed at low resolution because the scanning time for high-resolution MR imaging would be very long and cumbersome, and imaging is also very expensive. Learning-based image superresolution methods can reconstruct MR images with optimal quality and resolution. However, these methods have problems such as the inability to find the intrinsic relationship between low- and high-resolution image patches in the training dictionary, specification of the proper amount of error in the training and testing stage due to variability in MR image contrast, inability to reconstruct objects by smoothed edges, and use of the backpropagation method in updating their weight vectors. In this paper, we propose a new superresolution method according to competitive learning-based approaches to overcome the problems of previous superresolution methods, which do not have the problems and complexities of those methods. The proposed method includes self-organizing maps as a preprocessor, the nearest neighbor algorithm as a classifier, and a high-frequency filter as a high-frequency image detail extractor. We constructed a single external dictionary from a combination of low-resolution and high-resolution feature patches and trained our SOM network. Next, we reconstruct the high-resolution image by converting the low-resolution input image into feature patch vectors, and for each vector, we find all corresponding neurons in the network and retrieve all their training feature vectors. Next, we train the nearest neighbor algorithm with the recovered vectors plus the input vector and find the best similarity vector to the input vector. After finding all the best similarity vectors to the input vectors, we reconstruct our high superresolution image. The proposed image superresolution method in practical experiments was trained, tested, and evaluated by the Div2k dataset and compared with other traditional and state-of-the-art image enhancement methods on various datasets, such as SET5, SET14, BSDS100, and URBAN100, and presented better results with higher accuracy and quality than traditional and state-of-the-art methods, both visually compared to each other by human and computational benchmarks, such as the peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM), to compare image superresolution algorithms. This method is best for reconstructing high-resolution magnetic resonance images that require high-frequency details and sharp edges with a smooth slope of the imaging objects in their structures. The execution time of the proposed algorithm is slower than that of the other algorithms, so we use GPU hardware and parallel programming techniques to increase the algorithm speed.


I. INTRODUCTION
Magnetic resonance imaging (MRI) is a noninvasive diagnostic test that takes detailed images of the body's soft tissues.
The associate editor coordinating the review of this manuscript and approving it for publication was Yongjie Li. Images are generated using a magnetic field, radio waves, and a computer, unlike X-rays or CT scans. This test allows physicians to view the brain or spine as sliced layers and take a live picture of the target layer. They use these images and analyze them to identify tumors, strokes, and spinal discs [1]. MRI technology provides different information than other medical imaging techniques. The main advantages of MRI are that it can characterize and distinguish tissues based on their biochemical and physical properties, such as water, fat, iron, and extravascular blood, and their degradation products [2]. Imaging is performed at a low resolution because the scan time for high-resolution MRI images would be very long and impractical, and imaging is also expensive [3]. However, MRI systems cannot achieve sufficient sampling density in their images due to acquisition constraints, such as limited acquisition time or unavoidable movements, such as breathing and heart rate, which cause motion artifacts in the pictures. There are several different approaches to increasing the overall resolution of MRI scans. Hardware enhancements directly increase the resolution of acquired images, for example, by increasing the number of coil receiver channels, increasing the main magnetic field passing through the MRI core, and increasing the MRI signal [2], [4]. These methods are very efficient in reconstructing MRI images with good quality and fast scan time in clinical applications, but the upgrade of MRI hardware is physicsbased, which leads to a long cycle time to realize its technological innovation and has a very high cost. Independent of hardware enhancements, postacquisition image processing techniques, such as image superresolution, are also used to increase the resolution of MRI images. They have the advantage that they can be applied on all MRI machinery and in many practical applications without the need to purchase new hardware equipment. The main advantage of superresolution imaging methods based on soft image processing techniques is their ability to reconstruct high signal-to-noise ratios and high-resolution object representations, which, due to object motion, limited sampling time, or signal-to-noise ratio considerations, can only be achieved at low resolution. Image superresolution is an IL-posed problem because many high-resolution(HR) images can produce the same low-resolution(LR) image. This problem can be solved by assuming that the high-frequency information and details of neighboring pixels are enough to recover the high-frequency information of the lost pixel by downsampling [1]. In recent years, several image superresolution algorithms have been introduced to improve the quality and resolution of natural and medical images [5]. These existing image superresolution methods can be classified into three main categories: interpolation-based methods, reconstruction-based methods, and learning-based methods [6]. Interpolation-based methods are usually based on signal processing methods. They explore the relationship of pixel values within a single-image neighborhood and then predict subpixels based on these selected pixels. These superresolution imaging methods are very fast and do not have much computational complexity [7]- [9]. However, these traditional methods often result in excessive smoothing and do not introduce more high-frequency and edge information into the new image. They usually produce images with various effects along object boundaries, such as aliasing, blurring, and zigzag edges [10].
Reconstruction-based algorithms reconstruct high-resolution images by modeling the image creation sequence and usually create a linear system for image reconstruction [11], [12]. These methods are better than interpolation techniques in many image enhancement applications, and their performance for reconstructing a high-resolution image is good. However, the computational cost of this approach is very high, the convergence time is slow, the real-time efficiency is not high, and the image quality decreases as the scale factor increases. In such cases, the result may be too smooth with a lack of significant detail at high frequencies. Example-based methods use the relationships between low-resolution image patches and high-resolution image patches as prior superresolution information. These methods can restore high-resolution images with sharp edges with reasonable computational cost by learning the statistical relationships between the low-resolution and high-resolution image patches from a large training dataset [13]. In 2000, Baker and Kanade [14] and Freeman et al. [13] separately recommended image enhancement algorithms based on patch dictionaries.
In the example-based method, the main idea is to learn the corresponding relationship between low-resolution (LR) patches and high-resolution (HR) patches in a dataset and then select the most suitable HR patches in the dictionary for each input patch (LR) as a result of the reconstruction. Freeman and Pasztor used their proposed method and split an entire image into multiple overlapping image patches. After that, they searched the dictionary for the low-resolution image patches that most nearly matched the low-resolution input patch. Next, they used the corresponding high-resolution patches to construct a Markov random field. Next, they obtained the high-resolution image by solving the Markov random fields. In 2004, Chang et al. [15] proposed the neighbor embedding method for image enhancement, in which each input low-resolution image patch can be represented by a linear combination of a series of image patches within a dictionary neighborhood. This relationship is mapped to the high-resolution space to reconstruct a highresolution image. Example-based superresolution methods usually work well on low-resolution images containing duplicate features and textures; as such, they lack the richness of image structures outside of the input image structure and, therefore, cannot produce a successful representation for other class images [16]. In 2010, Yang et al. [17] proposed a new image superresolution method to improve image resolution and called it the sparse dictionary learning method. The sparse-based method learns an overcomplete dictionary containing only a small number of atoms. This technique identifies the linear combination of the low-resolution dictionary atoms to represent each input patch. Additionally, the high-resolution patch can be reconstructed using the corresponding linear combination of atoms from the high-resolution atom dictionary. This approach is very useful for image reconstruction, and their learning dictionary atoms are concise, but the extracted features and mapping functions are not adaptive, which may not be optimal for generating high-resolution images [18], [19]. Optimizing this method was performed by Zeyde et al. [20] in 2010. It includes training the low-resolution dictionary using the K-SVD method, reduces the computational complexity by using the principal component analysis algorithm, and solves the sparse vector quickly by orthogonal matching analysis. Kang et al. [21] optimized their method in 2015. They suggested learning sparse image representations to model the relationship between low-and high-resolution image patches in terms of the dictionaries learned for image patches with and without blocking artifacts simultaneously. In the new optimization method, image enhancement and deblocking were achieved in simultaneous sparse representation and morphology-based image decomposition. Yang and his research team [22] proposed a new image superresolution method based on redundant compact dictionaries learned from classified samples by K-means clustering to provide each sample with a more appropriate dictionary for image reconstruction. Yang, in 2012, optimized the proposed method by clustering the patterns and training multiple dictionaries according to the geometric similarity of the training patterns and then selecting a dictionary that has a similar geometric structure to the input low-resolution patch to reconstruct the high-resolution image patch [23]. Yang, in 2018, proposed an improved fuzzy clustering and weighted schema reconstruction framework to solve a variety of image structures. In this method, training patches are divided into multiple clusters by jointly learning multiple dictionary pairs with an improved fuzzy clustering method to minimize the error function. Then, highresolution patches are estimated according to several more accurate dictionary pairs [24]. These methods have better performance than previous image superresolution methods. However, these methods cannot find the intrinsic relationship of low-resolution and high-resolution patches, and they cannot reconstruct the edges and borders of objects in an image with a smooth slope. Artificial neural network-based image superresolution approaches were proposed by LeCun and his group in 1989. LeCun's image superresolution method [25] involves a single network that learns the entire recognition operation, from the normalized image of the character to the final classification. This method uses a backpropagation algorithm [26] to train its weight vectors on large image databases. It has been successfully applied to recognizing digits in handwritten zip codes by the U.S. Postal Service. Dong et al. [27] proposed a deep learning method for single-image superresolution in 2014. Their image enhancement method directly learns an end-to-end mapping between the low-resolution and high-resolution images. The mapping is represented as a deep convolutional neural network that takes the low-resolution image as input and produces a high-resolution image as output. This paper attempts to find the intrinsic relationship of low-and high-resolution patches, which in the previous algorithms were inaccessible, and to overcome the dictionary training methods according to the statistical calculation, which has uncertainty in its calculations. Furthermore, to overcome the error criteria-based training methods in the neural network-based image superresolution methods that use backpropagation methods to train their weight vectors, we proposed the new image superresolution method according to the competitive approaches that do not have the problems and complexities of the previous methods.

A. MOTIVATIONS AND CONTRIBUTIONS
The single-image superresolution (SISR) method is one of the most controversial image processing techniques that attempts to acquire high-resolution (HR) images from lowresolution (LR) images by estimating and approximating all missing high-frequency details such as magnetic resonance images, which need high-frequency details and sharp edges with a smooth slope of the image objects in their structures. In this paper, we propose a hybrid single-image superresolution to enhance magnetic resonance imaging (MRI) details by using self-organizing neural maps [28] as a preprocessor, the nearest neighbor algorithm [29] as a classifier and a high-frequency filter as a high-frequency image detail extractor. The proposed image superresolution method uses a single external dictionary to train and reconstruct the high-resolution image. Although our proposed superresolution method is more robust and accurate than most of the previous learning-based methods, since the neural weight vectors are automatically adjusted, there is also no need to perform statistical calculations or manually adjust the error correction of the proposed algorithm parameters. Our method uses the nonparametric k-nearest neighbor algorithm for classification, which classifies feature patch vectors according to their similarity. The edges of the high-resolution image objects are sharpened by a gentle slope, which results in an enhancement of high-frequency image details. We increase the performance and execution speed of the proposed algorithm using CPU-GPU hardware technology and parallel programming. We use CPU hardware and serial programming to create the external dictionary, extract the feature patch vectors and reconstruct the high-resolution output image. In addition, we use GPU hardware and parallel programming to train the self-organizing maps and nearest neighbor algorithm and locate the high-resolution patch vector in the reconstruction stage.
The main contributions of this work are as follows: • The unique external dictionary is built using highand low-resolution feature patch vectors from low-and high-resolution MRI images.
• We construct our self-organizing neural network and define its network parameters and initialize weight vectors by values close to zero. Next, we train our neural network by an external dictionary and store the neuron label and the content of each neuron according to the vector labels in another dictionary.
• We use the low-resolution input MRI image and make it into feature patch vectors, and for each feature patch vector, we locate the best matching neuron in the neural network and retrieve all the feature vectors pertaining to it from the training stage and all these vectors with the input test feature vector used to train the k-nearest neighbor algorithm and locate the best matching vector, which is very similar to the input vector, and retrieve the high-resolution patch from the dictionary. Then, after locating all the high-resolution patches, we reconstruct our high-resolution image.
• We simulate our proposed superresolution method with medical MRI image datasets and ordinary ground-truth datasets and compare the results with other traditional and state-of-the-art image superresolution algorithms for different upscaling factors.
• We use CPU-GPU hardware technology and parallel programming to execute the proposed algorithm and evaluate the performance of GPU hardware technology and parallel programming for increasing the speed and accuracy of the image superresolution algorithms. The remaining chapters of the paper are organized as follows. Section 2 describes the structure of the image model, the self-organizing neural network, and the k-nearest algorithm. Section 3 describes the proposed image superresolution method. Section 4 shows the experimental results on various ground-truth natural and MRI image data datasets to examine the performance of the proposed method. Section 5 is the discussion, and finally, Section 6 is the conclusion.

II. RELATED WORKS
A. FORWARD IMAGING SYSTEM MODEL Modeling the imaging system accurately under mathematical equations is an excellent step toward superresolution and image recognition. The low-resolution image is the result of the warping, blurring, and subsampling performed on the high-resolution image x during the acquisition process. By considering the above effects on modeling the imaging system, the imaging system [30] can be represented by equation (1).
The low-resolution image y ∈ R N is a blurred, warped, and subsampled version of the high-resolution image x ∈ R N , where B, W and D represent the blur, warping, and subsampling matrices, respectively. N is the number of images, and n represents noise. The image superresolution reconstruction approach can be an ill-posed problem due to ill-conditioned defocus operators. Regularization is the procedure adopted to stabilize the inverse of the ill-posed problem. It can be achieved by applying prior knowledge about the solution. There are two types of approaches: the deterministic approach and the stochastic approach. We can formulate the problem of recovering x from y by solving the following optimization problem by using the maximum a posteriori estimation (MAP) approach: Several of the proposed regularization-based superresolution methods incorporate the regularization term in the maximum estimate. Therefore, the superresolution optimization problem can be overwritten by Equation (3), where (Ax) is the regularization term that contains prior information about the desired high-resolution image x, and the parameter λ is the regularization factor that specifies the weight of the regularization term [31].
In this paper, we use the first part of the equation of the superresolution optimization problem through equation (4) to reconstruct the high-resolution image without the regularization part and use the 2-norm to calculate the Euclidean distance.

B. THE ORGANIZATIONAL ARCHITECTURE OF SELF-ORGANIZING MAPS
Self-organizing maps (SOMs) or Kohonen maps are a particular class of artificial neural networks first introduced in the 1980s by Teuvo Kohonen. They are unique types of neural networks that use an unsupervised competitive learning-based approach to update their weight vectors. This network does not learn by stochastic gradient descent (SGD) backpropagation like other artificial neural networks but uses competitive learning. A self-organizing map [32] consists of a set of neurons that are formed in a typical two-dimensional lattice. The number of neurons in a neural network varies depending on the application in which the neural network is used. The self-organizing map has two layers: the first is the input layer, and the second is the output layer or feature map. Unlike other kinds of artificial neural networks, the self-organizing map has no activation function for neurons. Instead, the weights are passed directly to the output layer without any further action. For each neuron in a selforganizing map, the vector of weights has the same dimensionality ''d'' as the input space [33]. The neurons in a lattice of self-organizing maps are each connected by a connection specified by the topology of the neural network, such as the hexagonal lattice constructions illustrated in Figure 1. As mentioned above, the self-organizing map does not use the backpropagation method together with stochastic gradient descent to update the weights, and this type of unsupervised artificial neural network uses competitive learning to update its weights. The competitive learning method is based on three main approaches: competition, cooperation, and adaptation. In the competition stage, each neuron in the self-organizing map is assigned an initial vector of weights with a value close to zero in the same dimensionality as the input space. In this case, each neuron in the output layer has a vector of weights W=[w 1 , w 2 , w 3 , . . . . . . , w d ] with dimensionality ''d''. In each iteration of the training step, the self-organizing map algorithm calculates the distance between each neuron in the output layer and the input sampling data ''X'', and the neuron with the smallest distance is the winner of the competition; then, this winning neuron is called the best matching unit (BMU) according to Equation (6). The best matching unit is the neuron in the neural network whose weight vectors are very similar to the input vector X=[x 1 , x 2 , x 3 , . . . ., x d ]. The Euclidean metric is often used to measure the distance of two vectors by the Equation (5).
During the cooperation stage, when the BMU is successfully located, the self-organizing map algorithm updates the weight vector of the winning neuron during the final adaptation process, but it is not the only one; its neighbors are also updated. We use the neighborhood kernel function to choose the neighboring neurons of the winning neuron in the lattice of the self-organizing map. The neighborhood kernel function depends on the distance between the winning neuron and the other neurons and is inversely proportional: increasing d ( c, i) decreases h(t), the neighborhood radius, which in turn depends on time and decreases as time increases, and this causes the neighborhood kernel function to decrease as well.
In this paper, we use the Gaussian neighborhood function according to Equation (7).
Since the number of neighbors of the winning neuron at each stage of the algorithm implementation, as well as the radius of the neighborhood of the winning neuron in time, is reduced, in this case, the value of the standard deviation of the Gaussian function is considered time-varying according to Equation (8).
The parameter τ 1 is the minimum number of iterations of the SOM-neural network in the training stage. Another parameter that plays a vital role in computing the self-organizing neural network algorithm is the learning rate of the neural network. The learning rate determines how many times we tune the neural network weights. The learning rate after time t, which is almost infinitely positive, converges to zero, so there is no update even for the winning neuron. The parameter τ 2 is the maximum number of iterations of the SOM-neural network in the training stage. The learning rate is estimated from Equation (9).
The weights of the winning neuron and all its neighboring neurons are updated according to equation (10). However, their weight vectors are not updated uniformly. The number of the vector of neuron weights farther away from the input vector is smaller. The trajectory of the winning neuron and its neighbors to the input vector is shown in Figure 2. One of the critical parameters in neural network algorithm calculations is the algorithm stopping condition. The closer the stopping condition is to reality, the more accurate the neural network will be in obtaining results. The stopping condition of the self-organizing network is that any change in the vector of weights is zero, i.e., the vector of weights from the previous stage is equal to the vector of weights computed in the next stage. In this paper, we use the stopping condition of Equation (11) for the training and testing stages of the self-organizing neural network. To train the SOMneural network, samples were chosen as the feature vector of pattern ''X'' from the input datasets, and the neural network algorithm started according to Algorithm (1).  10: end for 11: c ← arg min k d; 12: for k ← 1 to N do 13: 2σ 2 (n) ); 14: for k ← 1 to N do 15: 16: end for 17: end for 18: end for 19: Decrease the η(n) learning rate. 20: Decrease σ (n) neighborhood radius. 21

: end for
To test the SOM-neural network, a random sample is selected as the feature vector of the pattern ''X'' from the input dataset. Then, the distances between it and all the weight vectors of the network are calculated using the Euclidean distance measurement criterion. Then, the unit with the best match is selected using the minimum function, and we use the feature vector of this neuron for classification in the future.

C. THE K-NEAREST NEIGHBOR ALGORITHM STRUCTURE
The nearest neighbor algorithm is a simple and easy-toimplement supervised machine learning approach that may be used to solve classification and regression problems. The supervised machine learning algorithm attempts to learn a function to make predictions from new unlabeled data. Unlike unsupervised learning, the supervised learning method relies on labeled input data to learn a function that produces an appropriate output when new unlabeled data are provided. The k-nearest neighbor algorithm is based on the assumption that similar patterns are close to each other, which means that similar patterns are located near each other. This algorithm involves the concept of similarity, which is sometimes defined in terms of distance, closest similarity, and closest proximity to each other, using mathematics to calculate the distance between points in a data graph. There are many methods for calculating the distance between two points, and depending on the problem we decide to solve, one of them may be preferable. However, the rectilinear distance, also known as the Euclidean distance, is the most popular and well-known option. To choose the correct value of k for our data, we execute the k-nearest neighbor algorithm many times at different values of k and then select the value of k that reduces the number of errors encountered while maintaining the algorithm's ability to make accurate predictions when given data it has not seen before. The ''k'' nearest neighbor algorithm is executed in accordance with the steps described in Algorithm 2. It is important to note that if we decrease the value of k to one, the predictions we make become less stable, and the k-nearest algorithm predicts patterns incorrectly. However, as we increase the value of k, due to majority voting or averaging, our predictions become more stable, allowing us to make more accurate predictions with higher probability to some extent. As time progresses, we see an increasing number of errors. At this point, we know that the value of k has been exceeded. In some cases where a majority decision is made, such as the choice of mode in a sorting problem between labels, we usually make k an odd number to break the tie. The k-nearest-nearest algorithm is uncomplicated and very easy to set up, and there is no need to build a model, make various adjustments or perform additional calculations.
end for 9: end for 10: Sort the ordered collection of d k and indx k from smallest to largest in ascending order by the distances. 11: Select the first k entries from the sorted collection. 12: Get the labels of the selected k entries. 13: Return the mode of the k labels for classification. The k-nearest algorithm is also multipurpose and is used for data sorting, regression, and search algorithms.

III. PROPOSED IMAGE SUPERRESOLUTION METHOD
The proposed image superresolution method for reconstructing high-resolution images uses three stages: feature extraction and dictionary reconstruction, dictionary training, and image reconstruction.

A. FEATURE EXTRACTING AND DICTIONARY RECONSTRUCTION
We create a single overcomplete dictionary D (HL) containing two separate but related fields: the first is the feature patch vector field, which at this point is called a key field, and the second is the high-resolution patch vector, which at this point is called a value field. The procedures for creating an overcomplete dictionary and the associated field values can be seen in Figure 3. Preprocessing procedures for preparing low-resolution images from high-resolution images include several of these steps. In the first step, the best high-resolution images are selected from the high-resolution image dataset, and in the second step, a specific amount of noise is added to each image using a mean kernel to simulate the effects of the probability density function of the imaging system. Finally, the images are converted to low-resolution images with lower quality according to the required magnification factor using downsampling methods. The low-resolution images are individually enlarged to their original high-resolution sizes with the appropriate scaling factor using interpolation methods. Then, each low-resolution image is used in two different parts. In one portion, the low-resolution image is subtracted from the high-resolution input image to extract the details of the high-resolution image. The resulting image is used as the high-resolution image to create high-resolution image patches. In the second portion, the low-resolution image is used to extract the ''high-frequency details'' by passing it through a high-pass filter, and the result is a low-resolution image, which is used to create low-resolution image patches. The image patch extraction procedure is the same for high-and low-resolution images and the only difference is the kernel size. A 5-by-5 extraction kernel is used for low-resolution imaging, and a 7-by-7 extraction kernel is used for high-resolution imaging. The patches are extracted from the high-and low-resolution images in a concentric manner by overlapping the patches in all dimensions with a size of one pixel and a stride length of one pixel. When the high-resolution patches and their corresponding low-resolution patches are each extracted with the above method, the fusion feature vector of both patches, which is based on image feature extraction using image intensity [34], is extracted by converting the contents of the 7 × 7 matrix of the low-resolution patch into a 49 × 1 column vector. Next, the contents of the first row and first column of the 5 × 5 matrix of the high-resolution image intensity patch are converted into a 9 × 1 column vector, and its contents are added to the end of the previous vector to obtain the 58 × 1 target feature vector. Next, we remove the low-frequency details that do not provide much information about the image from the constructed vector and only consume the amount of storage memory of the machine, using the normalization of the vector by the mean function. We store all feature vectors Extract each patch feature vector and combine the HR and LR image patch vectors to construct the final vectors. 6: Normalize the vectors using the mean intensity of each patch (contrast normalization).

7:
Store the vector as a value and its HR patch vector as a key in the training database. 8: end for 9: Train the proposed SOM-neural network with all the vectors of the training database. 10: All the parameters of the SOM, as well as all the best matching units of the network and the data vector labels belonging to those units, are stored.
as the key fields and the entire contents of the intensity matrix of the high-resolution patches as value fields in the dictionary for the dictionary training stage.

B. THE DICTIONARY TRAINING
We label all input vectors and neurons in the self-organizing neural network in terms of numbers. We reconstruct a twodimensional self-organizing neural network with the weight vectors proportional to the input vector dimension, as shown in Figure 4. The weight vectors of the self-organizing neural network are initialized with initial and minimum values that approach zero depending on the spacing of the input data distributions. We configure the SOM-neural network using the following parameters: The lattice network is a sheet with a two-dimensional lattice space, the network topology is a hexagon, the neighborhood function of the network is Gaussian, the size of the neurons in the network is two-dimensional [ 10 15], and it has two training stages. In the first stage, called the coarse stage, the neuronal neighborhood radius function decreases from 3 to approximately 0.5, and the number of training epochs is 50. In the second stage, called the fine stage, the neuronal neighborhood radius function decreases from 1 to approximately 0.5, and the number of training epochs is 10. We train the SOM-neural network using the vectors from the training database and by Algorithm 3. As shown in the U-matrix in Figure 5, the training data distribution is smoothly distributed across the winning neurons. This matrix shows a lattice of neurons with adjacent distances between them in different colors depending on the distribution of data between neurons. Figure 6 also shows how the input vectors are distributed among the neurons in the neural network. As can be seen in the figure, the higher the number of vectors assigned to a winning neuron, the lower and brighter the color density of that neuron, and the lower the number of neurons assigned to a vector, the thicker and darker the color. Figure 7 shows the distribution of winning neurons in the neural network. In this figure, the regions of the neural network where the distribution of winning neurons is higher are identified and can be used to estimate the efficiency and quality of the neural network training. We then store all the best matching units and their vector content in the second dictionary, which has two fields, the neuron weight vectors, and the input vector labels.  Extract each patch feature vector and combine the HR and LR image patch vectors to construct the final vector. 6: Normalize the vector using the mean intensity of each patch (contrast normalization).

7:
Run the SOM-neural network and enter the input vector. 8: Obtain the BMU neuron that matches the input vector.

9:
Obtain six neighboring neurons for the BMU neuron. 10: Retrieve the training vectors of these seven neurons.

11:
Run the K-nearest neighbor algorithm for this retrieved data and input vector. 12: Obtain the best training vector that matches the input vector. 13: Find the high-resolution training patch that belongs to this vector label and place it in its location on the high-resolution output image. 14: end for 15: Reconstruct a high-resolution image by reconstructing the image from patches, a difference between the high-frequency image and the interpolation image, and the interpolation image.

C. THE SUPERRESOLUTION IMAGE RECONSTRUCTION
The low-resolution input image is enlarged to the high-resolution output image by an appropriate enlargement factor through interpolation methods and is used in three different application areas. The first application of the low-resolution image is to extract low-resolution image patches from it using the 7 × 7 kernel, and then these patches are used to create a final feature vector along with a high-resolution image patch. The second application of the low-resolution image is the extraction of its high-frequency details by high-pass filtering, where the output image from this step is subtracted from the interpolated image, and the resulting image is added to the output image at the end of the image reconstruction algorithm. The third application of this image is at the end of the algorithm to create a high-resolution output image. Since we have no high-resolution image from the low-resolution input image, we create the image with the dimensions of the high-resolution output image with zero pixel intensity values (M, N, d). We convert it into high-resolution patches using a 5 × 5 patch extractor kernel. When the high-resolution patches and their corresponding low-resolution patches are extracted, the merging feature vector of both patches, which is based on image feature extraction using image intensity, is extracted by converting the contents of the 7 × 7 matrix of the low-resolution patch into a 49×1 column vector. Next, the contents of the first row and the first column of the 5 × 5 matrix of the high-resolution image intensity patch are converted into a 9×1 column vector, and its contents are added to the end of the previous vector to obtain the 58 × 1 target feature vector. Next, we remove from the constructed vector the low-frequency details that do not provide much information about the image and only consume the amount of storage memory in the machine, using the normalization of the vector by the mean function. We test the SOM-neural network using Algorithm 4 for each experimental input vector to find the best matching unit, then find all the neighbors of the winning neuron, i.e., in this work, six neurons, as shown in Figure 8, and then retrieve the vector labels from the winning neurons plus six neighboring neurons. We use the nearest neighbor algorithm and take the k best training feature vectors that match this test feature vector, where k is 10 in this work. The algorithm sorts them in ascending order according to their distance to the input vector, selects the mode among them, and finds the high-resolution image field that maps to this key. Then, all the high-resolution test patches that best match the input image are taken. We reconstruct the high-resolution image as shown in Figure 9 by merging these three images: the image reconstructed from the patches, the image resulting from the difference of the high-pass filter output image, and finally the interpolation image.

IV. PRACTICAL OUTCOMES A. PREPARATION OF THE DATABASES
We used different image datasets to train, test, and validate the proposed image superresolution method depending on the application of the proposed image superresolution algorithm, such as for reconstructing natural images or for reconstructing medical images. In the application to reconstruct natural images, we used the natural images from known datasets to train, test, and validate the proposed algorithm. To train, test, and validate the proposed model using natural images, we used the Div2K dataset [35], which contains 1,000 highquality 2k images divided into 100 images for validation, 800 images for training, and 100 images for testing the proposed model. In the application for reconstructing clinical diffusion-weighted and MRI images, we used 75 diffusionweighted images and 90 brain MRI images from the brain development organization dataset in which each group of images had different high-frequency details in their image textures. In this paper, fifty images were used for training, 20 images for testing, and 5 images for validating the proposed model from the set of diffusion-weighted images. In addition, 65 images were used for training, 15 images were  used for testing, and 10 images were used for validating the proposed model from the set of MRI images. First, by preprocessing the images and converting the high-resolution images to low-resolution images using blurred noise for blurring, the images were rotated under various angles, and the images were subsampled with an appropriate scale factor to create low-resolution DW and MR images. We used complete natural imaging datasets such as SET5 [36], which includes 5 color images, SET14 [20], which includes 14 color images, BSDS100 [37], which includes 100 black and color images, and URBAN100 [5], which includes 100 black and color images, to evaluate the proposed superresolution imaging algorithm against other superresolution imaging methods. We also used a dataset of DW and MRI medical images including several black images of the human brain in the organization of human brain development to compare the proposed superresolution imaging algorithm with other superresolution imaging methods. We also used 25 DW images and 30 MRI images in addition to the training images to evaluate the proposed method with the other superresolution imaging algorithms.

B. THE SIMULATION ENVIRONMENT
All simulations of the proposed method were performed with MATLAB software version 2021a installed on Acer laptops with an Intel(R) Core (TM) i7-9750H CPU at 2.60 GHz Ram 16.0 GB and Windows 10 64 bit operating system and an Nvidia GeForce GTX 1650 graphics card with 4 GB GDDR5 Ram and 896 CUDA cores.

C. THE SIMULATION RESULTS
We performed experiments with traditional and state-of-theart image superresolution algorithms to improve the quality and resolution of natural and medical magnetic resonance images at different image magnifications. In this paper, we present the evaluation results to compare the performance and runtime of the algorithms on the reconstructed images. Initially, in the preprocessing stage, low-resolution natural and medical images were generated by subsampling the selected high-resolution images by a factor that is equal to the appropriate magnification factor. The low-resolution images were then blurred using a low-pass Gaussian filter (LPF) with a kernel size of 3 × 3 for sampling at Factor 2. Likewise, the size of the low-pass Gaussian filter was set to 3 × 3 for sampling at Factors 3 and 4. Next, to train a shared dictionary, we extracted more than 1,050,000 pairs of lowand high-resolution patches independently from each training dataset, such as Div2k and MRI. We considered a patch size of 5×5 with a one-pixel overlap between neighboring patches for the high-resolution images and a patch size of 7 × 7 with a one-pixel overlap between neighboring patches for the lowresolution images. It is clear that as the number of patches increased, the quality of the reconstructed high-resolution image increased. Clearly, as the number of patches increased, the quality and resolution of the reconstructed high-resolution image increased. However, the maximum efficient number of patches is finite, so increasing the number of patches beyond the maximum number did not affect the quality of the reconstructed images and only consumed machine memory with useless data. In addition, our attempts to extract more patches beyond the specific patch limit only increased the algorithm's execution time. By creating the image patches for natural and medical images from their image training datasets and training the dictionary with feature vectors of the patches based on the desired application, we tested the proposed image superresolution algorithm with various natural and medical image datasets and next compared the results with other traditional and state-of-the-art image enhancement methods using quantitative and qualitative criteria. We used six quantitative and qualitative parameters to compare the results of the proposed algorithm with other traditional and state-of-theart image superresolution methods. In addition to commonly used evaluation metrics, such as the mean squared error (MSE), peak signal-to-noise ratio (PSNR), and structural similarity index (SSIM), we used some other benchmarks to evaluate medical imaging enhancement approaches, such as the mutual information (MI) measure, which measures the degree of statistical dependence between two random variables [38]; the feature similarity index measurement (FSIM), which is based on the measurement of phase congruence and gradient magnitude to characterize local image quality [39]; gradient magnitude similarity deviation (GMSD), which is based on the exploration of the global variation in the local image quality map based on the gradient for the prediction of the global image quality [40]; and the natural image quality evaluator, which determines the image quality by calculating the local statistics of the input image (NIQE) [41]. We considered several approaches to compare the performance of the proposed image superresolution algorithm for medical MR imaging compared to traditional and state-of-the-art methods. Therefore, for better image superresolution reconstruction, the values of PSNR, MSSIM, MI, FSIM should be high, and MSE, GMSD, NIQE should be small.

1) THE MEDICAL DIFFUSION-WEIGHTED MRI IMAGE SUPERRESOLUTION
We tested the proposed image superresolution algorithm and other image superresolution methods on DW-MRI images, and the corresponding results of the algorithms on DW-MRI image reconstruction for visual comparison and image comparison according to quantitative image benchmarks are presented in Figure 11 for the scale factor of 2 and Figure 12 VOLUME 9, 2021 TABLE 1. Performance evaluation based on the benchmark for the DW-MRI dataset, Red is the best performance among all methods, and blue is the second-best performance among all methods. for the scale factor of 4. The proposed method in image reconstruction successfully provided the best performance in reconstructing object edges from images and also reconstructed the edges of objects with a smooth slope and not with a fast and steep slope, similar to other superresolution algorithms, which can be seen in the figures. The proposed method achieved an average improvement of approximately 0.7532 and 0.118 dB in PSNR over that of the CSFM method for 4-factor and 2-factor scaling, respectively, as shown in Table 1. For the proposed method, significant improvements were observed in PSNR, SSIM, and many other reference parameters. Because of the above results and careful analysis of the results by expert clinical operators, it is evident that for DW-MRI superresolution imaging, the proposed method is much more effective than traditional and state-of-the-art superresolution imaging techniques.

2) THE MEDICAL SPECTROSCOPIC MRI IMAGE SUPERRESOLUTION
The results of the proposed method compared with other image enhancement methods for spectroscopic MR images are presented in Figure 13 and 14 for scale ratios of 2 and 4, TABLE 2. Performance evaluation based on the MRI spectroscopic dataset benchmark, red shows the best performance among all methods, and blue shows the second-best performance among all methods.

TABLE 3.
Comparing the results of the proposed method with other algorithms for the complete databases with the image zoom factor 2. The numbers with a red mark indicate the best results, and the numbers with a blue mark indicate the second-best results.
respectively. The proposed method provides a better visual representation of the reconstructed image, with increased edge and boundary details, compared to traditional and stateof-the-art techniques. For most parameters, the proposed method is superior to other methods. The proposed method achieves an average improvement of approximately 0.91 and 0.9114 dB in PSNR over the CSFM method for 2-factor and 4-factor scaling, respectively, as shown in Table 2. The proposed method shows significant improvements in terms of PSNR, SSIM, and several other parameters. It is determined that, in the case of MR superresolution spectroscopic imaging, the proposed method is much more efficient than traditional and modern superresolution imaging techniques.

TABLE 5.
Comparing the results of the proposed method with other algorithms for the complete databases with the image zoom factor 4. The numbers with a red mark indicate the best results, and the numbers with a blue mark indicate the second-best results. model for high-resolution image reconstruction compared to other image superresolution methods. As a result, our method with scale Factor 2 outperforms traditional and stateof-the-art approaches, such as SRFBN and CSFM, on four datasets and achieves a comparable result with the RDN method with zoom Factor 2. In particular, compared with SRFBN, CSFM achieves a remarkable gain of almost the same PSNR and SSIM for zoom Factor 2. The proposed method achieves an average improvement of approximately 0.14 dB at SET5, 0.57 dB at SET14, 0.08 dB at BSDS100, and 0.13 dB at URBAN100 at PSNR over the CSFM method for the zoom scale of 2. The proposed method achieves at least an average improvement of approximately 0.0266 in SET5, 0.0052 in SET14, 0.0003 in BSDS100, and 0.0011 in URBAN100 in SSIM over the CSFM method for a scaling of 2. Moreover, as shown in Tables 4 and 5, the proposed method achieves weak results for scaling Factors 3 and 4. All these tables show that our image enhancement approach that is based on the SOM-KNN technique can present better results than traditional and some state-of-the-art image enhancement techniques and achieve reasonable PSNR and moderate SSIM at scale Factor 2. In practice, several experiments were performed with all image superresolution algorithms, the results of which, presented in Figures 15 and 16, show that our method is better than several others in reconstructing all details of an image, such as edges and lines. However, to present the best results in natural image reconstruction, the proposed method needs a very large training database, and the similarity of image details in the database should be higher.

4) COMPARISON OF COMPUTING TIMES
We used the existing state-of-the-art and traditional algorithm codes to compare the running time of our method with these algorithms, and the results of the average running time on various image datasets are shown in Table 6. We can see in Table 6 that our proposed method has a much lower running time speed than other image enhancement algorithms. The execution speed of the proposed algorithm is much slower than that of other image enhancement algorithms due to the use of all three image color components in the algorithm's calculations, i.e., the R, G, and B components. As a result, the computational time is more than three times longer than that of other algorithms that use YCbCr space and employ only one image component, such as the Y component, in their calculations. The use of three color components increases the number of image patches up to three times, and as a result, the image patch feature vectors have more attributes. The proposed algorithm easily finds the correct high-resolution patches. Therefore, the proposed algorithm provides higher-quality images than those produced by other image enhancement algorithms. Figure 17 shows the peak signal-to-noise ratio values of the different superresolution imaging algorithms as a function of the execution speed of each algorithm over time. Our method is much slower than the other methods but has the maximum peak signal-to-noise ratio over that of other algorithms.

5) SERIAL AND PARALLEL PROCESSING IN THE CPU-GPU ENVIRONMENT
In this work, we used both series programming on the CPU hardware and parallel programming on the GPU hardware VOLUME 9, 2021 to execute the proposed image superresolution algorithm. We used CPU hardware and serial programming for image up-and downsampling with a predefined zoom factor, filtered images with different kernels, and extracted patches with multiple kernel numbers. We also used it for vectorization, vector normalization, and at the end of the algorithm, for high-resolution image reconstruction. We used GPU hardware and parallel programming to train the SOM algorithm, the k-nearest neighbor algorithm, the high-resolution image patch, and high-resolution image reconstruction at the end of the algorithm.

V. DISCUSSIONS
In this paper, to increase the quality and resolution of medical images, we introduced an image enhancement method and presented the results obtained in improving the quality and resolution of natural and medical images. Such a method is based on a dictionary learning-based medical image reconstruction approach. In recent years, several dictionary-based image superresolution algorithms have been used to reconstruct high-resolution images from low-resolution images based on a single dictionary. However, due to the complexity of high-frequency details and texture information present in real images, a single dictionary cannot successfully recover image details. Single dictionary-based image superresolution algorithms did not present good performance in reconstructing real images. Image enhancement methods based on regression and clustering using multiple dictionaries achieved better results in high-resolution image reconstruction than image enhancement methods using single dictionaries, but these methods did not find the inherent relationship between LR and HR patches. Deep neural network learning-based methods can reconstruct high-resolution images significantly better than clustering and regression-based methods, but estimating the amount of error is the major problem for these methods. In addition, they use the backpropagation technique to update their weight vectors. These weight vector update processes are time-consuming, which increases the execution time of the image enhancement algorithm in the training stage. However, all of the above methods for reconstructing object boundaries and edges in images with smoothed slopes are weak. This is especially true in medical images, which have spatially changing pixel intensities throughout an image and considerable variations, unlike natural images, whose pixel intensities throughout an image are almost uniform and hardly change. We attempted to solve the three main problems of the previous methods, such as the intrinsic relationship between low-and high-resolution patches, the limitation of image detail acquisition, the omission of updating the neural network weight vectors by the backpropagation approach, and the estimation of the optimal and minimum error values for calculating the neural network weight vectors in the new model. The proposed image superresolution method uses self-organizing maps as a preprocessor, and this neural network works as the tree search block in the regression and classification methods. Thus, by using this preprocessor, we achieved the accuracy and speed of artificial neural networks in the single dictionary-based image reconstruction methods that work according to the classification and regression methods by using this preprocessor. Moreover, the proposed image superresolution method can reconstruct high-resolution images with better quality from a single dictionary, unlike the previous image superresolution method based on a single dictionary, which cannot present high-quality images. In addition, we used the nearest neighbor algorithm as a classifier to classify the feature patch vectors that previously belonged to the neurons of the neural network in the training stage. In particular, the vectors corresponding to the neurons at the boundary of the neural network, since these neurons, depending on the network topology, have incomplete neighbors. Therefore, the algorithm can accurately reconstruct the high-frequency details and texture information of the reconstructed images by unsupervised learning approaches and effectively remove the artifact and blocking effects of the reconstructed high-resolution images by classifying the input feature vectors into the correct categories. In addition, it can reconstruct the boundaries and edges of objects in images with good quality. We trained our model with 800 images from the Div2K dataset after preprocessing and processing the images. We then tested the model with 100 images from the Div2K dataset, and our model test results were satisfactory. We validated the algorithm with 100 images from the Div2K dataset with acceptable validation results. In addition, to train, test, and validate the proposed model with medical MRI and DW images, we used the medical imaging dataset from the brain development organization. All training, testing, and validation processes for medical imaging with the same as the previous training for natural imaging. We compared the results of the proposed method with those of other traditional and state-of-the-art image superresolution methods on natural and medical image datasets. Figure 10 shows the resulting images reconstructed by our image enhancement method from various image datasets for scale Factor x2. We can see in these images that the image details, such as edges and boundaries, were reconstructed very well. As seen in Column (e) of the figure, which shows the high-frequency difference between the output image of the proposed algorithm and the original high-resolution image, the proposed algorithm reconstructed all the details of the high-frequency image, and all images in this column are black and do not contain any remaining high-frequency image detail. We compared images reconstructed by the proposed algorithm in different image databases with images reconstructed by other image enhancement algorithms, both in terms of quality by expert persons and quantitatively using numerical image comparison criteria. The proposed image reconstruction algorithm is superior to other image enhancement methods for both natural and medical images with a zoom factor of 2. However, as the image zoom factor increases, the proposed algorithm gradually loses its advantage compared to other image enhancement algorithms in reconstructing high-quality images because it only uses a single high-frequency filter to process the input image, unlike VOLUME 9, 2021 the other algorithms that use several image feature extractor filters, such as edge, Gradian, Laplace, high-frequency and angular filters. As seen in the results presented in the tables for the different datasets, the results of the proposed method on the datasets are very different from each other, which is due to the use of trial and error methods in estimating the size of high-and low-resolution image patches. In addition, higher texture similarity in the input images leads to the reconstruction of more details in the output images. The proposed method is more capable of reconstructing human faces and medical magnetic resonance images with the best resolution, as these images have many similar details in their structures. The ability of the method to reconstruct natural images, such as landscapes and forests, which do not have many similar textures, is reduced. We also estimated the running time of the algorithms in the reconstruction of existing images by testing the proposed algorithm, as well as other existing image enhancement algorithms, on images with dimensions of 64 × 64, 256 × 256, 512 × 512, and 1024 × 1024. The results showed that the execution time of the proposed algorithm is high compared to other methods because the proposed algorithm uses three components R, G, and B of the color image, so the computational time is three times longer than other image enhancement methods. We also used MATLAB software to run the algorithm, which is much slower than the C and Python programming languages used by other algorithms. However, despite the slowness of the algorithm compared to other image enhancement methods, it is surprisingly effective in reconstructing the details of image objects, such as edges and contours, with a very smooth slope, especially in clinical images. In the future, we will use gradient kernels to improve the resolution of these images.

VI. CONCLUSION
In this paper, we proposed a novel hybrid single-image superresolution method for magnetic resonance image enhancement based on a self-organizing neural network as a preprocessor, the nearest neighbor algorithm as a classifier, and the use of a high-pass filter as a high-frequency image detail extractor. Unlike other image enhancement methods, our method uses a single overcomplete external dictionary to train the proposed method. We resolved the intrinsic relationship problem between low-and high-resolution image patches in the training dictionary by defining feature vectors that directly contain the low-and high-resolution patches. In addition, we solved the difficulty of specifying the appropriate amount of error at the training and testing stages due to the variability of MR image contrast. We also solved the use of backpropagation methods in updating the neural network weight vectors by competitive learning that does not require error correction. Since MRI images of internal body parts and organs of people are very similar in appearance and differ only in size, our method of reconstructing such images is very effective. This method's success lies in its ability to reconstruct the boundaries and edges of the objects in the image with a smooth slope without the need to perform any statistical calculations or adjust the regularization parameters. Practical experiments on the proposed superresolution method compared with other methods illustrate that our image reconstruction method achieves high performance. Under limited computational resources, our method achieves better evaluation criteria among all traditional and state-of-the-art benchmarks. It also achieves more reliable performance and resolution on images with different scale factors. We used CPU-GPU hardware and parallel programming to train and test the proposed algorithm and obtain better performance in algorithm speed and execution time.