Introduction

The ancient Silk Road served as a crucial conduit for material and cultural exchange between China and the West, with glass artifacts representing one of the hallmark trade goods during the early stages. Initially, early Chinese glass objects were introduced from Western Asia and Egypt, primarily in the form of glass beads1. After assimilating foreign glass-making techniques, Chinese artisans began to produce glass locally using autochthonous raw materials. Consequently, while domestically produced glass in China often resembled imported glass in appearance, its chemical composition differed markedly2 from that of other materials. The primary component of ancient Chinese glass was quartz sand (SiO2), with limestone added as a stabilizer that, upon calcination, was converted into calcium oxide (CaO). Owing to the high melting point of pure quartz, various flux agents were required during the refining process to lower the melting temperature. In ancient China, common flux agents included lead ore, plant ash, natural natron, and saltpeter, each contributing to distinct compositional characteristics. As a result, ancient Chinese glass can be broadly classified into two main types: lead-barium glass and high-potassium glass. The former, which is produced using lead ore as the flux, typically contains elevated levels of lead oxide (PbO) and barium oxide (BaO), whereas the latter, which is refined with plant ash, is characterized by a higher content of potassium oxide (K2O). As an important category of archeological material, ancient Chinese glass not only reflects the technological evolution of domestic glassmaking but also provides essential clues regarding raw material sourcing, manufacturing techniques, and Sino-foreign exchange along the Silk Road. However, over time, glass undergoes weathering because of environmental exposure, during which time internal elements may be exchanged with external elements, altering the original chemical composition. As such, identifying glass types solely based on the present concentrations of PbO, BaO, or K2O can lead to inaccurate conclusions. Currently, the classification of ancient Chinese glass relies heavily on microscopic observation, compositional analysis, and expert interpretation. Cultural heritage specialists often base their judgments on surface characteristics such as emblazonry, color, and degree of weathering, along with their own experience. This approach, however, is highly subjective, labor intensive, and prone to error. More importantly, it tends to overlook deeper structural patterns embedded in the compositional data.

In recent years, the interdisciplinary integration of mathematics with archeology and materials science has opened new avenues and provided unique insights for the study of ancient glass artifacts. Traditional analytical methods in archaeometry rely primarily on high-resolution structural imaging under microscopy and techniques such as scanning electron microscopy with energy dispersive X-ray spectroscopy (SEM‒EDS)3 and inductively coupled plasma‒mass spectrometry (ICP‒MS)4 to examine material composition. While these techniques are effective for characterizing archeological materials, the final interpretation still depends heavily on manual comparison and expert judgment. When faced with a large volume of excavated materials or time-sensitive identification tasks, such approaches become increasingly limited in terms of their efficiency. Moreover, inconsistencies in classification criteria and interpretative perspectives across different institutions and experts often make it difficult to reach a consensus or extract deeper patterns. Currently, the application of statistical methods in archeology remains relatively limited and often relies on basic compositional comparisons, which are insufficient for analyzing the high-dimensional data inherent in archeological materials. With the rapid expansion of excavation datasets, there is a pressing need for a mature, replicable analytical framework that can handle both complexity and scale. Mathematical modeling offers a powerful tool for abstracting real-world problems into mathematical frameworks, enabling structured analysis and deeper understanding. In various fields, modeling has proven instrumental in providing practical solutions and critical insights. For instance, in agricultural production, researchers have employed mathematical models to optimize drying conditions for Garcinia fruit, ensuring better preservation without compromising nutritional quality5. In aerospace engineering, Xu Yeshou et al.6 developed a mathematical model to describe the relationship between the macroscopic damping performance of dampers and the microstructure of viscoelastic materials, effectively predicting dynamic behavior under different testing conditions. In chemistry, mathematical models have been used to determine the optimal reaction conditions and yields for the ethanol coupling synthesis of C4 olefins7. As a data-driven extension of modeling, machine learning enables computers to automatically learn and improve performance without being explicitly programmed. It addresses the limitations of traditional statistical methods and has been successfully applied in various domains, such as wastewater treatment8, biosensor design9, and cardiovascular risk prediction10. In the field of archeology, researchers have begun to apply machine learning and mathematical modeling techniques11, primarily in ceramic analysis, demonstrating the potential of data-driven approaches in material classification and interpretation12.

Based on experimental data derived from archeologists’ analyses of a collection of ancient Chinese glass samples, this study conducts compositional data processing to explore the statistical characteristics of chemical weathering in ancient glass. By applying mathematical modeling and machine learning techniques, it identifies the classification patterns of high-potassium glass and lead-barium glass, ultimately aiming to achieve efficient and accurate classification of previously unidentified glass artifacts. In the domain of ancient glass research, Li et al.13 proposed a joint machine learning algorithm (JMLA) that integrates Daen-LR, ARIMA-LSTM, and MLR for the classification of unknown types of glass. Guo et al.14 suggested using the slime mold algorithm to optimize the parameters of a support vector machine (SVM) and analyzed a dataset comprising 69 groups of glass chemical compositions. Their research demonstrated that the SVM algorithm, combined with the slime mold strategy, provides a reliable classification reference for future glass artifacts. Zou15 systematically studied the changes in the composition of ancient glass due to weathering. They analyzed the surface weathering of glass relics and its correlation with three properties and established a multivariable time series model to predict the chemical composition content before weathering. Compared with these existing studies, our work is more systematic, comprehensive, and deeply analytical. First, the chemical composition data of ancient Chinese glass are preprocessed using central log-ratio (CLR) transformation to account for the closed nature of the compositional data. Subsequently, the correlations between multiple compositional features and the classification of lead-barium and high-potassium glass are investigated. Several statistical methods are then applied to examine the underlying statistical characteristics of chemical components within the classified groups. After confirming the statistical characteristics of the component content in ancient glass, we provide a novel prediction of the chemical component content in ancient glass before weathering. We subsequently employed multiple machine learning methods to explore and compare the classification rules of ancient Chinese glass, making it possible to identify unknown glass types. To ensure the robustness and practical applicability of the classification system, a sensitivity analysis is performed on the models. Ultimately, this study proposes a specific classification scheme for ancient Chinese glass and demonstrates its reliability and interpretative value for archeological and materials science research.

Methods

Sources of data

The original experimental data used in this paper are from the attachment of Question C of the 2022 Higher Education Community Cup National Mathematical Contest in Modeling for College Students16. All the datasets used in this study are provided in Supplementary Tables S1S3, which collectively document the provenance, typology, and chemical composition of the analyzed ancient glass samples. The descriptive metadata, including the cultural relic number, decorative motif (emblazonry), glass type (such as high-potassium or lead-barium), color, and surface-weathering condition (before or after weathering), are listed in Supplementary Table S1. These categorical attributes serve to contextualize each artifact and provide a qualitative framework for subsequent compositional interpretation. Supplementary Table S2 presents the quantitative elemental compositions (wt%) of the samples used to construct the classification model, encompassing major, minor, and trace oxides—SiO₂, Na₂O, K₂O, CaO, MgO, Al₂O₃, Fe₂O₃, CuO, PbO, BaO, P₂O₅, SrO, SnO₂, and SO₂. This dataset represents the analytical foundation for distinguishing technological groups and glass-making traditions. Finally, Supplementary Table S3 includes compositional measurements of unclassified or newly examined glass specimens, recorded with the same chemical parameters and contextual information. These data were employed to test and validate the performance of the classification model, thereby bridging the analytical dataset with its archeological application.

Symbol description

Handling missing values in compositional glass data

The original dataset comprises various feature data, including elemental compositions, derived from ancient Chinese glass samples and obtained through instrumental analysis or manual inspection. Owing to potential inaccuracies caused by measurement errors, environmental weathering, and sample degradation, data preprocessing is essential to ensure the reliability and consistency of subsequent mathematical modeling and machine learning analyses.

In Supplementary Table S1, the color of samples 19, 40, 48, and 58 is missing. The after-weathering lead-barium glasses numbered 19 and 48 belong to emblazonry A, and samples 40 and 58 belong to emblazonry C. The modes of the colors of these two types of samples in Supplementary Table S1 are ‘light blue’, and the missing color is filled with ‘light blue’. The values of some chemical components in Supplementary Tables S2, S3 are missing; the reason may be that the content of the component is low, and the instruments, therefore cannot detect it. It is also possible that there is no chemical component in the sample, although this case corresponds to two different situations. Hence, for the convenience of analysis, it is regarded as the same class. Moreover, because it is necessary to take the logarithm of the chemical composition data and then perform the central log-ratio Transformation, the missing null value of the component data is 0, or the component that is not detected is replaced by a smaller positive number, 0.0001.

Validation and screening of compositional glass data

When the sum of the chemical components of ancient glass is between 85% and 105%, it is regarded as valid data. The sum of the components of samples 15 and 17 is calculated to be 79.47% and 71.89%, respectively, which are classified as invalid data. Therefore, these two sets of data were deleted from Supplementary Tables S1, S2 and not considered for the next processing steps.

Limiting conditions for compositional analysis of ancient glass

The chemical composition data of ancient glass are compositional, where the total amount of all oxides theoretically is 100%. However, incomplete detection of some minor elements often causes the total to deviate from 100%. Instead of forcing normalization, which may distort the relative proportions among detected oxides, only variables with acceptable completeness rates were retained for multivariate analysis. Following the common practice in archaeometric studies, components detected in more than 75–85% of the samples were considered reliable. In accordance with this criterion, SiO₂, CaO, Al₂O₃, CuO, and P₂O₅, to a lesser extent, PbO and BaO, as shown in Supplementary Tables S2, S3, were selected as the representative variables for subsequent statistical modeling. When using variables such as PbO or others close to the detection limit, a univariate method is considered to process them.

Central Log-Ratio Transformation (CLR) of compositional data

When machine learning and mathematical modeling techniques are applied in archeology—particularly in studies involving the elemental variation of archeological materials—it is essential to first perform a proper central log-ratio (CLR) transformation on the compositional data. The reason is that the elemental data in archeological samples typically represent closed compositions, where the sum of all components equals 100% (i.e., mass percentages). Such data exhibit compositional constraints, meaning that the components are not independent but are proportionally interdependent, rendering the use of conventional Euclidean-based statistical methods inappropriate. Owing to these constant-sum constraints, compositional variables are inherently collinear, making traditional multivariate analyses susceptible to spurious correlations and misleading results. To address this issue, British statistician John Aitchison17,18,19,20 introduced log-ratio transformation as a methodology for analyzing compositional data. This approach is grounded in the principle that the ratios between components are not influenced by the closure constraint and that the logarithms of these ratios often approximate a normal distribution. As a result, conventional statistical and machine learning techniques can be reliably applied to the transformed data, enabling valid inference and robust classification in compositional domains such as archeological materials analysis. Owing to the fixed sum constraint, the variables of the composition data have obvious collinearity, which makes the traditional statistical analysis method invalid. It is necessary to solve such problems through appropriate transformations, such as the central log-ratio transformation (CLR), asymmetric logarithmic ratio transformation, equidistant logarithmic ratio transformation, etc.

Statistical analysis of categorical associations

To assess whether macroscopic attributes correlate with surface weathering, we modeled the relationships among weathering state, glass type, emblazonry, and color using contingency-table methods. First, we constructed contingency tables between surface weathering and each categorical variable (glass type, emblazonry, and color) using the 56 artifacts listed in Supplementary Table S1. Before applying the chi-square test, we verified that the total sample size was greater than 40, that no expected cell count was less than 1, and that at least 80% of the expected cell counts were greater than or equal to 5, ensuring the validity of the chi-square approximation. For surface weathering vs. glass type, these conditions were satisfied and the chi-square test was applied to test independence at the 5% significance level. For cross-tabulations involving low-frequency categories (emblazonry and color), the chi-square assumptions were violated. In these cases, we employed Fisher’s exact test to obtain exact p-values based on the hypergeometric distribution. Because emblazonry has three levels (A, B, C), we performed pairwise Fisher tests on the derived AB, AC, and BC groups to probe potential differences in weathering distributions between motif pairs. Fisher’s exact test was also used to evaluate the relationship between weathering state and color.

Statistical analysis of chemical compositions by weathering state

To characterize how weathering affects chemical composition within each glass type, we conducted univariate analyses on CLR-transformed oxide contents. Using the five groups T₁–T₅, we first visualized distributions of SiO₂ and other selected oxides via boxplots to obtain an overview of intergroup variability. For formal hypothesis testing, we examined the distributional assumptions of SiO₂ (and other key oxides as needed) in each group. Normality was assessed using Q–Q plots together with the Lilliefors test, which is suitable for small samples with unknown mean and variance. For pairs of groups representing the same glass type before and after weathering (e.g., T₃ vs. T₄ for lead-barium), we applied two-sample t tests to evaluate whether the mean CLR-transformed oxide content differed significantly between states. To mitigate the influence of potential outliers, we examined the coefficient of variation (CV) for each group.

Estimation of pre-weathering compositions

To obtain approximate pre-weathering compositions for weathered samples, we used group-level statistics from the glass type–weathering categories defined above. For each oxide and for each glass type (high-potassium and lead-barium), we calculated the central tendency (median or mean, depending on the dispersion) in the before-weathering groups and in the corresponding after-weathering groups, and took their ratios. These type-specific ratios were then used as multiplicative correction factors, applied to the measured compositions of after-weathering samples to estimate their pre-weathering values. This procedure was only used for glass types for which both before- and after-weathering data were available, and its performance was evaluated using artifacts that have both interior (before-weathering) and surface (after-weathering) measurements (Table 1).

Table 1 Symbols and definitions of the parameters

Supervised classification of the high-potassium glass and lead-barium glass

To investigate the internal compositional heterogeneity within each major glass type, we applied unsupervised clustering to the CLR-transformed data. High-potassium and lead-barium glasses were analyzed separately. K-means clustering was used to partition samples into compositional groups based on their oxide contents. For each glass type, we first explored clustering solutions using the full set of available oxides and then performed one-way ANOVA on individual variables to identify those that contributed most strongly to between-cluster differences. Reduced-variable clustering was then carried out on these more discriminative oxides. The quality of alternative clustering schemes (different numbers of clusters and variable subsets) was compared using standard internal validity indices, including the silhouette coefficient, Davies–Bouldin index and Calinski–Harabasz index.

Unsupervised clustering for subclassification within glass types

To investigate the internal compositional heterogeneity within each major glass type, we applied unsupervised clustering to the CLR-transformed data. High-potassium and lead-barium glasses were analyzed separately. K-means clustering was used to partition samples into compositional groups based on their oxide contents. For each glass type, we first explored clustering solutions using the full set of available oxides and then performed one-way ANOVA on individual variables to identify those that contributed most strongly to between-cluster differences. Reduced-variable clustering was then carried out on these more discriminative oxides. The quality of alternative clustering schemes (different numbers of clusters and variable subsets) was compared using standard internal validity indices, including the silhouette coefficient, Davies–Bouldin index and Calinski–Harabasz index. The final subclassification schemes and their compositional characteristics are presented and interpreted in the Results and Discussion sections.

Results

CLR of Chinese ancient glass compositional data

After the sample data (Supplementary Tables S1, S2) were processed using the CLR, the data in Table 2 were obtained. All the calculated data can be found in Supplementary Table S4.

Table 2 Sample data preprocessing and CLR summary table (part)

Analysis of the relationships between the surface weathering of glass relics and the glass type, emblazonry, and color

Studying the relationships between the surface weathering of ancient glass artifacts and their glass type, decorative style, and color is highly important. On the one hand, it facilitates an understanding of the aging and degradation patterns of glass with different characteristics from a materials science perspective; on the other hand, it helps to exclude the potential interference of certain features in subsequent analytical procedures. The weathering, emblazonry, color, and type of sample cultural relics in Supplementary Table S1 are fixed class variables, and the chi-square test21,22 can be used to analyze the relationship between them. To investigate whether the expected frequency meets the requirements, the weathering condition is used as the grouping variable, with emblazonry, type, and color as the variables. The contingency table (Supplementary Table 3) was calculated by SPSS.

Table 3 Contingency results for surface weathering and emblazonry, color and type of sample cultural relics

Given the data in Table 3, it can be concluded that only the expected frequency between surface weathering and glass type meets the requirements of the chi-square test, and the chi-square test can be used; the expected frequency between surface weathering and emblazonry, surface weathering and color is equal to 0, and the chi-square test cannot be used.

The chi-square test (Table 4) is used to test the independence of surface weathering and glass type. The null hypothesis is that the glass surface weathering and glass type are independent, and the alternative hypothesis is that the glass surface weathering and glass type are not independent.

Table 4 Independent chi-square test results for surface weathering and glass type

If the significance level is 0.05 and the P value is 0.02, which is lower than the significance level, at the 95% confidence level, the original hypothesis is rejected, and glass surface weathering is not independent of the glass type; that is, the glass type affects surface weathering.

Fisher’s exact test can be used for the independent analysis of surface weathering and emblazonry, surface weathering and color23,24. Compared with the chi-square test, Fisher’s exact test is more accurate when dealing with low-frequency observations (such as fewer than 5 observations). The basic principle of Fisher’s exact test is to use the hypergeometric distribution to calculate the probability of the observation data. By comparing the difference between the observed data and the randomly distributed data, it is possible to determine whether there is a significant correlation between the two categorical variables. Because the emblazonry in Supplementary Table S1 has three levels, A, B, and C, it cannot be directly used for Fisher’s exact test. First, emblazonry A and B in Supplementary Table S1 are selected as a group, A and C, as a group, and B and C, as a group, which are called the emblazonry AB group, emblazonry AC group, and emblazonry BC group, respectively; then, Fisher’s exact test is used.

If the significance level is 0.05, the significant P value in Table 5 is 0.06, which is greater than the significance level, and the original hypothesis cannot be rejected. Therefore, no significant difference was observed between the surface weathering and emblazonry AB group. Using the same method, Fisher’s exact test P values of the surface weathering and the emblazonry AC and BC groups were 0.57 and 0.15, respectively, which are greater than 0.05. There was no significant difference between the surface weathering and emblazonry AC and BC groups. Using the same test method, it can also be concluded that there is no significant difference between surface weathering and color. Through the above discussion, it can be concluded that only the type of glass has a significant effect on surface weathering and that the color and emblazonry of glass have no significant effect on surface weathering.

Table 5 Fisher’s exact test results for surface weathering and the emblazonry AB group

Analysis of the contents of the corresponding chemical components in ancient glass before or after weathering

Statistical analysis of the chemical composition of different glass types

The 67 valid data points in Table 2 are divided into three categories, before-weathering, after-weathering, and severe-weathering, according to the weathering of the sampling points, and then divided into lead-barium glass and high-potassium glass according to the type of glass. Because there are no sampling data for severe-weathering high-potassium glass, the data in Table 2 can be divided into five categories: before-weathering high-potassium, after-weathering high-potassium, before-weathering lead-barium, after-weathering lead-barium, and severe-weathering lead-barium. These five categories are represented by the letters T1, T2, T3, T4, and T5, respectively. Note that the surfaces of the glass cultural relic samples numbered 49, 50 and 53 are after-weathering, but there is a before-weathering sampling point, and the glass weathering type should be classified as before-weathering at this sampling point. The classification of all the valid data is shown in Table 6.

Table 6 Valid data classification for the CLR data

To analyze the variation in chemical compositions of these five glass types (T1, T2, T3, T4, and T5), SiO2 was taken as an example to construct a box diagram of SiO2.

As shown in Fig. 1, the content of SiO2 in high-potassium glass is greater than that in lead-barium glass. After weathering, the content of SiO2 in high-potassium glass is the highest, with an average value of 9.09, and the content of SiO2 in severe-weathering lead-barium glass is the lowest, with an average value of 4.44. Under the conditions of known high-potassium glass or lead-bismuth glass, in order to determine whether there is a significant difference in the content of SiO2 before and after weathering. Taking lead-barium glass as an example, whether the content of SiO2 obeys a normal distribution at T3 and T4 is tested first, and a QQ diagram is constructed.

Fig. 1
Fig. 1
Full size image

Boxplot of SiO2 content in T1, T2, T3, T4, and T5.

The data points in Figs. 2 and 3 are approximately distributed near a straight line, which can be considered to obey a normal distribution. In general, the Jarque–Bera test25,26 is also needed to test normality. The Jarque–Bera test evaluates whether the null hypothesis that the sample obeys a normal distribution with unknown mean and variance is true, but the Jarque–Bera test cannot be used for small sample tests. When the sample data volume is small, the Lilliefors test27,28 can be used. With respect to this problem, the classification sample size of the sample of cultural relics is small, and the Lilliefors test can be used. After MATLAB calculation, p = 0.13 and p = 0.26 are obtained, which are greater than the significance level of 0.05, and the null hypothesis cannot be rejected. That is, the content of SiO2 under T3 and T4 obeys a normal distribution, which also verifies the theory that the component data in the introduction often obey a normal distribution after the central log-ratio transformation (CLR).

Fig. 2
Fig. 2
Full size image

qq plot of the SiO2 content in T3.

Fig. 3
Fig. 3
Full size image

Content qq plot of SiO2 in T4.

The two-sample t test29,30 is used to test whether the mean values of the two are equal. The null hypothesis is that there is no significant difference in the mean value. Using MATLAB calculations, p = 0.001, which is less than the significance level of 0.05. Thus, the null hypothesis is rejected; that is, there is a significant difference in the mean value of SiO2 in lead-barium glass before weathering (T3) and after weathering (T4). The sample mean μ, variance σ, median, 95% confidence interval \({\mu }_{c},{\sigma }_{c}\), and coefficient of variation (CV) of SiO2 in five glass types (T1, T2, T3, T4, and T5) were calculated (Table 7).

Table 7 Sample mean, variance and 95% confidence interval of SiO2

The coefficient of variation \({CV}\) of T2 and T3 was less than 0.15, indicating that there was a small probability of outlier values in the current data and that the average value could be used for statistical analysis. The coefficient of variation (CV) of T1, T4, and T5 was greater than 0.15, indicating that there might be outliers in the data. The medians of 6.59, 5.25 and 4.10 were used for statistical analysis. Using the same analysis method, the mean (or median) of other chemical components under different types of glass can be calculated.

From Table 8, it can be concluded that the mean values (medians) of SiO2, K2O, PbO, and CuO in the high-potassium glass before and after weathering are quite different; in the lead-barium glass, the mean values (median) of Na2O, K2O, Fe2O3, and P2O5 before and after weathering are quite different. The mean values (medians) of SiO2, Fe2O3, PbO, BaO, and SO2 in the severe-weathering and after-weathering glass types are quite different.

Table 8 The mean (or median) of each chemical composition for different glass types

According to the after-weathering point data, the chemical composition content before weathering is predicted

As shown in Table 2, the cultural relics of samples 49 and 50 are lead-barium glass, which has sampling data for both before-weathering points and after-weathering points. Chemical composition histograms of samples 49 (Fig. 4) and 50 (Fig. 5) before and after weathering, respectively, are drawn below.

Fig. 4
Fig. 4
Full size image

Histogram of before-weathering and after-weathering chemical components for sample number 49.

Fig. 5
Fig. 5
Full size image

Histogram of before-weathering and after-weathering chemical components for sample number 50.

The proportion of each chemical component in the two samples is generally essentially the same, as shown in Fig. 5, and the specific values are slightly different. Unfortunately, only these two sets of matching data before-weathering and after-weathering have a small amount of data and lack high-potassium glass matching data. Therefore, according to the after-weathering point data, predicting the chemical composition content before weathering through regression, neural networks, and other models is inappropriate.

From the discussion in Section “Analysis of the relationships between the surface weathering of glass relics and the glass type, emblazonry, and color”, it is evident that only the type of glass has a significant effect on surface weathering and that the color and emblazonry of the glass have no significant effect on surface weathering. Therefore, when predicting the chemical composition content before weathering, only the type of glass needs to be considered, and the color and emblazonry do not need to be considered. Through the comparison of Fig. 4 and Fig. 5, the numerical changes in each chemical component in different samples before and after weathering are different, but the overall ‘appearance’ is consistent; that is, the proportion of each chemical component is nearly consistent; therefore, it is speculated that under different glass types, the ratio of the mean value (median) of chemical composition before weathering to the mean value (median) after weathering can be used to describe the change rule between them. From the compositional statistics summarized in Table 8, the median (or mean) concentration of each oxide for the different glass types was obtained. Based on these values, the proportional change in each chemical component before and after weathering was computed according to Eq. (1), yielding the ratio parameter \({k}_{{ij}}\)(\(i=\mathrm{1,2},\ldots ,14{;\; j}=\mathrm{1,2})\), where \(i\) represents the fourteen analyzed oxides and \(j\) corresponds to the high-potassium (\(j=1\)) and lead-barium (\(j=2\)) glass groups.

$${k}_{i1}=\frac{T1\left(i\right)}{T2\left(i\right)},{k}_{i2}=\frac{T3\left(i\right)}{T4\left(i\right)}$$
(1)

The chemical composition content before weathering can be predicted by multiplying \({k}_{{ij}}\) by the detection data of the after-weathering points. To verify the feasibility of this prediction method, the data of cultural relics No. 49 and No. 50 are used for verification. First, the value of \({k}_{i2}\) is multiplied by the chemical composition data of the after-weathering points to obtain the prediction data before weathering, after which the absolute error between the prediction data and the measured data is calculated. The complete table content can be found in Supplementary Table S5.

From Table 9, it can be concluded that the absolute error of the prediction of 9 chemical components, such as SiO2, CaO, MgO, Al2O3, and CuO, is small, and the absolute error of the prediction of 4 chemical components, such as Na2O, K2O and Fe2O3, is large. The reason for this finding may be that although the sample cultural relics are divided into three categories—before-weathering, after-weathering, and severe-weathering—the situation of the same type of individuals is different.

Table 9 Numbers 49 and 50 The predicted values and errors before the weathering of cultural relics (part)

Analysis of the classification law of high-potassium glass and lead-barium glass

For a cultural relic worker, fast and accurate classification of glass relics is necessary, which is a supervised classification problem. In Section “Analysis of the contents of the corresponding chemical components in ancient glass before or after weathering”, the mean (median) of each chemical composition in different glass types is calculated, and Table 8 is obtained. From Table 8, it can be concluded that the values of SiO2, K2O, PbO, and BaO in high-potassium glass and lead-barium glass are quite different. The key to classifying ancient Chinese glass relics is the selection of one or more chemical components to categorize and distinguish different types of glass. In the following, several types of classification models commonly used in machine learning are employed for analysis.

Decision trees

In accordance with the data in Table 2, MATLAB is used to construct Fig. 6.

Fig. 6
Fig. 6
Full size image

Decision tree for high-potassium and lead-barium glass.

The results revealed that the classification results were related only to the chemical composition of No. 9, that is, the value of PbO. The threshold value of the decision tree output was 3.04; when the content of PbO was less than 3.04, the sample was classified as high-potassium; otherwise, it was classified as lead-barium. The evaluation index of a classification method can be described by the importance of the chemical composition of the classification, the accuracy of the training set and the test set, and the F1 score. The above indices of the decision tree were calculated. The results indicate that the characteristic importance of PbO is 100%, and the accuracy and F1 score are both 1; that is, the use of PbO can completely divide the sample cultural relics into two categories, and the accuracy of each sample classification is 100%.

To further explore the use of decision trees to classify cultural relics, according to the weathering of cultural relics, they are divided into two categories. Decision tree models are established for before-weathering cultural relics and after-weathering cultural relics, and the branches of the decision trees are compared.

It can be concluded from Fig. 7 that the classification of before-weathering cultural relics is consistent with the decision tree of the overall classification; that is, the classification result is related only to the size of the PbO. When the content of PbO is less than 3.04, it is classified as a high-potassium class; otherwise, it is classified as a lead-barium class. In after-weathering cultural relics, the classification index is SiO2. When the content of SiO2 is less than 8.006, the after-weathering cultural relics are classified as lead-barium; otherwise, they are classified as high-potassium.

Fig. 7
Fig. 7
Full size image

Before-weathering and after-weathering decision trees.

Logit regression

Logit regression31,32, in this classification problem, because the sample data in Table 2 have been transformed by the central logarithm ratio, the collinearity between the chemical components is eliminated. The glass type (high-potassium, lead-barium) is regarded as the two-class classification data, and the chemical components are quantitative data. Using the binary logit model, F1 = 1 in the training set and test set can be obtained by SPSS calculation. The logit regression confusion matrix heatmap shows that logit regression correctly classifies the sample’s cultural relics.

Support Vector Machine (SVM)

A support vector machine (SVM)33,34 can solve the problem of machine learning in the case of small samples and simplify common classification and regression problems. When SPSS is used for calculations, the model results indicate that both the accuracy and the F1 score are 100%. All the lead-bismuth glasses can be classified correctly. It can be concluded that the classification effect of support vector machines is also good.

Random forest

In machine learning, random forest35,36 is a classifier containing multiple decision trees, and the output category is determined by the mode of the category output by individual trees. Leo Breiman37,38 and Adele Cutler39 developed the random forest algorithm. The results of the random forest can be obtained by SPSS calculations, for which F1 = 0.973; the importance of the characteristics involves many chemical components: PbO accounts for 27.3%, BaO accounts for 15%, and SrO accounts for 10.6%. The results show that one sample was misclassified.

Identification and sensitivity analysis of unknown types of glass relics

According to the evaluation results of the above four commonly used classification models, the F1 values for the decision tree, binary logit regression and support vector machine (SVM) are all 1, and the classification effect is the best. The F1 value for random forest is 0.976, and the classification effect is better.

To analyze the sensitivity of the above five methods, the data in Supplementary Table S3 (after normalization and central log-ratio transformation) are supplemented with a certain proportion of noise and then classified by the above five methods. After adding 5% noise to the data in Supplementary Table S3, the A6 category obtained by the after-weathering decision tree changed; after adding 10% noise to the data in Supplementary Table S3, the discrimination of two cultural relics by the after-weathering decision tree changed, the discrimination of one cultural relic by random forest changed, and the discrimination of cultural relics by the decision tree, binary logit and support vector machine (SVM) did not change. Therefore, the decision tree, binary logit, and support vector machine (SVM) methods demonstrated better anti-interference effects.

To evaluate the effectiveness of the proposed mathematical model, we applied it to classify ancient glass artifacts of unknown types (Supplementary Table S3) and further assessed its robustness under data perturbations. The data for each chemical component in Supplementary Table S3 were normalized, and the central log-ratio transformation (CLR) was performed. The above decision tree, binary logit regression, support vector machine (SVM) and random forest methods were used for classification. The results of classifying unknown types of ancient glass using machine learning models are shown in Table 10.

Table 10 Type identification of unknown cultural relics under different classification models

The cultural relic numbers A1, A3, A4, A5, A6, A7, and A8 and the five classification methods are consistent. The cultural relic number A2, decision tree, binary logit, and support vector machine (SVM) are classified as lead-barium, and the other two methods are classified as high-potassium. According to the discussion of the first five classification methods, A2 should be classified as lead-barium. All the unknown types of glass artifacts were successfully classified, and the results are presented in Table 11.

Table 11 Classification table of unknown types of ancient glass

To evaluate the robustness of the five classification methods described above, we introduced controlled noise into the dataset (Suplementary Table S3), which had been preprocessed through central log-ratio (CLR) transformation. Specifically, noise was added at two levels (5% and 10%) to the composition data of the unknown-type glass artifacts, and the classification performance of the five models was reevaluated. When 5% noise was added, the classification result of one artifact (A6) changed under the weathering decision tree model. At the 10% noise level, the weathering decision tree misclassified two artifacts, and the random forest model misclassified one artifact. In contrast, the standard decision tree, binary logistic regression (logit), and support vector machine (SVM) models maintained consistent classification results across both noise levels. These findings indicate that the decision tree, binary logit, and SVM classifiers exhibit strong resistance to data perturbation and demonstrate superior robustness.

Subclass division of high-potassium glass and lead-barium glass

In Part 3.4, the classification rules of high-potassium glass and lead-barium glass are discussed. Sometimes, it is necessary to classify these two types of glass into subcategories. This is an unsupervised classification problem. The high-potassium glass data in Table 2 are subjected to K-means clustering, K = 2.

It can be concluded from Table 12 that the P values of CaO, SO2, SrO, PbO, BaO, and CuO are all less than 0.05, which is significant at this level. The null hypothesis is rejected, indicating that there are significant differences between the above chemical components in the categories classified by cluster analysis.

Table 12 K-means clustering statistical table of high-potassium glass

The contour coefficient is the average of the contour coefficients of all the samples. The value range of the contour coefficient is [–1, 1]. The closer the distance of the samples in the same category is, the farther the distance of the samples in different categories is, the higher the score is, and the better the clustering effect is. The DBI (Davies–Bouldin) index is used to measure the ratio of the intracluster distance to the intercluster distance of any two clusters. The smaller the index is, the better the clustering effect is. The CH (Calinski–Harbasz score) index is obtained as the ratio of separation to tightness. The larger the CH is, the better the clustering effect is. As shown in Table 13, when the contour coefficient = 0.246, DBI = 1.597, and CH = 4.746, these indicators do not look too good. Taking K = 3 and K = 4, the contour coefficients can be calculated to be 0.251 and 0.22, respectively. With increasing K, the increase in the contour coefficient is not obvious.

Table 13 K-means clustering evaluation index of high-potassium glass (K = 2)

The analysis of the data in Table 12 shows that the chemical components of CaO, SO2, SrO, PbO, BaO, and CuO significantly differ among the categories classified by cluster analysis, and these six chemical components were selected for clustering again.

The contour coefficient and CH greatly improved, and the clustering effect significantly improved (Table 14).

Table 14 K-means clustering evaluation index of selected chemical components of high-potassium glass (K = 2)

From Table 15, it can be concluded that high-potassium glass can be divided into two subcategories according to its chemical composition. The contents of SO2, CaO, and CuO in the first subcategory are relatively high, while the contents of SrO, PbO, and BaO in the second subcategory are relatively high. The first subcategory is named high-potassium-CaO-CuO glass, and the second subclass is named high-potassium-BaO-PbO glass. The subclassification of lead-barium glass is carried out according to the same logic.

Table 15 K-means clustering variance table of selected chemical components of high-potassium glass (K = 2)

The calculation results (Tables 16 and 17) of the contour coefficient and CH are good. The lead-barium glass can be clustered into three subclasses by using Na2O, MgO, SO2, P2O5, CuO, BaO and Fe2O3. The contents of MgO and Fe2O3 in the first subclass are high, the content of Na2O in the second subclass is high, and the contents of BaO and CuO in the third subclass are high. These subclasses can be called lead-barium-MgO-Fe2O3, lead-barium-Na2O, and lead-barium-BaO-CuO glass, respectively.

Table 16 K-means clustering variance table (K = 3) of selected chemical components of lead-barium glass
Table 17 K-means clustering evaluation index of selected chemical components of lead-barium glass (K = 3)

Discussion

In this study, we present a data-driven classification framework for ancient glass, moving beyond traditional typological approaches by applying multivariate clustering to compositional data. We demonstrate that within the broadly classified high-potassium and lead-barium glass groups, distinct compositional subcategories emerge—namely, a high-potassium–CaO–CuO class versus a high-potassium–BaO–PbO class and three lead-barium subclasses enriched in MgO–Fe₂O₃, Na₂O, and BaO–CuO. By linking categorical variables (surface-weathering state, glass type, emblazonry, and color) via χ² and Fisher’s exact tests, we found that only the glass type correlates significantly with the weathering state, whereas emblazonry and color do not. These findings align with those of mechanistic studies showing that glass durability is strongly governed by composition and ionic mobility rather than serving merely as decorative or esthetic attributes40. Specifically, alkali-rich networks (such as high-potassium glass) are known to leach modifier cations more rapidly, thus accelerating surface degradation, whereas glasses containing lead and barium may form more chemically resistant structures, thereby reducing weathering41,42.

Building upon the compositional clustering framework described above, the present analysis highlights that the accurate classification of ancient glass cannot rely solely on macroscopic indicators such as surface weathering but must integrate the quantitative chemistry of the artifacts. The elemental composition of archeological glass is inherently compositional and constrained by the constant-sum rule, which renders conventional statistical methods inappropriate and results in calculation error43,44. To address this issue, the present work applies the centered log-ratio (CLR) transformation, a technique designed to preserve the relative structure of compositional data while enabling valid multivariate inference. According to the classification characteristics of the sample data, glass sample cultural relics are divided into five categories: before-weathering high-potassium, after-weathering high-potassium, before-weathering lead-barium, after-weathering lead-barium, and severe-weathering lead-barium. Taking SiO2 as an example, the distribution of the chemical composition in these five types of glass was discussed. The difference in SiO2 before and after weathering was tested by a two-sample t test, which revealed a significant difference in SiO2 before and after weathering. The sample mean or median of each chemical composition in the five kinds of glass was calculated. The change rule of each chemical composition before and after weathering was reflected by their ratio so that the chemical composition before weathering could be estimated according to the chemical composition after weathering. Such a data-driven approach establishes a quantitative bridge between glass alteration chemistry and classification modeling, providing a unique perspective to restore the elemental content of cultural relics.

The sum of the chemical composition ratios of ancient glass products should be 100%, which is typical component data. Many negative correlations were observed in the ancient glass composition data after CLR conversion. The fundamental reason for this negative correlation is that the sum of the chemical composition of the glass is zero. Since the content of trace elements in the ancient glass sample is very low, the glass is weakly affected by the overall additive effect. The conversion of CLR results in an artificial additive effect, resulting in a large number of negative correlations between trace elements. ILR is an effective method for analyzing geochemical composition data because of its superior theoretical properties. However, when the sum of components is not equal to 1, caution needs to be taken45. The calculation process of ILR is based on the assumption that the sum of the components is equal to 1. Notably, ILR does not involve one-to-one transformation. The transformed data cannot be used for the study of single elements, but can be used only for those based on a correlation coefficient matrix or a covariance matrix. In the analysis of ancient glass chemical composition data, the proportion of trace elements is very small, and the influence of the main elements on their content is weak. Therefore, when only trace elements or the chemical composition data of ancient glass for which the sum of each component is not equal to 1 are used, the use of central log-ratio transformation (CLR) is the most appropriate method.

To further elucidate the classification patterns derived from compositional clustering, multiple machine-learning algorithms—including decision tree, logistic regression, support vector machine (SVM), and random forest—were implemented to model the relationships between oxide composition and glass type. Among these, the decision tree, logistic regression, and SVM methods exhibited strong predictive performance and robustness against noise, confirming the stability of compositional boundaries across analytical uncertainties. Notably, the decision tree model identified PbO content as the most decisive variable for distinguishing lead-barium glass subclasses, reflecting the pivotal technological role of lead oxide as both a flux and optical modifier in ancient Chinese glassmaking46,47. The consistent prominence of PbO in model splits supports previous archaeometric interpretations that lead addition marked a deliberate technological innovation for achieving higher refractive indices and enhanced workability48. Sensitivity analysis performed on unknown or weathered samples demonstrated that the trained classifiers could reliably infer glass type even when partial compositional data were missing, thus underscoring their potential for nondestructive provenance and authenticity assessments.

This study demonstrates that integrating compositional data analysis with machine learning provides a powerful framework for decoding technological patterns in ancient Chinese glass. Beyond its archeological implications, this approach exemplifies how quantitative data-mining techniques can enhance material characterization and authentication in conservation science. Future work should expand the dataset to include isotopic and microstructural parameters, allowing the integration of multimodal data into unified predictive frameworks49,50. Ultimately, the methodology presented here establishes a scalable model for transforming complex heritage datasets into interpretable technological narratives, bridging chemistry, archeology, and computational science within the broader discourse of cultural heritage research.

Fig. 8
Fig. 8
Full size image

Schematic diagram of the research workflow.