# Computer Image Content Retrieval considering K-Means Clustering Algorithm

Authors: Miao Yu; Xiaojie Liu
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

The traditional computer image content retrieval technology can only meet the specific requirements of customers; because of its general features, it cannot comply with the requirements of various environments, purposes, and time simultaneously. This study presents a computer image content retrieval method for a K-means clustering algorithm (KCA). The information collected by computer is preprocessed by K-means clustering algorithm, and the unacquired computer image is labeled based on the optimal learning order according to the KCA. The K-means clustering algorithm classifies the color, pattern, shape, and content of computer images and takes advantage of the invariance advantages of image content retrieval such as scale, rotation, illumination, and blur correction to effectively solve the recurring problems of computer images during retrieval and increase its accuracy. The results of the experiment indicate that the proposed K-means clustering algorithm can enhance the efficiency and performance effectively during image retrieval by computer as compared to the traditional content search algorithm and also help to quickly converge to the query content; it also shows that KCA has good robustness.


---

## Body

## 1. Introduction

Early search engines generally use content-based search methods, which are developed on the basis of traditional information retrieval theory and technology. The relationship between web pages and search terms and the frequency and position displayed in user query documents is mainly considered. This method improves the quality and accuracy of search to a certain extent, but these methods are all keyword-based queries and cannot retrieve synonyms and polysemy in natural language. Hence, the search rate is not high, and there are certain boundaries [1, 2]. In recent years, the rapid progress of information technology has entered a digital age: there are fewer and fewer paper files, and digital files are commonly used. The current significant issue about querying demand information of users in computer image database in a fast and accurate manner is how to ensure the supply of archive information meets the demand. Computer image content retrieval is a useful solution. By adopting a personalized search system to refer to the same information among users, the new KCA is calculated accordingly. The most important is the user type, but the user’s participation is required because the calculation method of KCA and the approach of collaborative personalized search have unique features [3–5]. With the continuous development of the multimedia entertainment field, computer images have been gradually integrated into people’s lives. However, how can large-capacity computer image data better introduce computer images suitable for users based on the environment and different user features? The KCA is introduced into the computer image content retrieval process, and the computer image content retrieval is accurately carried out by using the deep belief network algorithm in the computer image audio segmentation stage.In the process of KCA, as for the problem that occurs during database retrieval, if this problem is completely solved, the KCA knowledge algorithm needs to be used to optimize the parameters of the algorithm. This study also combines the weight-sharing strategy. Weight sharing means that the KCA is different from the conventional vector algorithm in the way of connection and parameter sharing [6, 7]. The KCA can realize the features of local correlation and sharing of parameters. The sharing of weights mainly refers to acquiring parameter data based on multiple nodes in the hierarchical process. The feasibility of parameters for shared data is analyzed based on multiple goals during calculation. The retrieval is learned to obtain the weight for links and the offset of nodes in every layer, thereby initializing the network [8–10]. The deep belief network algorithm is fine-tuned from top-down based on KCA to address the defects of local optimum and excessive time required for retrieval. The deep belief network algorithm has powerful capacity for feature learning. However, based on the principle described above, computer image content retrieval requires a large amount of sample data and generates more parameter values. On the contrary, the recommendation search problem based on computer image lacks a large sample size. In addition, it is time-consuming to generate a large number of parameters, which is not good for practical applications.Compared with the previous algorithm, the proposed KCA is more accurate for computer image content retrieval and is suitable for the retrieval of computer image content retrieval system and the calibration rate of document query. The current situation tends to be personalized service, and the previous general retrieval system has been unable to comply with the retrieval requirement in various environments for different purposes at various time periods. Hence, we have conducted a series of studies and analyses on computer image content retrieval. Through experiments, we can see the interference factors affecting the calculation of KCA. After the computer image data are processed by dimensionality reduction, the input data information can be retrieved. The output data are processed by KCA during deep learning. The experimental results show that the calculation accuracy has been improved, the user’s interests and needs can be correctly expressed, and the computer image content retrieval has further improved the accuracy.


### 1.1. K-Means Clustering Algorithm

During the process of image search, the computer's image content extraction technology plays an important role, and the content extraction technology has laid an indispensable foundation for the follow-up work. The adopted system can keep the records of retrieval history and clicks of users, followed by search for the user’s operation behavior as the data source of the algorithm [11, 12]. The coherent operation is automatically accomplished by the system without disturbing the experience of the user. Firstly, the system saves the search history of the user in the browser, and the user’s content is known. Subsequently, the search content of the user is adjusted through his/her operation on the information retrieved. The temporal label is added to the data of the content. Hence, the content points where the user does not perceive are updated.The initial parameters for KCA are initial values crucial for implementing content extraction and are extremely important to the realization of the algorithm. The parameter values can be adjusted during the actual experiment, as shown in Figure1.Figure 1
Algorithm flow.The initial clustering of the KCA is Gaussian filtering to build a pyramid [13].(1)
Generate the initial image, make Gaussian smoothing, and calculate the spatial scale and the maximum number of layers.init_img = create—init_img(img,img_dbl,sigma);List<Feature>feat = newList<Feature> ();Intoctvs=(int) (Math.Log(Math.Min(init_img.Width, init_img.Height))/Math.Log(2)-2); Sigma is the scale parameterσ, and both width and height are the smallest odd numbers not less than 6σ + 1.(2)
Build the Gaussian Pyramid and the DOG Pyramid.gausspyr = build_gausspyr(init_img,octvs, intvls,sigma);The Gaussian filter calculation process is completed by calling the function build_gausspyr. In the build_gauss_pyr function, the two-dimensional Gaussian blur is completed, respectively, by decomposing it into row filtering and column filtering. Finally, the discrete points are interpolated by finite intervals and sigma difference, and the 5 rows/columns at the edge are not detected. Points with too small pixel values cannot be scattered as extreme points, and the extreme points can be precisely located. The main test data are described below://Based on Gaussian pyramid difference.Dog_pyr = build_dog_pyr(gauss_pyr,octvs, intvls)//Find content points, perform edge, and contrast content point processing.features = scale_space_extrema(dogpyr, octvs,intvls, contr_thr,curv_thr);//Reallocation and calculation of content point scale space coordinates;calc_feature_scales(ref features, sigma,intvls);if(img_dbl! = 0){IIIf the image is enlarged by 2 times in dbl = 1, the image is divided into 2 equal parts forimg_dbl(ref features) required by adjust;//Determine the histogram, determine the key points.calc_feature_oris(ref features, gauss_pyr);//Extract the content description words at each content point, 128 unique descriptions; compute_descriptor(ref features, gauss_pyr,descr_width, descr_hist_bins);The KCA mainly uses the initial feature value of the collected data input to retrieve the learning content according to the level. Aiming at the average time amplitude difference of time-domain features, energy in a relatively short time, etc., this study uses content retrieval as the initial input features of the algorithm and uses x(n) to express computer image search [14]. The content retrieval balance can be expressed:(1)En=∑m=−∞∞xnwn−m2=∑m=−∞∞xm2hn−m=xm2∗hn.The high dimensionality of time-domain features under initialization will cause massive noise interference. Hence, it is necessary to reduce the dimension of search input.For the normalized Laplace of Gaussian function, the normalized scale is theσ2D Gaussian function: Δnorm2L, Lx,y,σ.The KCA consists of two steps: content detection and content description. The purpose of detection is to obtain stable spots of images and then describe their content. There are two points in one-dimensional space:x and y, x=(x1,x2,...,xn) and y=(y1,y2,...,yn); the Austenite distance from point x to y vector is treated as(2)dx,y=x1−y12+x2−y22+⋯+xn−yn2=∑i=1nxi−yi2.The cosine distance refers to the size of the cosine value of the angle between two content vectors, and the content vector distance is expressed as(3)dx,y=∑xiyi∑xi2∑yi2.The Mahalanobis distance is developed from the covariance matrix. SetM sample content vectors x1～xm, denote the covariance matrix of M samples as S, and denote the average value as 〃; then, express the Mahalanobis distance between the content vectors xi and xj as(4)Dxi,yj=xi−xjS−1xi−xj.Since the content retrieval relationship of computer images includes direct content retrieval and indirect content retrieval, the source site cannot be determined initially, and the two attribute values of all nodes are initialized to 1 in the entire network layer:A0pt, A1pt. Then, the description content of website pt in pt⟶qt retrieves the computer image of website qt, calculates the content quality attribute value and content retrieval attribute value with the following iterative formula, and normalizes the attribute value of all web pages to 1 when each iteration is completed:(5)A0pt=∑qt⟶ptA1qt,(6)A1pt=∑pt⟶qtA0qt,(7)A0pt=A0pt∑∀ptA0pt21/2,(8)A1pt=A1pt∑∀ptA1pt21/2.Using the extracted content retrieval information, first extract the computer image content, retrieve the relationship between the retrieval websites, calculate the authority value of each content retrieval website, and take the website with the most content retrieval times as the source site, including direct content retrieval and indirect content retrieval. The pt. authoritative value is regarded as the content retrieval rate value of computer images.


## 1.1. K-Means Clustering Algorithm

During the process of image search, the computer's image content extraction technology plays an important role, and the content extraction technology has laid an indispensable foundation for the follow-up work. The adopted system can keep the records of retrieval history and clicks of users, followed by search for the user’s operation behavior as the data source of the algorithm [11, 12]. The coherent operation is automatically accomplished by the system without disturbing the experience of the user. Firstly, the system saves the search history of the user in the browser, and the user’s content is known. Subsequently, the search content of the user is adjusted through his/her operation on the information retrieved. The temporal label is added to the data of the content. Hence, the content points where the user does not perceive are updated.The initial parameters for KCA are initial values crucial for implementing content extraction and are extremely important to the realization of the algorithm. The parameter values can be adjusted during the actual experiment, as shown in Figure1.Figure 1
Algorithm flow.The initial clustering of the KCA is Gaussian filtering to build a pyramid [13].(1)
Generate the initial image, make Gaussian smoothing, and calculate the spatial scale and the maximum number of layers.init_img = create—init_img(img,img_dbl,sigma);List<Feature>feat = newList<Feature> ();Intoctvs=(int) (Math.Log(Math.Min(init_img.Width, init_img.Height))/Math.Log(2)-2); Sigma is the scale parameterσ, and both width and height are the smallest odd numbers not less than 6σ + 1.(2)
Build the Gaussian Pyramid and the DOG Pyramid.gausspyr = build_gausspyr(init_img,octvs, intvls,sigma);The Gaussian filter calculation process is completed by calling the function build_gausspyr. In the build_gauss_pyr function, the two-dimensional Gaussian blur is completed, respectively, by decomposing it into row filtering and column filtering. Finally, the discrete points are interpolated by finite intervals and sigma difference, and the 5 rows/columns at the edge are not detected. Points with too small pixel values cannot be scattered as extreme points, and the extreme points can be precisely located. The main test data are described below://Based on Gaussian pyramid difference.Dog_pyr = build_dog_pyr(gauss_pyr,octvs, intvls)//Find content points, perform edge, and contrast content point processing.features = scale_space_extrema(dogpyr, octvs,intvls, contr_thr,curv_thr);//Reallocation and calculation of content point scale space coordinates;calc_feature_scales(ref features, sigma,intvls);if(img_dbl! = 0){IIIf the image is enlarged by 2 times in dbl = 1, the image is divided into 2 equal parts forimg_dbl(ref features) required by adjust;//Determine the histogram, determine the key points.calc_feature_oris(ref features, gauss_pyr);//Extract the content description words at each content point, 128 unique descriptions; compute_descriptor(ref features, gauss_pyr,descr_width, descr_hist_bins);The KCA mainly uses the initial feature value of the collected data input to retrieve the learning content according to the level. Aiming at the average time amplitude difference of time-domain features, energy in a relatively short time, etc., this study uses content retrieval as the initial input features of the algorithm and uses x(n) to express computer image search [14]. The content retrieval balance can be expressed:(1)En=∑m=−∞∞xnwn−m2=∑m=−∞∞xm2hn−m=xm2∗hn.The high dimensionality of time-domain features under initialization will cause massive noise interference. Hence, it is necessary to reduce the dimension of search input.For the normalized Laplace of Gaussian function, the normalized scale is theσ2D Gaussian function: Δnorm2L, Lx,y,σ.The KCA consists of two steps: content detection and content description. The purpose of detection is to obtain stable spots of images and then describe their content. There are two points in one-dimensional space:x and y, x=(x1,x2,...,xn) and y=(y1,y2,...,yn); the Austenite distance from point x to y vector is treated as(2)dx,y=x1−y12+x2−y22+⋯+xn−yn2=∑i=1nxi−yi2.The cosine distance refers to the size of the cosine value of the angle between two content vectors, and the content vector distance is expressed as(3)dx,y=∑xiyi∑xi2∑yi2.The Mahalanobis distance is developed from the covariance matrix. SetM sample content vectors x1～xm, denote the covariance matrix of M samples as S, and denote the average value as 〃; then, express the Mahalanobis distance between the content vectors xi and xj as(4)Dxi,yj=xi−xjS−1xi−xj.Since the content retrieval relationship of computer images includes direct content retrieval and indirect content retrieval, the source site cannot be determined initially, and the two attribute values of all nodes are initialized to 1 in the entire network layer:A0pt, A1pt. Then, the description content of website pt in pt⟶qt retrieves the computer image of website qt, calculates the content quality attribute value and content retrieval attribute value with the following iterative formula, and normalizes the attribute value of all web pages to 1 when each iteration is completed:(5)A0pt=∑qt⟶ptA1qt,(6)A1pt=∑pt⟶qtA0qt,(7)A0pt=A0pt∑∀ptA0pt21/2,(8)A1pt=A1pt∑∀ptA1pt21/2.Using the extracted content retrieval information, first extract the computer image content, retrieve the relationship between the retrieval websites, calculate the authority value of each content retrieval website, and take the website with the most content retrieval times as the source site, including direct content retrieval and indirect content retrieval. The pt. authoritative value is regarded as the content retrieval rate value of computer images.


## 2. Computer Image Content Retrieval

In computer image content retrieval, user computer image content retrieval is accomplished by three stages of collecting and analyzing user data, constructing user content algorithm, and updating user content algorithm. If the computer image wants to obtain the user's information, it must first obtain the user’s obvious information, such as the user's account number, age, education level, occupation, affiliation, and sensed content keywords; the user can conduct adjustment and give response accordingly to make the required improvement gradually [15]; while other users are unwilling to reveal personal information or have time issues, so they do not submit accurate registration information. For this problem, an implicit information form can be set up, to extract the user's information, extract the bookmarks of their searched keywords, and download and save files. According to user bookmarks, information downloaded and saved, the problems that the user has been concerned about for a long time, the research area, etc., can be determined, which can become an essential data resource for establishing the algorithm. Due to the variable content of users, an update mechanism should be established for the algorithm, remove the forgotten topics in time to add new content, calculate the weight of the user content, and sort according to the proportion of the weight. People’s forgetting value tends to forget from the beginning and gradually become late. In the content algorithm system, multiply the weight of the sensed content keywords based on the time they are updated, sort out the phrase weight, and delete the content being omitted. The user’s behavior is tracked, and a new keyword is obtained for ratio recalculation, which is then included in the user content algorithm to complete the algorithm update if the weight is above threshold. This study proposes an image search method that combines K-means clustering algorithm and active learning. The method adopts two lengths. First, the label samples are initially trained based on the K-means clustering algorithm. In the relevant feedback process, the improved KCA proposed in this study is used, and k images are fed back to the user label, and the label result is used as a training set for retraining. Feedback will continue until feedback stops. The frame structure of this system is shown in Figure 2.Figure 2
The framework of K-means clustering algorithm.Algorithm 1: Computer image content retrieval and analysis algorithm based on KCA.
Input: domain classification algorithm, user perception content algorithm, retrieval keyword, retrieval engine. Output: multimedia digital archive user's computer image content retrieval results.(1)
According to the search keywords, setX from the initial search is generated by the search engine.(2)
Leti (iterations) = 0.(3)
For theith computer image of the set X, the distribution of probability in the field classification algorithm is calculated according to equation (1).(4)
Calculate the probability that current user is recommended with the computer image content retrievali by equation (8), and add it to the list Y.(5)
If the computer image content retrievali is the last computer image content retrieval in the set X, go to (6); otherwise, set i = i+1, and return to (3).(6)
Sort the computer image content in descending order based on the probability inY and retrieve and output.Because another search engine is required for implementing the algorithm, a probability distribution in the domain classification algorithm must be calculated for the search results in every digital archive of multimedia. This can affect the effect of the algorithm substantially. Calculating the distribution of probability in the field classification algorithm by the search engine for each computer image in advance can substantially enhance its performance, thereby filling the needs of processing in real time effectively.


## 3. Analysis of Examples and Results

The basic framework of the system for image retrieval includes two aspects: establishing a trademark image database and a content vector database (as shown in Figure3) and calculating and outputting the similarity in the trademark content database registered as the target trademark.Figure 3
Framework diagram of content-based trademark retrieval system.Image preprocessing: image preprocessing refers to performing specific processing such as resolution, normalization, median filtering, and grayscale on the images of the daytime sample set required for the experiment [16]. Image preprocessing removes interference to extract subsequent contents and normalizes images, and specific processing items and contents of image frame processing differ according to image conditions, and a unified request is not performed. The computer image content has the attributes of pixel points, point areas, or continuous curves of representative image meaning, and the content is different from the image recognition object of interest. The key component content is the method or algorithm of the computer to process the image. As shown in Figure 4, since the image can be basically represented by the content attribute or the abstraction of the image as the content of the computer image is real time, the content has good computational properties so that the content extraction method can be performed using the computer technology extraction method.Figure 4
Extraction and description of content.The content description is to obtain the content group belonging to the image after extracting the content and then store the content vector group in the image database to establish a content description vector for an image and multiple content extraction methods. Computer image content retrieval is a good example of using template matching techniques. The frontal images of people’s computer images are very similar; especially when reading and retrieving, the differences between people’s computer images are not too obvious. In order to distinguish different people, detailed discrimination is required. However, the content of the computer image is the main distinguishing content of the retrieval object people, which is independent and unique. Hence, in the retrieval of computer images, the sketches displayed in the template check boxes are corrected through the sample templates provided by the system so that the retrieval process can be successively refined, and finally, the required computer images can be retrieved, as shown in Figure5.Figure 5
Classification of computer image shape content.In this section, 192 images of 16 categories are used to transform each trademark image in four cases, scale, illumination, rotation, and blur, and then match with the original image. This proves that the content description of the KCA has the features of relatively stable matching ability and invariance. The key point content dimensions of KCA are all larger than 100 dimensions. The image after change of scale, illumination, rotation, and blurring still has good matching performance for KCA. It fully shows that it has good robustness.As shown in Figure6, the overall results show that the proposed image content retrieval system is a perfect match and can achieve the design goals of the system. Computer images can depict richer information content than static images. However, computer images (i.e., search techniques for dynamic images) are complex and usually include several steps, such as segment cutting, creation of description boxes, and hierarchical description of moving objects. The basic process is to sample segments of a computer image, extract representative content, and process dynamic segments through frames in the same way as existing static images. In addition, the motion-changing parts of the computer images are separated from the background and described individually.Figure 6
Algorithm training results.


## 4. Conclusions

For the purpose of addressing data redundancy during image content retrieval by computer, an image content retrieval algorithm based on KCA is proposed. The KCA is used in the computer image retrieval process. Using a small amount of computer image labeling data to generate data information that can be used for original image processing, combined with the K-means clustering algorithm, active learning strategies are applied to the computer image content retrieval process to quickly find known and unknown network attacks. The K-means clustering algorithm strategy queries the constraint relationship between unlabeled data and labeled data in the network, which can quickly obtaink nonempty adjacent sets that do not intersect with labeled data, enhance the algorithm performance effectively, improve the accuracy of image search, and quickly converge the results to the query target. The experimental analysis shows that the KCA has better robustness and less time consumption in the content retrieval process. In future research, better K-means clustering algorithms can be investigated that can be applied to image search.



---

*Source: 7914842-2022-05-21.xml*