Next Article in Journal
A Cascading Delphi Method-Based FMEA Risk Assessment Framework for Surgical Instrument Design: A Case Study of a Fetoscope
Previous Article in Journal
Generating 1 km Seamless Land Surface Temperature from China FY3C Satellite Data Using Machine Learning
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Ensemble Method of Triple Naïve Bayes for Plastic Type Prediction in Sorting System Automation

by
Irsyadi Yani
1,*,
Ismail Thamrin
1,
Dewi Puspitasari
1,
Barlin
1 and
Yulia Resti
2
1
Department of Mechanical Engineering, Faculty of Engineering, Universitas Sriwijaya, Jl Raya Palembang Prabumulih Km. 32, Inderalaya 30062, Ogan Ilir, Sumatera Selatan, Indonesia
2
Department of Mathematics, Faculty of Mathematics and Natural Science, Universitas Sriwijaya, Jl Raya Palembang Prabumulih Km. 32, Inderalaya 30062, Ogan Ilir, Sumatera Selatan, Indonesia
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(11), 6201; https://doi.org/10.3390/app15116201
Submission received: 25 February 2025 / Revised: 11 April 2025 / Accepted: 29 April 2025 / Published: 30 May 2025

Abstract

Recycling has been acknowledged as a viable alternative for the management of plastic refuse. An automatic sorting system is required by the industry to predict the plastic waste based on the type before it is recycled. The plastic sorting system automation requires intelligent computing as a software system that can predict the type of plastic accurately. The ensemble method is a method that combines several single prediction methods based on machine learning into an algorithm to obtain better performance. This study aims to build intelligent computing for the automation of digital image-based plastic waste sorting systems using an ensemble method built from three naïve Bayes single prediction methods. The three single models consist of one Naïve Bayes (NB) model with crisp discretization and two NB models with fuzzy discretization, namely those using a combination of linear–triangular fuzzy membership functions and a combination of linear–trapezoidal fuzzy membership functions. We hypothesize that the performance of each single model and the proposed ensemble model is different, and the performance of the ensemble model is higher than all the single models used to build it. The hypothesis is proven, and there is an increase in performance from each single method to the ensemble method ranging from 2.06% to 5.56%. The evidence of this hypothesis also shows that the performance of the proposed prediction model using the ensemble method built from three naive Bayes models is high and robust.

1. Introduction

The use of plastic is becoming more widespread in countries experiencing economic expansion [1]. Since 2000, plastic waste has more than doubled [2]. The 2023 Indonesian River Affairs Research Agency census conducted in 13 provinces shows that plastic waste is a major problem in Indonesia. The nature of plastic waste, which is difficult to decompose, has a very broad negative impact on various ecosystems, human health, and many species [3,4].
Recycling has been identified as a viable alternative for plastic waste management [5]. However, on the other hand, it can cause cross-contamination between types of plastic, thereby increasing industrial operational costs [6,7]. In the industrial process, plastic waste recycling requires an automatic sorting system to sort plastic waste based on its type. This system requires intelligent computing that should not only consider advanced technology in obtaining data, the number of samples, and the validation techniques used but also consider that the performance of the prediction model obtained is not only high but also robust, not because of luck or coincidence due to sampling carried out in the training and testing process. High, stable, and robust prediction performance will provide an effective and efficient sorting system [8,9].
In the current era of Industry 4.0, the use of digital images extracted into the chromatic model of Red, Green, and Blue (RGB) as datasets in solving prediction or identification-related problems is increasing rapidly because it is cheaper than other technologies [10], such as multi-wavelength transmission spectrum [7], image sensor [4], laser [11], or infrared sensor [12,13,14]. Some infrared sensor technologies that use spectroscopy are claimed to be low cost, but the prediction performance of the intelligent system that is built is still not satisfactory, with performance metrics below 73% [14], or the performance obtained uses very few samples [7,12], or the performance obtained is not yet robust because it is only based on one sampling [4,7,12,13,14].
Digital images processed using the chromatic model of RGB are generally more informative [15], have a real difference between the channel colors [16,17], and can also provide good predictive performance [18,19,20]. However, not all prediction methods in machine learning can directly process ratio-scale data generated by digital image processing to the chromatic model of RGB. In addition, the process of transforming ratio data to ordinal or nominal can produce ambiguous interval groups [21], especially digital image data processed into the RGB color space model [22,23], so the transformation carried out becomes inefficient [24]. Fuzzy discretization can overcome the problem of ambiguity in datasets [25,26], and in addition, it has the potential to enhance the prediction method’s efficacy [27,28]. Nevertheless, the prediction model’s efficacy with fuzzy discretization is significantly influenced by the combination of fuzzy membership functions employed [22,29].
The main challenge in building and developing intelligent computing is to obtain high, stable, and robust prediction performance. The ensemble method is a method that combines several single prediction methods based on machine learning into an algorithm to obtain better performance [30]. This method is one of the solutions when a single prediction method does not provide satisfactory prediction performance [31]. This method can also reduce prediction variance [32] and increase the robustness of the performance of a single method [33,34]. However, not all combinations of single prediction methods into ensemble methods provide good performance [31,34]. In-depth research is needed regarding the combination of single prediction methods that build it.
For this reason, this study aims to build and develop intelligent computing for the sorting system automation of plastic waste based on digital images using an ensemble method constructed from three basic prediction methods based on the Naïve Bayes (NB) model. The novelty of this work is the construction of an ensemble model based on three single NB models to predict three types of plastic as an intelligent system in sorting automation. One NB model with crisp discretization and two NB models with fuzzy discretization are the components of three basic models. For fuzzy discretization models, they are combinations of linear–trapezoidal fuzzy membership functions and linear–triangular fuzzy membership functions. Both combinations of fuzzy membership functions provide superior performance in several applications [22,29]. We hypothesize that the performance of the three NB-based basic models and the suggested ensemble models is different and that at least one of the suggested ensemble models has a higher performance than all NB-based single models.

2. Materials and Methods

2.1. Materials

The digital images of plastic waste that were deposited on a conveyor belt were captured to obtain the material for this work. The digital images were subsequently transformed into a chromatic model of the RGB and produced numerical data with a ratio scale. The capturing process is given in Figure 1.
This research involved three types of plastic that are commonly used in society and can decompose into waste as the dataset: Polyethylene Terephthalate (PET/PETE), High-Density Polyethylene (HDPE), and Polypropylene (PP). Samples of each type were 150 different objects, so the total sample was 450. Digital images of the objects were obtained through the capture process at random poses using a webcam with automatic lighting. We then processed the images using the RGB color model. This study’s plastic objects were intact and undamaged and had previously undergone a thorough cleaning to remove all dirt attachments.

2.2. Methods

Model development begins with transforming data from numerical form to categorical form using discretization, consisting of crisp discretization and fuzzy discretization. Each is built based on the notion of crisp and fuzzy set membership. In the notion of crisp set, an entry of universal X is denoted as x A if it is a member of set A . On the contrary, if x is not an entry of A , it is denoted as x A . Consequently, the membership degree of x in set A is limited to either 1 or 0, which is written as μ A x = 1   or μ A x = 0 [22]. In the notion of fuzzy set, the membership degree x in set A is contained in the range [0, 1]. This value is formulated in a function called the fuzzy membership function. This function shows the value of the membership of each value in a given fuzzy set X ~ d . If x possesses the highest membership value, it is considered a member of set A [22,35].
The number of categories in each predictor variable is determined by antecedent information or expert justification in crisp discretization, and the interval boundaries between categories are distinct [22,29]. Determining the category interval limits for each numeric variable with a ratio scale using (1), x d o and x d   are the d -th continuous and the d -th discretized predictor variable values, respectively [22]:
x d = x d o + R a n g e x d o
The number of categories in fuzzy discretization is determined by the categories that are established through crisp discretization, but it also accommodates overlapping class intervals [22]. Each variable is discretized through three categories, and each category is represented by a single fuzzy membership function. Suppose X   is the universal set of the fuzzy set, X ~ d , with element x f and membership function μ X ~ d x f , then the fuzzy set X ~ d is the ordered pairs of each x f and μ X ~ d x f [35]:
X ~ d = x f , μ X ~ d x f x f X
The fuzzy membership function μ X ~ d x f is defined as μ X ~ d x f : X     0 ,   1 , and every element x f of X is assigned a value within the interval [0, 1].
Naïve Bayes is a high-performance method for making predictions based on digital images [36,37], especially those that handle the vagueness that results from discretization [22]. However, sometimes this method also does not provide satisfactory performance [38]. The ensemble method is a machine learning-based algorithm that integrates multiple single prediction methods to enhance performance [30]. This technique is one of the solutions available when the prediction performance of a single prediction method is not satisfactory [31].
In this work, we suggest an ensemble method constructed from three basic naive Bayes models to predict plastic types. We form one naive Bayes model based on the results of the crisp discretization and two naive Bayes models based on the fuzzy discretization. Each discretization is formed based on antecedent information that the predictor variables obtained from digital image processing are categorized into dark, moderate, and light for each red, green, and blue color channel. The higher the color pixel value in each channel, the lighter the color displayed. The variance and entropy variables are also classified into three categories: low, moderate, and high. A higher value is indicated by a higher number in these two variables.
In the naïve Bayes method, an object or observation is predicted into a specific class based on the maximum posterior probability. The posterior probability is determined according to the Bayes theorem, which is based on the assumption that the predictor variables are independent in a naive (strong) manner.
Let Y j     be the target variable that denotes the j -th class of plastic type, P Y j   be the j -th class or type prior probability, P X 1 , , X D Y j   be the likelihood function of the D predictor variables, and P X 1 , , X D   be the joint distribution function of the plastic type. The posterior probability of the plastic type is written as follows [18,22]:
P Y j X 1 , , X D = P Y j   P X 1 , , X D Y j P X 1 , , X D = P Y j   d = 1 D P X d Y j   d = 1 D P X d
To involve discretization in the naive Bayes method, either crisp or fuzzy discretization, the predictor variables need to be of categorical type, so Equation (3) is adjusted to become Equation (4) [22,36]:
P Y j X 1 , , X D = d = 1 D n X d Y j + 1 n Y j + D d = 1 D k m n k X d Y j + 1 n X d Y j + m
where n X d Y j   is the amount of plastic images associated to the j -th class in all variables X , n Y j   is the amount of plastic images in the j -th class, n c X d Y j   is the amount of plastic images associated to the j -th class in a variable X d   with category k , and m is the number of categories in the variable X d .
The j -th likelihood function and the j   -th class or type prior probability, respectively, can be expressed as follows [18,22,36]:
P X d Y j = k m n k X d Y j + 1 n X d Y j + m
P Y j = d = 1 D n X d Y j + 1 n Y j + D
The following assumptions are needed to integrate fuzzy discretization into naive Bayes. Suppose X ~ d = x f 1 ,   x f 1 , x f Z   is the fuzzy sample information space of the red, green, and blue as predictor variables of X d , x f z X   is the independent event, and μ X ~ d x f z   is the fuzzy membership function of X d , then the fuzzy sample conditional probability function is formulated as P X ~ d Y j = z = 1 Z P x f z Y j μ X ~ d x f z , and the prior probability of the predictor variable is P X ~ d = z = 1 Z P x f z μ X ~ d x f z . Since the evidence is not fixed in the fuzzy set and the Laplace smoothing effect, the posterior probability is as follows [22,39]:
P Y j X 1 , , X D =   P Y j d = 1 D P X ~ d Y j d = 1 D P X ~ d =   P Y j d = 1 D z = 1 Z P x f z Y j μ X ~ d x f z + 1 Z d = 1 D z = 1 Z P x f z μ X ~ d x f z + 1 Z
The development of the naive Bayes model using fuzzy discretization includes two different combinations of fuzzy membership functions. First, a combination of triangular functions and linear functions (decreasing, increasing). Second, a combination of trapezoidal functions and linear functions (also decreasing and increasing). In both combinations, decreasing and increasing linear functions are used to discretize the first and third categories for each predictor variable, while triangular and trapezoidal functions are used to discretize the second category in each combination. The fuzzy membership functions are presented in Equations (8)–(11).
Assume that a is the least conspicuous domain entry with a membership value of 1, and b is the most conspicuous domain entry with a membership value of 0. The decreasing linear function is expressed as follows [22,40]:
μ X ~ d x f ; a , b = 1                                                             x f a b x f b a                           a x f b 0                                                             x f b
Let a   be the least conspicuous domain entry with a membership value of 0, and b be the most conspicuous domain entry with a membership value of 1. The increasing linear function can be written as follows [22,40]:
μ X ~ d x f ; a , b = 0                                                             x f a x f a b a                           a x f b 1                                                             x f b
For the triangular membership function, assume that a is the least conspicuous domain entry with a membership value of 0, b is a domain entry with a membership value of 1, and c is the most conspicuous domain element with a membership value of 0. The function can be formulated as follows [22,29,41]:
μ X ~ d x f ; a , b , c = 0                                                             x f a x f a b a                           a x f b c x f c b                           b x f c 0                                                             x f c
Let a be the least conspicuous domain entry with a membership value of 0, b be a domain entry with a membership value of 1, c be a domain entry with a membership value of 1, and d be the most conspicuous domain entry with a membership value of 0. The trapezoidal membership function is represented as follows [22,41]:
μ X ~ d x f ; a , b , c , d = 0                                                             x f a x f a b a                           a x f b 1                                             b x f c d x f d c                           c x f d 0                                                             x f d
In the machine learning concept, the prediction model performance is validated for unseen data, so the data must be split into training or modeling and test data. This research applied the k-fold cross-validation with k = 5 in the split dataset. The dataset was randomly separated into five folds of similar size, with one fold allocated as testing data and the remaining four assigned as modeling data. Each of the five iterations contained distinct data compositions for modeling and testing with a ratio of 80:20. The final model performance was the average of the five iterations [42,43]. The 5 fold was less biased compared to other numbers of folds [44] and capable of evaluating the quality and the stability of the model as well as preventing overfitting without reducing the quantity of learning data used [42].
The ensemble prediction model performance was then tested to obtain prediction results, as are all basic models. Let T P j be the true positive prediction at j -th class, T N j be the true negative prediction at j -th class, F P j be the false positive prediction at j -th class, and F N j     be the false negative prediction at j -th class. For the first class, all of the true and the false predictions are given in Table 1, and the other classes can be found similarly.
The evaluation metrics of model performance for J classes of plastic type are given in (12)–(14) [20,45].
A c c u r a c y = j = 1 J T P j + T N j T P j + F P j + F N j + T N J
P r e c i s i o n = j = 1 J T P j T P j + F P j J    
R e c a l l =   j = 1 J T P j T P j + F N j J
A satisfactory prediction performance is indicated by the highest metric size. In general, the research steps are described in Figure 2.

3. Results and Discussion

The five components of image processing in the chromatic model of RGB are red, green, and blue color channels as well as entropy and variance that are used as predictor variables and denoted by X 1 ,   X 2 , X 3 , X 4 , and X 5 , successively.
The summary of the predictor variables after rescale into 0–1, as represented in Figure 3, shows that some variables have a minimum value of zero and not all variables have a maximum value of 1 (with rounding to two decimal places). HDPE type has the highest mean value for all variables, except for variable X 4 , which is the smallest compared to the other classes. The lowest maximum value is owned by variable X 5 in the PP type.
Assessing the Pearson correlation is helpful to show that the naïve assumption between predictor variables in the naïve Bayesian method is met. As presented in Figure 4, in the overall data, the majority of correlations are high (more than 0.7), indicating a strong linear relationship, both positive and negative [46]. In both plastic types PET and HDPE, in addition to having a majority of high correlations, there are also very high (very strong) correlations. In the PP type, although the majority of correlations are low, there is one high correlation, namely the correlation between variables X 2 and X 5 .
Assessing the Gaussian assumption is helpful to show that the assumptions in the naïve Bayesian method for numeric predictor variables in the case of this study are not met; therefore, the discretization of predictor variables is indeed feasible, so the naïve Bayes method can be used. The histograms for each predictor variable are presented in Figure 4. All variables in Figure 5a,b show excessive skewness because they have two peaks in two different locations (bimodal). In Figure 5c, the preponderance of the variable distribution skews to the left (the median is greater than the mean), X 4 only tends to be skewed to the right (the median is smaller than the mean), and a bimodal distribution is prevalent for X 5 . In Figure 5d, the distribution of X 5 is biased to the right, whereas the other three variables are characteristically bimodal. This fact shows that, both in the data as a whole and for each plastic type, all are not Gaussian distributed, except for variable X 4 in the PP type.
Since the assumptions of the naïve Bayes method for numeric variables are not met, the discretization of predictor variables proposed in this work is feasible. Crisp discretizes that all predictor variables of the plastic-type dataset can be assigned to three categories based on antecedent information [18], where previously, the data were rescaled into values 0–1 to have uniform units. The crisp discretization parameters are obtained using Equation (1) [23,36].
In the crisp discretization, as presented in Table 2, each m -th category in each predictor variable has only two parameters, which are the lower and upper classes limits and do not overlap. The results of this crisp discretization are then implemented in the naïve Bayes method to predict three plastic types, both as a single method and in building an ensemble method. Fuzzy discretization for both linear–triangular combinations and linear–trapezoidal function combinations is formed based on crisp discretization. The parameters of both fuzzy discretization combinations are obtained using tuning systems [23,24]. The results of both fuzzy discretization models are shown in Table 3 and Table 4, respectively.
Table 3 shows that the first and third categories only have two parameters because the membership functions used are descending and increasing linear functions. However, the second category has three parameters because the membership functions used are triangular functions. Like crisp discretization, the results of this linear–triangular fuzzy discretization are then implemented in the naïve Bayes method to predict three plastic types, both as a single method and in building an ensemble method.
In Table 4, the first and third categories in this fuzzy discretization also use descending and increasing linear functions so that they only have two parameters, but the second category has four parameters because it follows the membership function used, namely the trapezoidal function. The results of this linear–trapezoidal fuzzy discretization are then implemented in the naïve Bayes method to predict three plastic types, both as a single method and in building an ensemble method.
Small disturbances or changes in training data often affect the performance of the prediction. Consequently, it is imperative to generalize the model’s performance to reflect the actual performance of the model. We propose different random resampling in dividing the folds in k-fold cross-validation to generalize the basic model performance and the performance of the proposed ensemble of triple naive Bayes models, which is the average of the performance of all resampling [33]. To accommodate the use of ANOVA and ad hoc tests, resampling is performed more than 30 times (exactly 35 times).
The results of the prediction of objects into specific classes for the first sampling of 5-fold cross-validation using NB with crisp discretization and two models using NB with fuzzy discretization as a single method and also the ensemble method are summarized in the confusion matrix shown in Table 5. From this table, metrics can be determined that show prediction performance.
In the first sampling, the test data, which are one-fold, contain 80% of the data (90 observations) and are distributed into PET, HDPE, and PP plastic types of 26, 34, and 30, respectively. The distribution of observations in the training data and test data to each plastic type can vary in each resampling.
The performance metrics of predictions in the first sampling of 5-fold cross-validation using NB with crisp discretization, two NB models with fuzzy discretization, and the ensemble method built from the three single NB models are presented in Table 6.
Among the three basic models, the highest model performance in the first sampling of 5-fold cross-validation is owned by the NB model with crisp discretization, while the lowest is owned by the NB model with linear–trapezoidal discretization. The ensemble of the triple NB model exhibits the highest performance compared to the other three basic models in accuracy, precision, and recall, with a percentage of 97.78–98.04%.
Furthermore, the performance of these models cannot be generalized, considering that each sampling can provide different prediction performance as presented in Figure 6. The figure shows that the four proposed models have different performances in each random resampling of 5-fold cross-validation technique. The twenty-seventh resampling in the NB model with crisp discretization exhibits the lowest performance, with accuracy, precision, and recall ranging from 91% to 92%. However, the highest performance is at the fifth resampling, which reaches 100% for all metrics. Similar events also occur in the performance of the two models of NB with fuzzy discretization. The lowest and highest performances for the linear–triangular combination are at the eighth and thirty-first resampling, respectively, with metric values ranging from 86 to 87% and 97 to 98%. In the linear–trapezoidal combination, the lowest and highest performances are at the eighth and thirty-third resampling, respectively, with metric values ranging from 85 to 87% and 97 to 98%. Similar to the performance of the three single NB prediction models, the ensemble model also has different performances in each resampling.
Table 7 presents three critical pieces of information regarding the performance generalization of the four proposed models, which are based on the thirty-five resampling. First, among the three proposed single methods, the performance of the NB with crisp discretization and NB with linear–trapezoidal fuzzy discretization models is the highest and the lowest, respectively. Second, the ensemble model built from the three single NB models, which have performances in the range of 91.51–95.16%, has a performance in the range of 97.07–97.3%. Third, the performance improvement of the ensemble model compared to each single model with NB with crisp discretization, NB with linear–triangular, and NB with linear–trapezoidal is 2.06–2.15%, 3.98–4.49%, and 4.79–5.56%, respectively.
This fact also informs us that fuzzy discretization does not always provide better performance than crisp discretization. It is suspected that the crisp discretization that is carried out does not produce vagueness in each category of the variable. However, the performance of the plastic-type prediction model using the NB model with discretization, which has the highest performance among the proposed single models, can be improved through the ensemble method, which is built from a combination of crisp and fuzzy discretization models.
Additionally, ANOVA (Table 8) shows whether the four proposed models’ performance is distinct, and when using the proposed ensemble models, whether the performance metrics have improved significantly.
The ANOVA demonstrates that the four proposed models show a significant improvement in performance metrics at 5% significance levels as well as a difference in at least one average performance metric for accuracy, precision, and recall. A post hoc test employing the Tukey–Kramer test is illustrated in Table 9.
The Absolute Mean Difference (AMD) between the two models is more than the Q-critical value, which results in a significant increase in metrics. The critical values for all three metrics in this study are 0.01. All three metrics have a substantial difference between all model pairings. This fact also indicates that the performance of the triple NB ensemble model is substantially better than that of all single NB models. The ensemble model’s efficacy is also influenced by the combination of the single models that have been constructed. Statistical tests that substantiate the research hypothesis demonstrate that the proposed prediction model, which is constructed from three naive Bayes models, performs exceptionally well and is exceedingly robust.

4. Comparison with Other Studies

Several other works that build intelligent computing systems for sorting plastic waste based on machine learning are presented in Table 10 as a comparison. The majority of the works use the validation method using k-fold cross-validation. In work [4], the precision metric that describes the percentage of objects that are truly the actual plastic type from all objects predicted as that type is high, which is more than 90%. Nevertheless, the accuracy, which is defined as the proportion of observations that are accurately classified in all plastic varieties, is low at 45.5%. Likewise, the recall that describes the percentage of observations in a plastic type that are successfully predicted as the same plastic type shows a low value (47.64%). The work also does not use a validation method in performing its prediction task. In work [12], which validates the prediction performance using 10-fold cross-validation and obtains a performance of 100%, in addition to not being generalized, the number of samples of 20 indicates that the test data of only four allow for as many true predictions as the test data so that the performance metric easily achieves 100%. Consequently, the model’s efficacy is also influenced by the quantity of samples. We have shown that the performance of k-fold cross-validation can be different in each sampling, as given in Figure 6; therefore, it is necessary to generalize the performance of the prediction model built for a machine learning-based system of at least thirty samplings [33]. The difference between the method we propose and the current method is that the ensemble method we propose is built from single methods in the form of NB methods that implement discretization, both crisp and fuzzy. Our proposed method has also proposed generalization to the performance of all proposed models, both the single NB method and the ensemble of the triple NB method, and obtained satisfactory performance (more than 97%).
According to [47,48,49], a performance above 85% is considered satisfactory. We built an intelligent computing system that has high, stable, and robust performance, as proven using statistical tests presented in Table 8, with accuracy, precision, and recall metric indicators all above 97% (Table 7). The main advantage of using our proposed method with high, stable, and robust performance is that the automatic plastic sorting process can run effectively and efficiently. The industry can use this resulting method to build automatic sorting computations.

5. Conclusions

The novelty of this study is to build intelligent computing using an ensemble model based on three single NB models to predict three types of plastic. The three basic models consist of one NB model with crisp discretization and two NB models with fuzzy discretization, namely those using a combination of fuzzy linear–triangular membership functions and a combination of fuzzy linear–trapezoidal membership functions. Five-fold cross-validation was employed to validate each proposed model, and thirty-five times resampling was employed to generalize it. The efficacy of the NB model with fuzzy discretization is influenced by the combination of fuzzy membership functions that are employed. The performance of the NB model with imprecise discretization is not superior to that of the NB model with crisp discretization. The hypothesis that the ensemble model outperforms all individual models and that the performance of the four proposed NB-based models differs in at least one metric has been validated. The four proposed models demonstrate a performance improvement from the single method to the ensemble method of the triple naive Bayes, with a range of 2.06% to 5.56%, as evidenced by a generalization of performance based on some resampling of five-fold cross-validation. Furthermore, the proposed prediction model’s robust and high performance is demonstrated by the evidence supporting this hypothesis, which is constructed from three naive Bayes models using the ensemble method. No prediction method is effective for all cases, and neither is the proposed ensemble method. The implementation of discretization, especially fuzzy, is influenced by many factors, such as the number of categories, types of functions, and combinations of fuzzy membership functions. Likewise, the ensemble method, built from naive Bayes methods with fuzzy discretization, is influenced not only by fuzzy discretization but also by the combination of single methods that build it. Further exploration is necessary. Furthermore, this research is also expected to be continued for other types of plastic that have not been discussed in this study.

Author Contributions

Conceptualization, I.Y. and Y.R.; methodology, I.Y. and I.T.; software, I.Y.; validation, D.P. and Y.R.; formal analysis, I.T. and B.; investigation, I.Y.; resources, I.Y.; data curation, D.P. and B.; writing—original draft preparation, I.Y.; writing—review and editing, I.Y. and Y.R.; visualization, D.P.; supervision, I.Y. and Y.R.; project administration, I.T. and B.; funding acquisition, I.Y. and Y.R. All authors have read and agreed to the published version of the manuscript.

Funding

This research is funded by the Directorate of Research, Technology, and Community Service of the Directorate General of Higher Education, Research, and Technology under the Implementation Contract for the State University Operational Assistance Program for the 2024 Fiscal Year Research Program Number: 090/E5/PG.02.00.PL/2024.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

The Ministry of Education, Culture, Research, and Technology is gratefully acknowledged by the author for DIPA No. SP DIPA 023-17.1.69052312024 revision 1 dated 4 February 2024, through contract Number 0015.004/UN9/SB1.LP2M.PT/2024.

Conflicts of Interest

There are no conflicts of interest that the authors have disclosed to any individual.

References

  1. Srigul, W.; Inrawong, P.; Kupimai, M. Plastik classification base on the correlation of RGB color. In Proceedings of the 13th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology, ECTI-CON 2016, Chiang Mai, Thailand, 28 June–1 July 2016; pp. 1–5. [Google Scholar] [CrossRef]
  2. OECD. Policy Highlights. Global Plastics Outlook Economic Drivers, Environmental Impacts and Policy Options; OECD: Paris, France, 2022. [Google Scholar]
  3. Abubakar, I.R.; Maniruzzaman, K.M.; Dano, U.L.; AlShihri, F.S.; AlShammari, M.S.; Ahmed, S.M.S.; Al-Gehlani, W.A.G.; Alrawaf, T.I. Environmental Sustainability Impacts of Solid Waste Management Practices in the Global South. Int. J. Environ. Res. Public Health 2022, 19, 12717. [Google Scholar] [CrossRef] [PubMed]
  4. Choi, J.; Lim, B.; Yoo, Y. Advancing Plastic Waste Classification and Recycling Efficiency: Integrating Image Sensors and Deep Learning Algorithms. Appl. Sci. 2023, 13, 10224. [Google Scholar] [CrossRef]
  5. Chow, C.; So, W.M.W.; Cheung, T.-Y. Research and development of a new waste collection bin to facilitate education in plastic recycling. J. Appl. Environ. Educ. Commun. 2016, 15, 45–57. [Google Scholar] [CrossRef]
  6. Pivnenko, K.; Eriksen, M.K.; Martín-Fernández, J.A.; Eriksson, E.; Astrup, T.F. Recycling of plastic waste: Presence of phthalates in plastics from households and industry. Waste Manag. 2016, 54, 44–52. [Google Scholar] [CrossRef]
  7. Shi, C.; Dai, F.; Lu, C.; Yu, S.; Lu, M.; Gao, X.; Wang, Z.; Zhang, S. Color Recognition of Transparent Plastic Based on Multi-Wavelength Transmission Spectrum. Appl. Sci. 2022, 12, 4948. [Google Scholar] [CrossRef]
  8. Hembram, T.K.; Saha, S.; Pradhan, B.; Maulud, K.N.A.; Alamri, A.M. Robustness analysis of machine learning classifiers in predicting spatial gully erosion susceptibility with altered training samples. Geomat. Nat. Hazards Risk 2021, 12, 794–828. [Google Scholar] [CrossRef]
  9. Bellet, A.; Habrard, A. Robustness and Generalization for Metric Learning. Neurocomputing 2015, 151, 259–267. [Google Scholar] [CrossRef]
  10. Ngugi, L.C.; Abelwahab, M.; Mohammed, A.-Z. Recent advances in image processing techniques for automated leaf pest and disease recognition—A review. Inf. Process. Agric. 2021, 8, 27–51. [Google Scholar] [CrossRef]
  11. Nie, J.; Wen, X.; Niu, X.; Chu, Y.; Chen, F.; Wang, W.; Zhang, D.; Hu, Z.; Xiao, J.; Guo, L. Identification of different colored plastics by laser-induced breakdown spectroscopy combined with neighborhood component analysis and support vector machine. Polym. Test. 2022, 112, 107624. [Google Scholar] [CrossRef]
  12. Singh, M.H.; Hait, S.; Thakur, A. Hyperspectral imaging-based classification of post-consumer thermoplastics for plastics recycling using artificial neural network. Process. Saf. Environ. Prot. 2023, 179, 593–602. [Google Scholar] [CrossRef]
  13. Bonifazi, G.; Fiore, L.; Gasbarrone, R.; Palmieri, R.; Serranti, S. Hyperspectral Imaging Applied to WEEE Plastic Recycling: A Methodological Approach. Sustainability 2023, 15, 11345. [Google Scholar] [CrossRef]
  14. Martinez-Hernandez, U.; West, G.; Assaf, T. Low-Cost Recognition of Plastic Waste Using Deep Learning and a Multi-Spectral Near-Infrared Sensor. Sensors 2024, 24, 2821. [Google Scholar] [CrossRef] [PubMed]
  15. Kusumo, B.S.; Heryana, A.; Mahendra, O.; Pardede, H.F. Machine Learning-based for Automatic Detection of Corn-Plant Diseases Using Image Processing. In Proceedings of the 2018 International Conference on Computer, Control, Informatics and Its Applications (IC3INA), Tangerang, Indonesia, 1–2 November 2018; pp. 93–97. [Google Scholar] [CrossRef]
  16. Fay, C.D.; Wu, L. Critical importance of RGB color space specificity for colorimetric bio/chemical sensing: A comprehensive study. Talanta 2024, 266, 124957. [Google Scholar] [CrossRef] [PubMed]
  17. Gao, Y.; Liang, J.; Yang, J. Color Palette Generation From Digital Images: A Review. Color Res. Appl. 2025, 50, 250–265. [Google Scholar] [CrossRef]
  18. Yani, I.; Resti, Y. Plastic-Type Prediction Based on Digital Image using Multinomial Naïve Bayes Method. In AIP Conference Proceedings; AIP Publishing: New York, NY, USA, 2024; Volume 2920, p. 040005. [Google Scholar] [CrossRef]
  19. Saputra, S.; Yudhana, A.; Umar, R. Implementation of Naïve Bayes for Fish Freshness Identification Based on Image Processing. J. RESTI (Rekayasa Sist. Teknol. Inf.) 2022, 6, 412–420. [Google Scholar] [CrossRef]
  20. Yani, I.; Resti, Y.; Burlian, F.; Yani, A. Prediction of Plastic-Type for Sorting System using Fisher Discriminant Analysis. Sci. Technol. Indones. 2021, 6, 313–318. [Google Scholar] [CrossRef]
  21. Ferreira, J.A.; Soares, E.A.M.G.; Machado, L.S.; Moraes, R.M. Assessment of Fuzzy Gaussian Naive Bayes for Classification Tasks. In Proceedings of the PATTERNS 2015: The Seventh International Conferences on Pervasive Patterns and Applications, Nice, France, 23–28 March 2015; pp. 64–69, ISBN 978-1-61208-393-3. [Google Scholar]
  22. Resti, Y.; Irsan, C.; Neardiaty, A.; Annabila, C.; Yani, I. Fuzzy Discretization on the Multinomial Naïve Bayes Method for Modeling Multiclass Classification of Corn Plant Diseases and Pests. Mathematics 2023, 11, 1761. [Google Scholar] [CrossRef]
  23. Resti, Y.; Irsan, C.; Amini, M.; Yani, I.; Passarella, R.; Zayanti, D.A. Performance Improvement of Decision Tree Model using Fuzzy Membership Function for Classification of Corn Plant Diseases and Pests. Sci. Technol. Indones. 2022, 7, 284–290. [Google Scholar] [CrossRef]
  24. Roy, A.; Pal, S.K. Fuzzy discretization of feature space for a rough set classifier. Pattern Recognit. Lett. 2003, 24, 895–902. [Google Scholar] [CrossRef]
  25. Sadollah, A. Introductory Chapter: Which Membership Function is Appropriate in Fuzzy System? In Fuzzy Logic Based in Optimization Methods and Control Systems and Its Applications; InTechOpen: London, UK, 2018; pp. 3–6. [Google Scholar] [CrossRef]
  26. Chen, Q.; Huang, M. Rough fuzzy model-based feature discretization in intelligent data preprocess. J. Cloud Comput. 2021, 10, 5. [Google Scholar] [CrossRef]
  27. Algehyne, E.A.; Jibril, M.L.; Algehainy, N.A.; Alamri, O.A.; Alzahrani, A.K. Fuzzy Neural Network Expert System with an Improved Gini Index Random Forest-Based Feature Importance Measure Algorithm for Early Diagnosis of Breast Cancer in Saudi Arabia. Big Data Cogn. Comput. 2022, 6, 13. [Google Scholar] [CrossRef]
  28. Femina, B.T.; Sudheep, E.M. A Novel Fuzzy Linguistic Fusion Approach to Naive Bayes Classifier for Decision Making Applications. Int. J. Adv. Sci. Eng. Inf. Technol. 2020, 10, 1889–1897. [Google Scholar] [CrossRef]
  29. Chen, Q.; Zeng, L.; Lin, C. A deep network embedded with rough fuzzy discretization for OCT fundus image segmentation. Sci. Rep. 2023, 13, 328. [Google Scholar] [CrossRef] [PubMed]
  30. Karlos, S.; Kostopoulos, G.; Kotsiantis, S. A Soft-Voting Ensemble Based Co-Training Scheme using Static Selection for Binary Classification Problems. Algorithms 2020, 13, 26. [Google Scholar] [CrossRef]
  31. Resti, Y.; Eliyati, N.; Rahmayani, M.; Zayanti, D.E.; Kresnawati, E.S.; Cahyono, E.S.; Yani, I. Ensemble of naive Bayes, decision trees, and random forest to predict air quality. Int. J. Artif. Intell. 2024, 13, 3039–3051. [Google Scholar] [CrossRef]
  32. Zhou, Z.-H. Ensemble Methods: Foundations and Algorithms; Taylor & Francis Group: Boca Raton, FL, USA, 2012. [Google Scholar]
  33. Kuhn, M.; Johnson, K. Applied Predictive Modeling; Springer: Cham, Switzerland, 2013. [Google Scholar] [CrossRef]
  34. Zhang, C.; Ma, Y. Ensemble Machine Learning: Methods and Applications; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2012. [Google Scholar] [CrossRef]
  35. Hudec, M. Fuzziness in Information Systems: How to Deal with Crisp and Fuzzy Data in Selection, Classification, and Summarization, 1st ed.; Springer International Publishing: Cham, Switzerland, 2016. [Google Scholar] [CrossRef]
  36. Resti, Y.; Irsan, C.; Putri, M.T.; Yani, I.; Ansyori, A.; Suprihatin, B. Identification of corn plant diseases and pests based on digital images using multinomial naïve Bayes and k-nearest neighbor. Sci. Technol. Indones. 2022, 7, 29–35. [Google Scholar] [CrossRef]
  37. Peksi, N.J.; Yuwono, B.; Florestiyanto, M.Y. Classification of Anemia with Digital Images of Nails and Palms using the Naive Bayes Method Klasifikasi Anemia dengan Citra Digital Kuku dan Telapak Tangan menggunakan Metode Naive Bayes. J. Inform. Teknol. Inf. 2021, 18, 118–130. [Google Scholar]
  38. Shanmugapriya, M.; Nehemiah, H.K.; Bhuvaneswaran, R.S.; Arputharaj, K.; Sweetlin, J.D. Fuzzy Discretization based Classification of Medical Data. Res. J. Appl. Sci. Eng. Technol. 2017, 14, 291–298. [Google Scholar] [CrossRef]
  39. Lee, C.F.; Tzeng, G.H.; Wang, S.Y. A new application of fuzzy set theory to the black-scholes option pricing model. Expert Syst. Appl. 2005, 29, 330–342. [Google Scholar] [CrossRef]
  40. Alzoman, R.M.; Alenazi, M.J.F. A comparative study of traffic classification techniques for smart city networks. Sensors 2021, 21, 4677. [Google Scholar] [CrossRef]
  41. Rutkowski, L. Flexible Neuro-Fuzzy Systems; Kluwer Academic Publisher: Boston, FL, USA, 2004. [Google Scholar]
  42. Lantz, B. Machine Learning with R; Packt Publishing: Birmingham, UK, 2013; pp. 315–348. [Google Scholar]
  43. White, J.; Power, S.D. k-Fold Cross-Validation Can Significantly Over-Estimate True Classification Accuracy in Common EEG-Based Passive BCI Experimental Designs: An Empirical Investigation. Sensors 2023, 23, 6077. [Google Scholar] [CrossRef] [PubMed]
  44. Rodríguez, J.D.; Perez, A.; Lozano, J.A. Sensitivity analysis of k-fold cross validation in prediction error estimation. IEEE Trans. Pattern Anal. Mach. Intell. 2009, 32, 569–575. [Google Scholar] [CrossRef]
  45. Dinesh, S.; Dash, T. Reliable Evaluation of Neural Network for Multiclass Classification of Real-world Data. arXiv 2016, arXiv:1612.00671. [Google Scholar]
  46. Schmidt, J.-S.; Osebold, R. Environmental management systems as a driver for sustainability: State of implementation, benefits and barriers in German construction companies. J. Civ. Eng. Manag. 2017, 23, 150–162. [Google Scholar] [CrossRef]
  47. Aronoff, S. The minimum accuracy value as an index of classification accuracy. Photogramm. Eng. Remote Sens. 1985, 51, 99–111. [Google Scholar]
  48. Ramasubramanian, K.; Singh, A. Machine Learning Using R with Time Series and Industry-Based Use Cases in R [Internet], 2nd ed.; Apress: Berkeley, CA, USA, 2019; Volume 321, pp. 344–362. Available online: https://www.apress.com/gp/book/9781484242148 (accessed on 11 February 2025).
  49. Vujović, Ž. Classification Model Evaluation Metrics. Int. J. Adv. Comput. Sci. Appl. 2021, 12, 599–606. [Google Scholar] [CrossRef]
Figure 1. Capturing process of plastic waste.
Figure 1. Capturing process of plastic waste.
Applsci 15 06201 g001
Figure 2. Research steps.
Figure 2. Research steps.
Applsci 15 06201 g002
Figure 3. Predictor variables summary.
Figure 3. Predictor variables summary.
Applsci 15 06201 g003
Figure 4. Pearson correlation of predictor variables.
Figure 4. Pearson correlation of predictor variables.
Applsci 15 06201 g004
Figure 5. Histogram of the predictor variable.
Figure 5. Histogram of the predictor variable.
Applsci 15 06201 g005aApplsci 15 06201 g005b
Figure 6. Performance of single and ensemble of triple NB in each random resampling.
Figure 6. Performance of single and ensemble of triple NB in each random resampling.
Applsci 15 06201 g006
Table 1. Confusion matrix for the first class.
Table 1. Confusion matrix for the first class.
j Prediction
123
1 T P j F P j F P j
Actual2 F N j T N j T N j
3 F N j T N j T N j
Table 2. Crisp discretization.
Table 2. Crisp discretization.
Predictor VariableCategory
( m )
123
Crisp
Discretization Parameter
X 1 [0.329, 0.553][0.554, 0.776][0.777, 1]
X 2 [0.350, 0.567][0.568, 0.783][0.784, 1]
X 3 [0.330, 0.553][0.554, 0.776][0.777, 1]
X 4 [0, 0.333][0.334, 0.667][0.668, 1]
X 5 [0, 0.039][0.040, 0.082][0.083, 1]
Table 3. Linear–triangular fuzzy discretization.
Table 3. Linear–triangular fuzzy discretization.
Predictor VariableCategory
( m )
123
Fuzzy
Discretization Parameter
X 1 [0.329, 0.776][0.553, 0.948, 0.944][0.888, 1]
X 2 [0.350, 0.783][0.567, 0.656, 0.946][0.892, 1]
X 3 [0.330, 0.776][0.553, 0.748, 0.944][0.888, 1]
X 4 [0, 0.667][0.333, 0.625, 0.916][0.833, 1]
X 5 [0, 0.082][0.039, 0.295, 0.552][0.104, 1]
Table 4. Linear–trapezoidal fuzzy discretization.
Table 4. Linear–trapezoidal fuzzy discretization.
Predictor VariableCategory
( m )
123
Fuzzy
Discretization Parameter
X 1 [0.329, 0.776][0.553, 0.751, 0.944, 0.948][0.888, 1]
X 2 [0.350, 0.783][0.567, 0.711, 0.656, 0.946][0.892, 1]
X 3 [0.330, 0.776][0.553, 0.651, 0.748, 0.944][0.888, 1]
X 4 [0, 0.667][0.333, 0.479, 0.625, 0.916][0.833, 1]
X 5 [0, 0.082][0.039, 0.167, 0.295, 0.552][0.104, 1]
Table 5. Confusion matrix of four proposed NB.
Table 5. Confusion matrix of four proposed NB.
(a) NB with Crisp Discretization
Prediction
Plastic TypePETHDPEPPSum
ActualPET260026
HDPE230234
PP003030
Sum28303290
(b) NB with Linear–Triangular Fuzzy Discretization
Prediction
Plastic TypePETHDPEPPSum
ActualPET233026
HDPE032234
PP003030
Sum23353290
(c) NB with Linear–Trapezoidal Fuzzy Discretization
Prediction
Plastic TypePETHDPEPPSum
ActualPET224026
HDPE032234
PP003030
Sum22363290
(d) Ensemble of Triple Naïve Bayes
Prediction
Plastic TypePETHDPEPPSum
ActualPET260026
HDPE032234
PP003030
Sum26323290
Table 6. Performance metrics on the first resampling for single and ensemble model.
Table 6. Performance metrics on the first resampling for single and ensemble model.
ModelPerformance Metric
AccuracyPrecisionRecall
NB with crisp discretization95.5695.5496.08
NB with linear–triangular fuzzy discretization94.4495.0694.19
NB with linear–trapezoidal fuzzy discretization93.3394.2192.91
Ensemble of triple NB97.7897.9298.04
Table 7. Performance generalization for single and ensemble of triple NB model.
Table 7. Performance generalization for single and ensemble of triple NB model.
ModelPerformance Metric (%)
AccuracyPrecisionRecall
NB with crisp discretization95.0595.1694.92
NB with linear–triangular fuzzy discretization92.6393.3292.61
NB with linear–trapezoidal fuzzy discretization91.5992.5191.51
Ensemble of triple NB97.1197.3097.07
Table 8. ANOVA of single and ensemble methods.
Table 8. ANOVA of single and ensemble methods.
MetricsSource of Var.Sum of SquaresMean SquaresFp-ValueF-Criteria
Accuracybetween0.060.0240.986.25 × 10−192.67
within0.070.00
Recallbetween0.070.0245.841.71 × 10−20
within0.060.00
Precisionbetween0.050.0238.285.34 × 10−18
within0.060.00
Table 9. Tukey–Kramer test of single and ensemble methods.
Table 9. Tukey–Kramer test of single and ensemble methods.
Comparison ModelAbsolute Mean Difference
AccuracyRecallPrecision
NB with crisp discretization vs. NB with linear–triangular0.020.020.02
NB with crisp discretization vs. NB with linear–trapezoidal0.030.030.03
NB with crisp discretization vs. ensemble of triple NB0.020.020.02
NB with linear–triangular vs. NB with linear–trapezoidal0.010.010.01
NB with linear–triangular vs. ensemble of triple NB0.040.040.04
NB with linear–trapezoidal vs. ensemble of triple NB0.060.050.06
Table 10. Comparison with other studies.
Table 10. Comparison with other studies.
PaperPlastic TypeDatasetSum of SampleThe Best Prediction Method UsedValidation MethodPerformance GeneralizationMetric Performance (%)
AccuracyRecallPrecision
Choi et al. [4]PET and PET-GImage sensor and deep learning You Only Look Once (YOLO)----45.5047.6491.00
Shi et al., [7]Colorless, light blue, light green, and apple green transparent plastics of PETMulti-wavelength transmission spectrum40Naïve Bayes10-fold cross-validation-100.00100.00100.00
Singh et al. 2023 [12]PET, HDPE, PP, PSHyperspectral image in near-infrared20Artificial Neural Networkhold out 80:20-87.0087.3387.15
Bonifazi et al. [13]Electric and Electronic Equipment (WEEE)Hyperspectral image in Short-Wave InfraRed (SWIR) spectral-Partial Least Squared-Linear Discriminant Analysis-- 86.7
Martinez-Hernandez et al. [14]PET, HDPE, PVC, LDPE, PP, and PSTriad Spectroscopy Sensor423Convolutional Neural Network with Principal Component Analysis10-fold cross-validation-72.5072.5072.43
Yani and Resti, 2024 [18]PET, HDPE, PPRGB image450Multinomial Naïve Bayes5-fold cross-validation-97.3496.00-
Yani et al. [20]PET, HDPE, PPRGB image450Fisher Discriminant Analysis 87.1191.67-
Proposed MethodPET, HDPE, PPRGB image450Ensemble of Triple naïve Bayes5-fold cross-validationthirty-five resampling of 5-fold cross-validation97.1197.3097.07
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Yani, I.; Thamrin, I.; Puspitasari, D.; Barlin; Resti, Y. Ensemble Method of Triple Naïve Bayes for Plastic Type Prediction in Sorting System Automation. Appl. Sci. 2025, 15, 6201. https://doi.org/10.3390/app15116201

AMA Style

Yani I, Thamrin I, Puspitasari D, Barlin, Resti Y. Ensemble Method of Triple Naïve Bayes for Plastic Type Prediction in Sorting System Automation. Applied Sciences. 2025; 15(11):6201. https://doi.org/10.3390/app15116201

Chicago/Turabian Style

Yani, Irsyadi, Ismail Thamrin, Dewi Puspitasari, Barlin, and Yulia Resti. 2025. "Ensemble Method of Triple Naïve Bayes for Plastic Type Prediction in Sorting System Automation" Applied Sciences 15, no. 11: 6201. https://doi.org/10.3390/app15116201

APA Style

Yani, I., Thamrin, I., Puspitasari, D., Barlin, & Resti, Y. (2025). Ensemble Method of Triple Naïve Bayes for Plastic Type Prediction in Sorting System Automation. Applied Sciences, 15(11), 6201. https://doi.org/10.3390/app15116201

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop