Recognition Algorithm of Popular Elements of Ethnic Minority Traditional Clothing Based on PCA

,


Introduction
e fast-paced modern life makes the traditional ethnic minority clothing face the crisis of disappearance. e digital protection and inheritance of ethnic minority clothing culture are urgent. With the development of science and technology, some advanced technical means have been used to protect and inherit the clothing culture of ethnic minorities [1]. As one of the constituent elements of clothing, ethnic minority clothing color is a symbol of inheriting national culture. Using increasingly mature image processing technology to process the clothing image of Huayao Dai has great significance and value for the study of ethnic minority clothing color [2].
Literature [3] in order to use the set information in the image set to improve the image recognition accuracy and robustness to image changes so as to greatly reduce the influence of factors such as posture, illumination, occlusion, and misalignment on the recognition accuracy, an image set prototype and projection learning algorithm (lpsop) for image set classification is proposed. e algorithm learns representative points (prototypes) and an orthogonal global projection matrix for each image set so that each image set in the target sub-space can be optimally classified into the nearest prototype set of the same kind. It not only can reduce the interference of redundant images but also can reduce the storage and computing overhead. e learned projection matrix can greatly improve classification accuracy and noise robustness.
e experimental results on UCSD/Honda, CMU MoBo, and YouTube cellulitis show that Lpsop has higher recognition accuracy and better robustness than the current popular image set classification algorithm. However, this method considers the characteristics of many elements of ethnic minority traditional clothing, resulting in the decline of recognition accuracy.
In reference [4], aiming at the problems of low matching accuracy, long operation time, and low recognition accuracy in the traditional remote sensing image template matching and recognition process, a remote sensing image template matching intelligent recognition method based on STACS is proposed. rough the analysis of the remote sensing image measured by the man-made satellite survey system (STACS), the gradient is used as the feature to match the remote sensing image template. Combined with dot algorithm, the secondary gradient features of remote sensing image are removed, and only the gradient direction with large amplitude is used as the feature quantity to complete template matching; e neighborhood pixel difference method is used to recognize the target features of remote sensing images. e experimental results show that the proposed method has a high accuracy of remote sensing image template matching, short operation time, and high recognition accuracy and has certain practical value. However, this method has not been applied to the recognition of popular elements of ethnic minority traditional clothing, and the recognition time and recognition accuracy need to be further considered. According to clothing design theory, clothing schools can be identified by a set of visually distinguishable style elements, which show obvious visual appearance characteristics and reflect high-level fashion style, thus better describing clothing schools. Reference [5] proposed an automatic classification method of clothing types based on visually distinguishable style elements, replacing the previous lowdiscernibility features or fuzzy keywords to identify clothing types. Hierarchical image segmentation identifies and organizes image elements as tree structures. Tree structure represents the semantic information of the image. is is one of the most basic computer vision problems. e emphasis of reference [6] is on images from visual design, such as graphical interfaces, posters, and presentations. Extracting hierarchies from these images allows quantitative analysis of visual design choices and replication of designs from handdrawn or hard copy. Reference [6] puts forward a more accurate method, which integrates the general design principles of visual design.
Principal component analysis (PCA) is a widely used algorithm in intelligent recognition. Its principle is to extract the main components of ethnic minority traditional clothing by using K-L transform, construct the feature popular element space, project the test image to this space, obtain a set of projection coefficients, and identify it by comparing with each popular element. PCA method has achieved a good recognition effect, but the amount of calculation is large [7]. Wavelet transform denoises and extracts features from the image by constructing a wavelet basis, which not only effectively avoids the interference of noise and redundant data [8] but also accurately locates the boundary points, which is helpful to improve the eigenvalues of popular elements in ethnic minority clothing. After a series of image preprocessing, the PCA features of clothing images are obtained by PCA, and the image recognition is carried out according to the principle of minimum European distance. e research contributions of the thesis include the following: (1) In this paper, minority clothing image is taken as the research object, image enhancement, and threshold segmentation are completed; the principal component analysis method is adopted to extract the principal component features of minority clothing image; and image matching degree is obtained according to Euclidean distance minimum principle (2) e calculation process of the PCA method is optimized by the wavelet transform algorithm to realize the recognition of popular elements of minority traditional clothing (3) e comparative experimental results show that the PCA + BP neural network algorithm is better than the other two recognition algorithms in recognition rate and recognition time e remainder of this paper is organized as follows. Section 2 introduces the overall structure design of the algorithm. Section 3 discusses image preprocessing. Section 4 discusses feature extraction and image recognition. Section 5 discusses the experiment and analysis. Section 6 presents the conclusions of the study.

Overall Structure Design of the Algorithm
e whole algorithm is mainly composed of two modules: image preprocessing, feature extraction, and image recognition. e overall structure of the algorithm is shown in Figure 1.
e image preprocessing part consists of three parts: image graying, image enhancement, and threshold segmentation. e weighted average method is used to convert the color image into the gray image, and the histogram is used to expand the dynamic range of image gray value so as to enhance the overall contrast of the image and make the details of the image clearer. After the threshold is determined by an iterative method, the image is segmented to segment the target and background in the picture. e feature extraction and image recognition module is composed of three parts: extracting PCA features, establishing a classifier, and image recognition. It mainly extracts the PCA features of the target obtained by threshold segmentation by PCA, establishes a classifier by using Euclidean distance, inputs the PCA features into the classifier as an input, recognizes the image, and outputs the recognition results.

Image Preprocessing
Since the image is easily affected by the image itself and external factors, it is necessary to carry out image preprocessing [9], optimize the image, reduce the amount of calculation, retain useful information, and minimize useless information. Preprocessing mainly includes image enhancement and threshold segmentation. In this paper, the weighted average method is used to convert the color image into a grayscale image, as shown in Figure 2. e image enhancement part completes histogram equalization and histogram normalization, as shown in Figures 3 and 4.
Image segmentation is helpful for image recognition, and the quality of image segmentation directly affects the effect of subsequent image processing [10]. e basic idea of threshold segmentation is that the foreground region in the image, that is, the extracted target and background region belong to two different gray sets. e two gray sets can be segmented by using a threshold T belonging to the gray level so that the image can be segmented into foreground region and background region.
Based on the idea of approximation [11], the iterative method first selects an approximate threshold T, divides the 2 Scientific Programming     image into two parts R1 and R2, and calculates the mean value of regions R1 and R2 µ 1 and µ 2, Select a new segmentation threshold t � (µ 1 + µ 2)/2, repeat the above steps until µ 1 and µ 2 until there is no change. e segmentation results in this paper are shown in Figure 5.

Feature Extraction and Image Recognition
Feature extraction is a key part of image recognition. e purpose of feature extraction is to retain image information as much as possible in order to achieve effective recognition. Whether the feature extraction is good or bad is directly related to the result of image recognition. In this paper, PCA (principal components analysis) based on principal component analysis is used to realize the recognition of ethnic minority clothing images.

eoretical Basis of PCA.
Principal components analysis (PCA) is widely used in pattern recognition and data compression [12]. Its main advantage is to reduce the dimension and remove the redundancy of the data. Its method is to decompose the characteristics of the covariance matrix of the sample and calculate the characteristic vectors and eigenvalues of the covariance matrix. e feature vectors corresponding to several larger eigenvalues are found as the principal components of the analyzed data, that is, PCA features represent the original data so as to achieve the purpose of dimensionality reduction and redundancy.
PCA method uses the linear combination of principal component vectors to minimize the mean square error. Mathematically, it can be verified that the PCA method can use eigenvalues to realize projection vector [13].
Let x i |i � 1, . . . , N be a set of n-dimensional vectors, expressed as matrix form X � [x 1 , x 2 , . . . , x N ], and average all columns of X to obtain where N is the total number of samples and x is the average value of all samples. Let X � [x 1 , x 2 , . . . , x N ], then the covariance matrix S t corresponding to data X can be defined by the following formula: Suppose: m is the rank of matrix S t and λ i |i � 1, 2, . . . , m is the nonzero eigenvalue of matrix S t ; w i |i � 1, 2, . . . , m represents the corresponding eigenvector of matrix S t ; and λ 1 ≥ λ 2 ≥ · · · ≥ λ m , the formula is as follows: In principal component analysis, set where W represents the principal component matrix and w i represents the principal component contained in the data.
Convert any n-dimensional random vector x to obtain the following formula: Original image   Scientific Programming e new m-dimensional vector y is obtained from formula (4).
According to the mathematical demonstration theory, the transformation of the two is mainly projection, and vector y is the projection coefficient, which is the result of the transformation of vector x under the PCA algorithm. Reconstruct y to obtain data: In popular element recognition, PCA-based methods can be divided into adaptive PCA-based methods and empirical PCA-based methods.

Typical Algorithms.
In the PCA algorithm, the main two key items are eigenvector and eigenvalue of the covariance matrix.
According to the above analysis, the dimension of covariance matrix S t is n × n. ere are many dimensions and the amount of direct calculation data is very large. erefore, a method to solve this problem is proposed.
Set a new matrix S t ′ , then: It is easy to find that the dimension of matrix S t ′ is N × N. With the help of the theory of linear algebra, it can be proved that matrices S t and S t ′ have the same eigenvalues, so the eigenvalues corresponding to S t can be obtained by calculating the eigenvalues of S t ′ , but it is much easier to calculate the eigenvalues of S t ′ because of N ≪ n. Assuming that W represents the eigenvector of matrix S t and Q represents the eigenvector of matrix S t ′ , it can be further proved that W and Q satisfy the following relationship: where Λ is a diagonal matrix, Λ � diag[λ 1 , λ 2 , . . . , λ N ] ∈ Ρ N×N , and λ 1 ≥ λ 2 ≥ · · · ≥ λ N . From the above results, the eigenvalues and eigenvectors of matrix S t can be obtained through matrix S t ′ . However, the dimension of S t ′ is much smaller than that of S t , so this method can reduce the amount of calculation and improve the overall operation speed. e traditional PCA algorithm includes the following steps [14]: Calculate the average value x of the group of data and construct the matrix X � [x 1 , x 2 , . . . , x N ] Calculate the covariance matrix S t corresponding to X Calculate the eigenvalue of the covariance matrix S t and eigenvector matrix W, where the eigenvalue corresponds to the eigenvector one by one, and the eigenvalues are arranged in order from large to small e fast PCA algorithm is as follows: Calculate matrix S t ′ � (X − X) T (X − X) Calculate the eigenvalue of matrix S t ′ and eigenvector military Array Q, where the eigenvalue corresponds to the eigenvector one by one, and the features are arranged in the order of large to small Construct diagonal matrices Λ, Λ � diag[λ 1 , λ 2 , . . . , λ N ] ∈ Ρ N×N , and λ 1 ≥ λ 2 ≥ . . . ≥ λ N According to formula (7), the eigenvector matrix W is calculated using X, Λ and Q

Improved PCA Algorithm Based on Wavelet Transform.
e identification of popular elements can help the algorithm achieve a better recognition effect. erefore, feature extraction can better improve the recognition degree of popular element recognition algorithm. In this paper, an improved principal component analysis algorithm based on wavelet transform is proposed.

Algorithm Analysis.
In this paper, a principal component analysis algorithm based on wavelet transform is proposed. Its basic idea is: Firstly, the image is decomposed into four sub-graphs by wavelet transform. en the total scatter matrix is calculated according to the within class mean of the sub-graph, and the optimal projection matrix is obtained. e samples are projected so that each original image corresponds to four feature matrices. e nearest distance method is used to classify the images, and four recognition results are obtained [15]. According to the importance of low-frequency components and high-frequency components, appropriate weighting and sorting are carried out to obtain the final results.

Algorithm Flow.
e flow chart of this algorithm is shown in Figure 6.
Based on the above analysis, the image recognition method based on PCA first converts the sample image into a feature vector set, which is the set of basic components of the sample image, and projects it into the feature expression space, that is, PCA sub-space. en, the PCA feature extracted from the image to be recognized is projected into the feature expression space. By calculating the Euclidean distance between its projection point and the PCA feature of the sample image in the feature expression space [16], the recognition is carried out according to the principle of minimizing the Euclidean distance. e algorithm is described as follows: (1) Obtain the clothing image set t optimized by preprocessing in the image library. Suppose there are n national costume images in the image library, and n sample images are obtained after image preprocessing. Each sample consists of its pixel gray value to form a vector X i ; then the pixel number of the sample image is the dimension M � width * height of X i ; and the vector constitutes After optimizing the image to be recognized, the PCA features are extracted and projected into the PCA sub-space. e nearest distance between the vector after PCA feature projection of a sample and the vector after image projection to be recognized is found, that is, the popular element of clothing image to be recognized.

Algorithm Implementation.
e algorithm proposed in this paper is divided into the training stage and the recognition stage.
(1) Training Phase. C represents the category of popular elements and sets the category to ω 1 , ω 2 , . . . , ω c . Set n(i) as the number of training samples of the i-th human company, N � C i�1 n(i) as the image overview of the training samples, and each popular element image sample A ij as the m × n image matrix. e sample A ij is decomposed by a first-order wavelet to obtain a 2 × 2 module image matrix: (2) Finding the Global Dispersion Matrix. Each class of training samples is calculated to obtain the average popular elements of each image in each class: where i � 1, 2, . . . , C; j � 1, 2, . . . , n(i); k � 1, 2; and l � 1, 2.  Scientific Programming rough demonstration, it can be proved that G t is a nonnegative definite matrix. en calculate the matrix after projection processing. e method is as follows: first, set the first r of G t as the maximum eigenvalue so as to obtain the eigenvector corresponding to this eigenvalue, specifically expressed as X 1 , X 2 , . . . , X r . Let P be the optimal projection matrix, P � [Z 1 , Z 2 , . . . , Z r ].
Setting: A ij represents the training sample set recognized by wavelet transform, and the following results are obtained: e characteristic matrix of is as follows: (4) Identification Phase. For test sample T, first decompose the first level wavelet and then obtain four sub-graphs: en the characteristic matrix is obtained as follows: e characteristic matrices (T 11 − η)P, (T 12 − η)P, (T 21 − η)P, and (T 22 − η)P of each sub-graph are obtained. e nearest distance method is used to judge the category of the four sub-blocks of the test sample: Calculate the Euclidean distance between ((A ij )11 − η)P and (T 11 − η)P: where superscript represents four sub-graphs, respectively.
In the same way, find out the classes of the other three sub-graphs, assuming that the classes of the other three subgraphs are ω m , ω n , and ω o , respectively.
(5) Weighted Sorting. Each sub-graph will get a recognition effect based on wavelet transform, and the highest recognition rate is the low-frequency sub-graph [17], followed by the vertical and horizontal sub-graphs. It can be inferred that the diagonal sub-graph has a low recognition rate.
After getting all the processed pictures, we can get the corresponding processed pictures by arranging and weighting them accordingly.
is picture has both highfrequency effective recognition and low-frequency stability. It has obvious advantages, which can effectively enable us to improve the overall recognition rate of recognition in flow element recognition.  Table 1.

Experimental Environment and Popular Element
Scientific Programming e experimental results show that the average correct recognition rate of the algorithm is 82%, and the algorithm has certain feasibility and correctness. Among them, the correct recognition rate of Hani clothing image is 85%, Bai and Miao 84%, Buyi 82%, and finally Wa 75%. Hani nationality has the highest correct recognition rate because its clothing edge lines are obvious, which is very different from that of other nationalities, and it is easy to identify popular elements.

Experimental Steps and Results
Demonstration. e experiment in this paper is carried out in three environments: Comparison between improved algorithm and classical algorithm. e improved algorithm proposed in this paper is compared with the classical algorithm. rough comparison, it is verified whether the proposed algorithm has a better recognition effect.
Experiment on the number of training samples. Compare the recognition rate of the algorithm when taking a different number of training samples.
Weight experiment. e weights are assigned according to the weights of different components for the identification of popular elements.

Experiment 1: Comparison between Improved Algorithm and Classical Algorithm.
e specific design of this experiment is as follows: Training samples: randomly select any 20 popular element images of each character, a total of 100 Test sample: remaining images; 100 sheets in total is algorithm: Step 1: Image processing: the initial image is decomposed by wavelet to obtain a 2 × 2 pixel matrix.
Step 2: Image feature extraction: extract the feature matrix of four sub-graphs for training and testing samples.
Step 3: Image classification: the nearest distance method is used for classification, and four recognition results are obtained for weighted sorting.
Step 4: Wavelet bases commonly used in wavelet transform include Haar wavelet base, Daubechies wavelet base, biorthogonal wavelet base, Symlets wavelet base, and so on. In this paper, the experiments of sym4, bior3.7, bior1.3, dB4, and Haar wavelet bases are carried out, in which sym4 performs best. erefore, sym4 is selected as the wavelet base of the algorithm proposed in this paper.
Step 5: e average value of 10 experiments for each experimental result can make the data more accurate; comparative experiment: the proposed algorithm is compared with ca-m2dpca and m2dpca. e specific experimental results are shown in Figure 7. As shown in Figure 7, the algorithm proposed in this paper has certain advantages compared with other algorithms. e main reasons are as follows: Wavelet transform is introduced to improve the recognition efficiency. Weighted sorting of four subgraphs. e recognition accuracy is improved.
After processing, the algorithm proposed in this paper has the characteristics of low frequency and is very stable. At the same time, it also has the characteristics of high frequency, which improves the recognition rate.

Experiment 2: Training Sample Experiment.
In the experiment, the accuracy and efficiency of popular element recognition are also affected by the number of training samples. e more samples, the better the recognition effect. Because there are more samples, the more features recognized and the more fully trained, the better the recognition effect. In order to better verify the training samples and determine their effectiveness, a comparative experiment is proposed in this paper.
Randomly select k images of ethnic minority costumes as the training set e remaining 10-K images of ethnic minority costumes are used as the test sample set Wavelet basis selection sym4 In MATLAB, if you want to improve the experimental accuracy, you need to carry out the average value of 10 experimental results. e specific data are shown in Figure 8.
As shown in Figure 8, the number of samples collected is also the key to the recognition effect, but the image collection of popular elements is a very huge project.
When the number of samples collected is small, the identification of epidemic elements will be affected With the increase of the number of samples, the recognition rate of the three algorithms will increase e recognition rate of the algorithm proposed in this paper is significantly higher than that of ca-m2dpca and m2dpca When the number of training samples is greater than 4, the recognition rate of the algorithm mentioned in this paper can reach 0.965, which effectively reflects the efficiency and effectiveness of the algorithm proposed in this paper.     In the experiment, different sub-graphs have different weights. e low-frequency component has the main characteristics of popular elements, and the results are relatively stable.
Wavelet still selects sym4. In this paper, MATLAB is used for simulation experiment. Two groups of training samples are randomly selected and given different weights. e specific experimental results are shown in Table 2.
Compared with ca-m2dpca, the principal component analysis algorithm based on wavelet proposed in this paper obtains the experimental results: the principal component analysis algorithm based on wavelet proposed in this paper can effectively recognize the expression changes and increase the recognition rate. After increasing the horizontal weight, the recognition rate has been greatly improved.

Conclusion
is paper compares and analyzes the image enhancement effects of histogram equalization and histogram specification through experiments. Combined with the characteristics of ethnic minority clothing images, histogram specification is used to enhance ethnic minority clothing images. e algorithm can stretch the gray range and increase the contrast of the target image. e bimodal method, iterative method, and Otsu method are used to separate the foreground from the background. e nearest neighbor classifier is used to take the PCA features extracted by PCA as the input vector to realize image recognition. e average correct recognition rate of this algorithm is 82%, and there is still a lot of work to be further improved.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e author declares that there are no conflicts of interest.