A Ceramic Artifact Fragment Classification Method Based on Swarm Intelligence Optimized Convolutional Neural Network

By using an improved method, the problems of insufficient database and low classification accuracy in existing technologies were solved, achieving efficient classification of ceramic artifact fragments. The hyperparameter adjustment process of the model was simplified, and the classification accuracy and efficiency were improved, providing technical support for the protection and inheritance of ceramic artifacts.

CN116311255BActive Publication Date: 2025-12-02NORTHWEST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310209446.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-07
Publication Date
2025-12-02
Estimated Expiration
2043-03-07

AI Technical Summary

Technical Problem

The lack of a publicly available database of ceramic fragments in existing technologies results in low classification accuracy of basic deep learning models, and the time-consuming and inefficient hyperparameter tuning makes it difficult to support efficient ceramic fragment model classification accuracy tuning. This leads to excessively long tuning time for classification model accuracy.

Method used

A method based on swarm intelligence to optimize convolutional neural networks was adopted. By improving the monarch butterfly optimization algorithm and information entropy strategy, the convolutional neural network structure was optimized, and a hybrid monarch butterfly optimization algorithm EHMBO based on information entropy was constructed. Combined with the spatial transformation module STNs and the VGG16 feature extraction module, the classification model of ceramic artifact fragments was optimized.

Benefits of technology

This improved the efficiency of ceramic fragment classification, simplified the hyperparameter adjustment process of the model, and enhanced classification accuracy and efficiency, providing an objective basis for the protection and inheritance of ceramic cultural relics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116311255B_ABST
    Figure CN116311255B_ABST
Patent Text Reader

Abstract

This invention discloses a method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks, comprising the following steps: 1. Data collection, preprocessing, and data augmentation of ceramic artifact fragments; classification and labeling based on appearance features to construct a ceramic artifact fragment dataset; 2. Improving the Monarch Butterfly optimization algorithm to obtain IMBO for convolutional neural network structure optimization; 3. Constructing IMBO-STNsCNN based on IMBO; 4. Introducing the concept of information entropy into the Monarch Butterfly optimization algorithm to establish a hybrid Monarch Butterfly optimization algorithm EHMBO based on information entropy and multiple mutation strategies, enabling individuals in the population to develop the globally optimal region more quickly and find the optimal solution; 5. Initializing the parameters of the EHMBO algorithm; 6. Optimizing the hyperparameters of the IMBO-STNsCNN classification model using EHMBO to obtain the final classification model and training it to obtain the IMBO-STNsCNN ceramic artifact fragment classification model, which improves the classification efficiency of ceramic fragments and thus improves the efficiency of ceramic artifact repair.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically a method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks. Background Technology

[0002] Chinese traditional ceramic culture possesses profound cultural heritage and connotations. However, due to the passage of time and the influence of natural and human factors, a large portion of excavated ceramic artifacts are broken and difficult to identify, posing significant challenges to their research. To restore the original appearance of ceramics, it is necessary to classify and piece together the unearthed ceramic fragments. The classification stage, which determines the relationships between fragments, can effectively solve the problems of high complexity and inaccurate results in virtual splicing algorithms, and also effectively avoid secondary damage to the fragments caused by manual identification. With the development of computer technology and artificial intelligence, computer-aided automatic classification of cultural relic fragments can effectively improve classification efficiency. In recent years, many scholars have applied artificial intelligence methods to the classification of ceramic fragments. Generally, there are two methods for classifying ceramic fragments: one is classification based on the chemical composition of the ceramic materials; the other is classification assisted by computer technology, which includes traditional machine learning methods and deep learning methods. Traditional machine learning methods mainly extract features from ceramic fragments using manual feature extractors, such as Gabor filters, HOG histograms of oriented gradients, and color histograms, to extract color and texture features. Then, machine learning methods, such as SVM, KNN, and K-means, are used for classification. Deep learning methods, on the other hand, are designed for image data and generally use convolutional neural networks to automatically extract features and build automatic classifiers.

[0003] Due to the fragility, complex and diverse characteristics of ceramic fragments, chemical material composition analysis requires specialized instruments and may cause irreparable damage to the fragments. Traditional machine learning methods are insufficient for high-precision classification of ceramic fragments. Therefore, more and more scholars are using deep learning-based methods for ceramic fragment classification. Currently, deep learning-based ceramic classification technology still has shortcomings, with the following problems needing to be addressed: 1. There is currently no publicly available ceramic fragment database. Some scholars use ceramic data from museums, while others use fragment scans or image data from relevant books. 2. The accuracy of ceramic fragment classification using basic deep learning models is not high enough, requiring further improvement in the model's feature extraction and classification capabilities. 3. Currently widely used successful deep neural networks are designed manually from scratch after fully considering domain knowledge. This requires a large amount of prior knowledge, consuming significant time and computational resources. Furthermore, for a high-performance model, manual parameter tuning is necessary, which involves significant uncertainty and is time-consuming, resulting in low efficiency. Summary of the Invention

[0004] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks, which improves the classification efficiency of ceramic fragments and thus improves the efficiency of ceramic artifact repair.

[0005] To achieve the above objectives, the present invention employs the following technical solution:

[0006] A method for classifying ceramic artifact fragments based on swarm intelligence-optimized convolutional neural networks includes the following steps:

[0007] Step 1: First, collect, preprocess, and augment the data of ceramic artifact fragments. Then, classify and label the ceramic artifact fragments according to their appearance characteristics to construct a ceramic artifact fragment dataset.

[0008] Step 2: First, the Chicken Optimization Algorithm (CSO) is used to improve the Monarch Butterfly Optimization Algorithm in the transfer stage. Then, the reverse learning strategy based on Spearman correlation coefficient is introduced into the Monarch Butterfly Optimization Algorithm. Finally, the F-distribution random mutation of adaptive features is used to replace the Levy flight in the Monarch Butterfly Optimization Algorithm to obtain the improved Monarch Butterfly Optimization Algorithm (IMBO) for the optimization of convolutional neural network structure.

[0009] Step 3: Construct an IMBO-STNsCNN classification model based on spatial transformation convolutional neural networks;

[0010] Step 4: Introduce the concept of information entropy into the monarch butterfly optimization algorithm to represent the aggregation state of individuals in the population, and establish a hybrid monarch butterfly optimization algorithm EHMBO based on information entropy and multi-mutation strategy. This achieves an adaptive balance between its global exploration ability and local development ability, enabling individuals in the population to develop the global optimal region more quickly and find the optimal solution.

[0011] Step 5: Initialize the parameters of the EHMBO algorithm;

[0012] Step 6: Optimize the hyperparameters of the IMBO-STNsCNN classification model using EHMBO to obtain the final classification model. Then train the final classification model to obtain the IMBO-STNsCNN ceramic artifact fragment classification model.

[0013] Furthermore, the preprocessing in step 1 includes cropping and normalizing the image of the ceramic artifact fragments.

[0014] Furthermore, the data augmentation in step 1 includes using the Python data augmentation library Imgaug to perform affine transformation, flipping, Gaussian blur, histogram equalization, contrast-limited adaptive histogram equalization, sharpening, and filling on the image of ceramic artifact fragments.

[0015] Furthermore, the convolutional neural network structure optimization process in step 2 includes the following steps:

[0016] Step 2.1: Population initialization, encoding the CNN model as an individual in the population;

[0017] Step 2.2, Fitness Evaluation: Compile the individual representative network structure into a complete CNN network, and use the loss function value of the final model as the fitness value of the individual.

[0018] Step 2.3: Search for the CNN network structure according to the IMBO algorithm flow.

[0019] Furthermore, the IMBO-STNsCNN in step 3 consists of a spatial transformation module STNs, a VGG16 feature extraction module, and an IMBO-optimized CNN module. The spatial transformation module STNs includes a localized network, a grid generator, and a sampler.

[0020] Furthermore, the spatial transformation module STNs performs spatial transformation on the image or feature map, including the following steps:

[0021] Step 3.1: Use a localized network to obtain the input feature map, and output spatial transformation parameters applied to the feature map through the hidden layer. Use the parameters to determine the transformation method based on the input.

[0022] Step 3.2: The mesh generator uses the parameters obtained from the localized network to transform the input data of the model, which is to perform an affine transformation on the image data, as follows:

[0023]

[0024] In the formula, The pixel coordinates of the input data. θ represents the pixel coordinates of the output data. 11 θ 12 θ 13 θ 21 θ 22 and θ 23 These are the six parameters of an affine transformation, used to represent scaling, rotation, linear distortion, and translation transformations of the data.

[0025] This process yields the coordinates of each position in the transformed output feature map on the corresponding coordinate point in the input feature map. The sampler then directly extracts the pixel value of each position in the input feature map.

[0026] Step 3.3: Use the feature map and sampling grid as input to the sampler to generate a mapping of the output sampled from the input grid points.

[0027] Furthermore, the process of introducing the concept of information entropy into the Monarch Butterfly optimization algorithm in step 4 includes the following steps:

[0028] Step 4.1: Divide the individuals in the population into Land1 and Land2 according to their fitness values. Individuals in Land1 are divided into roosters, hens, and chicks.

[0029] Step 4.2, Rooster position update: The rooster's foraging trajectory is the path planning for other types of chickens in the flock to search for food. The rooster's position update is as shown in formula (2):

[0030]

[0031]

[0032] In the formula, Let represent the position of the i-th rooster in the j-th dimension at time t, f represent the fitness value of the individual, i represent the current rooster individual, k represent another rooster individual randomly selected from Land1, and randn have a mean of 0 and a variance of σ. 2 Normally distributed random numbers;

[0033] Step 4.3: Update the hen's position. The hen follows the rooster in the search and will also compete with other individuals. The hen's position is updated as shown in formula (4):

[0034]

[0035]

[0036]

[0037] In the formula, i represents the current hen, r1 is the rooster in the subgroup to which hen i belongs, r2 is another randomly selected hen, ε represents the variance based on the F distribution, and S1 and S2 both represent the difference between the two sets of fitness values, which are used to update the position.

[0038] Step 4.4, update the chick's position as shown in formula (7):

[0039]

[0040]

[0041] In the formula, i represents the current chick individual, α1, α2, and α3 represent the disturbance factors based on the joint control of information entropy and relative distance, and their calculation methods are shown in formulas (12) to (14). g represents the randomly selected rooster individual, m represents the randomly selected hen individual, b represents the expelled individual generated by the rooster individual, and the position of the expelled individual is calculated as shown in formula (8). ub and lb represent the upper and lower bounds of the individual position, respectively, γ represents a normally distributed random number, where u1, u2, and u3 represent the probabilities of the chick learning from the rooster, hen, and expelled position, respectively, and q is a random number with a value range of (0, u3). The calculation of u1, u2, and u3 is shown in formula (9).

[0042]

[0043] R=abs(δ1)+abs(δ2)+abs(δ3) (10)

[0044]

[0045] α=s×E (12)

[0046]

[0047]

[0048] In the formula: u1, u2, and u3 are determined by the fitness differences δ1, δ2, and δ3 between the individual and the selected rooster, hen, and expelled individual; E is the population information entropy; s is the relative distance between two individuals; N represents the number of individuals in the population; M represents the number of targets learned by the individual; H is the intermediate term for calculating the information entropy; and R is the intermediate term for calculating the intermediate term H. During the algorithm iteration process, the probability of the chick selecting the target adaptively changes, which improves the population diversity.

[0049] Furthermore, the individual positions in Land2 are generated by an adjustment operator, which is expressed as:

[0050] When r <= p, the i-th individual in Land2 is generated by the following formula:

[0051]

[0052] In the formula, best represents the best individual in Land1 and Land2, and p represents the migration period;

[0053] When r > p, the i-th individual in Land2 is generated by the following formula:

[0054]

[0055] In the formula, r3 represents an individual randomly selected from Land2;

[0056] If rand > BAR, where BAR represents the adjustment ratio and rand represents a randomly generated number with the same value range as r, then the individual position is further updated as follows:

[0057]

[0058]

[0059]

[0060] In the formula, i1 and i2 are two individuals randomly selected from Land2, and T max ε represents the maximum number of iterations, t represents the current number of iterations, fpdf() represents a random number generated following the F distribution, ε represents the variance based on the F distribution, and ε0 is an algorithm parameter, set to 0.

[0061] During the algorithm tuning phase, to identify potentially better individuals in Land2, the Spearman correlation coefficient is introduced. Calculated based on the difference between the number of each pair of rank pairs in two columns, it reflects the strength of the relationship between the two sets of variables. It is a non-parametric statistical method, with values ​​ranging from -1 to +1. The larger the absolute value, the stronger the correlation between individuals. The calculation method for the correlation coefficient is as follows:

[0062]

[0063] Furthermore, step 5, which initializes the parameters of the EHMBO algorithm, includes setting the size N of the individuals in the algorithm population, the dimension D of the individual positions, and the maximum number of iterations iter. max Maximum step size S maxThe population is initialized by setting the ratio of Land1 individuals to partition, the migration period to period = 1.2, and the adjustment ratio to BAR = 1.2, and then the initial optimal solution in the population is determined.

[0064] Furthermore, the specific process of step 6 is as follows:

[0065] Step 6.1: Set the learning rate, number of network iterations, batch size, and number of neurons in the fully connected layer in the model corresponding to the position of each individual in EHMBO.

[0066] Step 6.2: Initialize the IMBO-STNsCNN network. Set the learning rate, batch size, network iteration count, and number of fully connected neurons for each individual in the population. Set the upper and lower bounds for each hyperparameter. Use the loss function value of the compiled model as the fitness value of the individual in the population. Update the global best individual in the population.

[0067] Step 6.3: Update the individual's position according to the EHMBO algorithm process;

[0068] Step 6.4: Calculate the fitness value of an individual based on its updated position. If the fitness value of the current individual is better than that of the current global best individual, then update the global best individual in the population.

[0069] Step 6.5: If the current algorithm iteration count has not reached the maximum iteration count (iter) max If the result is positive, proceed to step 6.3; otherwise, the optimization ends and the optimal model hyperparameters obtained from EHMBO optimization are returned.

[0070] Step 6.6: Input the optimal hyperparameters into the IMBO-STNsCNN classification model for model training to obtain the IMBO-STNsCNN ceramic artifact fragment classification model.

[0071] Compared with the prior art, the present invention has the following technical effects:

[0072] A diverse and well-sampled database of ceramic artifact fragments was created through data augmentation, providing a solid foundation and prerequisite for subsequent ceramic fragment classification research. The proposed improved Monarch Butterfly optimization algorithm IMBO for convolutional neural network structure optimization optimizes the CNN network structure by encoding individuals into corresponding CNN structures. It is applicable to both numerical optimization of the Monarch Butterfly optimization algorithm IMBO and optimization of CNN network structures.

[0073] By incorporating Spatial Transformation Network (STNs) modules and CNN network modules obtained through the IMBO search optimization algorithm into a convolutional neural network, the STNs module can proactively perform spatial transformations on images or feature maps by generating appropriate transformations for each input sample. The transformations are then performed on the entire feature map rather than locally, and can include scaling, cropping, rotation, and non-rigid deformation. This allows networks containing STNs modules to not only select the most relevant regions in the image but also transform these regions into normalized, expected poses, simplifying the recognition of subsequent layers and improving the model's classification performance.

[0074] The proposed hybrid monarch butterfly optimization algorithm, EHMBO, based on information entropy and a multi-mutation strategy, uses information entropy to represent the aggregation state of individuals in the population, thereby regulating the optimization process. A dynamic perturbation factor, jointly controlled by information entropy and relative distance, is added to the individual position update to achieve an adaptive balance between the algorithm's global exploration capability and local exploitation capability, enabling the algorithm to converge quickly to the optimal solution. Since the initial parameters of the classification model are difficult to determine and obtaining the optimal hyperparameters is time-consuming and inefficient, the good optimization ability of the EHMBO algorithm is used to optimize the network's hyperparameter settings, improving the network's learning and generalization capabilities, and thus enhancing the model's classification performance. This achieves the best classification results within an acceptable time consumption.

[0075] This invention can effectively extract complex and difficult-to-distinguish visual features from ceramic artifact fragments, enabling efficient classification. Furthermore, it searches for suitable network structures for ceramic fragment classification even in the absence of prior knowledge. Based on this, it automatically adjusts and optimizes the model's hyperparameters to address the difficulty in determining hyperparameters within the network. This effectively improves the efficiency of hyperparameter setting, increases network convergence speed, and enhances classification efficiency. It lays an objective foundation for subsequent research such as ceramic fragment assembly, strengthening the protection and inheritance of ceramic culture. Attached Figure Description

[0076] Figure 1 : Flowchart of the present invention;

[0077] Figure 2(a) and Figure 2(b): Ceramic fragment images after data enhancement according to the present invention;

[0078] Figure 3 : CNN representation of individual populations in this invention;

[0079] Figure 4 : Diagram of the IMBO-STNsCNN model of this invention;

[0080] Figure 5 : A structural diagram of the spatial transformation network (STNs) of this invention;

[0081] Figure 6Flowchart of the EHMBO optimized IMBO-STNsCNN classification model of this invention;

[0082] Figure 7 The training results and loss curves of this invention are shown in the figure. Detailed Implementation

[0083] The specific content of the present invention will be further explained in detail below with reference to the embodiments.

[0084] like Figure 1 As shown, a method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks includes the following steps:

[0085] Step 1: First, collect, preprocess, and augment the data of ceramic artifact fragments. Then, classify and label the ceramic artifact fragments according to their appearance characteristics to construct a ceramic artifact fragment dataset.

[0086] The data source is existing ceramic artifact fragments from the Visualization Research Institute. The data is in the form of two-dimensional RGB ceramic fragment images captured by a high-definition camera. The original image resolution is 4224*3168, with a horizontal and vertical resolution of 350 dpi. After collecting the raw data, the images were cropped and normalized. Based on the texture and color characteristics of the ceramic fragments, eight categories of labels were added to the ceramic artifact fragment data. After data processing, a ceramic artifact fragment image of size 224*224 was obtained. Since deep learning methods require a large amount of input data for training, the collected data is insufficient to support model training. Data augmentation is needed to expand the dataset size. The data augmentation operation is implemented using the Python data augmentation library Imgaug. The data augmentation effect is shown in Figure 2(a) and Figure 2(b). Some of the implementation methods are as follows:

[0087] (1) Affine transformation: seq = iaa.Affine(scale = {"x":(0.8,1.2),"y":(0.8,1.2)},

[0088] translate_percent={"x":(-0.2,0.2),"y":(-0.2,0.2)},

[0089] rotate = (-45, 45),

[0090] shear=(-16,16),

[0091] order = [0, 1],

[0092] cval = (0,0),

[0093] mode="constant")

[0094] (2) Horizontal mirror flip: seq = iaa.Fliplr(p = 1, name = None, deterministic = "deprecated", random_state = None)

[0095] (3) Mirror flip: seq = iaa.Flipud(p = 1, name = None, deterministic = "deprecated", random_state = None)

[0096] (4) Gaussian blur: seq = iaa.GaussianBlur(sigma = (0, 7.0), name = None,

[0097] deterministic="deprecated",random_state=None)

[0098] (5) Histogram equalization: seq = iaa.contrast.AllChannelsHistogramEqualization(seed = None, name = None, deterministic = "deprecated", random_state = None)

[0099] (6) Contrast-limited adaptive histogram equalization:

[0100] Seq=iaa.contrast.AllChannelsCLAHE(per_channel=False,

[0101] name=None,deterministic="deprecated",random_state=None)

[0102] (7) Sharpen: seq = iaa.Sharpen(alpha = (0, 1.0), lightness = (0.75, 1.5))

[0103] (8) Fill: seq = iaa.Pad(percent = (0, 0.1))

[0104] Step 2: First, the idea of ​​Chicken Swarm Optimization (CSO), which has superior development capabilities, is introduced into the Monarch Butterfly Optimization Algorithm. A chicken migration operator is proposed to improve the migration stage of the Monarch Butterfly Optimization Algorithm, enhancing individual information interaction and fully utilizing acquired prior and procedural knowledge to improve convergence accuracy. Then, a back-learning strategy based on Spearman correlation coefficient is introduced into the Monarch Butterfly Optimization Algorithm to discover potential better individuals in the population, improving population diversity. Next, F-distribution random mutation with adaptive features is used to replace the Lévy flight in the Monarch Butterfly Optimization Algorithm, solving the problems of high uncertainty and large jumps in Lévy flight. This allows the algorithm to fully utilize the current solution, improving convergence speed. Thus, an improved Monarch Butterfly Optimization Algorithm, IMBO, is proposed for convolutional neural network structure optimization. The convolutional neural network (CNN) representation of individuals in the population is as follows: Figure 3 To ensure that the compiled network is a meaningful CNN network, the following rules must be met:

[0105] 1) The first layer of the model is required to be a convolutional layer to extract feature map features;

[0106] 2) The last layer is required to be a fully connected layer that outputs the final classification result, which is also the convention currently adopted by researchers in this field;

[0107] 3) Fully connected layers can only be placed at the end of the model network structure and cannot be connected between convolutional or pooling layers. Individual initialization starts from the beginning of the model and adds layers one by one. Once it is determined that a fully connected layer is to be added, every subsequent layer must also be a fully connected layer.

[0108] 4) The DropOut layer is used to discard the output of some neurons in the fully connected layer, so it is required to be connected after the fully connected layer, except for the fully connected layer at the end of the model;

[0109] The process of optimizing the convolutional neural network structure includes the following steps:

[0110] Step 2.1: Population initialization, encoding the CNN model as an individual in the population;

[0111] Step 2.2, Fitness Evaluation: Compile the individual representative network structure into a complete CNN network, and use the loss function value of the final model as the fitness value of the individual.

[0112] Step 2.3: Search for the CNN network structure according to the IMBO algorithm flow;

[0113] Step 3: Construct a spatial transformation convolutional neural network (IMBO-STNsCNN) classification model based on IMBO, such as... Figure 4 IMBO-STNsCNN consists of a spatial transformation network (STNs), a VGG16 feature extraction module, and an IMBO-optimized CNN module. The spatial transformation network (STN) performs spatial transformation of the input data, and the VGG16 extracts features from the data. The STNs include a localization network, a grid generator, and a sampler.

[0114] The structure of the STNs module is as follows: Figure 5 As shown, it is a dynamic mechanism that can actively perform spatial transformations on images or feature maps by generating appropriate transformations for each input sample. The transformations are then performed on the entire feature map rather than locally, and can include scaling, cropping, rotation, and non-rigid deformation. This allows networks containing STNs to not only select the most relevant regions in the image, but also transform these regions into canonical, expected poses to simplify recognition in the following layers. Notably, spatial transformation networks can be trained using standard backpropagation, allowing end-to-end training of the models they are injected into. Furthermore, low-resolution inputs can be used for high-resolution raw inputs, thereby improving computational efficiency. The network structure of the IMBO-optimized CNN module is the optimal structure obtained through IMBO optimization. The STN module is used as the first layer of the network model for the input image, directly transforming the input. After combining the two sets of STN modules for feature extraction in the VGG network, the model can automatically extract features from multiple local regions in the feature map for classification.

[0115] The spatial transformation module STNs performs spatial transformation on images or feature maps, including the following steps:

[0116] Step 3.1: Use a localized network to obtain the input feature map, and output spatial transformation parameters applied to the feature map through the hidden layer. Use the parameters to determine the transformation method based on the input.

[0117] Step 3.2: The mesh generator uses the parameters obtained from the localized network to transform the input data of the model, which is to perform an affine transformation on the image data, as follows:

[0118]

[0119] In the formula, The pixel coordinates of the input data. θ represents the pixel coordinates of the output data. 11 θ 12 θ 13 θ 21 θ 22 and θ 23 These are the six parameters of an affine transformation, used to represent scaling, rotation, linear distortion, and translation transformations of the data.

[0120] This process yields the coordinates of each position in the transformed output feature map on the corresponding coordinate point in the input feature map. The sampler then directly extracts the pixel value of each position in the input feature map.

[0121] Step 3.3: Using the feature map and sampling grid as input to the sampler, generate a mapping of the output sampled from the input grid points;

[0122] Step 4: Introduce the concept of information entropy into the Monarch Butterfly optimization algorithm to represent the aggregation state of individuals in the population. Establish a hybrid Monarch Butterfly optimization algorithm (EHMBO) based on information entropy and a multi-mutation strategy. This achieves an adaptive balance between the algorithm's global exploration capability and local development capability, enabling individuals in the population to develop the globally optimal region more quickly and find the optimal solution. The process of introducing the concept of information entropy into the Monarch Butterfly optimization algorithm includes the following steps:

[0123] Step 4.1: Divide the individuals in the population into Land1 and Land2 according to their fitness values. Individuals in Land1 are divided into roosters, hens, and chicks.

[0124] Land1, the position of individuals in subgroup 1, is generated by the migration operator. The idea of ​​the Chicken Optimization Algorithm (CSO), which has better development capabilities, is introduced. An improved chicken migration operator is proposed to improve the migration stage of the algorithm. In the migration stage, subgroup 1 is divided into several subgroups according to the fitness value of individuals in the population. Individuals in the subgroups have a competitive and learning relationship. Each chicken is classified according to the fitness value of individuals in the subgroup. Different identities determine different behaviors.

[0125] Step 4.2, Rooster Location Update: The rooster's foraging trajectory is the path planning for food search by other types of chickens in the flock, with a relatively wide search area. Roosters with better adaptability can find food in a wider range of places than roosters with poorer adaptability. The rooster's location update is shown in formulas (2) and (3):

[0126]

[0127]

[0128] In the formula, Let represent the position of the i-th rooster in the j-th dimension at time t, f represent the fitness value of the individual, i represent the current rooster individual, k represent another rooster individual randomly selected from subgroup 1, and Randn is the mean, which is 0, and the variance is σ. 2 Normally distributed random numbers;

[0129] Step 4.3: Hen location update. The hen follows the rooster in the search and also competes with other individuals. Hens with higher fitness values ​​have an advantage over hens with lower fitness values. The hen's location is updated as shown in formula (4):

[0130]

[0131]

[0132]

[0133] In the formula, i represents the current hen, r1 is the rooster in the subgroup to which hen i belongs, r2 is another randomly selected hen, ε represents the variance based on the F distribution, and S1 and S2 both represent the difference between the two sets of fitness values, which are used to update the position.

[0134] Step 4.4, Chick position update: The single position update strategy for chicks is modified to allow them to learn from multiple targets, thereby increasing population diversity and solving the problem of blind chick selection. Simultaneously, a constructed perturbation factor is introduced into the individual position update, enabling the algorithm to achieve an adaptive balance between exploration and development. The chick position update is shown in formula (13):

[0135]

[0136]

[0137] In the formula, i represents the current chick individual, α1, α2, and α3 represent the disturbance factors based on the joint control of information entropy and relative distance, and their calculation methods are shown in formulas (12) to (14). g represents the randomly selected rooster individual, m represents the randomly selected hen individual, b represents the expelled individual generated from the rooster individual, and the position of the expelled individual is calculated as shown in formula (8). ub and lb represent the upper and lower bounds of the individual position, respectively. γ represents a normally distributed random number, q is a uniformly distributed random number in the range (0, u3), and u1, u2, and u3 represent the probabilities of the chick learning from the rooster, hen, and expelled position. The calculation of u1, u2, and u3 is shown in formula (9).

[0138]

[0139] R=abs(δ1)+abs(δ2)+abs(δ3) (10)

[0140]

[0141] α=s×E (12)

[0142]

[0143]

[0144] In the formula: u1, u2, and u3 are determined by the fitness differences δ1, δ2, and δ3 between an individual and the selected rooster, hen, and expelled individual; E is the population information entropy; s is the relative distance between two individuals; N represents the number of individuals in the population; M represents the number of targets an individual learns; H is the intermediate term for calculating the information entropy; and R is the intermediate term for calculating the intermediate term H. During the algorithm iteration process, the probability of the chick selecting a target adaptively changes, which improves the population diversity.

[0145] Land2, or subgroup 2, has its individual positions determined by an adjustment operator, which can be expressed as follows:

[0146] When r <= p, the i-th individual in subgroup 2 is generated by the following formula:

[0147]

[0148] In the formula, best represents the best individual in subgroup 1 and subgroup 2, and p represents the migration period.

[0149] When r > p, the i-th individual in subgroup 2 is generated by the following formula:

[0150]

[0151] In the formula, r3 represents an individual randomly selected from subgroup 2;

[0152] In this case, if rand > BAR, where BAR represents the adjustment ratio and rand represents a randomly generated number with the same value range as r, then the individual position can be further updated as follows:

[0153]

[0154]

[0155]

[0156] In the formula, i1 and i2 are two individuals randomly selected from subgroup 2, and T max ε represents the maximum number of iterations, t represents the current number of iterations, fpdf() represents a random number generated following the F distribution, ε represents the variance based on the F distribution, and ε0 is an algorithm parameter, set to 0.

[0157] During the algorithm tuning phase, to identify potentially better individuals in subgroup 2, the Spearman correlation coefficient is introduced. It is calculated based on the difference between the number of each pair of rank pairs in two columns of paired ranks, reflecting the strength of the relationship between the two sets of variables. It is a non-parametric statistical method, with values ​​ranging from -1 to +1. The larger the absolute value, the stronger the correlation between individuals. The calculation method for the correlation coefficient is as follows:

[0158]

[0159] Step 5: Initialize the parameters of the EHMBO algorithm, setting the population size N, the dimension of individual positions D, and the maximum number of iterations iter. max Maximum step size S max The population is initialized with the following parameters: the ratio of individuals in the subgroup to the number of individuals (partition), the migration period (period) to 1.2, and the adjustment ratio (BAR) to 1.2. The initial optimal solution in the population is then determined.

[0160] Step 6: Optimize the hyperparameters of the IMBO-STNsCNN model using the Hybrid Monarch Butterfly Optimization Algorithm (EHMBO) based on information entropy and multiple mutation strategies to further improve the model's classification performance and obtain the final classification model. Then train the final classification model to obtain the IMBO-STNsCNN ceramic artifact fragment classification model. The specific operation process is as follows: Figure 6 As shown, it includes the following steps:

[0161] Step 6.1: Initialize the monarch butterfly population and set the dimension of individuals in the population. The dimension is the number of hyperparameters to be determined in the model, including the model's learning rate, batch size, number of network iterations, and number of neurons in the fully connected layer.

[0162] Step 6.2: Initialize the IMBO-STNsCNN network. Set the learning rate, batch size, network iteration count, and number of fully connected neurons for each individual in the population. Set the upper and lower bounds for each hyperparameter. Use the loss function value of the compiled model as the fitness value of the individual in the population. The fitness of the individual is the optimization target of the algorithm. Update the global best individual in the population.

[0163] Step 6.3: Update the individual's location according to the EHMBO algorithm flow;

[0164] Step 6.4: Calculate the fitness value of an individual based on its updated position. If the fitness value of the current individual is better than that of the current global best individual, then update the global best individual in the population.

[0165] Step 6.5: If the current algorithm iteration count has not reached the maximum iteration count (iter) maxIf the result is positive, proceed to step 6.3; otherwise, the optimization ends and the optimal model hyperparameters obtained from EHMBO optimization are returned.

[0166] Step 6.6: Input the optimal hyperparameters into the IMBO-STNsCNN classification model to train the model thoroughly, obtaining the final IMBO-STNsCNN ceramic artifact fragment classification model. Figure 7 This is a curve showing the change in loss function value versus accuracy during model training.

Claims

1. A method for classifying ceramic artifact fragments based on swarm intelligence-optimized convolutional neural networks, characterized in that, Includes the following steps: Step 1: First, collect, preprocess, and augment the data of ceramic artifact fragments. Then, classify and label the ceramic artifact fragments according to their appearance characteristics to construct a ceramic artifact fragment dataset. Step 2: First, the Chicken Optimization Algorithm (CSO) is used to improve the Monarch Butterfly Optimization Algorithm in the transfer stage. Then, the reverse learning strategy based on Spearman correlation coefficient is introduced into the Monarch Butterfly Optimization Algorithm. Finally, the F-distribution random mutation of adaptive features is used to replace the Levy flight in the Monarch Butterfly Optimization Algorithm to obtain the improved Monarch Butterfly Optimization Algorithm (IMBO) for the optimization of convolutional neural network structure. Step 3: Construct an IMBO-STNsCNN classification model based on spatial transformation convolutional neural networks; Step 4: Introduce the concept of information entropy into the monarch butterfly optimization algorithm to represent the aggregation state of individuals in the population, and establish a hybrid monarch butterfly optimization algorithm EHMBO based on information entropy and multiple mutation strategy. This achieves an adaptive balance between its global exploration ability and local development ability, enabling individuals in the population to develop the global optimal region more quickly and find the optimal solution. Step 5: Initialize the parameters of the EHMBO algorithm; Step 6: Optimize the hyperparameters of the IMBO-STNsCNN classification model using EHMBO to obtain the final classification model. Then train the final classification model to obtain the IMBO-STNsCNN ceramic artifact fragment classification model.

2. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 1, characterized in that, The preprocessing in step 1 includes cropping and normalizing the images of ceramic artifact fragments.

3. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 1, characterized in that, The data augmentation in step 1 includes using the Python data augmentation library Imgaug to perform affine transformation, flipping, Gaussian blur, histogram equalization, contrast-limited adaptive histogram equalization, sharpening, and filling on the image of ceramic artifact fragments.

4. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 1, characterized in that, The process of optimizing the convolutional neural network structure in step 2 includes the following steps: Step 2.1: Population initialization, encoding the CNN model as an individual in the population; Step 2.2, Fitness Evaluation: Compile the individual representative network structure into a complete CNN network, and use the loss function value of the final model as the fitness value of the individual. Step 2.3: Search for the CNN network structure according to the IMBO algorithm flow.

5. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 1, characterized in that, In step 3, IMBO-STNsCNN consists of a spatial transformation module STNs, a VGG16 feature extraction module, and an IMBO-optimized CNN module. The spatial transformation module STNs includes a localized network, a grid generator, and a sampler.

6. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 5, characterized in that, The spatial transformation module STNs performs spatial transformation on images or feature maps, including the following steps: Step 3.1: Use a localized network to obtain the input feature map, and output spatial transformation parameters applied to the feature map through the hidden layer. Use the parameters to determine the transformation method based on the input. Step 3.2: The mesh generator uses the parameters obtained from the localized network to transform the input data of the model, which is to perform an affine transformation on the image data, as follows: In the formula, The pixel coordinates of the input data. θ represents the pixel coordinates of the output data. 11 θ 12 θ 13 θ 21 θ 22 and θ 23 These are the six parameters of an affine transformation, used to represent scaling, rotation, linear distortion, and translation of the data. This process yields the coordinates of each position in the transformed output feature map on the corresponding coordinate point in the input feature map. The sampler then directly extracts the pixel value of each position in the input feature map. Step 3.3: Use the feature map and sampling grid as input to the sampler to generate a mapping of the output sampled from the input grid points.

7. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 1, characterized in that, Step 4, which introduces the concept of information entropy into the Monarch Butterfly optimization algorithm, includes the following steps: Step 4.1: Divide the individuals in the population into Land1 and Land2 according to their fitness values. Individuals in Land1 are divided into roosters, hens, and chicks. Step 4.2, Rooster position update: The rooster's foraging trajectory is the path planning for other types of chickens in the flock to search for food. The rooster's position update is as shown in formula (2): In the formula, Let represent the position of the i-th rooster in the j-th dimension at time t, f represent the fitness value of the individual, i represent the current rooster individual, k represent another rooster individual randomly selected from Land1, and randn have a mean of 0 and a variance of σ. 2 Normally distributed random numbers; Step 4.3: Update the hen's position. The hen follows the rooster in the search and will also compete with other individuals. The hen's position is updated as shown in formula (4): In the formula, i represents the current hen, r1 is the rooster in the subgroup to which hen i belongs, r2 is another randomly selected hen, ε represents the variance based on the F distribution, and S1 and S2 both represent the difference between the two sets of fitness values, which are used to update the position. Step 4.4, update the chick's position as shown in formula (7): In the formula, i represents the current chick individual, α1, α2, and α3 represent the disturbance factors based on the joint control of information entropy and relative distance, and their calculation methods are shown in formulas (12) to (14). g represents the randomly selected rooster individual, m represents the randomly selected hen individual, b represents the expelled individual generated by the rooster individual, and the position of the expelled individual is calculated as shown in formula (8). ub and lb represent the upper and lower bounds of the individual position, respectively, γ represents a normally distributed random number, where u1, u2, and u3 represent the probabilities of the chick learning from the rooster, hen, and expelled position, respectively, and q is a random number with a value range of (0, u3). The calculation of u1, u2, and u3 is shown in formula (9). R=abs(δ1)+abs(δ2)+abs(δ3) (10) α=s×E (12) In the formula: u1, u2, and u3 are determined by the fitness differences δ1, δ2, and δ3 between the individual and the selected rooster, hen, and expelled individual; E is the population information entropy; s is the relative distance between two individuals; N represents the number of individuals in the population; M represents the number of targets learned by the individual; H is the intermediate term for calculating the information entropy; and R is the intermediate term for calculating the intermediate term H. During the algorithm iteration process, the probability of the chick selecting the target adaptively changes, which improves the population diversity.

8. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 7, characterized in that, The individual positions in Land2 are generated by an adjustment operator, which is expressed as: When r <= p, the i-th individual in Land2 is generated by the following formula: In the formula, best represents the best individual in Land1 and Land2, and p represents the migration period; When r > p, the i-th individual in Land2 is generated by the following formula: In the formula, r3 represents an individual randomly selected from Land2; If rand > BAR, where BAR represents the adjustment ratio and rand represents a randomly generated number with the same value range as r, then the individual position is further updated as follows: In the formula, i1 and i2 are two individuals randomly selected from Land2, and T max ε represents the maximum number of iterations, t represents the current number of iterations, fpdf() represents a random number generated following the F distribution, ε represents the variance based on the F distribution, and ε0 is an algorithm parameter, set to 0. During the algorithm tuning phase, to identify potentially better individuals in Land2, the Spearman correlation coefficient is introduced. Calculated based on the difference between the number of each pair of rank pairs in two columns, it reflects the strength of the relationship between the two sets of variables. It is a non-parametric statistical method, with values ​​ranging from -1 to +1. The larger the absolute value, the stronger the correlation between individuals. The calculation method for the correlation coefficient is as follows: 。 9. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 1, characterized in that, Step 5, initializing the parameters of the EHMBO algorithm, includes: first setting the size N of the individuals in the algorithm population, the dimension D of the individual positions, and the maximum number of iterations iter. max Maximum step size S max The population is initialized by setting the ratio of Land1 individuals to partition, the migration period to period = 1.2, and the adjustment ratio to BAR = 1.2, and then the initial optimal solution in the population is determined.

10. The method for classifying ceramic artifact fragments based on swarm intelligence optimized convolutional neural networks according to claim 1, characterized in that, The specific process of step 6 is as follows: Step 6.1: Set the learning rate, number of network iterations, batch size, and number of neurons in the fully connected layer in the model corresponding to the position of each individual in EHMBO. Step 6.2: Initialize the IMBO-STNsCNN network. Set the learning rate, batch size, network iteration count, and number of fully connected neurons for each individual in the population. Set the upper and lower bounds for each hyperparameter. Use the loss function value of the compiled model as the fitness value of the individual in the population. Update the global best individual in the population. Step 6.3: Update the individual's position according to the EHMBO algorithm process; Step 6.4: Calculate the fitness value of an individual based on its updated position. If the fitness value of the current individual is better than that of the current global best individual, then update the global best individual in the population. Step 6.5: If the current algorithm iteration count has not reached the maximum iteration count (iter) max If the result is positive, proceed to step 6.3; otherwise, the optimization ends and the optimal model hyperparameters obtained from EHMBO optimization are returned. Step 6.6: Input the optimal hyperparameters into the IMBO-STNsCNN classification model for model training to obtain the IMBO-STNsCNN ceramic artifact fragment classification model.

Citation Information

Patent Citations

  • An ancient ceramic source breaking and cutting method based on multi-feature information fusion

    CN109583376A

  • Method for intelligently classifying short videos

    CN115410131A